subroutine distrirhom(rmax,npoints,flag,nhom) c----------------------------------------------------------------------- c Author Jerome Gonichon c for x-y in input10 ran=3 (homogeneous distribution) c----------------------------------------------------------------------- c include 'param_sz.h' include 'constcom.h' c common/hom/xhom(imaa),yhom(imaa) dimension xhom1(imaa),yhom1(imaa),rhom(imaa) c----------------------------------------------------------------------- rmaxsq=rmax**2 delthom=2*rmax/(sqrt(float(npoints))-1) nhom=0 x=-rmax y=-rmax do 10 i=1,npoints 20 continue if(x.lt.rmax)then x=x+delthom else if(y.lt.rmax)then y=y+delthom x=-rmax else goto 10 endif endif rsq=x**2+y**2 if(rsq.gt.rmaxsq)then goto 20 endif xhom(i)=x yhom(i)=y rhom(i)=sqrt(xhom(i)**2+yhom(i)**2) write(50,*)rhom(i) nhom=nhom+1 10 continue if(flag.eq.0)return c---sorting rhom ascendant do 12 j=2,nhom a=rhom(j) b=xhom(j) c=yhom(j) do 11 i=j-1,1,-1 if(rhom(i).le.a)goto 13 rhom(i+1)=rhom(i) xhom(i+1)=xhom(i) yhom(i+1)=yhom(i) 11 continue i=0 13 rhom(i+1)=a xhom(i+1)=b yhom(i+1)=c 12 continue if(flag.eq.1)return if(flag.eq.2)then do 60 i=1,nhom xhom1(i)=xhom(nhom+1-i) yhom1(i)=yhom(nhom+1-i) 60 continue do 50 i=1,nhom xhom(i)=xhom1(i) yhom(i)=yhom1(i) write(48,*)xhom(i),yhom(i),rhom(i) 50 continue return endif inc=0 n=0 do 30 i=1,nhom/2+3 xhom1(i+inc)=xhom(i) xhom1(i+inc+4)=xhom(nhom+1-i) yhom1(i+inc)=yhom(i) yhom1(i+inc+4)=yhom(nhom+1-i) n=n+1 if(n.eq.4)then inc=inc+4 n=0 endif 30 continue do 40 i=1,nhom xhom(i)=xhom1(i) yhom(i)=yhom1(i) write(49,*)xhom(i),yhom(i),sqrt(xhom(i)**2+yhom(i)**2) 40 continue return end c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*