C+ C NAME: C writegoodsourceb.f C PURPOSE: C Write the brightness source ADU values used in the tomography into a file (bad sources are flagged bad). C CALLING SEQUENCE: C call writegoodsourceb(cgbfiles,SRCB,GOBS,NBSG,NLG) C INPUTS: C cgbfiles(NLG) character*32 bgfile name to write out C SRCB(NLG) character*25 source name (Camera, RA and Dec of Source, and the orbit number and fraction) C GOBS(NLG) real observation brightness value (in S10) C NBSG(NLG) integer good or bad source, if good 1, if bad, 0 C NLG integer number of sources C C OUTPUTS: C FUNCTIONS/SUBROUTINES: C- subroutine writegoodsourceb(cgbfiles,SRCB,GOBS,NBSG,NLG) character cgbfiles (NLG)*32 character SRCB (NLG)*34 character SRCBS*34 character clstcgbfile*32 integer NBSG (NLG) ! Is this a good or bad source? real GOBS (NLG) ! Brightness observation (in S10) clstcgbfile = ' ' ADUPS10 = 0.552 BADOBS = -9999.99 do I=1,NLG C print *, I, cgbfiles(I) if(clstcgbfile .ne. cgbfiles(I)) then close (14) open (14,file=cgbfiles(I),status='new',recl=34,access='sequential',form='formatted') clstcgbfile = cgbfiles(I) end if SRCBS = SRCB(I) if(NBSG(I).eq.0) then write(SRCBS(27:34),'(F8.2)') BADOBS end if write (14,'(A)') SRCBS end do close (14) return end