added source code
[unres.git] / source / unres / src_MD / md-diff / np / tnp_respa_i_step1.f
1
2 c-----------------------------------------------------------------
3       subroutine tnp_respa_i_step1
4 c Applying Nose-Poincare algorithm - step 1 to coordinates
5 c J.Comput.Phys. 151 114 (1999) S.D.Bond B.J.Leimkuhler B.B.Laird
6 c
7 c d_t is not updated here, it is destroyed
8 c
9       implicit real*8 (a-h,o-z)
10       include 'DIMENSIONS'
11       include 'COMMON.CONTROL'
12       include 'COMMON.VAR'
13       include 'COMMON.MD'
14       include 'COMMON.CHAIN'
15       include 'COMMON.DERIV'
16       include 'COMMON.GEO'
17       include 'COMMON.LOCAL'
18       include 'COMMON.INTERACT'
19       include 'COMMON.IOUNITS'
20       include 'COMMON.NAMES'
21       double precision C_np,d_time_s,tmp,d_time_ss
22
23       d_time_s=d_time*0.5*s_np        
24 ct2      d_time_s=d_time*0.5*s12_np
25
26       do j=1,3
27         d_t_new(j,0)=d_t_old(j,0)+d_a_old(j,0)*d_time_s
28       enddo
29       do i=nnt,nct-1    
30         do j=1,3    
31           d_t_new(j,i)=d_t_old(j,i)+d_a_old(j,i)*d_time_s
32         enddo
33       enddo
34       do i=nnt,nct
35         if (itype(i).ne.10) then
36           inres=i+nres
37           do j=1,3    
38            d_t_new(j,inres)=d_t_old(j,inres)+d_a_old(j,inres)*d_time_s
39           enddo
40         endif      
41       enddo 
42
43       do i=0,2*nres
44        do j=1,3
45         d_t(j,i)=d_t_new(j,i)
46        enddo
47       enddo
48
49       call kinetic(EK)
50       EK=EK/s_np**2
51
52       C_np=0.5*d_time*(dimen*Rb*t_bath*(1.0+log(s_np))-EK+potE-Csplit)
53      &                     -pi_np
54
55       pistar=-2.0*C_np/(1.0+sqrt(1.0-C_np*d_time/Q_np))
56       tmp=0.5*d_time*pistar/Q_np
57       s12_np=s_np*(1.0+tmp)/(1.0-tmp)
58
59       d_time_ss=0.5*d_time*(1.0/s12_np+1.0/s_np)
60 ct2      d_time_ss=d_time/s12_np
61 c      d_time_ss=0.5*d_time*(1.0/sold_np+1.0/s_np) 
62
63       do j=1,3
64         dc(j,0)=dc_old(j,0)+d_t_new(j,0)*d_time_ss
65       enddo
66       do i=nnt,nct-1    
67         do j=1,3    
68           dc(j,i)=dc_old(j,i)+d_t_new(j,i)*d_time_ss
69         enddo
70       enddo
71       do i=nnt,nct
72         if (itype(i).ne.10) then
73           inres=i+nres
74           do j=1,3    
75            dc(j,inres)=dc_old(j,inres)+d_t_new(j,inres)*d_time_ss
76           enddo
77         endif      
78       enddo 
79
80       return
81       end