Adam 7/30/2014
[unres.git] / source / cluster / wham / src-M-NEWCORR / readrtns.F
index 321e11e..326d4ec 100644 (file)
@@ -64,6 +64,7 @@ C
       write (iout,*) 'beta_h',(beta_h(i),i=1,nT)
       lprint_cart=index(controlcard,"PRINT_CART") .gt.0
       lprint_int=index(controlcard,"PRINT_INT") .gt.0
+      with_dihed_constr = index(controlcard,"WITH_DIHED_CONSTR").gt.0
       if (min_var) iopt=1
       return
       end
@@ -87,6 +88,7 @@ C
       include 'COMMON.CONTROL'
       include 'COMMON.CONTACTS'
       include 'COMMON.TIME1'
+      include 'COMMON.TORCNSTR'
 #ifdef MPL
       include 'COMMON.INFO'
 #endif
@@ -193,7 +195,11 @@ C 12/1/95 Added weight for the multi-body term WCORR
         bad(i,2)=scalscp*bad(i,2)
       enddo
 
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
+#endif
       print *,'indpdb=',indpdb,' pdbref=',pdbref
 
 C Read sequence if not taken from the pdb file.
@@ -233,6 +239,28 @@ C Convert sequence to numeric code
 
       print *,'Call Read_Bridge.'
       call read_bridge
+
+      if (with_dihed_constr) then
+
+      read (inp,*) ndih_constr
+      write (iout,*) "ndih_constr",ndih_constr
+      if (ndih_constr.gt.0) then
+        read (inp,*) ftors
+        write (iout,*) 'FTORS',ftors
+        read (inp,*) (idih_constr(i),phi0(i),drange(i),i=1,ndih_constr)
+        write (iout,*)
+     &   'There are',ndih_constr,' constraints on phi angles.'
+        do i=1,ndih_constr
+          write (iout,'(i5,2f8.3)') idih_constr(i),phi0(i),drange(i)
+        enddo
+        do i=1,ndih_constr
+          phi0(i)=deg2rad*phi0(i)
+          drange(i)=deg2rad*drange(i)
+        enddo
+      endif
+
+      endif
+
       nnt=1
       nct=nres
       print *,'NNT=',NNT,' NCT=',NCT