1 c-----------------------------------------------------------
3 implicit real*8 (a-h,o-z)
5 include 'COMMON.CONTROL'
9 include 'COMMON.LANGEVIN'
11 include 'COMMON.LANGEVIN.lang0'
13 include 'COMMON.CHAIN'
14 include 'COMMON.DERIV'
16 include 'COMMON.LOCAL'
17 include 'COMMON.INTERACT'
18 include 'COMMON.IOUNITS'
19 include 'COMMON.NAMES'
20 include 'COMMON.TIME1'
21 double precision xv,sigv,lowb,highb
22 c Generate random velocities from Gaussian distribution of mean 0 and std of KT/m
23 c First generate velocities in the eigenspace of the G matrix
24 c write (iout,*) "Calling random_vel dimen dimen3",dimen,dimen3
31 sigv=dsqrt((Rb*t_bath)/geigen(i))
34 d_t_work_new(ii)=anorm_distr(xv,sigv,lowb,highb)
35 c write (iout,*) "i",i," ii",ii," geigen",geigen(i),
36 c & " d_t_work_new",d_t_work_new(ii)
45 c Ek1=Ek1+0.5d0*geigen(i)*d_t_work_new(ii)**2
48 c write (iout,*) "Ek from eigenvectors",Ek1
50 c Transform velocities to UNRES coordinate space
56 d_t_work(ind)=d_t_work(ind)
57 & +Gvec(i,j)*d_t_work_new((j-1)*3+k+1)
59 c write (iout,*) "i",i," ind",ind," d_t_work",d_t_work(ind)
63 c Transfer to the d_t vector
71 d_t(j,i)=d_t_work(ind)
75 if (itype(i).ne.10) then
78 d_t(j,i+nres)=d_t_work(ind)
83 c write (iout,*) "Kinetic energy",Ek,EK1," kinetic temperature",
84 c & 2.0d0/(dimen3*Rb)*EK,2.0d0/(dimen3*Rb)*EK1