Fixed energy compare to MD
authorBartlomiej Zaborowski <bartek.zaborowski@chem.univ.gda.pl>
Wed, 17 Oct 2012 16:54:49 +0000 (18:54 +0200)
committerBartlomiej Zaborowski <bartek.zaborowski@chem.univ.gda.pl>
Wed, 17 Oct 2012 16:54:49 +0000 (18:54 +0200)
source/unres/src_CSA_DiL/energy_p_new_barrier.F

index c1e8ad3..faed00e 100644 (file)
@@ -674,7 +674,7 @@ c      enddo
           gradc(j,i,icg)=gradbufc(j,i)+welec*gelc(j,i)+
      &                wel_loc*gel_loc(j,i)+
      &                0.5d0*(wscp*gvdwc_scpp(j,i)+
-     &                welec*gelc_long(j,i)
+     &                welec*gelc_long(j,i)+
      &                wel_loc*gel_loc_long(j,i)+
      &                wcorr*gcorr_long(j,i)+
      &                wcorr5*gradcorr5_long(j,i)+
@@ -1399,7 +1399,7 @@ C
         do iint=1,nint_gr(i)
           do j=istart(i,iint),iend(i,iint)
             ind=ind+1
-            itypj=itype(j)
+            itypj=iabs(itype(j))
 c            dscj_inv=dsc_inv(itypj)
             dscj_inv=vbld_inv(j+nres)
             chi1=chi(itypi,itypj)
@@ -5252,7 +5252,7 @@ c
         do j = 1,3
           xx = xx + x_prime(j)*dc_norm(j,i+nres)
           yy = yy + y_prime(j)*dc_norm(j,i+nres)
-          zz = zz + z_prime(j)*dc_norm(j,i+nres)
+          zz = zz + dsign(1.0,itype(i))*z_prime(j)*dc_norm(j,i+nres)
         enddo
 
         xxtab(i)=xx
@@ -5262,7 +5262,7 @@ C
 C Compute the energy of the ith side cbain
 C
 c        write (2,*) "xx",xx," yy",yy," zz",zz
-        it=itype(i)
+        it=iabs(itype(i))
         do j = 1,65
           x(j) = sc_parmin(j,it) 
         enddo
@@ -5270,7 +5270,7 @@ c        write (2,*) "xx",xx," yy",yy," zz",zz
 Cc diagnostics - remove later
         xx1 = dcos(alph(2))
         yy1 = dsin(alph(2))*dcos(omeg(2))
-        zz1 = -dsin(alph(2))*dsin(omeg(2))
+        zz1 = -dsign(1.0,itype(i))*dsin(alph(2))*dsin(omeg(2))
         write(2,'(3f8.1,3f9.3,1x,3f9.3)') 
      &    alph(2)*rad2deg,omeg(2)*rad2deg,theta(3)*rad2deg,xx,yy,zz,
      &    xx1,yy1,zz1
@@ -5633,11 +5633,6 @@ c      lprn=.true.
       etors_ii=0.0D0
        itori=itortyp(itype(i-2))
        itori1=itortyp(itype(i-1))
-        if (iabs(itype(i)).eq.20) then
-        iblock=2
-        else
-        iblock=1
-        endif
         phii=phi(i)
         gloci=0.0D0
 C Proline-Proline pair is a special case...
@@ -5734,6 +5729,11 @@ c     lprn=.true.
       etors_ii=0.0D0
         itori=itortyp(itype(i-2))
         itori1=itortyp(itype(i-1))
+        if (iabs(itype(i)).eq.20) then
+        iblock=2
+        else
+        iblock=1
+        endif
         phii=phi(i)
         gloci=0.0D0
 C Regular cosine and sine terms