gcorr_loc(i)=0.0d0
enddo
do i=iatel_s,iatel_e
- if (i.eq.1) cycle
+ if (i.eq.1) then
+ if (itype(i).eq.ntyp1.or. itype(i+1).eq.ntyp1
+ & .or. itype(i+2).eq.ntyp1) cycle
+ else
if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1
& .or. itype(i+2).eq.ntyp1
& .or. itype(i-1).eq.ntyp1
&) cycle
+ endif
if (itel(i).eq.0) goto 1215
dxi=dc(1,i)
dyi=dc(2,i)
num_conti=0
C write (iout,*) 'i',i,' ielstart',ielstart(i),' ielend',ielend(i)
do j=ielstart(i),ielend(i)
- if (j.eq.1) cycle
+ if (j.eq.1) then
+ if (itype(j).eq.ntyp1 .or. itype(j+1).eq.ntyp1
+ & .or.itype(j+2).eq.ntyp1
+ &) cycle
+ else
if (itype(j).eq.ntyp1 .or. itype(j+1).eq.ntyp1
& .or.itype(j+2).eq.ntyp1
& .or.itype(j-1).eq.ntyp1
&) cycle
+ endif
C
C) cycle
if (itel(j).eq.0) goto 1216
if (yj.lt.0) yj=yj+boxysize
zj=mod(zj,boxzsize)
if (zj.lt.0) zj=zj+boxzsize
- dist_init=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
+ dist_init=(xj-xmedi)**2+(yj-ymedi)**2+(zj-zmedi)**2
xj_safe=xj
yj_safe=yj
zj_safe=zj
xj=xj_safe+xshift*boxxsize
yj=yj_safe+yshift*boxysize
zj=zj_safe+zshift*boxzsize
- dist_temp=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
+ dist_temp=(xj-xmedi)**2+(yj-ymedi)**2+(zj-zmedi)**2
if(dist_temp.lt.dist_init) then
dist_init=dist_temp
xj_temp=xj
yj=yj_safe-ymedi
zj=zj_safe-zmedi
endif
-
rij=xj*xj+yj*yj+zj*zj
sss=sscale(sqrt(rij))
sssgrad=sscagrad(sqrt(rij))
c &'evdw1',i,j,evdwij
c &,iteli,itelj,aaa,evdw1
- write (iout,'(a6,2i5,0pf7.3)') 'ees',i,j,eesij
+C write (iout,'(a6,2i5,0pf7.3)') 'ees',i,j,eesij
c write(iout,'(2(2i3,2x),7(1pd12.4)/2(3(1pd12.4),5x)/)')
c & iteli,i,itelj,j,aaa,bbb,ael6i,ael3i,
c & 1.0D0/dsqrt(rrmij),evdwij,eesij,
else
diff = vbld(i)-vbldp0
c write (iout,*) i,vbld(i),vbldp0,diff,AKP*diff*diff
+ endif
estr=estr+diff*diff
do j=1,3
gradb(j,i-1)=AKP*diff*dc(j,i-1)/vbld(i)
enddo
- endif
- write (iout,'(a7,i5,4f7.3)')
- & "estr bb",i,vbld(i),vbldp0,diff,AKP*diff*diff
+C endif
+C write (iout,'(a7,i5,4f7.3)')
+C & "estr bb",i,vbld(i),vbldp0,diff,AKP*diff*diff
enddo
estr=0.5d0*AKP*estr+estr1
c
nbi=nbondterm(iti)
if (nbi.eq.1) then
diff=vbld(i+nres)-vbldsc0(1,iti)
-c write (iout,*) i,iti,vbld(i+nres),vbldsc0(1,iti),diff,
-c & AKSC(1,iti),AKSC(1,iti)*diff*diff
+C write (iout,*) i,iti,vbld(i+nres),vbldsc0(1,iti),diff,
+C & AKSC(1,iti),AKSC(1,iti)*diff*diff
estr=estr+0.5d0*AKSC(1,iti)*diff*diff
do j=1,3
gradbx(j,i)=AKSC(1,iti)*diff*dc(j,i+nres)/vbld(i+nres)