gcorr_loc(i)=0.0d0
enddo
do i=iatel_s,iatel_e
- 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 (i.eq.1) cycle
+C if (itype(i).eq.ntyp1.or. itype(i+1).eq.ntyp1
+C & .or. itype(i+2).eq.ntyp1) cycle
+C 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
+C 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) then
- if (itype(j).eq.ntyp1 .or. itype(j+1).eq.ntyp1
- & .or.itype(j+2).eq.ntyp1
- &) cycle
- else
+ if (j.eq.1) cycle
+C if (itype(j).eq.ntyp1 .or. itype(j+1).eq.Cntyp1
+C & .or.itype(j+2).eq.ntyp1
+C &) cycle
+C 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 endif
if (itel(j).eq.0) goto 1216
ind=ind+1
iteli=itel(i)
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