C+ C NAME: C EARTH C PURPOSE: C Returns the heliographic or ecliptic longitude (in degrees) of the C sub-Earth point C CATEGORY: C Celestial mechanics C CALLING SEQUENCE: function EARTH(iYrIn,Doy) C INPUTS: C iYr integer year C (if iYr<0 then the ecliptic longitude is returned) C Doy real day of year, including fraction for time of day C OUTPUTS: C EARTH real heliographic longitude (degrees, 0<=EARTH<360) C CALLS: C SunNewcomb, ECLIPTIC_HELIOGRAPHIC C SEE ALSO: C XMAP_SC_POS C PROCEDURE: C Typically used as external function to e.g. href=XMAP_SC_POS C MODIFICATION HISTORY: C JAN-1991, Paul Hick (UCSD/CASS) C JUL-1993, Paul Hick (UCSD/CASS; pphick@ucsd.edu), added option to return ecliptic longitude C- integer iYrIn real Doy double precision rLng double precision rLat double precision rDist iYr = abs(iYrIn) call SunNewcomb(0,iYr,Doy,rLng,rLat,rDist) XLNG = mod(sngl(rLng)+180.0,360.0) if (iYrIn .ge. 0) then XLAT = 0.0 call ECLIPTIC_HELIOGRAPHIC(0,iYr,Doy,XLNG,XLAT) end if EARTH = XLNG return end