c This program is an example of how to set up and use the c ran_cat() subroutine to generate random galaxy positions c in accord to a selected survey geometry and selection function. c c To compile link with ran_subs.f and geometries.f c eg c f77 ran_subs.f geometries.f example.f -o example.exe c program example implicit none integer iseed,i,N,j parameter(N=20000) real x(N),y(N),z(N),d(N),r(N) real zlimit character selfile*180,outfile*180 logical vlim c c Make Catalogue Selection selfile = 'data1/om1:lam0:strc:a/sel1.pscz ' !selection function file zlimit=0.5 !redshift at which to truncate the catalogue iseed= -6969 !random number seed which should be negative outfile = 'data1/om1:lam0:strc:a/ran1.pscz' vlim=.false. c c Generate N random galaxy positions and echo first 10 do i=1,N call ran_cat(x(i),y(i),z(i),d(i),iseed,zlimit,selfile,vlim) r(i)=sqrt(x(i)**2+y(i)**2+z(i)**2) if (i.le.10) then write(0,'(i3,5(a,f7.4))') i,': x=',x(i),' y=',y(i), & ' z=',z(i),' r=',r(i),' d=',d(i) end if end do c c c Write positions in the same format as one of the mock catalogues open(11,file=outfile,status='unknown',form='unformatted') write(11) 0,N ! n=0 and ng=number of galaxies in the catalogue write(11) zlimit write(11) 2 ! idf=2 write(11) 0.0,0.0,0.0,((0.0,i=1,3),j=1,3),iseed, & 0.0,0.0,0.0 !dummy values for c !orientation and velocity of the c !observer in the N-body simulation write(11) 0,0,0 !dummy values for mass fluctuation c !in 8Mpc/h, density parameter and cosmological constant write(11) (x(i),i=1,N) write(11) (y(i),i=1,N) write(11) (z(i),i=1,N) write(11) (d(i),i=1,N) write(11) (0.0,i=1,N) !dummy magnitude values write(11) (0.0,i=1,N) !dummy zhmax values write(11) (0,i=1,N) !dummy id values close(11) stop end