From: Carlie Coats on
qquito wrote:
> Dear Everyone:
>
> 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

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


From: Philipp E. Weidmann on
Am 20.06.2010 06:23, schrieb qquito:
> Dear Everyone:
>
> 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
>


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
From: Arjen Markus on
On 20 jun, 19:56, Arjan <arjan.van.d...(a)rivm.nl> wrote:
> > 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.
>
> 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

The routines I referred are by Arjan by the way ;).

Regards,

Arj_e_n