From 7f0180cec09003eb00ab68b95110de7bd15d81a1 Mon Sep 17 00:00:00 2001 From: Adam Kazimierz Sieradzan Date: Fri, 23 Nov 2012 09:43:14 -0500 Subject: [PATCH] Dzialajace gradient dla src_MD-M dla pola Yi --- source/unres/src_MD-M/cinfo.f | 6 +++--- source/unres/src_MD-M/energy_p_new_barrier.F | 25 +++++++++++++++---------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/source/unres/src_MD-M/cinfo.f b/source/unres/src_MD-M/cinfo.f index 5e5b814..6ca43e2 100644 --- a/source/unres/src_MD-M/cinfo.f +++ b/source/unres/src_MD-M/cinfo.f @@ -1,10 +1,10 @@ C DO NOT EDIT THIS FILE - IT HAS BEEN GENERATED BY COMPINFO.C -C 2 3 3473 +C 2 3 3488 subroutine cinfo include 'COMMON.IOUNITS' write(iout,*)'++++ Compile info ++++' - write(iout,*)'Version 2.3 build 3473' - write(iout,*)'compiled Wed Nov 21 07:54:12 2012' + write(iout,*)'Version 2.3 build 3488' + write(iout,*)'compiled Fri Nov 23 09:23:06 2012' write(iout,*)'compiled by aks255@matrix.chem.cornell.edu' write(iout,*)'OS name: Linux ' write(iout,*)'OS release: 2.6.34.9-69.fc13.x86_64 ' diff --git a/source/unres/src_MD-M/energy_p_new_barrier.F b/source/unres/src_MD-M/energy_p_new_barrier.F index 26eccc3..6df357a 100644 --- a/source/unres/src_MD-M/energy_p_new_barrier.F +++ b/source/unres/src_MD-M/energy_p_new_barrier.F @@ -5066,7 +5066,7 @@ C & dc_norm(3,i+nres) y_prime(j) = (dc_norm(j,i) + dc_norm(j,i-1))*sinfac enddo do j = 1,3 - z_prime(j) = -uz(j,i-1) + z_prime(j) = -uz(j,i-1)*dsign(1.0,dfloat(itype(i))) enddo c write (2,*) "i",i c write (2,*) "x_prime",(x_prime(j),j=1,3) @@ -5088,8 +5088,7 @@ c do j = 1,3 xx = xx + x_prime(j)*dc_norm(j,i+nres) yy = yy + y_prime(j)*dc_norm(j,i+nres) - zz = zz + dsign(1.0,dfloat(itype(i))) - & *z_prime(j)*dc_norm(j,i+nres) + zz = zz + z_prime(j)*dc_norm(j,i+nres) enddo xxtab(i)=xx @@ -5150,6 +5149,7 @@ c & dscp1,dscp2,sumene c sumene = enesc(x,xx,yy,zz,cost2tab(i+1),sint2tab(i+1)) escloc = escloc + sumene c write (2,*) "i",i," escloc",sumene,escloc +c#define DEBUG #ifdef DEBUG C C This section to check the numerical derivatives of the energy of ith side @@ -5193,6 +5193,7 @@ C End of diagnostics section. C C Compute the gradient of esc C +c zz=zz*dsign(1.0,dfloat(itype(i))) pom_s1=(1.0d0+x(63))/(0.1d0 + dscp1)**2 pom_s16=6*(1.0d0+x(64))/(0.1d0 + dscp1**6)**2 pom_s2=(1.0d0+x(65))/(0.1d0 + dscp2)**2 @@ -5217,7 +5218,7 @@ C & +(sumene2x+sumene4x*cost2tab(i+1))*(s2+s2_6) & +(pom1+pom2)*pom_dx #ifdef DEBUG - write(2,*), "de_dxx = ", de_dxx,de_dxx_num + write(2,*), "de_dxx = ", de_dxx,de_dxx_num,itype(i) #endif C sumene1y=x(3) + 2*x(6)*yy + x(9)*xx + x(10)*zz @@ -5232,7 +5233,7 @@ C & +(sumene2y+sumene4y*cost2tab(i+1))*(s2+s2_6) & +(pom1-pom2)*pom_dy #ifdef DEBUG - write(2,*), "de_dyy = ", de_dyy,de_dyy_num + write(2,*), "de_dyy = ", de_dyy,de_dyy_num,itype(i) #endif C de_dzz =(x(24) +2*x(27)*zz +x(28)*xx +x(30)*yy @@ -5244,15 +5245,16 @@ C & +x(60)*xx*yy)*cost2tab(i+1)*(s2+s2_6) & + ( x(14) + 2*x(17)*zz+ x(18)*xx + x(20)*yy)*(s2+s2_6) #ifdef DEBUG - write(2,*), "de_dzz = ", de_dzz,de_dzz_num + write(2,*), "de_dzz = ", de_dzz,de_dzz_num,itype(i) #endif C de_dt = 0.5d0*sumene3*cost2tab(i+1)*(s1+s1_6) & -0.5d0*sumene4*sint2tab(i+1)*(s2+s2_6) & +pom1*pom_dt1+pom2*pom_dt2 #ifdef DEBUG - write(2,*), "de_dt = ", de_dt,de_dt_num + write(2,*), "de_dt = ", de_dt,de_dt_num,itype(i) #endif +c#undef DEBUG c C cossc=scalar(dc_norm(1,i),dc_norm(1,i+nres)) @@ -5277,13 +5279,16 @@ c & (dC_norm(j,i-1),j=1,3)," vbld_inv",vbld_inv(i+1),vbld_inv(i) dZZ_Ci1(k)=0.0d0 dZZ_Ci(k)=0.0d0 do j=1,3 - dZZ_Ci(k)=dZZ_Ci(k)-uzgrad(j,k,2,i-1)*dC_norm(j,i+nres) - dZZ_Ci1(k)=dZZ_Ci1(k)-uzgrad(j,k,1,i-1)*dC_norm(j,i+nres) + dZZ_Ci(k)=dZZ_Ci(k)-uzgrad(j,k,2,i-1) + & *dsign(1.0,dfloat(itype(i)))*dC_norm(j,i+nres) + dZZ_Ci1(k)=dZZ_Ci1(k)-uzgrad(j,k,1,i-1) + & *dsign(1.0,dfloat(itype(i)))*dC_norm(j,i+nres) enddo dXX_XYZ(k)=vbld_inv(i+nres)*(x_prime(k)-xx*dC_norm(k,i+nres)) dYY_XYZ(k)=vbld_inv(i+nres)*(y_prime(k)-yy*dC_norm(k,i+nres)) - dZZ_XYZ(k)=vbld_inv(i+nres)*(z_prime(k)-zz*dC_norm(k,i+nres)) + dZZ_XYZ(k)=vbld_inv(i+nres)* + & (z_prime(k)-zz*dC_norm(k,i+nres)) c dt_dCi(k) = -dt_dCi(k)/sinttab(i+1) dt_dCi1(k)= -dt_dCi1(k)/sinttab(i+1) -- 1.7.9.5