C*********************************************************** SUBROUTINE NONGRAVI C*********************************************************** c this is the routine used with gmet=2 c constructs the lists of potential impacting pairs c replaces gravi in case of no self-gravity c uses x-ordering -> good for radially elongated regions C*********************************************************** INCLUDE 'ssbox.inc' real xvar(nstar2),yvar(nstar2) dimension indx(nstar2) CALL CPU(TIME1) c--------------------------------------- c sort particles according to radial coordinate c include padding to facilitate the treatment of boundaries c--------------------------------------- do 10 i=1,lkm xvar(i)=r(i,1) xvar(lkm+i)=r(i,1)+2.*xl yvar(i)=r(i,2) yvar(lkm+i)=r(i,2)+bvak 10 continue c xvar(index) in ascending order lkm2=2*lkm call indexr(lkm2,xvar,indx) c-------------------------------------------------------------------- c compute the list of impact candidates, c taking advantage of 1-d ordering c 1) choose a target particle 1 c (in the order of increasing radial coordinate x) c 2) go through all other particles 2 for which c an impact is in principle possible: c x1 < x2 < x1+rajatmp c rajatemp= s1+smax = maximum possible sum of radii c 3) For these find the actual distance and relative velocity c and decide whether to include to list of potential impact pairs c c IMPACT LIST: c ix=index of impact list c indix(ix,1) and indix(id,2) indices of the pair c eroix(ix) = current distance between pair c nnix(ix) =-1,0,1 indicate whether the nearest pair c mmix(ix) =-1,0,1 is found among image particles c------------------------------------------------------------------ ix=0 rajatmp=raja1+2.*s(lkm) c largest particle: smax=s(lkm) do 20 i=1,lkm ii=indx(i) xtemp1=xvar(ii) rajatmp=raja1+s(ii)+smax xrajatmp=xtemp1+rajatmp do 30 j=i+1,lkm2 jj=indx(j) xtemp2=xvar(jj) if(xtemp2.gt.xrajatmp) goto 20 mmtemp=99 dy=yvar(ii)-yvar(jj) if(abs(dy).lt.rajatmp) mmtemp=0 if(abs(dy+2.*yl).lt.rajatmp) mmtemp=1 if(abs(dy-2.*yl).lt.rajatmp) mmtemp=-1 if(mmtemp.eq.99) goto 30 nntemp=0 if(jj.gt.lkm) nntemp=-1 jjt=jj if(jj.gt.lkm) jjt=jj-lkm c nearest images c nntemp=0 and mmtemp=0 --> between actual particles c nntemp=1 or -1 between images over radial boundaries c mmtemp=1 or -1 between images over tangential boundaries c [avak=2*xl, cvak=2*yl] dx=r(ii,1)-r(jjt,1)+nntemp*avak dy=r(ii,2)-r(jjt,2)+nntemp*bvak+mmtemp*cvak dz=r(ii,3)-r(jjt,3) ssum=s(ii)+s(jjt) ddist=dx**2+dy**2+dz**2 dist=sqrt(ddist) ero=dist-ssum if(ero.lt.raja1) then dvx=rp(ii,1)-rp(jjt,1) dvy=rp(ii,2)-rp(jjt,2)+nntemp*vvak dvz=rp(ii,3)-rp(jjt,3) dero=EROVAK1*sqrt(dvx**2+dvy**2+dvz**2)*dt+EROVAK2*raja1 if(ero.lt.dero) then ix=ix+1 c dilcol assumes that II ',0.9*NIX,IX RETURN END