first and last GLY in seq gives correct energy in unres and wham
[unres.git] / source / cluster / wham / src-M / readrtns.F
index a723920..4b14b66 100644 (file)
@@ -38,7 +38,8 @@ C
       min_var=(index(controlcard,'MINVAR').gt.0)
       plot_tree=(index(controlcard,'PLOT_TREE').gt.0)
       punch_dist=(index(controlcard,'PUNCH_DIST').gt.0)
-      call readi(controlcard,'NCUT',ncut,1)
+      call readi(controlcard,'NCUT',ncut,0)
+      call readi(controlcard,'NCLUST',nclust,5)
       call readi(controlcard,'SYM',symetr,1)
       write (iout,*) 'sym', symetr
       call readi(controlcard,'NSTART',nstart,0)
@@ -49,7 +50,8 @@ C
       lgrp=(index(controlcard,'LGRP').gt.0)
       caonly=(index(controlcard,'CA_ONLY').gt.0)
       print_dist=(index(controlcard,'PRINT_DIST').gt.0)
-      call multreada(controlcard,'CUTOFF',rcutoff,ncut,-1.0d0)
+      if (ncut.gt.0) 
+     & call multreada(controlcard,'CUTOFF',rcutoff,ncut,-1.0d0)
       call readi(controlcard,'IOPT',iopt,2) 
       lside = index(controlcard,"SIDE").gt.0
       efree = index(controlcard,"EFREE").gt.0
@@ -115,6 +117,7 @@ C Read weights of the subsequent energy terms.
       call reada(weightcard,'WTURN4',wturn4,1.0D0)
       call reada(weightcard,'WTURN6',wturn6,1.0D0)
       call reada(weightcard,'WSTRAIN',wstrain,1.0D0)
+      call reada(weightcard,'WSCCOR',wsccor,1.0D0)
       call reada(weightcard,'WBOND',wbond,1.0D0)
       call reada(weightcard,'WTOR',wtor,1.0D0)
       call reada(weightcard,'WTORD',wtor_d,1.0D0)
@@ -146,9 +149,10 @@ C 12/1/95 Added weight for the multi-body term WCORR
       weights(16)=wvdwpp
       weights(17)=wbond
       weights(18)=scal14
+      weights(19)=wsccor
       write (iout,10) wsc,wscp,welec,wvdwpp,wbond,wang,wscloc,wtor,
      &  wtor_d,wstrain,wel_loc,wcorr,wcorr5,wcorr6,wturn3,
-     &  wturn4,wturn6
+     &  wturn4,wturn6,wsccor
    10 format (/'Energy-term weights (unscaled):'//
      & 'WSCC=   ',f10.6,' (SC-SC)'/
      & 'WSCP=   ',f10.6,' (SC-p)'/
@@ -166,7 +170,9 @@ C 12/1/95 Added weight for the multi-body term WCORR
      & 'WCORR6= ',f10.6,' (multi-body 6th order)'/
      & 'WTURN3= ',f10.6,' (turns, 3rd order)'/
      & 'WTURN4= ',f10.6,' (turns, 4th order)'/
-     & 'WTURN6= ',f10.6,' (turns, 6th order)')
+     & 'WTURN6= ',f10.6,' (turns, 6th order)'/
+     & 'WSCCOR= ',f10.6,' (SC-backbone torsinal correalations)')
+
       if (wcorr4.gt.0.0d0) then
         write (iout,'(/2a/)') 'Local-electrostatic type correlation ',
      &   'between contact pairs of peptide groups'
@@ -202,6 +208,19 @@ C Convert sequence to numeric code
       do i=1,nres
         itype(i)=rescode(i,sequence(i),iscode)
       enddo
+      if (itype(2).eq.10.and.itype(1).eq.ntyp1) then
+        write (iout,*)
+     &   "Glycine is the first full residue, initial dummy deleted"
+        do i=1,nres
+          itype(i)=itype(i+1)
+        enddo
+        nres=nres-1
+      endif
+      if (itype(nres-1).eq.10.and.itype(nres).eq.ntyp1) then
+        write (iout,*)
+     &   "Glycine is the last full residue, terminal dummy deleted"
+        nres=nres-1
+      endif
       print *,nres
       print '(20i4)',(itype(i),i=1,nres)