a7af27bf493c5aa2b8c0a529f8ac7e51507a31b2
[unres.git] / source / unres / src_MD / src / md-diff / np / tnp1_step2.f
1 c---------------------------------------------------------------------
2       subroutine tnp1_step2
3 c  Step 2 of the velocity Verlet algorithm: update velocities
4       implicit real*8 (a-h,o-z)
5       include 'DIMENSIONS'
6       include 'COMMON.CONTROL'
7       include 'COMMON.VAR'
8       include 'COMMON.MD'
9       include 'COMMON.CHAIN'
10       include 'COMMON.DERIV'
11       include 'COMMON.GEO'
12       include 'COMMON.LOCAL'
13       include 'COMMON.INTERACT'
14       include 'COMMON.IOUNITS'
15       include 'COMMON.NAMES'
16
17       double precision d_time_s12
18
19       do i=0,2*nres
20        do j=1,3
21         d_t(j,i)=d_t_new(j,i)
22        enddo
23       enddo
24
25       call kinetic(EK)
26       EK=EK/s12_np**2
27
28       d_time_s12=0.5d0*s12_np*d_time
29
30       do j=1,3
31         d_t(j,0)=d_t_new(j,0)+d_a(j,0)*d_time_s12
32       enddo
33       do i=nnt,nct-1
34         do j=1,3
35           d_t(j,i)=d_t_new(j,i)+d_a(j,i)*d_time_s12
36         enddo
37       enddo
38       do i=nnt,nct
39         if (itype(i).ne.10) then
40           inres=i+nres
41           do j=1,3
42             d_t(j,inres)=d_t_new(j,inres)+d_a(j,inres)*d_time_s12
43           enddo
44         endif
45       enddo 
46
47 cd      write(iout,*) 'pistar',pistar,EK,E_old,potE,s12_np
48       pistar=pistar+(EK-0.5*(E_old+potE)
49      &       -dimen*Rb*t_bath*log(s12_np)+H0-dimen*Rb*t_bath)*d_time
50       tmp=1+pistar/(2*Q_np)*0.5*d_time
51       s_np=s12_np*tmp**2
52       pi_np=pistar/tmp
53
54       return
55       end