C sscale=1.0d0
C else if(r.le.r_cut.and.r.ge.r_cut-rlamb) then
C gamm=(r-(r_cut-rlamb))/rlamb
- sscalelip=1.0d0+r*r*(2*r-3.0d0)
+ sscalelip=1.0d0+r*r*(2.0d0*r-3.0d0)
C else
C sscale=0d0
C endif
C sscagrad=0.0d0
C else if(r.le.r_cut.and.r.ge.r_cut-rlamb) then
C gamm=(r-(r_cut-rlamb))/rlamb
- sscagradlip=r*(6*r-6.0d0)
+ sscagradlip=r*(6.0d0*r-6.0d0)
C else
C sscagrad=0.0d0
C endif
endif
rrij=1.0D0/(xj*xj+yj*yj+zj*zj)
-
sss=sscale(1.0d0/(dsqrt(rrij)))
sssgrad=sscagrad(1.0d0/(dsqrt(rrij)))
if (sss.lt.1.0d0) then
C
fac=-(evdwij+e1)*rrij*(1.0d0-sss)
- fac=fac-(evdwij)*sssgrad*dsqrt(rrij)
+ fac=fac-(evdwij)*sssgrad*dsqrt(rrij)/expon
ggg(1)=xj*fac
ggg(2)=yj*fac
ggg(3)=zj*fac
if (xj.lt.0) xj=xj+boxxsize
yj=mod(yj,boxysize)
if (yj.lt.0) yj=yj+boxysize
- zj=mod(zi,boxzsize)
+ zj=mod(zj,boxzsize)
if (zj.lt.0) zj=zj+boxzsize
dist_init=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
xj_safe=xj
rrij=1.0D0/(xj*xj+yj*yj+zj*zj)
sss=sscale(1.0d0/(dsqrt(rrij)))
sssgrad=sscagrad(1.0d0/(dsqrt(rrij)))
- if (sss.gt.0.0d0) then
+ if (sss.gt.0.0d0) then
fac=rrij**expon2
e1=fac*fac*aad(itypj,iteli)
evdw2=evdw2+evdwij*sss
if (energy_dec) write (iout,'(a6,2i5,2(0pf7.3))')
& 'evdw2',i,j,sss,evdwij
+
C
C Calculate contributions to the gradient in the virtual-bond and SC vectors.
C
fac=-(evdwij+e1)*rrij*sss
- fac=fac+(evdwij)*sssgrad*dsqrt(rrij)
+ fac=fac+(evdwij)*sssgrad*dsqrt(rrij)/expon
ggg(1)=xj*fac
ggg(2)=yj*fac
ggg(3)=zj*fac