5D update
[unres.git] / source / cluster / wham / src-HCD-5D / energy_p_new.F
index c2d7f85..5cc851c 100644 (file)
@@ -126,7 +126,11 @@ C
       endif
 c      print *,"Processor",myrank," computed Utord"
 C
-      call eback_sc_corr(esccor)
+      if (wsccor.gt.0.0d0) then
+        call eback_sc_corr(esccor)
+      else
+        esccor=0.0d0
+      endif
 
       if (wliptran.gt.0) then
         call Eliptransfer(eliptran)
@@ -1272,7 +1276,7 @@ C finding the closest
 c            write (iout,*) i,j,xj,yj,zj
             rrij=1.0D0/(xj*xj+yj*yj+zj*zj)
             rij=dsqrt(rrij)
-            sss=sscale(1.0d0/rij))
+            sss=sscale(1.0d0/rij)
             sssgrad=sscagrad(1.0d0/rij)
             if (sss.le.0.0) cycle
 C Calculate angle-dependent terms of energy and contributions to their
@@ -2084,9 +2088,9 @@ C The order of matrices is from left to right.
         call transpose2(DtUg2der(1,1,i-1),auxmat(1,1))
         call matmat2(auxmat(1,1),EUg(1,1,i),Ug2DtEUgder(1,1,1,i))
         endif
-#endif
       enddo
       endif
+#endif
       return
       end
 C--------------------------------------------------------------------------
@@ -2113,7 +2117,7 @@ C
       include 'COMMON.INTERACT'
 #ifdef FOURBODY
       include 'COMMON.CONTACTS'
-      include 'COMMON.CONTMAP'
+      include 'COMMON.CONTMAT'
 #endif
       include 'COMMON.CORRMAT'
       include 'COMMON.TORSION'
@@ -2431,7 +2435,7 @@ C-------------------------------------------------------------------------------
       include 'COMMON.INTERACT'
 #ifdef FOURBODY
       include 'COMMON.CONTACTS'
-      include 'COMMON.CONTMAP'
+      include 'COMMON.CONTMAT'
 #endif
       include 'COMMON.CORRMAT'
       include 'COMMON.TORSION'
@@ -3476,7 +3480,7 @@ C Third- and fourth-order contributions from turns
       include 'COMMON.CHAIN'
       include 'COMMON.DERIV'
       include 'COMMON.INTERACT'
-      include 'COMMON.CONTACTS'
+      include 'COMMON.CORRMAT'
       include 'COMMON.TORSION'
       include 'COMMON.VECTORS'
       include 'COMMON.FFIELD'
@@ -3663,7 +3667,7 @@ C Third- and fourth-order contributions from turns
       include 'COMMON.CHAIN'
       include 'COMMON.DERIV'
       include 'COMMON.INTERACT'
-      include 'COMMON.CONTACTS'
+      include 'COMMON.CORRMAT'
       include 'COMMON.TORSION'
       include 'COMMON.VECTORS'
       include 'COMMON.FFIELD'
@@ -4923,14 +4927,14 @@ C        if (itype(i-1).eq.ntyp1) cycle
           coskt(k)=dcos(k*theti2)
           sinkt(k)=dsin(k*theti2)
         enddo
-        if (i.eq.3) then 
-          phii=0.0d0
-          ityp1=nthetyp+1
-          do k=1,nsingle
-            cosph1(k)=0.0d0
-            sinph1(k)=0.0d0
-          enddo
-        else
+cu        if (i.eq.3) then 
+cu          phii=0.0d0
+cu          ityp1=nthetyp+1
+cu          do k=1,nsingle
+cu            cosph1(k)=0.0d0
+cu            sinph1(k)=0.0d0
+cu          enddo
+cu        else
         if (i.gt.3 .and. itype(i-3).ne.ntyp1) then
 #ifdef OSF
           phii=phi(i)
@@ -4952,7 +4956,6 @@ c          ityp1=nthetyp+1
             sinph1(k)=0.0d0
           enddo 
         endif
-        endif
         if (i.lt.nres .and. itype(i+1).ne.ntyp1) then
 #ifdef OSF
           phii1=phi(i+1)