all CMakeLists.txt updated with corrected names and directories
[unres.git] / source / cluster / wham / src / energy_p_new.F
index 471eb5d..1fc05cb 100644 (file)
@@ -3,7 +3,7 @@
       include 'DIMENSIONS'
       include 'sizesclu.dat'
 
-      external proc_proc
+c     external proc_proc
 #ifdef WINPGI
 cMS$ATTRIBUTES C ::  proc_proc
 #endif
@@ -189,7 +189,7 @@ c detecting NaNQ
 #ifdef WINPGI
       idumm=proc_proc(etot,i)
 #else
-      call proc_proc(etot,i)
+c     call proc_proc(etot,i)
 #endif
       if(i.eq.1)energia(0)=1.0d+99
 #ifdef MPL
@@ -262,7 +262,7 @@ cd        write (iout,*) i,g_corr5_loc(i)
      &   +wsccor*fact(1)*gsccor_loc(i)
       enddo
       endif
-cd    call enerprint(energia(0),fact)
+c      call enerprint(energia(0),fact)
 cd    call intout
 cd    stop
       return
@@ -3438,8 +3438,6 @@ c
 c        sgtheta=-gtheta(k)*theta_diff(k)*sigma_theta(k,i)*waga_theta ! right functional form?
           sum_sgtheta=sum_sgtheta+sgtheta ! cum variable
         enddo
-c       grad_theta3=sum_sgtheta/sum_gtheta 1/*theta(i)? s. line below
-c       grad_theta3=sum_sgtheta/sum_gtheta
 c
 c       Final value of gradient using same var as in Econstr_back
         dutheta(i-2)=sum_sgtheta/sum_gtheta*waga_theta
@@ -3648,9 +3646,12 @@ c
      &              waga_theta*Eval+waga_d*Erot)*waga_homology(iset)
 c     write (iout,*) "ehomology_constr=",ehomology_constr
       endif
-c      write (iout,*) "odleg",odleg," kat",kat," Eval",Eval," Erot",Erot
-c     write (iout,*) "ehomology_constr",ehomology_constr
-c     ehomology_constr=odleg+kat+Uconst_back
+#ifdef DEBUG
+      write (iout,*) "iset",iset," waga_homology",waga_homology(iset)
+      write (iout,*) "odleg",waga_dist,odleg," kat",waga_angle,kat,
+     & " Eval",waga_theta,Eval," Erot",waga_d,Erot
+      write (iout,*) "ehomology_constr",ehomology_constr
+#endif
       return
 
   748 format(a8,f12.3,a6,f12.3,a7,f12.3)
@@ -4052,7 +4053,7 @@ C
           enddo
         else
           phii1=0.0d0
-          ityp3=nthetyp+1
+          ityp3=ithetyp(itype(i))
           do k=1,nsingle
             cosph2(k)=0.0d0
             sinph2(k)=0.0d0
@@ -5165,6 +5166,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
@@ -5177,6 +5183,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
 
       return