C+ C NAME: C write_read_bad_src.f C PURPOSE: C To write and read a bad source from a file. Used to continue to eliminate bad sources from the tomography program C CATEGORY: C write and read a file C CALLING SEQUENCEi C call write_read_bad_src(iLU,cfile,isrcread,NBS,cSRC) C INPUTS: C iLU integer logical unit opened or closed C cfile character*10 file name bad_source C isrcread integer 0 - don't write or read sources C 1 - write out bad velocity sources C 10 - read in bad velocity sources C 2 - write out bad density sources C 20 - read in bad density sources C NBS integer number of the bad source C cSRC character*115 Source description C input file C C OUTPUTS: C output file C C RESTRICTIONS: C C PROCEDURE: C C MODIFICATION HISTORY: C 2018 MAY B.Jackson (UCSD) C- subroutine write_read_bad_src(iLU,cfile,isrcread,NBS,cSRC) C character cfile*10 character cSRC*115 close(13) open (13, file=cFile1,status='old',recl=1000,access='sequential',form='formatted',iostat=iReaddata) if(isrcread.eq.0) then print *, 'No sources read or written' return end if if(isrcread.eq.1) then ! write out a velocity source number and description write (ilu,'(I10,A)',iostat=iWriteV) NBS, cSRC if(iWriteV.ne.0) return end if if(isrcread.eq.10) then ! read in a velocity source number read (ilu,'(I10)',iostat=iReadV) NBS if(iReadV.ne.0) return end if if(isrcread.eq.2) then ! write out a velocity source number and description write (ilu,'(I10,A)',iostat=iWriteGN) NBS, cSRC if(iWriteGN.ne.0) return end if if(isrcread.eq.20) then ! read in a velocity source number read (ilu,'(I10)',iostat=iReadGN) NBS if(iReadGN.ne.0) return end if return end