#ifdef TIMING
time_vec=time_vec+MPI_Wtime()-time01
#endif
+C Introduction of shielding effect first for each peptide group
+C the shielding factor is set this factor is describing how each
+C peptide group is shielded by side-chains
+C the matrix - shield_fac(i) the i index describe the ith between i and i+1
+ if (shield_mode.gt.0) then
+ call set_shield_fac
+ endif
c print *,"Processor",myrank," left VEC_AND_DERIV"
if (ipot.lt.6) then
#ifdef SPLITELE
call Eliptransfer(eliptran)
endif
C print *,"za lipidami"
+ if (AFMlog.gt.0) then
+ call AFMforce(Eafmforce)
+ else if (selfguide.gt.0) then
+ call AFMvel(Eafmforce)
+ endif
#ifdef TIMING
time_enecalc=time_enecalc+MPI_Wtime()-time00
#endif
energia(20)=Uconst+Uconst_back
energia(21)=esccor
energia(22)=eliptran
+ energia(23)=Eafmforce
c Here are the energies showed per procesor if the are more processors
c per molecule then we sum it up in sum_energy subroutine
c print *," Processor",myrank," calls SUM_ENERGY"
Uconst=energia(20)
esccor=energia(21)
eliptran=energia(22)
+ Eafmforce=energia(23)
#ifdef SPLITELE
etot=wsc*evdw+wscp*evdw2+welec*ees+wvdwpp*evdw1
& +wang*ebe+wtor*etors+wscloc*escloc
& +wstrain*ehpb+wcorr*ecorr+wcorr5*ecorr5
& +wcorr6*ecorr6+wturn4*eello_turn4+wturn3*eello_turn3
& +wturn6*eturn6+wel_loc*eel_loc+edihcnstr+wtor_d*etors_d
- & +wbond*estr+Uconst+wsccor*esccor+wliptran*eliptran
+ & +wbond*estr+Uconst+wsccor*esccor+wliptran*eliptran+Eafmforce
#else
etot=wsc*evdw+wscp*evdw2+welec*(ees+evdw1)
& +wang*ebe+wtor*etors+wscloc*escloc
& +wcorr6*ecorr6+wturn4*eello_turn4+wturn3*eello_turn3
& +wturn6*eturn6+wel_loc*eel_loc+edihcnstr+wtor_d*etors_d
& +wbond*estr+Uconst+wsccor*esccor+wliptran*eliptran
+ & +Eafmforce
#endif
energia(0)=etot
c detecting NaNQ
& wturn6*gcorr6_turn_long(j,i)+
& wstrain*ghpbc(j,i)
& +wliptran*gliptranc(j,i)
+ & +gradafm(j,i)
enddo
enddo
& wturn6*gcorr6_turn_long(j,i)+
& wstrain*ghpbc(j,i)
& +wliptran*gliptranc(j,i)
+ & +gradafm(j,i)
+
enddo
enddo
#endif
& wsccor*gsccorc(j,i)
& +wscloc*gscloc(j,i)
& +wliptran*gliptranc(j,i)
+ & +gradafm(j,i)
#else
gradc(j,i,icg)=gradbufc(j,i)+welec*gelc(j,i)+
& wel_loc*gel_loc(j,i)+
& wsccor*gsccorc(j,i)
& +wscloc*gscloc(j,i)
& +wliptran*gliptranc(j,i)
+ & +gradafm(j,i)
+
#endif
gradx(j,i,icg)=wsc*gvdwx(j,i)+wscp*gradx_scp(j,i)+
& wbond*gradbx(j,i)+
Uconst=energia(20)
esccor=energia(21)
eliptran=energia(22)
+ Eafmforce=energia(23)
#ifdef SPLITELE
write (iout,10) evdw,wsc,evdw2,wscp,ees,welec,evdw1,wvdwpp,
& estr,wbond,ebe,wang,
& ecorr5,wcorr5,ecorr6,wcorr6,eel_loc,wel_loc,eello_turn3,wturn3,
& eello_turn4,wturn4,eello_turn6,wturn6,esccor,wsccor,
& edihcnstr,ebr*nss,
- & Uconst,eliptran,wliptran,etot
+ & Uconst,eliptran,wliptran,Eafmforce,etot
10 format (/'Virtual-chain energies:'//
& 'EVDW= ',1pE16.6,' WEIGHT=',1pD16.6,' (SC-SC)'/
& 'EVDW2= ',1pE16.6,' WEIGHT=',1pD16.6,' (SC-p)'/
& 'ESS= ',1pE16.6,' (disulfide-bridge intrinsic energy)'/
& 'UCONST= ',1pE16.6,' (Constraint energy)'/
& 'ELT=',1pE16.6, ' WEIGHT=',1pD16.6,' (Lipid transfer energy)'/
+ & 'EAFM= ',1pE16.6,' (atomic-force microscopy)'/
& 'ETOT= ',1pE16.6,' (total)')
+
#else
write (iout,10) evdw,wsc,evdw2,wscp,ees,welec,
& estr,wbond,ebe,wang,
& ecorr,wcorr,
& ecorr5,wcorr5,ecorr6,wcorr6,eel_loc,wel_loc,eello_turn3,wturn3,
& eello_turn4,wturn4,eello_turn6,wturn6,esccor,wsccro,edihcnstr,
- & ebr*nss,Uconst,eliptran,wliptran,etot
+ & ebr*nss,Uconst,eliptran,wliptran,Eafmforc,etot
10 format (/'Virtual-chain energies:'//
& 'EVDW= ',1pE16.6,' WEIGHT=',1pD16.6,' (SC-SC)'/
& 'EVDW2= ',1pE16.6,' WEIGHT=',1pD16.6,' (SC-p)'/
& 'ESS= ',1pE16.6,' (disulfide-bridge intrinsic energy)'/
& 'UCONST=',1pE16.6,' (Constraint energy)'/
& 'ELT=',1pE16.6, ' WEIGHT=',1pD16.6,' (Lipid transfer energy)'/
+ & 'EAFM= ',1pE16.6,' (atomic-force microscopy)'/
& 'ETOT= ',1pE16.6,' (total)')
#endif
return
C lipbufthick is thickenes of lipid buffore
sslipj=sscalelip(fracinbuf)
ssgradlipj=-sscagradlip(fracinbuf)/lipbufthick
- elseif (zi.gt.bufliptop) then
+ elseif (zj.gt.bufliptop) then
fracinbuf=1.0d0-((bordliptop-zj)/lipbufthick)
sslipj=sscalelip(fracinbuf)
ssgradlipj=sscagradlip(fracinbuf)/lipbufthick
if (zi.lt.buflipbot) then
C what fraction I am in
fracinbuf=1.0d0-
- & ((positi-bordlipbot)/lipbufthick)
+ & ((zi-bordlipbot)/lipbufthick)
C lipbufthick is thickenes of lipid buffore
sslipi=sscalelip(fracinbuf)
ssgradlipi=-sscagradlip(fracinbuf)/lipbufthick
elseif (zi.gt.bufliptop) then
- fracinbuf=1.0d0-((bordliptop-positi)/lipbufthick)
+ fracinbuf=1.0d0-((bordliptop-zi)/lipbufthick)
sslipi=sscalelip(fracinbuf)
ssgradlipi=sscagradlip(fracinbuf)/lipbufthick
else
if (zj.lt.buflipbot) then
C what fraction I am in
fracinbuf=1.0d0-
- & ((positi-bordlipbot)/lipbufthick)
+ & ((zj-bordlipbot)/lipbufthick)
C lipbufthick is thickenes of lipid buffore
sslipj=sscalelip(fracinbuf)
ssgradlipj=-sscagradlip(fracinbuf)/lipbufthick
- elseif (zi.gt.bufliptop) then
- fracinbuf=1.0d0-((bordliptop-positi)/lipbufthick)
+ elseif (zj.gt.bufliptop) then
+ fracinbuf=1.0d0-((bordliptop-zj)/lipbufthick)
sslipj=sscalelip(fracinbuf)
ssgradlipj=sscagradlip(fracinbuf)/lipbufthick
else
c write(iout,*) 'b1=',b1(1,i-2)
c write (iout,*) 'theta=', theta(i-1)
enddo
+#else
+ b1(1,i-2)=b(3,iti)
+ b1(2,i-2)=b(5,iti)
+ b2(1,i-2)=b(2,iti)
+ b2(2,i-2)=b(4,iti)
+ b1tilde(1,i-2)=b1(1,i-2)
+ b1tilde(2,i-2)=-b1(2,i-2)
+ b2tilde(1,i-2)=b2(1,i-2)
+ b2tilde(2,i-2)=-b2(2,i-2)
+ EE(1,2,i-2)=eeold(1,2,iti)
+ EE(2,1,i-2)=eeold(2,1,iti)
+ EE(2,2,i-2)=eeold(2,2,iti)
+ EE(1,1,i-2)=eeold(1,1,iti)
+ enddo
+#endif
#ifdef PARMAT
do i=ivec_start+2,ivec_end+2
#else
do i=3,nres+1
#endif
-#endif
if (i .lt. nres+1) then
sin1=dsin(phi(i))
cos1=dcos(phi(i))
if (i.le.1) cycle
C write(iout,*) "tu jest i",i
if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1
+C changes suggested by Ana to avoid out of bounds
+ & .or.((i+4).gt.nres)
+ & .or.((i-1).le.0)
+C end of changes by Ana
& .or. itype(i+2).eq.ntyp1
- & .or. itype(i+3).eq.ntyp1
- & .or. itype(i-1).eq.ntyp1
- & .or. itype(i+4).eq.ntyp1
- & ) cycle
+ & .or. itype(i+3).eq.ntyp1) cycle
+ if(i.gt.1)then
+ if(itype(i-1).eq.ntyp1)cycle
+ end if
+ if(i.LT.nres-3)then
+ if (itype(i+4).eq.ntyp1) cycle
+ end if
dxi=dc(1,i)
dyi=dc(2,i)
dzi=dc(3,i)
do i=iturn4_start,iturn4_end
if (i.le.1) cycle
if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1
+C changes suggested by Ana to avoid out of bounds
+ & .or.((i+5).gt.nres)
+ & .or.((i-1).le.0)
+C end of changes suggested by Ana
& .or. itype(i+3).eq.ntyp1
& .or. itype(i+4).eq.ntyp1
& .or. itype(i+5).eq.ntyp1
do i=iatel_s,iatel_e
if (i.le.1) cycle
if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1
+C changes suggested by Ana to avoid out of bounds
+ & .or.((i+2).gt.nres)
+ & .or.((i-1).le.0)
+C end of changes by Ana
& .or. itype(i+2).eq.ntyp1
& .or. itype(i-1).eq.ntyp1
& ) cycle
C write (iout,*) i,j
if (j.le.1) cycle
if (itype(j).eq.ntyp1.or. itype(j+1).eq.ntyp1
+C changes suggested by Ana to avoid out of bounds
+ & .or.((j+2).gt.nres)
+ & .or.((j-1).le.0)
+C end of changes by Ana
& .or.itype(j+2).eq.ntyp1
& .or.itype(j-1).eq.ntyp1
&) cycle
enddo
return
end
+C---------------------------------------------------------
+C AFM soubroutine for constant force
+ subroutine AFMforce(Eafmforce)
+ implicit real*8 (a-h,o-z)
+ include 'DIMENSIONS'
+ include 'COMMON.GEO'
+ include 'COMMON.VAR'
+ include 'COMMON.LOCAL'
+ include 'COMMON.CHAIN'
+ include 'COMMON.DERIV'
+ include 'COMMON.NAMES'
+ include 'COMMON.INTERACT'
+ include 'COMMON.IOUNITS'
+ include 'COMMON.CALC'
+ include 'COMMON.CONTROL'
+ include 'COMMON.SPLITELE'
+ include 'COMMON.SBRIDGE'
+ real*8 diffafm(3)
+ dist=0.0d0
+ Eafmforce=0.0d0
+ do i=1,3
+ diffafm(i)=c(i,afmend)-c(i,afmbeg)
+ dist=dist+diffafm(i)**2
+ enddo
+ dist=dsqrt(dist)
+ Eafmforce=-forceAFMconst*(dist-distafminit)
+ do i=1,3
+ gradafm(i,afmend-1)=-forceAFMconst*diffafm(i)/dist
+ gradafm(i,afmbeg-1)=forceAFMconst*diffafm(i)/dist
+ enddo
+C print *,'AFM',Eafmforce
+ return
+ end
+C---------------------------------------------------------
+C AFM subroutine with pseudoconstant velocity
+ subroutine AFMvel(Eafmforce)
+ implicit real*8 (a-h,o-z)
+ include 'DIMENSIONS'
+ include 'COMMON.GEO'
+ include 'COMMON.VAR'
+ include 'COMMON.LOCAL'
+ include 'COMMON.CHAIN'
+ include 'COMMON.DERIV'
+ include 'COMMON.NAMES'
+ include 'COMMON.INTERACT'
+ include 'COMMON.IOUNITS'
+ include 'COMMON.CALC'
+ include 'COMMON.CONTROL'
+ include 'COMMON.SPLITELE'
+ include 'COMMON.SBRIDGE'
+ real*8 diffafm(3)
+C Only for check grad COMMENT if not used for checkgrad
+C totT=3.0d0
+C--------------------------------------------------------
+C print *,"wchodze"
+ dist=0.0d0
+ Eafmforce=0.0d0
+ do i=1,3
+ diffafm(i)=c(i,afmend)-c(i,afmbeg)
+ dist=dist+diffafm(i)**2
+ enddo
+ dist=dsqrt(dist)
+ Eafmforce=0.5d0*forceAFMconst
+ & *(distafminit+totTafm*velAFMconst-dist)**2
+C Eafmforce=-forceAFMconst*(dist-distafminit)
+ do i=1,3
+ gradafm(i,afmend-1)=-forceAFMconst*
+ &(distafminit+totTafm*velAFMconst-dist)
+ &*diffafm(i)/dist
+ gradafm(i,afmbeg-1)=forceAFMconst*
+ &(distafminit+totTafm*velAFMconst-dist)
+ &*diffafm(i)/dist
+ enddo
+C print *,'AFM',Eafmforce,totTafm*velAFMconst,dist
+ return
+ end
+