C+ C NAME: C writegoodsourceg.f C PURPOSE: C Write the velocity and g-level values used in the tomography into files (bad sources are flagged bad) C CALLING SEQUENCE: C call writegoodsourcev(istation,cggfiles,SRCGG,GOBS,NBSG,NLG) C INPUTS: C istation 0 - UCSD, 1 - Nagoya, 2 - Ooty C cggfiles(NLG) character*9 file name to write out (i.e., ooty.2004) C SRCGG(NLG) character*115 all the file values C GOBS(NLG) real observation g-level value 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 writegoodsourceg(istation,cggfiles,SRCGG,GOBS,NBSG,NLG) character cggfiles (NLG)*11 character cgg*11 character SRCGG (NLG)*115 character clstcggfile*11 character SRCGVU*115 character SRCGVN*66 character SRCGVO*105 character cg*1 integer NBSG (NLG) ! Is this a good or bad source? real GOBS (NLG) ! Brightness observation (in S10) cg = 'g' clstcggfile = ' ' BADGOBSU = -9.0 BADGOBSN = 0.00000 BADGOBSO = -99.999 do I=1,NLG if(clstcggfile .ne. cggfiles(I)) then close (14) cgg = cggfiles(I) write (cgg(2:2),'(A)') cg ! For g-level files to distinguish them if(istation.eq.0) open (14,file=cgg,status='new',recl=115,access='sequential',form='formatted') if(istation.eq.1) open (14,file=cgg,status='new',recl=66,access='sequential',form='formatted') if(istation.eq.2) open (14,file=cgg,status='new',recl=105,access='sequential',form='formatted') clstcggfile = cggfiles(I) end if if(istation.eq.0) then ! UCSD g-levels SRCGVU = SRCGG(I) ! No UCSD g-levels were ever determined write (14,'(A)') SRCGVU end if if(istation.eq.1) then ! Nagoya g-levels SRCGVN = SRCGG(I) if(NBSG(I).eq.0) write(SRCGVN(59:66),'(F8.5)') BADGOBSN ! Bad Nagoya g-levels write (14,'(A)') SRCGVN end if if(istation.eq.2) then ! Ooty g-levels SRCGVO = SRCGG(I) if(NBSG(I).eq.0) write(SRCGVO(99:105),'(F7.3)') BADGOBSO ! Bad Ooty g-levels write (14,'(A)') SRCGVO end if end do close (14) return end