poprawki w ANG w src_MD-M
[unres.git] / source / unres / src_MD-M / checkder_p.F
index 26854e6..b017e1c 100644 (file)
@@ -281,7 +281,7 @@ C Check the gradient of the energy in Cartesian coordinates.
 c      call intcartderiv
 c      call checkintcartgrad
       call zerograd
-      aincr=1.0D-5
+      aincr=10.0D-6
       write(iout,*) 'Calling CHECK_ECARTINT.'
       nf=0
       icall=0
@@ -362,6 +362,7 @@ c      call checkintcartgrad
       endif
       write (iout,'(/a/)') 'Gradient in virtual-bond and SC vectors'
       do i=0,nres
+        print *,i
         do j=1,3
          xx(j)=c(j,i+nres)
          ddc(j)=dc(j,i) 
@@ -513,7 +514,20 @@ c-------------------------------------------------------------------------
      &     +(c(j,i+1)-c(j,i))/dnorm2)
         enddo
         be=0.0D0
-        if (i.gt.2) phi(i+1)=beta(i-2,i-1,i,i+1)
+        if (i.gt.2) then
+        if (i.le.nres) phi(i+1)=beta(i-2,i-1,i,i+1)
+        if ((itype(i).ne.10).and.(itype(i-1).ne.10)) then
+         tauangle(3,i+1)=beta(i+nres-1,i-1,i,i+nres)
+        endif
+        if (itype(i-1).ne.10) then
+         tauangle(1,i+1)=beta(i-1+nres,i-1,i,i+1)
+         omicron(1,i)=alpha(i-2,i-1,i-1+nres)
+         omicron(2,i)=alpha(i-1+nres,i-1,i)
+        endif
+        if (itype(i).ne.10) then
+         tauangle(2,i+1)=beta(i-2,i-1,i,i+nres)
+        endif
+        endif
         omeg(i)=beta(nres+i,i,maxres2,i+1)
         alph(i)=alpha(nres+i,i,maxres2)
         theta(i+1)=alpha(i-1,i,i+1)