C+ C NAME: C writegoodsources.f C PURPOSE: C Write the velocity and g-level values used in the tomography into files (bad sources are flagged bad). C This subroutine was written for use with the standard input, but it outputs a goodsources.txt ascii file C in the format of the old nagoya.xxxx files. C In-situ sources are placed at the end of the IPS sources. C This subroutine only works if NLV = LNG and N_ING = N_INV. C CALLING SEQUENCE: C call writegoodsources(istation,NLMAXV,SRCGV,NBSV,NSBG,NLV,N_IN) C INPUTS: C istation 0 - UCSD, 1 - Nagoya, 2 - Ooty C NLMAXV Maximum number of sources C SRCGV(NLV+N_IN) character*115 all the file values C NBSV(NLV+N_IN) integer good or bad velocity source, if good 1, if bad, < 1 C NBSG(NLV+N_IN) integer good or bad g-level or density source, if good 1, if bad, < 1 C NLV integer number of IPS sources C N_IN integer number of in-situ sources C C OUTPUTS: C FUNCTIONS/SUBROUTINES: C- subroutine writegoodsources(NLMAXV,SRCGV,NBSV,NBSG,NLV,N_IN) character cvgfiles*16 character SRCGV (NLMAXV)*115 character SRCGVG*73 ! General all file values integer NBSV (NLMAXV) ! Is this a good or bad velocity source? integer NBSG (NLMAXV) ! Is this a good or bad g-level source? print *, 'Into writegoodsources ' cvgfiles = 'nagoya.fast.good' clstcvgfile = ' ' IBADVOBSN = -999 BADGOBSN = 0.00000 BADDOBSNIN = -.99999 do I=1,NLV+N_IN ! Loop through all the sources input if(I.eq.1.and.(NLV+N_IN).gt.0) then close (14) open (14,file=cvgfiles,status='new',recl=73,access='sequential',form='formatted') else if((NLV+N_IN).le.0) return end if SRCGVG = SRCGV(I) if(NBSV(I).le.0) write(SRCGVG(50:54),'(I5)') IBADVOBSN ! Bad velocities (remote and in-situ) if(NBSG(I).le.0.and.I.le.NLV) write(SRCGVG(60:66),'(F7.5)') BADGOBSN ! Bad g-levels if(NBSG(I).le.0.and.I.gt.NLV) write(SRCGVG(59:66),'(F8.5)') BADDOBSNIN ! Bad in-situ density write (14,'(A)') SRCGVG end do close (14) return end