correction - adding ehomology_constr
[unres.git] / source / wham / src / energy_p_new.F
index 3ca5082..5cfdcce 100644 (file)
 c
 c          For Gaussian-type Urestr
 c
-        ehomology_constr=(waga_dist*odleg+waga_angle*kat+
-     &              waga_theta*Eval+waga_d*Erot)*waga_homology(iset)
+c        ehomology_constr=(waga_dist*odleg+waga_angle*kat+
+c     &              waga_theta*Eval+waga_d*Erot)*waga_homology(iset)
+        ehomology_constr=waga_dist*odleg+waga_angle*kat+
+     &              waga_theta*Eval+waga_d*Erot
 c     write (iout,*) "ehomology_constr=",ehomology_constr
       else
 c
 c          For Lorentzian-type Urestr
 c  
-        ehomology_constr=(-waga_dist*odleg+waga_angle*kat+
-     &              waga_theta*Eval+waga_d*Erot)*waga_homology(iset)
+c        ehomology_constr=(-waga_dist*odleg+waga_angle*kat+
+c     &              waga_theta*Eval+waga_d*Erot)*waga_homology(iset)
+        ehomology_constr=-waga_dist*odleg+waga_angle*kat+
+     &              waga_theta*Eval+waga_d*Erot
 c     write (iout,*) "ehomology_constr=",ehomology_constr
       endif
 #ifdef DEBUG
@@ -5251,6 +5255,11 @@ c   3 = SC...Ca...Ca...SCi
           cosphi=dcos(j*tauangle(intertyp,i))
           sinphi=dsin(j*tauangle(intertyp,i))
           esccor=esccor+v1ij*cosphi+v2ij*sinphi
+#define DEBUG
+#ifdef DEBUG
+          esccor_ii=esccor_ii+v1ij*cosphi+v2ij*sinphi
+#endif
+#undef DEBUG
           gloci=gloci+j*(v2ij*cosphi-v1ij*sinphi)
         enddo
         gloc_sc(intertyp,i-3,icg)=gloc_sc(intertyp,i-3,icg)+wsccor*gloci
@@ -5263,6 +5272,9 @@ c     &gloc_sc(intertyp,i-3,icg)
      & ,(v2sccor(j,intertyp,itori,itori1),j=1,6)
         gsccor_loc(i-3)=gsccor_loc(i-3)+gloci
        enddo !intertyp
+#ifdef DEBUG
+       write (iout,*) "i",i,(tauangle(j,i),j=1,3),esccor_ii
+#endif
       enddo
 c        do i=1,nres
 c        write (iout,*) "W@T@F",  gloc_sc(1,i,icg),gloc(i,icg)