implicit none *takes clem's data, transforms it twice(Tucker + Lupton), gets VBRI integer rahour,ramin,decdeg,decmin,a,b,c,j,uflag,gflag,rflag,iflag,zflag integer bmagflag,vmagflag,rmagflag,imagflag real u,uerr,g,gerr,r,rerr,i,ierr,z,zerr,chi,sharp,sep,vel real uout,uerrout,gout,gerrout,rout,rerrout,iout,ierrout,zout,zerrout real rasec,decsec,bmag,vmag,rmag,imag character*100 junk open(1,file = 'clemmatched13_wsep', status = 'old') open(2,file = 'clemtransformout', status = 'unknown') open(3,file = 'clemtransformuvbri', status = 'unknown') write(2,1) 1 format('## RA Dec u uerr g gerr r : rerr i ierr z zerr chi sharp sep') write(3,2) 2 format('## RA Dec B V R : I chi sharp sep Bf Vf Rf If') do a=1,2000000 uflag = 0 gflag = 0 rflag = 0 iflag = 0 zflag = 0 vmagflag = 0 bmagflag = 0 rmagflag = 0 imagflag = 0 read (1,*,end=5) rahour,ramin,rasec,decdeg,decmin,decsec, : junk,junk,u,uerr, : g,gerr,r,rerr,i,ierr,z,zerr,(junk,j=1,5),chi,sharp,sep if(u.lt.99.and.g.lt.99) then uout = u else uout = 99.999 end if if((u-g).lt.(.7).or.(u-g).gt.(2.7)) then uflag = 1 end if if(g.lt.99.and.r.lt.99) then gout = g + .06*((g-r) - .53) else gout = 99.999 end if if((g-r).lt.(.15).or.(g-r).gt.(1.2)) then gflag = 1 bmagflag = 1 vmagflag = 1 end if if(r.lt.99.and.i.lt.99) then rout = r + .035*((r-i) - .21) iout = i + .041*((r-i) - .21) else rout = 99.999 iout = 99.999 end if if((r-i).lt.(.1).or.(r-i).gt.(.6)) then rflag = 1 iflag = 1 rmagflag = 1 imagflag = 1 end if if(i.lt.99.and.z.lt.99) then zout = z - .03*((i-z) - .09) else zout = 99.999 end if if((i-z).lt.(-.2).or.(i-z).gt.(.4)) then zflag = 1 end if if(gout.lt.99.and.iout.lt.99) then bmag = gout + .019*(gout-iout)**3 -.1673*(gout-iout)**2 + .528*(gout-iout) + .0887 vmag = gout + .06*(gout-iout)**3 -.2247*(gout-iout)**2 - .1286*(gout-iout) -.1074 rmag = rout - .005*(gout-iout)**3 + .0125*(gout-iout)**2 - .0946*(gout-iout) -.1467 imag = iout -.004*(gout-iout)**3 + .0082*(gout-iout)**2 - .0798*(gout-iout) -.3709 else bmag = 99.999 vmag = 99.999 rmag = 99.999 imag = 99.999 end if if(MOD(a,1000).eq.(0)) then print*,a end if write(2,3) rahour,ramin,rasec,decdeg,decmin,decsec,uout,uerr,gout,gerr,rout,rerr, : iout,ierr,zout,zerr,chi,sharp,sep,uflag,gflag,rflag, : iflag,zflag 3 format(i2,i3,f7.3,i4,i3,f6.2,f8.3,f7.4,f8.3,f7.4,f8.3,f7.4,f8.3,f7.4, : f8.3,f7.4,f7.3,f8.3,f8.3,i3,i3,i3,i3,i3) write(3,4) rahour,ramin,rasec,decdeg,decmin,decsec,bmag,vmag, : rmag,imag,chi,sharp,sep,bmagflag,vmagflag,rmagflag,imagflag 4 format(i2,i3,f7.3,i4,i3,f6.2,f8.3,f8.3,f8.3,f8.3, : f7.3,f8.3,f8.3,i3,i3,i3,i3) end do 5 continue close(1) close(2) close(3) close(4) end