58 use sufr_kinds,
only: double
59 use sufr_constants,
only: jd2000, au, earthr,rsun
60 use sufr_angles,
only: rev
68 real(double),
intent(in) :: jd
69 integer,
intent(in) :: calc
70 real(double),
intent(in),
optional :: lat,lon
72 real(double) :: jde,deltat,tjc,tjc2,tjc3,tjc4, Aorb, l0,m,e,c,odot,nu,omg,a1e2,r, aber, lam,b
73 real(double) :: ra,dec,lm,eps,eps0,deps,gmst,agst,lst,dpsi,az,alt,hh, llat,llon
78 if(
present(lat)) llat = lat
79 if(
present(lon)) llon = lon
82 jde = jd + deltat/86400.d0
84 tjc = (jd-jd2000)/36525.d0
92 l0 = 4.895063113086d0 + 628.331965406500135d0 *tjc + 5.29213354358d-6 *tjc2 + 3.4940522d-10 *tjc3 - &
93 1.1407666d-10 *tjc4 - 8.726646d-14 *tjc4*tjc + 9.696d-16 * tjc4*tjc2
96 m = 6.24006012697d0 + 628.3019551680d0*tjc - 2.680535d-6*tjc2 + 7.12676d-10*tjc3
99 e = 0.0167086342d0 - 4.203654d-5 *tjc - 1.26734d-7 *tjc2 + 1.444d-10*tjc3 - 2.d-14*tjc4 + 3.d-15*tjc4*tjc
102 c = (2*e - 0.25d0*e**3)*sin(m) + 1.25d0*e**2*sin(2*m) + 13.d0/12.d0*e**3*sin(3*m)
110 a1e2 = aorb*(1.d0-e**2)
111 r = a1e2/(1.d0 + e*cos(nu))
114 omg = 2.18243919722d0 - 33.7570446083d0 *tjc + 3.623594d-5 *tjc2 + 3.734035d-8 *tjc3 - 2.87931d-10 *tjc4
117 lm = 3.810344430588d0 + 8399.709113522267d0*tjc - 2.315615585d-5*tjc2 + 3.23904d-8*tjc3 - 2.67714d-10*tjc4
121 dpsi = (-8.338601d-5-7.1365d-8*tjc)*sin(omg) - 6.39324d-6*sin(2*l0) - 1.1025d-6*sin(2*lm) + 9.9969d-7*sin(2*omg) &
125 aber = -9.9365085d-5 * a1e2/r
128 lam = rev(odot + aber + dpsi)
138 planpos(7) = 5.77551830441d-3 * r
144 planpos(17) = asin(earthr/(r*au))
155 eps0 = 0.409092804222d0 - 2.26965525d-4*tjc - 2.86d-9*tjc2 + 8.78967d-9*tjc3
156 deps = 4.46d-5*cos(omg) + 2.76d-6*cos(2*l0) + 4.848d-7*cos(2*lm) - 4.36d-7*cos(2*omg)
159 ra = atan2(cos(eps)*sin(lam),cos(lam))
160 dec = asin(sin(eps)*sin(lam))
174 agst = rev(gmst + dpsi*cos(eps))
175 lst = rev(agst + llon)
185 call eq2horiz(ra,dec,agst, hh,az,alt, lat=llat,lon=llon)
194 planpos(16) = atan2(sin(hh),tan(llat)*cos(dec) - sin(dec)*cos(hh))
226 use sufr_kinds,
only: double
227 use sufr_constants,
only: pi2, h2r,r2h
230 integer,
intent(in) :: DoY
231 real(double),
intent(in) :: hour, lon,lat,tz
232 real(double),
intent(out) :: dec,ha, alt,az
233 real(double) :: eclon, Teq,Tdif,Tsol
236 eclon = pi2/365.d0 * doy
238 dec = 5.80863d-3 - 0.401146d0 * cos(eclon) - 6.1069d-3 * cos(2 * eclon) - 2.43997d-3 * cos(3 * eclon) &
239 + 6.52264d-2 * sin(eclon) + 5.59378d-4 * sin(2 * eclon) + 1.25437d-3 * sin(3 * eclon)
246 teq = -2.6d0 - 0.44d0 * doy
247 else if(doy .lt. 136)
then
248 teq = -5.2d0 - 9.d0 * cos( (doy - 43) * 0.0357d0 )
249 else if(doy .lt. 241)
then
250 teq = -1.4d0 + 5.d0 * cos( (doy - 135) * 0.0449d0 )
251 else if(doy .lt. 336)
then
252 teq = 6.3d0 + 10.d0 * cos( (doy - 306) * 0.036d0 )
254 teq = 0.45d0 * (359 - doy)
258 tdif = tz - lon*r2h - teq/60.d0
264 ha = (tsol - 12.d0)*h2r
267 az = atan2(sin(ha), cos(ha)*sin(lat) - tan(dec)*cos(lat))
270 alt = asin( sin(dec) * sin(lat) + cos(dec) * cos(lat) * cos(ha))
subroutine eq2horiz(ra, dec, agst, hh, az, alt, lat, lon)
Convert spherical equatorial coordinates (RA, dec, agst) to spherical horizontal coordinates (hh,...
subroutine sunpos_vla(doy, hour, lon, lat, tz, ha, dec, az, alt)
Compute the position of the Sun - very low accuracy routine (~0.18 degrees in az/alt)