From 890cd4ffc8cc239da40ddf432851bf8fd27df279 Mon Sep 17 00:00:00 2001 From: Adam Sieradzan Date: Mon, 23 Feb 2015 20:00:58 +0100 Subject: [PATCH] poprawka turn3 i turn4 uwaga moga byc wlaczone diagnostki --- source/unres/src_MD/COMMON.DERIV | 9 +++++++-- source/unres/src_MD/COMMON.SCCOR | 18 ++++++++++-------- source/unres/src_MD/checkder_p.F | 2 +- source/unres/src_MD/energy_p_new_barrier.F | 16 +++++++++++++++- source/unres/src_MD/intcartderiv.F | 26 +++++++++++++------------- source/unres/src_MD/unres.F | 1 + 6 files changed, 47 insertions(+), 25 deletions(-) diff --git a/source/unres/src_MD/COMMON.DERIV b/source/unres/src_MD/COMMON.DERIV index 6fdb1aa..e4c39c5 100644 --- a/source/unres/src_MD/COMMON.DERIV +++ b/source/unres/src_MD/COMMON.DERIV @@ -2,7 +2,9 @@ & gvdwpp,gel_loc,gel_loc_long,gvdwc_scpp, & gradx_scp,gvdwc_scp,ghpbx,ghpbc,gloc,gloc_x,dtheta,dphi,dalpha, & domega,gscloc,gsclocx,gradcorr,gradcorr_long,gradcorr5_long, - & gradcorr6_long,gcorr6_turn_long,gvdwcT,gvdwxT,gvdwx + & gradcorr6_long,gcorr6_turn_long,gvdwcT,gvdwxT,gvdwx,gloc_sc, + & dcostau,dsintau,dtauangle,dcosomicron, + & domicron integer nfl,icg common /derivatT/ gvdwcT(3,maxres),gvdwxT(3,maxres) common /derivat/ dcdv(6,maxdim),dxdv(6,maxdim),dxds(6,maxres), @@ -21,7 +23,10 @@ & gel_loc_turn4(maxvar),gel_loc_turn6(maxvar),gcorr_loc(maxvar), & g_corr5_loc(maxvar),g_corr6_loc(maxvar),gsccorc(3,maxres), & gsccorx(3,maxres),gsccor_loc(maxres),dtheta(3,2,maxres), - & gscloc(3,maxres),gsclocx(3,maxres), + & gscloc(3,maxres),gsclocx(3,maxres),gloc_sc(3,0:maxres2,10), + & dcostau(3,3,3,maxres2),dsintau(3,3,3,maxres2), + & dtauangle(3,3,3,maxres2),dcosomicron(3,3,3,maxres2), + & domicron(3,3,3,maxres2), & dphi(3,3,maxres),dalpha(3,3,maxres),domega(3,3,maxres),nfl,icg double precision derx,derx_turn common /deriv_loc/ derx(3,5,2),derx_turn(3,5,2) diff --git a/source/unres/src_MD/COMMON.SCCOR b/source/unres/src_MD/COMMON.SCCOR index 208d60b..623bbad 100644 --- a/source/unres/src_MD/COMMON.SCCOR +++ b/source/unres/src_MD/COMMON.SCCOR @@ -1,18 +1,20 @@ cc Parameters of the SCCOR term double precision v1sccor,v2sccor,vlor1sccor, - & vlor2sccor,vlor3sccor,gloc_sc, - & dcostau,dsintau,dtauangle,dcosomicron, - & domicron,v0sccor + & vlor2sccor,vlor3sccor,v0sccor +C,gloc_sc, +C & dcostau,dsintau,dtauangle,dcosomicron, +C & domicron,v0sccor integer nterm_sccor,isccortyp,nsccortyp,nlor_sccor common/sccor/v1sccor(maxterm_sccor,3,-ntyp:ntyp,-ntyp:ntyp), & v2sccor(maxterm_sccor,3,-ntyp:ntyp,-ntyp:ntyp), - & v0sccor(maxterm_sccor,-ntyp:ntyp), + & v0sccor(-ntyp:ntyp,-ntyp:ntyp), & nterm_sccor(-ntyp:ntyp,-ntyp:ntyp),isccortyp(-ntyp:ntyp), & nsccortyp, & nlor_sccor(-ntyp:ntyp,-ntyp:ntyp), & vlor1sccor(maxterm_sccor,20,20), & vlor2sccor(maxterm_sccor,20,20), - & vlor3sccor(maxterm_sccor,20,20),gloc_sc(3,0:maxres2,10), - & dcostau(3,3,3,maxres2),dsintau(3,3,3,maxres2), - & dtauangle(3,3,3,maxres2),dcosomicron(3,3,3,maxres2), - & domicron(3,3,3,maxres2) + & vlor3sccor(maxterm_sccor,20,20) +C,gloc_sc(3,0:maxres2,10), +C & dcostau(3,3,3,maxres2),dsintau(3,3,3,maxres2), +C & dtauangle(3,3,3,maxres2),dcosomicron(3,3,3,maxres2), +C & domicron(3,3,3,maxres2) diff --git a/source/unres/src_MD/checkder_p.F b/source/unres/src_MD/checkder_p.F index 4d0379e..ff70fa1 100644 --- a/source/unres/src_MD/checkder_p.F +++ b/source/unres/src_MD/checkder_p.F @@ -284,7 +284,7 @@ C Check the gradient of the energy in Cartesian coordinates. c call intcartderiv c call checkintcartgrad call zerograd - aincr=1.0D-5 + aincr=1.0D-6 write(iout,*) 'Calling CHECK_ECARTINT.' nf=0 icall=0 diff --git a/source/unres/src_MD/energy_p_new_barrier.F b/source/unres/src_MD/energy_p_new_barrier.F index 0bcd6f3..3ef05a4 100644 --- a/source/unres/src_MD/energy_p_new_barrier.F +++ b/source/unres/src_MD/energy_p_new_barrier.F @@ -3023,6 +3023,9 @@ C C Loop over i,i+2 and i,i+3 pairs of the peptide groups C do i=iturn3_start,iturn3_end + if (itype(i).eq.21 .or. itype(i+1).eq.21 + & .or. itype(i+2).eq.21 .or. itype(i+3).eq.21.or.itype(i+4).eq.21) + & cycle dxi=dc(1,i) dyi=dc(2,i) dzi=dc(3,i) @@ -3038,6 +3041,10 @@ C num_cont_hb(i)=num_conti enddo do i=iturn4_start,iturn4_end + if (itype(i).eq.21 .or. itype(i+1).eq.21 + & .or. itype(i+2).eq.21 .or. itype(i+3).eq.21.or.itype(i+4).eq.21 + & .or. itype(i+5).eq.21) + & cycle dxi=dc(1,i) dyi=dc(2,i) dzi=dc(3,i) @@ -3056,6 +3063,8 @@ c c Loop over all pairs of interacting peptide groups except i,i+2 and i,i+3 c do i=iatel_s,iatel_e + if (itype(i).eq.21 .or. itype(i+1).eq.21 + &.or.itype(i+2)) cycle dxi=dc(1,i) dyi=dc(2,i) dzi=dc(3,i) @@ -3068,6 +3077,8 @@ c c write (iout,*) 'i',i,' ielstart',ielstart(i),' ielend',ielend(i) num_conti=num_cont_hb(i) do j=ielstart(i),ielend(i) + if (itype(j).eq.21 .or. itype(j+1).eq.21 + &.or.itype(j+2)) cycle call eelecij(i,j,ees,evdw1,eel_loc) enddo ! j num_cont_hb(i)=num_conti @@ -5959,17 +5970,19 @@ c lprn=.true. c write (iout,*) "EBACK_SC_COR",iphi_start,iphi_end,nterm_sccor esccor=0.0D0 do i=itau_start,itau_end +C do i=42,42 esccor_ii=0.0D0 if ((itype(i-2).eq.ntyp1).or.(itype(i-1).eq.ntyp1)) cycle isccori=isccortyp(itype(i-2)) isccori1=isccortyp(itype(i-1)) phii=phi(i) + cccc Added 9 May 2012 cc Tauangle is torsional engle depending on the value of first digit c(see comment below) cc Omicron is flat angle depending on the value of first digit c(see comment below) - +C print *,i,tauangle(1,i) do intertyp=1,3 !intertyp cc Added 09 May 2012 (Adasko) @@ -5996,6 +6009,7 @@ c 3 = SC...Ca...Ca...SCi esccor=esccor+v1ij*cosphi+v2ij*sinphi gloci=gloci+j*(v2ij*cosphi-v1ij*sinphi) enddo +C print *,i,tauangle(1,i),gloci gloc_sc(intertyp,i-3,icg)=gloc_sc(intertyp,i-3,icg)+wsccor*gloci c write (iout,*) "WTF",intertyp,i,itype(i),v1ij*cosphi+v2ij*sinphi c &gloc_sc(intertyp,i-3,icg) diff --git a/source/unres/src_MD/intcartderiv.F b/source/unres/src_MD/intcartderiv.F index 889bedd..fcc2e86 100644 --- a/source/unres/src_MD/intcartderiv.F +++ b/source/unres/src_MD/intcartderiv.F @@ -35,7 +35,7 @@ c We need dtheta(:,:,i-1) to compute dphi(:,:,i) do i=3,nres #endif cost=dcos(theta(i)) - sint=sqrt(1-cost*cost) + sint=dsqrt(1-cost*cost) do j=1,3 dcostheta(j,1,i)=-(dc_norm(j,i-1)+cost*dc_norm(j,i-2))/ & vbld(i-1) @@ -54,9 +54,9 @@ c We need dtheta(:,:,i-1) to compute dphi(:,:,i) #endif if ((itype(i-1).ne.10).and.(itype(i-1).ne.21)) then cost1=dcos(omicron(1,i)) - sint1=sqrt(1-cost1*cost1) + sint1=dsqrt(1-cost1*cost1) cost2=dcos(omicron(2,i)) - sint2=sqrt(1-cost2*cost2) + sint2=dsqrt(1-cost2*cost2) do j=1,3 CC Calculate derivative over first omicron (Cai-2,Cai-1,SCi-1) dcosomicron(j,1,1,i)=-(dc_norm(j,i-1+nres)+ @@ -149,7 +149,7 @@ c Obtaining the gamma derivatives from cosine derivative endif enddo - do i=1,nres-1 + do i=1,nres do j=1,3 dc_norm2(j,i+nres)=-dc_norm(j,i+nres) enddo @@ -213,15 +213,15 @@ c Obtaining the gamma derivatives from cosine derivative dcostau(j,1,1,i)=fac1*dcosomicron(j,2,2,i-1)+fac3* & dcosomicron(j,2,2,i-1)-fac0*(dc_norm(j,i-1)-scalp* & (dc_norm2(j,i-2+nres)))/vbld(i-2+nres) - dtauangle(j,1,1,i)=-1/sing*dcostau(j,1,1,i) + dtauangle(j,1,1,i)=-1.0d0/sing*dcostau(j,1,1,i) dcostau(j,1,2,i)=fac1*dcosomicron(j,2,1,i-1)+fac2* & dcostheta(j,1,i)+fac3*dcosomicron(j,2,1,i-1)+fac4* & dcostheta(j,1,i) - dtauangle(j,1,2,i)=-1/sing*dcostau(j,1,2,i) + dtauangle(j,1,2,i)=-1.0d0/sing*dcostau(j,1,2,i) dcostau(j,1,3,i)=fac2*dcostheta(j,2,i)+fac4* & dcostheta(j,2,i)-fac0*(-dc_norm(j,i-2+nres)-scalp* & dc_norm(j,i-1))/vbld(i) - dtauangle(j,1,3,i)=-1/sing*dcostau(j,1,3,i) + dtauangle(j,1,3,i)=-1.0d0/sing*dcostau(j,1,3,i) c write (iout,*) "else",i enddo endif @@ -287,15 +287,15 @@ c Obtaining the gamma derivatives from cosine derivative dcostau(j,2,1,i)=fac1*dcostheta(j,1,i-1)+fac3* & dcostheta(j,1,i-1)-fac0*(dc_norm(j,i-1+nres)-scalp* & dc_norm(j,i-3))/vbld(i-2) - dtauangle(j,2,1,i)=-1/sing*dcostau(j,2,1,i) + dtauangle(j,2,1,i)=-1.0d0/sing*dcostau(j,2,1,i) dcostau(j,2,2,i)=fac1*dcostheta(j,2,i-1)+fac2* & dcosomicron(j,1,1,i)+fac3*dcostheta(j,2,i-1)+fac4* & dcosomicron(j,1,1,i) - dtauangle(j,2,2,i)=-1/sing*dcostau(j,2,2,i) + dtauangle(j,2,2,i)=-1.0d0/sing*dcostau(j,2,2,i) dcostau(j,2,3,i)=fac2*dcosomicron(j,1,2,i)+fac4* & dcosomicron(j,1,2,i)-fac0*(dc_norm(j,i-3)-scalp* & dc_norm(j,i-1+nres))/vbld(i-1+nres) - dtauangle(j,2,3,i)=-1/sing*dcostau(j,2,3,i) + dtauangle(j,2,3,i)=-1.0d0/sing*dcostau(j,2,3,i) c write(iout,*) i,j,"else", dtauangle(j,2,3,i) enddo endif @@ -360,15 +360,15 @@ c Obtaining the gamma derivatives from cosine derivative dcostau(j,3,1,i)=fac1*dcosomicron(j,2,2,i-1)+fac3* & dcosomicron(j,2,2,i-1)-fac0*(dc_norm(j,i-1+nres)-scalp* & dc_norm2(j,i-2+nres))/vbld(i-2+nres) - dtauangle(j,3,1,i)=-1/sing*dcostau(j,3,1,i) + dtauangle(j,3,1,i)=-1.0d0/sing*dcostau(j,3,1,i) dcostau(j,3,2,i)=fac1*dcosomicron(j,2,1,i-1)+fac2* & dcosomicron(j,1,1,i)+fac3*dcosomicron(j,2,1,i-1)+fac4* & dcosomicron(j,1,1,i) - dtauangle(j,3,2,i)=-1/sing*dcostau(j,3,2,i) + dtauangle(j,3,2,i)=-1.0d0/sing*dcostau(j,3,2,i) dcostau(j,3,3,i)=fac2*dcosomicron(j,1,2,i)+fac4* & dcosomicron(j,1,2,i)-fac0*(dc_norm2(j,i-2+nres)-scalp* & dc_norm(j,i-1+nres))/vbld(i-1+nres) - dtauangle(j,3,3,i)=-1/sing*dcostau(j,3,3,i) + dtauangle(j,3,3,i)=-1.0d0/sing*dcostau(j,3,3,i) c write(iout,*) "else",i enddo endif diff --git a/source/unres/src_MD/unres.F b/source/unres/src_MD/unres.F index b14c040..a63047f 100644 --- a/source/unres/src_MD/unres.F +++ b/source/unres/src_MD/unres.F @@ -736,6 +736,7 @@ c enddo print *,'icheckgrad=',icheckgrad goto (10,20,30) icheckgrad 10 call check_ecartint + call check_ecartint return 20 call check_cartgrad return -- 1.7.9.5