X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=source%2Funres%2Fsrc_MD-M%2Fcheckder_p.F;h=ebfd52b998fbfe927b71584a5bf65a1810183558;hb=57038e4bdff4cc9534106b25bfbd4b9a844d47fd;hp=26854e6f5f73d8d8ce64e68f1c67c2dc0dc23528;hpb=478a9d9a1c99eb3f4bc4ca676ff3162bdd01d633;p=unres.git diff --git a/source/unres/src_MD-M/checkder_p.F b/source/unres/src_MD-M/checkder_p.F index 26854e6..ebfd52b 100644 --- a/source/unres/src_MD-M/checkder_p.F +++ b/source/unres/src_MD-M/checkder_p.F @@ -2,6 +2,7 @@ C Check the gradient of Cartesian coordinates in internal coordinates. implicit real*8 (a-h,o-z) include 'DIMENSIONS' + include 'COMMON.CONTROL' include 'COMMON.IOUNITS' include 'COMMON.VAR' include 'COMMON.CHAIN' @@ -14,8 +15,9 @@ C Check the gradient of Cartesian coordinates in internal coordinates. * Check the gradient of the virtual-bond and SC vectors in the internal * coordinates. * - aincr=1.0d-7 - aincr2=5.0d-8 + print '("Calling CHECK_ECART",1pd12.3)',aincr + write (iout,'("Calling CHECK_ECART",1pd12.3)') aincr + aincr2=0.5d0*aincr call cartder write (iout,'(a)') '**************** dx/dalpha' write (iout,'(a)') @@ -25,7 +27,7 @@ C Check the gradient of Cartesian coordinates in internal coordinates. do k=1,3 temp(k,i)=dc(k,nres+i) enddo - call chainbuild + call chainbuild_extconf do k=1,3 gg(k)=(dc(k,nres+i)-temp(k,i))/aincr xx(k)=dabs((gg(k)-dxds(k,i))/(aincr*dabs(dxds(k,i))+aincr)) @@ -34,7 +36,7 @@ C Check the gradient of Cartesian coordinates in internal coordinates. & i,(gg(k),k=1,3),(dxds(k,i),k=1,3),(xx(k),k=1,3) write (iout,'(a)') alph(i)=alphi - call chainbuild + call chainbuild_extconf enddo write (iout,'(a)') write (iout,'(a)') '**************** dx/domega' @@ -45,7 +47,7 @@ C Check the gradient of Cartesian coordinates in internal coordinates. do k=1,3 temp(k,i)=dc(k,nres+i) enddo - call chainbuild + call chainbuild_extconf do k=1,3 gg(k)=(dc(k,nres+i)-temp(k,i))/aincr xx(k)=dabs((gg(k)-dxds(k+3,i))/ @@ -55,7 +57,7 @@ C Check the gradient of Cartesian coordinates in internal coordinates. & i,(gg(k),k=1,3),(dxds(k+3,i),k=1,3),(xx(k),k=1,3) write (iout,'(a)') omeg(i)=omegi - call chainbuild + call chainbuild_extconf enddo write (iout,'(a)') write (iout,'(a)') '**************** dx/dtheta' @@ -68,7 +70,7 @@ C Check the gradient of Cartesian coordinates in internal coordinates. temp(k,j)=dc(k,nres+j) enddo enddo - call chainbuild + call chainbuild_extconf do j=i-1,nres-1 ii = indmat(i-2,j) c print *,'i=',i-2,' j=',j-1,' ii=',ii @@ -83,7 +85,7 @@ c print *,'i=',i-2,' j=',j-1,' ii=',ii enddo write (iout,'(a)') theta(i)=theti - call chainbuild + call chainbuild_extconf enddo write (iout,'(a)') '***************** dx/dphi' write (iout,'(a)') @@ -94,7 +96,7 @@ c print *,'i=',i-2,' j=',j-1,' ii=',ii temp(k,j)=dc(k,nres+j) enddo enddo - call chainbuild + call chainbuild_extconf do j=i-1,nres-1 ii = indmat(i-2,j) c print *,'ii=',ii @@ -108,7 +110,7 @@ c print *,'ii=',ii write(iout,'(a)') enddo phi(i)=phi(i)-aincr - call chainbuild + call chainbuild_extconf enddo write (iout,'(a)') '****************** ddc/dtheta' do i=1,nres-2 @@ -119,7 +121,7 @@ c print *,'ii=',ii temp(k,j)=dc(k,j) enddo enddo - call chainbuild + call chainbuild_extconf do j=i+1,nres-1 ii = indmat(i,j) c print *,'ii=',ii @@ -148,7 +150,7 @@ c print *,'ii=',ii temp(k,j)=dc(k,j) enddo enddo - call chainbuild + call chainbuild_extconf do j=i+2,nres-1 ii = indmat(i+1,j) c print *,'ii=',ii @@ -175,6 +177,7 @@ C---------------------------------------------------------------------------- C Check the gradient of the energy in Cartesian coordinates. implicit real*8 (a-h,o-z) include 'DIMENSIONS' + include 'COMMON.CONTROL' include 'COMMON.CHAIN' include 'COMMON.DERIV' include 'COMMON.IOUNITS' @@ -191,8 +194,8 @@ C Check the gradient of the energy in Cartesian coordinates. nf=0 nfl=0 call zerograd - aincr=1.0D-7 - print '(a)','CG processor',me,' calling CHECK_CART.' + print '("Calling CHECK_ECART",1pd12.3)',aincr + write (iout,'("Calling CHECK_ECART",1pd12.3)') aincr nf=0 icall=0 call geom_to_var(nvar,x) @@ -272,17 +275,20 @@ C Check the gradient of the energy in Cartesian coordinates. integer uiparm(1) double precision urparm(1) external fdum - r_cut=2.0d0 - rlambd=0.3d0 +c r_cut=2.0d0 +c rlambd=0.3d0 icg=1 nf=0 nfl=0 + print *,"ATU 3" call intout c call intcartderiv c call checkintcartgrad call zerograd - aincr=1.0D-5 - write(iout,*) 'Calling CHECK_ECARTINT.' +c aincr=8.0D-7 +c aincr=1.0D-7 + print '("Calling CHECK_ECARTINT",1pd12.3)',aincr + write (iout,'("Calling CHECK_ECARTINT",1pd12.3)') aincr nf=0 icall=0 call geom_to_var(nvar,x) @@ -297,8 +303,10 @@ c call checkintcartgrad write (iout,*) "exit cartgrad" call flush(iout) icall =1 + write (iout,*) "gcard and gxcart" do i=1,nres - write (iout,'(i5,3f10.5)') i,(gradxorr(j,i),j=1,3) + write (iout,'(i5,3f10.5,5x,3f10.5)') i,(gcart(j,i),j=1,3), + & (gxcart(j,i),j=1,3) enddo do j=1,3 grad_s(j,0)=gcart(j,0) @@ -362,6 +370,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) @@ -395,6 +404,7 @@ c write (iout,*) "etot11",etot11," etot12",etot12 c write(iout,'(2i5,2(a,f15.10))')i,j," etot",etot," etot1",etot1 dc(j,i)=ddc(j)-aincr call chainbuild_cart +C print *,c(j,i) c call int_from_cart1(.false.) if (.not.split_ene) then call etotal(energia1(0)) @@ -506,20 +516,40 @@ c------------------------------------------------------------------------- #else do i=2,nres #endif +C print *,i dnorm1=dist(i-1,i) - dnorm2=dist(i,i+1) + dnorm2=dist(i,i+1) +C print *,i,dnorm1,dnorm2 do j=1,3 c(j,maxres2)=0.5D0*(2*c(j,i)+(c(j,i-1)-c(j,i))/dnorm1 & +(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) +C print *,omeg(i) alph(i)=alpha(nres+i,i,maxres2) +C print *,alph(i) theta(i+1)=alpha(i-1,i,i+1) vbld(i)=dist(i-1,i) +C print *,vbld(i) vbld_inv(i)=1.0d0/vbld(i) vbld(nres+i)=dist(nres+i,i) +C print *,vbld(i+nres) + if (itype(i).ne.10) then vbld_inv(nres+i)=1.0d0/vbld(nres+i) else @@ -593,6 +623,11 @@ cd call flush(iout) &rad2deg*theta(i),rad2deg*phi(i),vbld(nres+i), &rad2deg*alph(i),rad2deg*omeg(i) enddo + do i=1,nres + write (iout,'(i5,2(3f10.5,5x),f10.5,5x,f10.5)' ) + & i,(dc_norm(j,i),j=1,3), + & (dc_norm(j,nres+i),j=1,3),vbld_inv(i+1),vbld_inv(i+nres) + enddo endif 1212 format (a3,'(',i3,')',2(f15.10,2f10.2)) #ifdef TIMING @@ -605,6 +640,7 @@ c---------------------------------------------------------------------------- C Check the gradient of energy in internal coordinates. implicit real*8 (a-h,o-z) include 'DIMENSIONS' + include 'COMMON.CONTROL' include 'COMMON.CHAIN' include 'COMMON.DERIV' include 'COMMON.IOUNITS' @@ -619,8 +655,9 @@ C Check the gradient of energy in internal coordinates. character*6 key external fdum call zerograd - aincr=1.0D-7 - print '(a)','Calling CHECK_INT.' +c aincr=1.0D-7 + print '("Calling CHECK_INT",1pd12.3)',aincr + write (iout,'("Calling CHECK_INT",1pd12.3)') aincr nf=0 nfl=0 icg=1 @@ -651,12 +688,12 @@ cd write (iout,'(i3,1pe14.4)') (i,gana(i),i=1,nvar) xi=x(i) x(i)=xi-0.5D0*aincr call var_to_geom(nvar,x) - call chainbuild + call chainbuild_extconf call etotal(energia1(0)) etot1=energia1(0) x(i)=xi+0.5D0*aincr call var_to_geom(nvar,x) - call chainbuild + call chainbuild_extconf call etotal(energia2(0)) etot2=energia2(0) gg(i)=(etot2-etot1)/aincr