kolejna
[unres.git] / source / unres / src_MD / int_to_cart.f
index 3d29019..4b2f3b5 100644 (file)
@@ -124,17 +124,26 @@ c   calculating dE/ddc1
         do j=1,3
 cc Derviative was calculated for oposite vector of side chain therefore
 c there is "-" sign before gloc_sc
-         gxcart(j,1)=gxcart(j,1)-gloc_sc(1,1,icg)*
+         gxcart(j,1)=gxcart(j,1)-gloc_sc(1,0,icg)*
      &     dtauangle(j,1,1,3)
-         gcart(j,1)=gcart(j,1)+gloc_sc(1,1,icg)*
-     &     dtauangle(j,
-          if (itype(2).ne.10) gxcart(j,1)=gxcart(j,1)
-     &-gloc_sc(3,1,icg)*dtauangle(j,3,1,3)
+         gcart(j,1)=gcart(j,1)+gloc_sc(1,0,icg)*
+     &     dtauangle(j,1,2,3)
+          if (itype(2).ne.10) then
+         gxcart(j,1)= gxcart(j,1)
+     &               -gloc_sc(3,0,icg)*dtauangle(j,3,1,3)
+         gcart(j,1)=gcart(j,1)+gloc_sc(3,0,icg)*
+            dtauangle(j,3,2,3)
+          endif
 c   As potetnial DO NOT depend on omicron anlge their derivative is
 c   ommited 
 c     &     +gloc_sc(intertyp,nres-2,icg)*dtheta(j,1,3)         
         enddo
        endif
+       if (itype(3).ne.10) then
+       do j=1,3
+       gcart(j,1)=gcart(j,1)+
+     & gloc_sc(2,1,icg)*dtauangle(j,2,2,4)
+       enddo
 c     Calculating the remainder of dE/ddc2
        do j=1,3
          gcart(j,2)=gcart(j,2)+gloc(1,icg)*dphi(j,2,4)+