C+ C NAME: C Time2SunRA C PURPOSE: C Calculate sidearal time and position of the Sun. C Good for years 1901 through 2099. Accuracy is 0.006 degree. C CATEGORY: C Celestial mechanics C CALLING SEQUENCE: subroutine Time2SunRA(tt,GST,SLONG,SRASN,SDEC) C INPUTS: C tt(2) integer UT time C OUTPUTS: C GST double precision Greenwich sidereal time (degrees) C SLONG double precision Ecliptic longitude Sun (degrees) C SRASN double precision Apparent right ascension Sun (degrees) C SDEC double precision Apparent declination (degrees) C INCLUDE: include 'math.h' C CALLS: C Time2YDoy, Time2Day8 C RESTRICTIONS: C Only valid for years 1901 through 2099 C MODIFICATION HISTORY: C From: Geophysical Coordinate Transformations, C.T. Russell, in: C Cosmic Electrodynamics 2 (1971) 184-196 C- integer tt(2) double precision GST double precision SLONG double precision SRASN double precision SDEC integer yr integer doy(2) integer day double precision f double precision d double precision t double precision vl double precision g double precision obliq double precision slp double precision sin_d double precision cos_d call Time2YDoy(0,tt,yr,doy) day = doy(1) doy(1) = 0 call Time2Day8(0,doy,f) d = 365*(yr-1900)+(yr-1901)/4+day+f-0.5d0 t = d/36525.0d0 vl = dmod(279.696678d0+0.9856473354d0*d,360.0d0) GST = dmod(279.690983d0+0.9856473354d0*d+360.0d0*f+180.0d0,360.0d0) g = dmod(358.475845d0+0.985600267d0*d,360.0d0)/MATH__DPR SLONG = vl+(1.91946d0-0.004789d0*t)*dsin(g)+0.020094d0*dsin(2.0d0*g) obliq = (23.45229d0-0.0130125d0*t)/MATH__DPR slp = (SLONG-0.005686d0)/MATH__DPR sin_d = dsin(obliq)*dsin(slp) cos_d = dsqrt(1.0d0-sin_d*sin_d) SDEC = datan2(sin_d,cos_d)*MATH__DPR SRASN = 180.0d0-MATH__DPR*datan2(1.0d0/dtan(obliq)*sin_d/cos_d,-dcos(slp)/cos_d) return end