added source code
[unres.git] / source / unres / src_MD / src / md-diff / np / tnp_respa_step2.f
1 c---------------------------------------------------------------------
2       subroutine tnp_respa_step2
3 c  Step 2 of the velocity Verlet algorithm: update velocities for RESPA
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_s
18
19 ct1      s12_np=s_np
20 ct2      pistar=pi_np
21
22 ct      call kinetic(EK)
23 ct      HNose1=Hnose(EK,s12_np,potE,pistar,Q_np,t_bath,dimen)
24 ct      pi_np=pistar+0.5*d_time*(2*EK-dimen*Rb*t_bath)
25 ct     &                              -0.5*d_time*(HNose1-H0)         
26
27 c-------------------------------------
28 c test of reviewer's comment
29       pi_np=pi_np-0.5*d_time*(E_long+Csplit-H0)
30 cr      print '(a,3f)','2 pi_np,s_np',pi_np,s_np,E_long
31 c-------------------------------------
32       d_time_s=d_time*0.5*s_np
33
34       do j=1,3
35         d_t_old(j,0)=d_t_old(j,0)+d_a(j,0)*d_time_s
36       enddo
37       do i=nnt,nct-1
38         do j=1,3
39           d_t_old(j,i)=d_t_old(j,i)+d_a(j,i)*d_time_s
40         enddo
41       enddo
42       do i=nnt,nct
43         if (itype(i).ne.10) then
44           inres=i+nres
45           do j=1,3
46             d_t_old(j,inres)=d_t_old(j,inres)+d_a(j,inres)*d_time_s
47           enddo
48         endif
49       enddo 
50
51 cd      s_np=s12_np
52
53       return
54       end