New valence-torsionals completed
[unres.git] / source / unres / src_MD-M / intcartderiv.F
index 0b75bf0..227a119 100644 (file)
@@ -119,7 +119,7 @@ c the conventional case
 c    Obtaining the gamma derivatives from sine derivative                               
        if (phi(i).gt.-pi4.and.phi(i).le.pi4.or.
      &     phi(i).gt.pi34.and.phi(i).le.pi.or.
-     &     phi(i).gt.-pi.and.phi(i).le.-pi34) then
+     &     phi(i).ge.-pi.and.phi(i).le.-pi34) then
          call vecpr(dc_norm(1,i-1),dc_norm(1,i-2),vp1)
          call vecpr(dc_norm(1,i-3),dc_norm(1,i-1),vp2)
          call vecpr(dc_norm(1,i-3),dc_norm(1,i-2),vp3) 
@@ -163,6 +163,11 @@ c           endif
         endif                                                                                           
       enddo
 Calculate derivative of Tauangle
+      do i=1,nres-1
+       do j=1,3
+        dc_norm2(j,i+nres)=-dc_norm(j,i+nres)
+       enddo
+      enddo
 #ifdef PARINTDER
       do i=itau_start,itau_end
 #else
@@ -194,7 +199,7 @@ cc         write(iout,*) "faki",fac0,fac1,fac2,fac3,fac4
 c    Obtaining the gamma derivatives from sine derivative                                
        if (tauangle(1,i).gt.-pi4.and.tauangle(1,i).le.pi4.or.
      &     tauangle(1,i).gt.pi34.and.tauangle(1,i).le.pi.or.
-     &     tauangle(1,i).gt.-pi.and.tauangle(1,i).le.-pi34) then
+     &     tauangle(1,i).ge.-pi.and.tauangle(1,i).le.-pi34) then
          call vecpr(dc_norm(1,i-1),dc_norm(1,i-2),vp1)
          call vecpr(dc_norm2(1,i-2+nres),dc_norm(1,i-1),vp2)
          call vecpr(dc_norm2(1,i-2+nres),dc_norm(1,i-2),vp3)
@@ -341,7 +346,7 @@ c        dc_norm2(j,i-1+nres)=-dc_norm(j,i-1+nres)
 c    Obtaining the gamma derivatives from sine derivative                                
        if (tauangle(3,i).gt.-pi4.and.tauangle(3,i).le.pi4.or.
      &     tauangle(3,i).gt.pi34.and.tauangle(3,i).le.pi.or.
-     &     tauangle(3,i).gt.-pi.and.tauangle(3,i).le.-pi34) then
+     &     tauangle(3,i).ge.-pi.and.tauangle(3,i).le.-pi34) then
          call vecpr(dc_norm(1,i-1+nres),dc_norm(1,i-2),vp1)
          call vecpr(dc_norm2(1,i-2+nres),dc_norm(1,i-1+nres),vp2)
          call vecpr(dc_norm2(1,i-2+nres),dc_norm(1,i-2),vp3)
@@ -420,7 +425,7 @@ c             write (iout,*) "i",i," cosa",cosa," sina",sina," sino",sino
 c obtaining the derivatives of omega from sines            
             if(omeg(i).gt.-pi4.and.omeg(i).le.pi4.or.
      &         omeg(i).gt.pi34.and.omeg(i).le.pi.or.
-     &         omeg(i).gt.-pi.and.omeg(i).le.-pi34) then
+     &         omeg(i).ge.-pi.and.omeg(i).le.-pi34) then
                fac15=dcos(theta(i+1))/(dsin(theta(i+1))*
      &        dsin(theta(i+1)))
                fac16=dcos(alph(i))/(dsin(alph(i))*dsin(alph(i)))