c+ c name: multiple.for c purpose: this program searches through the output file generated by 'stars2smei.for' c for stars within 0.01 degrees of each other and lists them. c The program only searches through the previous 20 entries, since c the input files are sorted (sort of) by RA. A separate check shows no c pairs split between the four files. c inputs: four "starsout" files from stars2smei.for c outputs: A printed list of stars within 0.01 degrees of one another c calls: none c mods: Jan 2003, Andrew Buffington (UCSD; (858)-534-6630; abuffington@ucsd.edu) c- program multiple implicit none integer*4 i,j,k,irahour,iramin,idecdeg,idecmin,idecsec,iarg,jarg real*4 amagb,amagv,amagsmei,rasec,rasave(20),decsave(20),ra,dec,deldec,delra,rsky,c character*13 starsout character*26 identifier,idsave(20),blanks character*4 otype character*1 obafg,subtype,lum(6) blanks=' ' c do k=1,4 do j=1,20 rasave(j)=0. decsave(j)=0. idsave(j)=blanks enddo c if(k.eq.1)starsout = 'n_poleout.dat' if(k.eq.2)starsout = 'fieldout+.dat' if(k.eq.3)starsout = 'fieldout-.dat' if(k.eq.4)starsout = 's_poleout.dat' print *,starsout c open (11,file=starsout) do i=1,3000 read(11,11)obafg,subtype,lum,otype,irahour,iramin,rasec,idecdeg,idecmin,idecsec,amagb,amagv,amagsmei, & iarg,jarg,identifier 11 format(8a1,2x,a4,2x,i2,1x,i2,1x,f5.2,2x,i3,1x,i2,1x,i2,8x,f5.2,6x,f5.2,6x,f5.2,2i4,2x,a26) if(irahour.eq.0.and.iramin.eq.0)go to 99 ra=15.*(float(irahour)+float(iramin)/60.+rasec/3600.) dec=float(idecdeg)+float(idecmin)/60.+float(idecsec)/3600. c=cosd(dec) do j=1,20 delra=abs(ra-rasave(21-j))*c deldec=abs(dec-decsave(21-j)) rsky=sqrt(deldec*deldec+delra*delra) if(rsky.lt.0.01)print 12,i,identifier,idsave(21-j),21-j,rsky 12 format(i6,', ? overlap with ',a26,', ',a26,', earlier by ',i2,', dr = ',f6.4) if(j.lt.20)then rasave(21-j)=rasave(20-j) decsave(21-j)=decsave(20-j) idsave(21-j)=idsave(20-j) else rasave(1)=ra decsave(1)=dec idsave(1)=identifier endif enddo enddo 99 continue close(11) enddo c print *,' reached end' end