From time to time, I need to call a routine to compute the solar
zenith angle and solar azimuth angle, and I need to provide the YEAR,
MONTH and DATE and GMT as well as the LONGITUDE of the concerned
location.
Around the end/beginning of a month and/or a year, the converting of
time involves the change of DATE, MONTH and the YEAR. It's pretty much
a nuisance!
Is there a routine or intrinsic procedure to do the converting along
with DATE, MONTH and YEAR?
Thank you for reading and replying!
--Roland
You may try the date/time routines that appear in my Flibs project -
http://flibs.sf.net.
Nothing specific to timezones or zenith angles, but they may help in
the conversion
of date and time.
Regards,
Arjen
Built-in functions are available in PL/I for all date and time conversions.
You can use my routines for solar angles (plus the ones for date/
time).
Send me an e-mail at
arjan [dot] van [dot] dijk [at] rivm [dot] nl.
Regards,
Arjan
Converting Y-M-D to something like Lilian format will ease at least a
little of this pain. Enterprise PL/I has the SECS() builtin, or I just
posted code to do this at:
http://home.roadrunner.com/~pflass/PLI/code/secs.pli
Other than that I can't help.
That's a standard kind of question in environmental modeling; one
place to look is in the EPA's "SMOKE" biogenic-emissions modeling
software from http://www.cmascenter.org/. Look for "biog/czangle.F"
and "ioapi/daymon.f".
On the other hand, you'll have to wade through a lot of stuff
to get to those particular codes ;(
A word of advice: the academic professors almost always phrase
everything in terms of the zenith angle itself, while what you
actually need is the COSINE of this angle. The straightforward
spherical-trigonometry algorithm gives you the cosine directly;
I've seen many codes which then take the inverse-cosine in a
zenith-angle routine, and then immediately take the cosine of the
result in the caller in order to use it. All they accomplish is
(a) unnecessary round-off error, and (b) wasted CPU time, since
trig and inverse-trig functions are computationally expensive.
FWIW -- Carlie Coats
I suggest you look at
http://oceancolor.gsfc.nasa.gov/cgi/idllibrary.cgi?dir=navigation
which has a PROLOG source file called lonlat2solz.pro (full link
http://oceancolor.gsfc.nasa.gov/DOCS/idl/navigation/lonlat2solz.pro)
containing a function that does exactly what you need (after some
trivial calendar conversions). It shouldn't be too hard to port this
code to FORTRAN.
--
-- Philipp Emanuel Weidmann
The routines I referred are by Arjan by the way ;).
Regards,
Arj_e_n