real*8 function elong( jd, ra, dec ) ! ! Given the apparent right ascension and declination (degrees) ! of an object at time jd (Julian Day, UT), return the elongation ! (angular distance) of the object from the apparent Sun. ! ! B. Knapp, 1996-01-29, 2001-01-03, 2001-04-24 (i*4) ! C C RCS DATA C C $Header$ C C $Log$ C ! implicit none ! ! Input: real*8 jd, ra, dec ! ! Constants: real*8 D2R parameter (D2R = 3.14159265358979324d0/180.d0) integer*4 SUN, APPARENT, EQUATORIAL, SPHERICAL parameter (SUN=0, APPARENT=2, EQUATORIAL=1, SPHERICAL=1) ! ! Local variables: real*8 pv(6) integer*4 status ! Functions, Subroutines real*8 angdst external ephem, angdst ! ! ! Get the apparent coordinates of the sun call ephem(jd, SUN, APPARENT, EQUATORIAL, SPHERICAL, pv, status) ! ! Compute the elongation elong = angdst(ra*D2R, dec*D2R, pv(1)*D2R, pv(2)*D2R)/D2R return end