correction of dihedral homology restraints phi(i+3)
[unres.git] / source / unres / src_MD-M / energy_p_new_barrier.F
index b3c4c22..5eca704 100644 (file)
@@ -7060,11 +7060,12 @@ c      write (iout,*) idihconstr_start_homo,idihconstr_end_homo
       do i=idihconstr_start_homo,idihconstr_end_homo
         kat2=0.0d0
 c        betai=beta(i,i+1,i+2,i+3)
-        betai = phi(i+3)
+        betai = phi(i)
 c       write (iout,*) "betai =",betai
         do k=1,constr_homology
           dih_diff(k)=pinorm(dih(k,i)-betai)
-c         write (iout,*) "dih_diff(",k,") =",dih_diff(k)
+cd          write (iout,'(a8,2i4,2f15.8)') "dih_diff",i,k,dih_diff(k)
+cd     &                  ,sigma_dih(k,i)
 c          if (dih_diff(i,k).gt.3.14159) dih_diff(i,k)=
 c     &                                   -(6.28318-dih_diff(i,k))
 c          if (dih_diff(i,k).lt.-3.14159) dih_diff(i,k)=
@@ -7172,6 +7173,9 @@ c
 c         dtheta_i=theta(j)-thetaref(j,iref)
 c         dtheta_i=thetaref(k,i)-theta(i) ! original form without indexing
           theta_diff(k)=thetatpl(k,i)-theta(i)
+cd          write (iout,'(a8,2i4,2f15.8)') "theta_diff",i,k,theta_diff(k)
+cd     &                  ,sigma_theta(k,i)
+
 c
           utheta_i=-0.5d0*theta_diff(k)**2*sigma_theta(k,i) ! waga_theta rmvd from Gaussian argument
 c         utheta_i=-0.5d0*waga_theta*theta_diff(k)**2*sigma_theta(k,i) ! waga_theta?
@@ -7242,7 +7246,7 @@ c                                    Original sign inverted for calc of gradient
           dyy=-yytpl(k,i)+yytab(i) ! ibid y
           dzz=-zztpl(k,i)+zztab(i) ! ibid z
 c         write(iout,*) "dxx, dyy, dzz"
-c         write(iout,'(2i5,3f8.2)') k,i,dxx,dyy,dzz
+cd          write(iout,'(2i5,4f8.2)') k,i,dxx,dyy,dzz,sigma_d(k,i)
 c
           usc_diff_i=-0.5d0*(dxx**2+dyy**2+dzz**2)*sigma_d(k,i)  ! waga_d rmvd from Gaussian argument
 c         usc_diff(i)=-0.5d0*waga_d*(dxx**2+dyy**2+dzz**2)*sigma_d(k,i) ! waga_d?