X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=source%2Funres%2Fsrc-HCD-5D%2Fgradient_p.F;h=adafa5374ce70d65a22d596e39d6c0c57c0ded7e;hb=5836ecdab5a8b95f079bbf6e07374dee3fce8a26;hp=82b8c34eb5be51ffe9f24da2fd4c74f36b5e073d;hpb=a05e8996b6fb955dc21aef7a85db21ee73d0a9d3;p=unres.git diff --git a/source/unres/src-HCD-5D/gradient_p.F b/source/unres/src-HCD-5D/gradient_p.F index 82b8c34..adafa53 100644 --- a/source/unres/src-HCD-5D/gradient_p.F +++ b/source/unres/src-HCD-5D/gradient_p.F @@ -335,6 +335,11 @@ c--------------------------------------------------------------------------- integer i,j,kk #ifdef DEBUG write (iout,*)"Converting virtual-bond gradient to CA/SC gradient" + write (iout,*) "dC/dX gradient" + do i=0,nres + write (iout,'(i5,3f10.5,5x,3f10.5)') i,(gcart(j,i),j=1,3), + & (gxcart(j,i),j=1,3) + enddo #endif do i=nres,1,-1 do j=1,3 @@ -345,17 +350,24 @@ c--------------------------------------------------------------------------- ! (gcart_new(j,i),j=1,3),(gxcart(j,i),j=1,3) enddo ! Correction: dummy residues - if (nnt.gt.1) then - do j=1,3 - gcart(j,nnt)=gcart(j,nnt)+gcart(j,1) - enddo - endif - if (nct.lt.nres) then - do j=1,3 -! gcart_new(j,nct)=gcart_new(j,nct)+gcart_new(j,nres) - gcart(j,nct)=gcart(j,nct)+gcart(j,nres) - enddo - endif + do i=2,nres + if (itype(i-1).eq.ntyp1 .and. itype(i).ne.ntyp1) then + gcart(:,i)=gcart(:,i)+gcart(:,i-1) + else if (itype(i-1).ne.ntyp1 .and. itype(i).eq.ntyp1) then + gcart(:,i-1)=gcart(:,i-1)+gcart(:,i) + endif + enddo +c if (nnt.gt.1) then +c do j=1,3 +c gcart(j,nnt)=gcart(j,nnt)+gcart(j,1) +c enddo +c endif +c if (nct.lt.nres) then +c do j=1,3 +c! gcart_new(j,nct)=gcart_new(j,nct)+gcart_new(j,nres) +c gcart(j,nct)=gcart(j,nct)+gcart(j,nres) +c enddo +c endif #ifdef DEBUG write (iout,*) "CA/SC gradient" do i=1,nres