wprowadzenie do multichaina SCcorr
[unres.git] / source / unres / src_MD-M / intcartderiv.F
index b8f84b9..94b3989 100644 (file)
@@ -46,12 +46,14 @@ c We need dtheta(:,:,i-1) to compute dphi(:,:,i)
         cost=dcos(theta(i))
        sint=sqrt(1-cost*cost)
         do j=1,3
+C         if (itype(i-1).ne.21) then
           dcostheta(j,1,i)=-(dc_norm(j,i-1)+cost*dc_norm(j,i-2))/
      &   vbld(i-1)
-          if (itype(i-1).ne.21) dtheta(j,1,i)=-dcostheta(j,1,i)/sint
+          if (itype(i-1).ne.21)  dtheta(j,1,i)=-dcostheta(j,1,i)/sint
           dcostheta(j,2,i)=-(dc_norm(j,i-2)+cost*dc_norm(j,i-1))/
      &   vbld(i)
-          if (itype(i-1).ne.21) dtheta(j,2,i)=-dcostheta(j,2,i)/sint
+          if (itype(i-1).ne.21)  dtheta(j,2,i)=-dcostheta(j,2,i)/sint
+C          endif
         enddo
       enddo
 #if defined(MPI) && defined(PARINTDER)
@@ -622,7 +624,7 @@ c Check alpha gradient
       write (iout,*) 
      & "Analytical (upper) and numerical (lower) gradient of alpha"
       do i=2,nres-1
-       if(itype(i).ne.10) then
+       if((itype(i).ne.10).and.(itype(i).ne.ntyp1)) then
                    do j=1,3
              dcji=dc(j,i-1)
                      dc(j,i-1)=dcji+aincr
@@ -658,7 +660,7 @@ c     Check omega gradient
       write (iout,*) 
      & "Analytical (upper) and numerical (lower) gradient of omega"
       do i=2,nres-1
-       if(itype(i).ne.10) then
+       if((itype(i).ne.10).and.(itype(i).ne.ntyp1)) then
                    do j=1,3
              dcji=dc(j,i-1)
                      dc(j,i-1)=dcji+aincr