C+ C NAME: C program readsources_used C PURPOSE: C Write the velocity and g-level sources used in the tomography into a file that gives the source and its RA and Dec V C CALLING SEQUENCE: C call writegsource_used(istation,NLMAXV,cvgfiles,SRCGV,NLV) C INPUTS: C istation 0 - UCSD, 1 - Nagoya, 2 - Ooty C NLMAXV Maximum number of sources C cvgfiles(NLV+N_IN) character*9 vfile name to write out (i.e., ooty.2004) C SRCGV(NLV+N_IN) character*115 all the file values C NLV integer number of sources C C OUTPUTS: C FUNCTIONS/SUBROUTINES: C- program readsources_used parameter (NLMAX = 10000) character cfilen*11 /'nagoya.????'/ character SRCGV(NLMAX)*115 character cvgfiles(NLMAX)*11 iyr = 2013 call AskI4('Year of the data?',iyr) istation = 1 call AskI4('IPS Station 0=UCSD, 1=Nagoya, 2=Ooty?',istation if(istation.eq.1) then ! nagoya write(cfilen(8:11),'(I4)') iyr print *, cfilen open (13, file=cFilen,status='old',recl=120,access='sequential',form='formatted',iostat=iReadnagoya) if(iReadnagoya.ne.0) then print *, 'There are no nagoya files for this year.' stop end if NL = 1 do I=1,NLMAX read (13,cFmt24,iostat=iReadnagoya) SRCGV(NL) if(iReadnagoya.eq.0) then cvgfiles(NL) = cFilen NL = NL + 1 end if end do call writesources_used(istation,II,cvgfiles,SRCGV,NL) end if end stop C**************************************************************************************************** subroutine writesources_used(istation,NLMAX,cvgfiles,SRCGV,NL) stop end subroutine writesources_used(istation,NLMAX,cvgfiles,SRCGV,NL) character cvgfiles (NLMAX)*11 character SRCGV (NLMAX)*115 character cvgfile*11 character cvgooty*16 /'ucsdsources.????'/ character cvgnagoya*18 /'nagoyasources.????'/ character cvgooty*16 /'ootysources.????'/ character SRCGVU*115 ! UCSD character SRCGVN*66 ! Nagoya character SRCGVO*105 ! Ooty character SRCGVI (NLMAX)*115 ! Source output character source*10 character ra*8 character sd1*1 character d1*2 character sd2*1 character d2*2 character sd3*1 character d3*2 character freq*3 /'327'/ print *, 'Into writesources_used' if(NL.le.0) then print *, 'There are no IPS sources used in the tomography' return end if do I=1,NL NSRCVGI(I) = 0 end do III= 0 do I=1,NL if(istation.ne.1) then print *, 'UCSD and Ooty used sources files not able to be produced yet.' return end if if(istation.eq.1) then ! nagoya.???? file read SRCGVN = SRCGV(I) do II=I,NLV SRCGVII = SRCGV(II) if(SRCGVN(1:8).eq.SRCGVII(1:8).and.NSRCVGI(II).ne.1) then NSRCVGI(II) = 1 III = III+1 SRCGVI(III) = SRCGVN end if end do end if end do read (cvgfile(7:10)) iyr ! read and place the year in the file name write (cvgnagoya(15:18) iyr open (14,file=cvgnagoya,status='new',recl=115,access='sequential',form='formatted') do I=1,III SRCGVN = SRCGV(I) read (SRCGVN(1:8)) source read (SRCGVN(70:77) ra read (SRCGVN((78:78) sd1 read (SRCGVN((79:80) d1 read (SRCGVN((83:84) d2 read (SRCGVN((87:88) d2 if(d1.eq.'00'.and.sd1.eq.'-') then sd1 = ' ' sd2 = '-' end if if(d2.eq.'00'.and.sd2.eq.'-') then sd2 = ' ' sd3 = '-' end if write (14,'(A8,1X,A8,1X,A1,A2,1X,A1,A2,1X,A1,A2,10X,A3)') source,ra,sd1,d1,sd2,d2,sd3,d3,freq end do close (14) return end