implicit none *combines the zeljko dataset with all the CAS ugriz data. integer a,b,c,d,j,x,y real ra,dec,u,g,r,i,z,uerr,gerr,rerr,ierr,zerr,casholder(1000,14),id real zra,zdec,zu,zg,zr,zi,zz,zuerr,zgerr,zrerr,zierr,zzerr,diffra,diffdec character*100 junk logical found open(11, file = 'nonvarMvsPTerr.dat', status = 'old') open(12, file = 'uflag.csv', status = 'old') open(13, file = 'gflag.csv', status = 'old') open(14, file = 'rflag.csv', status = 'old') open(15, file = 'iflag.csv', status = 'old') open(16, file = 'zflag.csv', status = 'old') * open(22, file = 'zeljkoucombined', status = 'unknown') * open(23, file = 'zeljkogcombined', status = 'unknown') * open(24, file = 'zeljkorcombined', status = 'unknown') * open(25, file = 'zeljkoicombined', status = 'unknown') * open(26, file = 'zeljkozcombined', status = 'unknown') open(20, file = 'zeljkocascombined', status = 'unknown') do x=1,1000 casholder(x,1) = 1000 casholder(x,2) = 1000 casholder(x,3) = 1000 do y=4,8 casholder(x,y) = 99.999 end do do y=9,14 casholder(x,y) = 9.999 end do end do do b=1,3 read(11,*) write(20,2) 2 format('##') end do do b=1,200000 read(11,*,end = 10) ra,dec,u,g,r,i,z,uerr,gerr,rerr,ierr,zerr write(20,5) ra,dec,u,g,r,i,z,uerr,gerr,rerr,ierr,zerr 5 format(f10.5,f11.5,5f8.3,5f9.3) end do 10 continue c writes out all of zeljko to the new file^ rewind 11 do a=12,16 read(a,*) do b=1,200000 read(a,*,end = 30) id,ra,dec,u,uerr,g,gerr,r,rerr,i,ierr,z,zerr do c=1,3 read(11,*) end do found = .false. do c=1,200000 read(11,*,end = 15) zra,zdec,zu,zg,zr,zi,zz,zuerr,zgerr,zrerr, : zierr,zzerr diffra = (zra - ra)*cosd(zdec) diffdec = zdec - dec if(abs(diffra).lt.(.0002778)) then if(abs(diffdec).lt.(.0002778)) then found = .true. go to 15 end if end if end do 15 continue rewind 11 print*,b,a if(found.eq.(.false.)) then j=1 do c=1,1000 if(casholder(c,1).eq.(1000)) then go to 20 end if if(casholder(c,1).eq.id) then found = .true. if(a.eq.12) then casholder(c,4) = u casholder(c,9) = uerr else if(a.eq.13) then casholder(c,5) = g casholder(c,10) = gerr else if(a.eq.14) then casholder(c,6) = r casholder(c,11) = rerr else if(a.eq.15) then casholder(c,7) = i casholder(c,12) = ierr else casholder(c,8) = z casholder(c,13) = zerr end if go to 20 end if j = j+1 end do 20 continue if(found.eq.(.false.)) then casholder(j,1) = id casholder(j,2) = ra casholder(j,3) = dec go to 15 end if end if end do 30 continue end do do a=1,1000 if(casholder(a,1).ne.(1000)) then write(20,5) (casholder(a,j),j=2,13) end if end do close(11) close(12) close(13) close(14) close(15) close(16) close(20) end