C+ C NAME: C bLOSCheckLoc C PURPOSE: C CATEGORY: C I/O C CALLING SEQUENCE: logical function bLOSCheckLoc(XCbeg,XCend,NLOS,NINSIDE,DLOS,iYr,Doy,rLngLOS,rLatLOS,ObsXC,rLngSun,rDisSun) C INPUTS: C XCbeg real modified Carrington variable for start of map C XCend real modified Carrington variable for end of map C NLOS integer # segments along line of sight C (if NLOS=0 then bLOSCheckLoc always returns .TRUE.) C NINSIDE integer when at least NINSIDE segments lie inside [XCbeg, XCend] C the return value is .TRUE. C DLOS real length of los segment (what units??) C iYr integer year of observation C Doy real day of year (incl. fraction for time of day) C rLngLOS real Topocentric ecliptic longitude diff. with Earth-Sun line C rLatLOS real Topocentric ecliptic latitude C ObsXC real Modified Carrington variable for observer C rLngSun real Ecliptic longitude Sun C rDisSun real Sun-Earth distance (AU) C OUTPUTS: C bLOSCheckLoc logical C RESTRICTIONS: C CALLS: C POINT_ON_LOS, ECLIPTIC_HELIOGRAPHIC, XMAP_OBS_POS C PROCEDURE: C MODIFICATION HISTORY: C JUN-1994, Paul Hick (UCSD) C- real XCbeg real XCend integer NLOS integer NINSIDE real DLOS integer iYr real Doy real rLngLOS real rLatLOS real ObsXC real rLngSun real rDisSun bLOSCheckLoc = NLOS .eq. 0 if (bLOSCheckLoc) return ObsLng = rLngSun-180.0 Inside = 0 do J=1,NLOS ! Loop over all segments along LOS P1 = rLngLOS ! Topocentric ecliptic longitude diff. with Earth-Sun line P2 = rLatLOS ! Topocentric ecliptic latitude P3 = (J-0.5)*DLOS ! Distance along LOS (units of rDisSun) ! Convert to heliocentric coordinates call POINT_ON_LOS(P1,P2,P3,ELO,ELOS,iEorW) P3 = P3*rDisSun ! Convert to AU P1 = ObsLng+P1 ! Heliocentric longitude of P call ECLIPTIC_HELIOGRAPHIC(0,iYr,Doy,P1,P2) ! Convert to heliographic coordinates P1 = XMAP_OBS_POS(ObsXC,P1) ! Modified Carrington variable of P if (XCbeg .le. P1 .and. P1 .le. XCend) Inside = Inside+1 end do bLOSCheckLoc = Inside .ge. NINSIDE return end