subroutine SMEIRead(cFile,cgbfilesL,NORBITST,M,MX,NLOC,LOC,iYr,dTDOY,ISSD,IC,RA,DEC,ORBITV,ISS,ZSMEI,nGood1) include 'openfile.h' include 'filparts.h' character cFile*(*),cName*32,cName1*100,cValue*2 ! cName1*28,cName2*4,cName3*72,cName4*72 character cgbfilesL*32 integer LOC integer iiYr,iYr integer ISS(*) real*8 dTDOY integer IC(*) real RA(*) real DEC(*) real ORBITV(*) real ZSMEI(*) logical bOK,bOpenFile SECPO = 6096.312 C print *, 'Into SMEIREAD', cfile IL = itrim(cFile) if(IL .eq. 0) return ! Blank input string MXX = NORBITST + M - 1 C print *, 'In smeiread. Orbit number = ',MXX ifirst = 1 do while (iSearch(ifirst,cFile,cFile).eq.1) ifirst = 0 IL = iSetFileSpec(cFile) IL = iGetFileSpec(FIL__NAME,FIL__NAME,cName) read (cName(24:28),'(I5)',iostat=I) MXXX C print *, 'cName is ', cName, ' MXXX =',MXXX if (I.ne.0) return if(MXXX.eq.MXX) then C print *, 'Got to Orbit =' , MXX IL1 = iSetFileSpec(cFile) if (IL .ne. 28) return ! Couldn't read file read (cName(8:11),'(I4)',iostat=I) iYr if (I.ne.0) return read (cName(13:15),'(I3)',iostat=I) IDY if (I.ne.0) return read (cName(17:18),'(I2)',iostat=I) IH if (I.ne.0) return read (cName(19:20),'(I2)',iostat=I) IM if (I.ne.0) return read (cName(21:22),'(I2)',iostat=I) IS if (I.ne.0) return ISSD = IH*60*60 + IM*60 + IS ! Orbit beginning time dTDOY = dble(float(IDY)) bOK = bOpenFile(OPN__NOMESSAGE+OPN__READONLY+OPN__TRYINPUT+OPN__STOP+OPN__TEXT,iU,cFile,iRecl) LOC = 0 nGood = 0 C iold = 1 ! Old data set used iold = 0 ! New data set used do while (bOK) LOC = LOC + 1 cgbfilesL = cName if(iold.eq.1) read (iU,'(I1,2F7.2,I5,F8.2)',iostat=iSMEIRead) IC(LOC),RA(LOC),DEC(LOC),ISS(LOC),ZSMEI(LOC) if(iold.eq.0) read (iU,'(I1,2F7.2,F7.0,I4,F8.2)',iostat=iSMEIRead) IC(LOC),RA(LOC),DEC(LOC),ORBITV(LOC),ISS(LOC),ZSMEI(LOC) if(iold.eq.1) then if(LOC.le.10.and.MXX .le. 2) write(*,'(2I4,2F8.2,I7,F8.2)') LOC,IC(LOC),RA(LOC),DEC(LOC),ISS(LOC),ZSMEI(LOC) end if if(iold.eq.0) then if(LOC.le.10.and.MXX .eq. 195) write(*,'(2I4,2F8.2,F7.0,I7,F8.2)') LOC,IC(LOC),RA(LOC),DEC(LOC),ORBITV(LOC),ISS(LOC),ZSMEI(LOC) end if if(iSMEIRead.ne.0) then bOK = .FALSE. ! End if an end of file is reached LOC = LOC-1 end if if (LOC .ge. NLOC) then bOK = .FALSE. ! End if all RA and Dec locations used up print *, 'There are more lines of sight per orbit than the maximum allowed of',NLOC,' Increase parameter NLOC1' end if if(iold.eq.0) ISS(LOC) = nint((float(ISS(LOC))/10000.)*SECPO) ! Put in 4/10/2007 BVJ if(ZSMEI(LOC).gt.-999..and.bOK) nGood = nGood + 1 end do nGood1 = nGood1 + nGood C print *, LOC, MXX, iYr, IDY, IH, IM, IS, ISSD, dTDOY, nGood, nGood1 print *, 'In smeiread. Orbit number = ',MXX,' Points: good =',nGood,', accumulated =',nGood1 IL2 = iFreeLun(iU) end if C end if end do return end