93c4166e429914e9030af0c8e908f1e3473b6b23
[unres.git] / source / unres / src_MD / md-diff / np / verlet_bath.f
1 c-----------------------------------------------------------------------
2       subroutine verlet_bath
3 c
4 c  Coupling to the thermostat by using the Berendsen algorithm
5 c
6       implicit real*8 (a-h,o-z)
7       include 'DIMENSIONS'
8       include 'COMMON.CONTROL'
9       include 'COMMON.VAR'
10       include 'COMMON.MD'
11       include 'COMMON.CHAIN'
12       include 'COMMON.DERIV'
13       include 'COMMON.GEO'
14       include 'COMMON.LOCAL'
15       include 'COMMON.INTERACT'
16       include 'COMMON.IOUNITS'
17       include 'COMMON.NAMES'
18       double precision T_half,fact
19
20       T_half=2.0d0/(dimen*Rb)*EK
21       fact=dsqrt(1.0d0+(d_time/tau_bath)*(t_bath/T_half-1.0d0))
22 c      write(iout,*) "T_half", T_half
23 c      write(iout,*) "EK", EK
24 c      write(iout,*) "fact", fact                               
25       do j=1,3
26         d_t(j,0)=fact*d_t(j,0)
27       enddo
28       do i=nnt,nct-1
29         do j=1,3
30           d_t(j,i)=fact*d_t(j,i)
31         enddo
32       enddo
33       do i=nnt,nct
34         if (itype(i).ne.10) then
35           inres=i+nres
36           do j=1,3
37             d_t(j,inres)=fact*d_t(j,inres)
38           enddo
39         endif
40       enddo 
41       return
42       end