subroutine getref(x,y,a,nuse) character*120 inline parameter(maxstars=10000) dimension x(*),y(*),a(*) dimension xtemp(maxstars),ytemp(maxstars),atemp(maxstars), & index(maxstars) C OK, first open the file open(unit=1,file='MasterList',status='old') Cwrite(6,98) 98 format('Getting the masterlist...') i=0 1 read(1,2,end=99) inline if(inline(1:1).eq.'#') go to 1 2 format(a80) C modify when we have the REAL master list.... read(inline,*,err=1) xt,yt,at,d1,d2,ae,d3,d4 i=i+1 xtemp(i)=xt ytemp(i)=yt atemp(i)=at go to 1 99 close(unit=1) n=i Cwrite(6,1000) n 1000 format('Calling sort with',i5) call sort(n,atemp,index) do 100 i=1,nuse x(i)=xtemp(index(i)) y(i)=ytemp(index(i)) a(i)=atemp(index(i)) 100 continue Cwrite(6,101) 101 format('Exiting getrefs') return end C C C subroutine getnew(x,y,a,nuse,ierr) character*120 inline parameter(maxstars=10000) dimension x(*),y(*),a(*) dimension xtemp(maxstars),ytemp(maxstars),atemp(maxstars), & index(maxstars) C Assume the file is open... i=0 1 read(1,2,end=99) inline if(inline(1:1).eq.'#') go to 1 2 format(a120) read(inline,*,err=1) xt,yt,at,d1,d2,ae,d3,d4,hjd CREMOVED FOR MAKING THE CALIBRATED STUFF C Next, check that the filter was V... C should only have to do this once per file Cif(i.eq.0) then C do 33 k=1,120 C if(inline(k:k).eq.'V') go to 34 C33 continue Cierr=1 Cclose(unit=1) Creturn Cend if 34 continue i=i+1 xtemp(i)=xt ytemp(i)=yt atemp(i)=at go to 1 99 close(unit=1) n=i Cwrite(6,103) n 103 format('N=',i5,' in getnew') call sort(n,atemp,index) do 100 i=1,nuse x(i)=xtemp(index(i)) y(i)=ytemp(index(i)) a(i)=atemp(index(i)) 100 continue return end