1 c-----------------------------------------------------------
3 implicit real*8 (a-h,o-z)
5 include 'COMMON.CONTROL'
8 include 'COMMON.LANGEVIN'
10 include 'COMMON.DERIV'
12 include 'COMMON.LOCAL'
13 include 'COMMON.INTERACT'
14 include 'COMMON.IOUNITS'
15 include 'COMMON.NAMES'
16 include 'COMMON.TIME1'
17 double precision xv,sigv,lowb,highb
18 c Generate random velocities from Gaussian distribution of mean 0 and std of KT/m
19 c First generate velocities in the eigenspace of the G matrix
20 c write (iout,*) "Calling random_vel"
23 sigv=dsqrt((Rb*t_bath)/geigen(i))
26 d_t_work_new(i)=anorm_distr(xv,sigv,lowb,highb)
30 c Ek1=Ek1+0.5d0*geigen(i)*d_t_work_new(i)**2
32 c Transform velocities to UNRES coordinate space
36 d_t_work(i)=d_t_work(i)+Gvec(i,j)*d_t_work_new(j)
39 c Transfer to the d_t vector
47 d_t(j,i)=d_t_work(ind)
51 if (itype(i).ne.10) then
54 d_t(j,i+nres)=d_t_work(ind)
59 c write (iout,*) "Kinetic energy",Ek,EK1," kinetic temperature",
60 c & 2.0d0/(dimen*Rb)*EK,2.0d0/(dimen*Rb)*EK1