subroutine SMEIRead(cFile,NORBITST,M,MX,NLOC,LOC,iYr,dTDOY,ISSD,RA,DEC,ISS,ZSMEI,nGood1) include 'openfile.h' include 'filparts.h' character cFile*(*),cName*28,cName1*100,cValue*2 ! cName1*28,cName2*4,cName3*72,cName4*72 integer LOC integer iiYr,iYr integer ISS(*) real*8 dTDOY real RA(*) real DEC(*) real ZSMEI(*) logical bOK,bOpenFile SECPO = 6096.312 C cFile1 ='/home/bjackson/dat/smei/by_orbit/points_2003_????????????????????' 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 C if(II .eq. 1) then C print *, "first cfile input",cfile C iSe = iSearch(1,cFile,cFile) C print *, "cfile output", cfile C else C iSe = iSearch(0,cFile,cFile) C end if C print *, 'II =', II, ' and iSe =', iSe, ' and cFile =',cFile C if (iSe .eq. 1) then 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) IL1 = iGetFileSpec(FIL__DIRECTORY,FIL__TYPE,cName1) bOK = bOpenFile(OPN__NOMESSAGE+OPN__READONLY+OPN__TRYINPUT+OPN__STOP+OPN__TEXT,iU,cName1,iRecl) C print *, 'cName1 is ', cName1, ' MXX =',MXX 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 = .TRUE. LOC = 0 nGood = 0 C iold = 1 ! Old data set used iold = 0 ! New data set used do while (bOK) LOC = LOC + 1 if(iold.eq.1) read (iU,'(I1,2F7.2,I5,F8.2)',iostat=iSMEIRead) IC,RA(LOC),DEC(LOC),ISS(LOC),ZSMEI(LOC) if(iold.eq.0) read (iU,'(I1,2F7.2,7X,I4,F8.2)',iostat=iSMEIRead) IC,RA(LOC),DEC(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,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,I7,F8.2)') LOC,IC,RA(LOC),DEC(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