inres=i+nres
do j=1,3
d_t(j,inres)=d_t(j,inres)+0.5d0*d_a(j,inres)*d_time
inres=i+nres
do j=1,3
d_t(j,inres)=d_t(j,inres)+0.5d0*d_a(j,inres)*d_time
inres=i+nres
do j=1,3
d_t(j,inres)=d_t_new(j,inres)+0.5d0*d_a(j,inres)*d_time
inres=i+nres
do j=1,3
d_t(j,inres)=d_t_new(j,inres)+0.5d0*d_a(j,inres)*d_time
inres=i+nres
do j=1,3
d_t(j,inres)=d_t_new(j,inres)+(0.5d0*(d_a(j,inres)
inres=i+nres
do j=1,3
d_t(j,inres)=d_t_new(j,inres)+(0.5d0*(d_a(j,inres)
c if (dabs(accel(j)).gt.amax) amax=dabs(accel(j))
if (dabs(accel(j)).gt.dabs(accel_old(j))) then
dacc=dabs(accel(j)-accel_old(j))
c if (dabs(accel(j)).gt.amax) amax=dabs(accel(j))
if (dabs(accel(j)).gt.dabs(accel_old(j))) then
dacc=dabs(accel(j)-accel_old(j))
do j=1,3
c accel(j)=accel(j)+d_a(j,i+nres)-d_a_old(j,i+nres)
accel_old(j)=accel_old(j)+d_a_old(j,i+nres)
do j=1,3
c accel(j)=accel(j)+d_a(j,i+nres)-d_a_old(j,i+nres)
accel_old(j)=accel_old(j)+d_a_old(j,i+nres)
c if (dabs(accel(j)).gt.amax) amax=dabs(accel(j))
if (dabs(accel(j)).gt.dabs(accel_old(j))) then
dacc=dabs(accel(j)-accel_old(j))
c if (dabs(accel(j)).gt.amax) amax=dabs(accel(j))
if (dabs(accel(j)).gt.dabs(accel_old(j))) then
dacc=dabs(accel(j)-accel_old(j))
do j=1,3
epdriftij=
& dabs((d_a(j,i+nres)-d_a_old(j,i+nres))*gxcart(j,i))
do j=1,3
epdriftij=
& dabs((d_a(j,i+nres)-d_a_old(j,i+nres))*gxcart(j,i))
do j=1,3
dc_work(ind+j)=dc_old(j,i+nres)
d_t_work(ind+j)=d_t_old(j,i+nres)
do j=1,3
dc_work(ind+j)=dc_old(j,i+nres)
d_t_work(ind+j)=d_t_old(j,i+nres)
do j=1,3
dc_work(ind+j)=dc_old(j,i+nres)
d_t_work(ind+j)=d_t_old(j,i+nres)
do j=1,3
dc_work(ind+j)=dc_old(j,i+nres)
d_t_work(ind+j)=d_t_old(j,i+nres)