First trial to introduce steered MD non successful
[unres.git] / source / unres / src_MD-M / MD_A-MTS.F
index 30f6ab1..42b3af4 100644 (file)
@@ -196,7 +196,11 @@ c Variable time step algorithm.
 #endif
         endif
         if (ntwe.ne.0) then
-         if (mod(itime,ntwe).eq.0) call statout(itime)
+         if (mod(itime,ntwe).eq.0) then
+           call statout(itime)
+           call enerprint(potEcomp)
+C           print *,itime,'AFM',Eafmforc,etot
+         endif
 #ifdef VOUT
         do j=1,3
           v_work(j)=d_t(j,0)
@@ -230,6 +234,7 @@ c Variable time step algorithm.
 #endif
         endif
         if (mod(itime,ntwx).eq.0) then
+          write(iout,*) 'time=',itime
 C          call check_ecartint
           call returnbox
           write (tytul,'("time",f8.2)') totT
@@ -1793,7 +1798,7 @@ c-----------------------------------------------------------
       include 'COMMON.IOUNITS'
       include 'COMMON.NAMES'
       include 'COMMON.TIME1'
-      double precision xv,sigv,lowb,highb
+      double precision xv,sigv,lowb,highb,vec_afm(3)
 c Generate random velocities from Gaussian distribution of mean 0 and std of KT/m 
 c First generate velocities in the eigenspace of the G matrix
 c      write (iout,*) "Calling random_vel dimen dimen3",dimen,dimen3
@@ -1807,10 +1812,27 @@ c      call flush(iout)
           lowb=-5*sigv
           highb=5*sigv
           d_t_work_new(ii)=anorm_distr(xv,sigv,lowb,highb)
+
 c          write (iout,*) "i",i," ii",ii," geigen",geigen(i),
 c     &      " d_t_work_new",d_t_work_new(ii)
         enddo
       enddo
+       if (SELFGUIDE.gt.0) then
+       distance=0.0
+       do j=1,3
+       vec_afm(j)=c(j,afmend)-c(j,afmbeg)  
+       distance=distance+vec_afm(j)**2
+       enddo
+       distance=dsqrt(distance)
+       do j=1,3
+         d_t_work_new(j+(afmbeg-1)*3)=-velAFMconst*vec_afm(j)/distance
+         d_t_work_new(j+(afmend-1)*3)=velAFMconst*vec_afm(j)/distance
+         write(iout,*) "myvel",d_t_work_new(j+(afmbeg-1)*3),
+     &    d_t_work_new(j+(afmend-1)*3)
+       enddo
+
+       endif
+
 c diagnostics
 c      Ek1=0.0d0
 c      ii=0