C+ C NAME: C Read_ASHI_track.f C PURPOSE: C Read the ASHI track file C CATEGORY: C I/O C CALLING SEQUENCE: C call Read_ASHI_track(cfilen,NLMAX,NL,iyr,idoyst,JD,alat,alon) C C INPUTS: C cfilen character Name of the ASHI input file C NLMAX integer Maximum number of track values possible in the file C iyr integer Year of the observation - 2022 C idoyst integer Starting day of the observation - 237 (August 25) C C OUTPUTS: C NL integer # valid data tracked points in track file C JD (NLMAX) real*8 Julian date of the observation C alat(NLmax) real latitude of ASHI C alon(NLmax) real longitude of ASHI C C FUNCTIONS/SUBROUTINES: C julian8 C C MODIFICATION HISTORY: C April-2022, Bernard Jackson (UCSD) C- subroutine read_ashi_track(cfilen,NLMAX,NL,iyr,idoyst,JD,alat,alon) character cfilen*15 character SRC(10)*60 real alat(NLMAX), & alon(NLMAX) real*8 JD(NLMAX) real*8 doy8,doy8x,doy8l,JDio,JEpoch print*, ' Into read_ashi_track',iyr,idoyst open (13, file=cfilen,status='old',recl=120,access='sequential',form='formatted',iostat=iReadashi) if(iReadashi.ne.0) then print *, 'There are no ashi files in this directory.' close(13) stop end if NL = 1 do I = 1,10 read (13,'(A60)',iostat=iReadashi) SRC(I) if(iReadashi.eq.0) then print*, SRC(I) end if if(I.eq.10) then print*,' ' print*,'All the above information is skipped.' print*,'Only a portion of the material, TIME, LAT, and LON is read.' print*,' ' end if end do NL = 0 doy8l = -1.0d0 doy8x = 0.0d0 do I=1,NLMAX read (13,'(3(1X,I2),35X,F2.0,F5.1,F5.0,f5.1)',iostat=iReadashi) iH,iM,iS,alatd,alatm,alond,alonm if(iReadashi.eq.0) then NL = NL + 1 doy8 = dfloat(idoyst)+(dfloat(iH)/24.d0)+(dfloat(iM)/(1440.d0))+(dfloat(iS)/(86400.d0)) + doy8x if(doy8.lt.doy8l) then doy8x = 1.0d0 doy8 = doy8 + 1.0d0 end if doy8l = doy8 call Julian8(0,iyr,doy8,JDio,JEpoch) JD(I) = JDio ! Julian date in days alat(I) = alatd-(alatm/60.) ! Latitude in degrees and fractions alon(I) = -alond-(alonm/60.) ! Longitude in west degrees and fractions else close(13) print *, ' ' print *, 'Number of ASHI track values read in =',NL print *, ' ' return end if C if(NL.le.30) write (*,'(I4,3I3,F11.6,2F6.1,F8.4,2F6.1,F8.3,F15.6)') C & NL,iH,iM,iS,doy8,alatd,alatm,alat(I),alond,alonm,alon(I),JD(I) C if(NL.eq.1000) print*, ' ' C if(NL.ge.1222) write (*,'(I4,3I3,F11.6,2F6.1,F8.4,2F6.1,F8.4,F15.6)') C & NL,iH,iM,iS,doy8,alatd,alatm,alat(I),alond,alonm,alon(I),JD(I) end do return end