Commit 10/1/12
[unres.git] / source / unres / src_MIN / readrtns_min.F
index 8aa0305..9d444cf 100644 (file)
@@ -66,16 +66,11 @@ C
 #endif
       include 'COMMON.IOUNITS'
       include 'COMMON.TIME1'
-c      include 'COMMON.THREAD'
       include 'COMMON.SBRIDGE'
       include 'COMMON.CONTROL'
       include 'COMMON.MCM'
-c      include 'COMMON.MAP'
       include 'COMMON.HEADER'
-c      include 'COMMON.CSA'
       include 'COMMON.CHAIN'
-c      include 'COMMON.MUCA'
-c      include 'COMMON.MD'
       include 'COMMON.FFIELD'
       include 'COMMON.SETUP'
       COMMON /MACHSW/ KDIAG,ICORFL,IXDR
@@ -123,8 +118,7 @@ C Set up the time limit (caution! The time must be input in minutes!)
       dccart=(index(controlcard,'CART').gt.0)
       overlapsc=(index(controlcard,'OVERLAP').gt.0)
       overlapsc=.not.overlapsc
-      searchsc=(index(controlcard,'NOSEARCHSC').gt.0)
-      searchsc=.not.searchsc
+      searchsc=(index(controlcard,'SEARCHSC').gt.0)
       sideadd=(index(controlcard,'SIDEADD').gt.0)
       energy_dec=(index(controlcard,'ENERGY_DEC').gt.0)
       outpdb=(index(controlcard,'PDBOUT').gt.0)
@@ -137,7 +131,7 @@ C Set up the time limit (caution! The time must be input in minutes!)
       call readi(controlcard,'MAXGEN',maxgen,10000)
       call readi(controlcard,'MAXOVERLAP',maxoverlap,1000)
       call readi(controlcard,"KDIAG",kdiag,0)
-      call readi(controlcard,"RESCALE_MODE",rescale_mode,1)
+      call readi(controlcard,"RESCALE_MODE",rescale_mode,0)
       if(me.eq.king .or. .not. out1file .and. fg_rank.eq.0)
      & write (iout,*) "RESCALE_MODE",rescale_mode
       split_ene=index(controlcard,'SPLIT_ENE').gt.0
@@ -360,7 +354,7 @@ C 12/1/95 Added weight for the multi-body term WCORR
         bad(i,1)=scalscp*bad(i,1)
         bad(i,2)=scalscp*bad(i,2)
       enddo
-      call rescale_weights(t_bath)
+c      call rescale_weights(t_bath)
       if(me.eq.king.or..not.out1file)
      & write (iout,22) wsc,wscp,welec,wvdwpp,wbond,wang,wscloc,wtor,
      &  wtor_d,wstrain,wel_loc,wcorr,wcorr5,wcorr6,wsccor,wturn3,
@@ -428,6 +422,9 @@ c        print *,'Finished reading pdb data'
 c        call contact(.false.,ncont_ref,icont_ref,co)
 
         if (sideadd) then 
+C Following 2 lines for diagnostics; comment out if not needed
+         write (iout,*) "Before sideadd"
+         call intout
          if(me.eq.king.or..not.out1file)
      &    write(iout,*)'Adding sidechains'
          maxsi=1000
@@ -437,14 +434,19 @@ c        call contact(.false.,ncont_ref,icont_ref,co)
             nsi=0
             fail=.true.
             do while (fail.and.nsi.le.maxsi)
-c              call gen_side(iti,theta(i+1),alph(i),omeg(i),fail)
+              call gen_side(iti,theta(i+1),alph(i),omeg(i),fail)
               nsi=nsi+1
             enddo
             if(fail) write(iout,*)'Adding sidechain failed for res ',
      &              i,' after ',nsi,' trials'
           endif
          enddo
+C 9/29/12 Adam: Recalculate coordinates with new side chain positions
+         call chainbuild
         endif  
+C Following 2 lines for diagnostics; comment out if not needed
+        write (iout,*) "After sideadd"
+        call intout
       endif
       if (indpdb.eq.0) then
 C Read sequence if not taken from the pdb file.
@@ -696,7 +698,7 @@ C initial geometry.
 #endif
             do itrial=1,100
               itmp=1
-c              call gen_rand_conf(itmp,*30)
+              call gen_rand_conf(itmp,*30)
               goto 40
    30         write (iout,*) 'Failed to generate random conformation',
      &          ', itrial=',itrial
@@ -723,7 +725,7 @@ c              call gen_rand_conf(itmp,*30)
 #else
           do itrial=1,100
             itmp=1
-c            call gen_rand_conf(itmp,*31)
+            call gen_rand_conf(itmp,*31)
             goto 40
    31       write (iout,*) 'Failed to generate random conformation',
      &        ', itrial=',itrial
@@ -754,9 +756,9 @@ c            call gen_rand_conf(itmp,*31)
 
       endif 
 C Generate distance constraints, if the PDB structure is to be regularized. 
-      if (nthread.gt.0) then
-        call read_threadbase
-      endif
+c      if (nthread.gt.0) then
+c        call read_threadbase
+c      endif
       call setup_var
       if (me.eq.king .or. .not. out1file)
      & call intout
@@ -1040,6 +1042,9 @@ cd      enddo
       call readi(minimcard,'MINFUN',minfun,maxmin)
       call reada(minimcard,'TOLF',tolf,1.0D-2)
       call reada(minimcard,'RTOLF',rtolf,1.0D-4)
+      print_min_stat=min0(index(minimcard,'PRINT_MIN_STAT'),1)
+      print_min_res=min0(index(minimcard,'PRINT_MIN_RES'),1)
+      print_min_ini=min0(index(minimcard,'PRINT_MIN_INI'),1)
       write (iout,'(/80(1h*)/20x,a/80(1h*))') 
      &         'Options in energy minimization:'
       write (iout,'(4(a,i5),a,1pe14.5,a,1pe14.5)')