C+ C NAME: C writegoodsourcev.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,cvgfiles,SRCGV,VOBS,NBSV,NLV) C INPUTS: C istation 0 - UCSD, 1 - Nagoya, 2 - Ooty C cvgfiles(NLG) character*9 vfile name to write out (i.e., ooty.2004) C VOBS(NLG) real observation velocity value (in kms) C SRCGV(NLG) character*115 all the file values C NBSV(NLG) integer good or bad source, if good 1, if bad, 0 C NLV integer number of sources C C OUTPUTS: C FUNCTIONS/SUBROUTINES: C- subroutine writegoodsourcev(istation,cvgfiles,SRCGV,VOBS,NBSV,NLV) character cvgfiles (NLV)*11 character SRCGV (NLV)*115 character clstcvgfile*11 character cvgfil*11 character SRCGVU*115 ! UCSD character SRCGVN*66 ! Nagoya character SRCGVO*105 ! Ooty character cv*1 integer NBSV (NLV) ! Is this a good or bad source? real VOBS (NLV) ! Brightness observation (in S10) print *, 'Into write good sources V' cv = 'v' clstcvgfile = ' ' BADVOBSU = -999.0 IBADVOBSN = -999 IBADVOBSO = -9999 do I=1,NLV C print *, I, istation, cvgfiles(I) if(clstcvgfile .ne. cvgfiles(I)) then close (14) cvgfil = cvgfiles(I) write (cvgfil(2:2),'(A)') cv ! For velocity files to distinguish them if(istation.eq.0) open (14,file=cvgfil,status='new',recl=115,access='sequential',form='formatted') if(istation.eq.1) open (14,file=cvgfil,status='new',recl=66, access='sequential',form='formatted') if(istation.eq.2) open (14,file=cvgfil,status='new',recl=105,access='sequential',form='formatted') clstcvgfile = cvgfiles(I) end if if(istation.eq.0) then ! UCSD velocities SRCGVU = SRCGV(I) if(NBSV(I).eq.0) write(SRCGVU(23:31),'(F9.1)') BADVOBSU ! Bad UCSD velocities write (14,'(A)') SRCGVN end if if(istation.eq.1) then ! Nagoya velocities SRCGVN = SRCGV(I) if(NBSV(I).eq.0) write(SRCGVN(50:53),'(I4)') IBADVOBSN ! Bad Nagoya velocities write (14,'(A)') SRCGVN end if if(istation.eq.2) then ! Ooty velocities SRCGVO = SRCGV(I) if(NBSV(I).eq.0) write(SRCGVO(81:85),'(I5)') IBADVOBSO ! Bad Ooty velocities write (14,'(A)') SRCGVO end if end do close (14) return end