Adam's lipid and dfa corrections
[unres.git] / source / unres / src-HCD-5D / gradient_p.F
index adafa53..67275ed 100644 (file)
@@ -278,17 +278,20 @@ cd      write(iout,*) 'calling int_to_cart'
 #ifdef DEBUG
       write (iout,*) "gcart, gxcart, gloc before int_to_cart"
 #endif
-      do i=1,nct
+      do i=0,nct
         do j=1,3
           gcart(j,i)=gradc(j,i,icg)
           gxcart(j,i)=gradx(j,i,icg)
         enddo
 #ifdef DEBUG
-        if((itype(i).ne.10).and.(itype(i).ne.ntyp1)) then
+        if (i.eq.0) then
+        write (iout,'(i5,2(3f10.5,5x),4f10.5)') i,(gcart(j,i),j=1,3),
+     &    (gxcart(j,i),j=1,3)
+        else if((itype(i).ne.10).and.(itype(i).ne.ntyp1)) then
         write (iout,'(i5,2(3f10.5,5x),4f10.5)') i,(gcart(j,i),j=1,3),
      &    (gxcart(j,i),j=1,3),gloc(i,icg),gloc(i+nphi,icg),
      &    gloc(ialph(i,1),icg),gloc(ialph(i,1)+nside,icg)
-        else
+        else 
         write (iout,'(i5,2(3f10.5,5x),4f10.5)') i,(gcart(j,i),j=1,3),
      &    (gxcart(j,i),j=1,3),gloc(i,icg),gloc(i+nphi,icg)
         endif