Merge branch 'UCGM' of mmka.chem.univ.gda.pl:unres4 into UCGM
[unres4.git] / source / unres / MD.F90
index b60dd27..52d7ec3 100644 (file)
           do j=1,3    
             adt=(d_a_old(j,inres)+d_af_work(ind+j))*d_time
             adt2=0.5d0*adt+sqrt13*d_as_work(ind+j)*d_time
+!            write(iout,*) "adt",adt,"ads",adt2
             dc(j,inres)=dc_old(j,inres)+(d_t_old(j,inres)+adt2)*d_time
             d_t_new(j,inres)=d_t_old(j,inres)+0.5d0*adt
             d_t(j,inres)=d_t_old(j,inres)+adt
        write (iout,*) "vcm right after adjustment:"
        write (iout,*) (vcm(j),j=1,3) 
       endif
-      if (.not.rest) then        
-  122   continue               
+
+
+  
 !         call chainbuild
+
+      if ((.not.rest).or.(forceminim)) then            
+         if (forceminim) call chainbuild_cart
+  122   continue                
          if(iranconf.ne.0 .or.indpdb.gt.0.and..not.unres_pdb .or.preminim) then
           if (overlapsc) then 
            print *, 'Calling OVERLAP_SC'
 !el       ginvfric(2*nres,2*nres)      !maxres2=2*maxres
 !el      common /przechowalnia/ ginvfric
       
-      logical :: lprn = .false., checkmode = .false.
+      logical :: lprn, checkmode
       integer :: i,j,ind,k,nres2,nres6,mnum
       nres2=2*nres
       nres6=6*nres
-
+      lprn=.false.
+      checkmode=.false.
+!      if (large) lprn=.true.
+!      if (large) checkmode=.true.
       if(.not.allocated(gamvec)) allocate(gamvec(nres6)) !(MAXRES6)
       if(.not.allocated(ginvfric)) allocate(ginvfric(nres2,nres2)) !maxres2=2*maxres
       do i=0,nres2