C+ C NAME: C iReadNagoya C CALLING SEQUENCE: function iReadNagoya(iU,iFirst) C INPUTS: C iU integer logical unit number of open IPS data file C iFirst integer 0 or 1. The value 1 resets the record counter C back to one. The value 0 increments the counter by 1. C OUTPUTS: C (none) C CALLS: C ReadVIPSCheckData, DATE_DOY, XMAP_SC_POS, POINT_ON_LOS, SunNewcomb C ECLIPTIC_EQUATOR C INCLUDE: include 'sun.h' C EXTERNAL: external EARTH C PROCEDURE: C > Structure of Nagoya files: C cSrce string descriptor for radio source C iY,iM,iD integer year, month and day of observation C UT real universal time of day C DP real heliocentric distance point P (AU) C iTHR integer ?? (only from 1990 - 1993) C iHLA integer heliocentric ecliptic latitude point P C iHLO integer heliocentric longitude point P relative to C Sun-Earth direction (i.e. a difference of C ecliptic longitudes) C iGLA,iGLO integer heliographic location point P (degrees) C iROT integer Carrington rotation number C iVEL integer IPS velocity (km/s) C iDVEL integer error in velocity (km/s) C SCINDX/G-VALUE real scintillation index (arbitrary units); C present from 1990 to 1996) or G-value (after 1997) C C Record length of original Nagoya files: C C 1990-1993: 73 chars C 1994-1996: 68 chars (no THR column) C 1997-1998: 66 chars (no THR, g-value instead of source index C C In the processed files, iTHR has been omitted, and the source C index has been replaced by zero (i.e. results in a zero g-value) C MODIFICATION HISTORY: C JUL-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- integer iU integer iFirst double precision JDCar(nCar) character cMon*3 character cSrce*9 double precision dLngSun double precision dLatSun double precision dDisSun character cFmt*40 /'(A9,3I2,F6.2,F5.2,I4,I5,I4,3I5,I4,F8.5)'/ logical bCheckV logical bCheckG save cSrce,iY,iM,iD,UT,DP,iHLA,iHLO,iGLA,iGLO,iROT,iVEL,iDVEL,GVAL,iRec iU = iU ! Avoids compiler warning on VMS read (iU,cFmt,iostat=iReadNagoya) cSrce,iY,iM,iD,UT,DP,iHLA,iHLO,iGLA,iGLO,iROT,iVEL,iDVEL,GVAL if (iY .lt. 50) iY = iY+100 ! Y2K fix iRec = (1-iFirst)*iRec+1 ! iFirst=1 initializes record counter return C+ C NAME: C iProcessNagoya C PURPOSE: C Used as external function in 1st argument of ReadVIPS C CALLING SEQUENCE: entry iProcessNagoya(iR,nCar,JDCar,NCoff,XCend,Radius, & nYr,Doy,XCsc,XCobs,xLat,xVV,xGG,dRA, & rLngSun,rDisSun,rLngP,rLatP,rEloP) C INPUTS: C See documentation for href=ReadVIPS=. C OUTPUTS: C See documentation for href=ReadVIPS=. C SEE ALSO: C iReadNagoya C PROCEDURE: C Entry point in iReadNagoya. C MODIFICATION HISTORY: C ???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- call ReadVIPSCheckData(bCheckV,bCheckG,Vmin,Vmax,Gmin,Gmax) Bad = BadR4() if (bCheckV .and. iVEL .gt. 0) then if (Vmin .ne. Bad .and. iVEL .lt. Vmin) iVEL = 0 if (Vmax .ne. Bad .and. iVEL .gt. Vmax) iVEL = 0 end if if (bCheckG .and. GVAL .ne. 0.0) then if (Gmin .ne. Bad .and. GVAL .lt. Gmin) GVAL = 0.0 if (Gmax .ne. Bad .and. GVAL .gt. Gmax) GVAL = 0.0 end if if (bCheckV .and. bCheckG) then ! No velocity, no g-level available: reject if (iVEL .le. 0 .and. GVAL .eq. 0.0) then iProcessNagoya = 0 return end if else if (bCheckG) then if (GVAL .eq. 0.0) then ! No g-level available: reject iProcessNagoya = 0 return endif else if (iVEL .le. 0) then ! No velocity available: reject iProcessNagoya = 0 return endif end if nYr = 1900+iY cMon = ' ' ! Make sure iM is used call DATE_DOY(0,nYr,cMon,iM,iD,iDoy) Doy = iDoy+UT/24.0 XCsc = XMAP_SC_POS(EARTH,nYr,Doy,-nCar,JDCar) if (XCsc .eq. BadR4()) then ! Time outside JDCar range iProcessNagoya = 0 return end if ! Sub-Earth position if (XCsc .gt. XCend) then ! Sub-Earth past XCend iProcessNagoya = 2 return end if iR = iRec XCobs = iROT+(360.0-iGLO)/360.0 ! Point-P at DP XCobs = XCobs+SUN__SPIRAL*(Radius-DP)/iVEL ! Point-P traced to Radius XCobs = XCobs-NCoff ! Subtract offset xLat = iGLA ! Heliographic lat(P) xVV = iVEL ! IPS velocity xGG = GVAL ! Set to 0 if GVAL not available rLng = iHLO ! Heliocentric ecliptic lng(P)-lng(Earth) rLat = iHLA ! Heliocentric ecliptic lat(P) rP = DP ! Distance Sun-P (AU) call POINT_ON_LOS(rLng,rLat,rP,rEloSun,rEloP,i) !call PointOnLos(rLng,rLat,rP,rEloSun,rEloP,i) rLngP = rLng ! Geocentric ecliptic lng(P)-lng(Sun) rLatP = rLat ! Geocentric ecliptic lat(P) rEloP = -i*rEloP ! rEloP>0 : East of Sun ! <0 : West of Sun call SunNewcomb(0,nYr,Doy,dLngSun,dLatSun,dDisSun) rDisSun = dDisSun rLngSun = dLngSun ! Geocentric ecliptic lng(Sun) rSun = rLngSun rLng = rSun+rLng ! Geocentric ecliptic lng(P) call ECLIPTIC_EQUATOR(0,nYr,Doy,rLng,rLat) ! rLng = RA of P rLat = dLatSun ! Geocentric ecliptic lat(Sun) call ECLIPTIC_EQUATOR(0,nYr,Doy,rSun,rLat) ! rSun = RA of Sun dRA = rLng-rSun ! RA(P)-RA(Sun) if (abs(dRA) .gt. 180.0) dRA = dRA-sign(1.0,dRA)*360.0 iProcessNagoya = 1 return end