Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GMT - Local Time Converting along with DATE, MONTH and YEAR

32 views
Skip to first unread message

qquito

unread,
Jun 20, 2010, 12:23:36 AM6/20/10
to
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

Arjen Markus

unread,
Jun 20, 2010, 9:42:50 AM6/20/10
to

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

robin

unread,
Jun 20, 2010, 10:48:04 AM6/20/10
to
qquito wrote in message <9e8f42b6-d58f-4659...@c10g2000yqi.googlegroups.com>...

>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!


Built-in functions are available in PL/I for all date and time conversions.

Arjan

unread,
Jun 20, 2010, 1:56:54 PM6/20/10
to
> 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

Peter Flass

unread,
Jun 20, 2010, 2:28:33 PM6/20/10
to

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.

Carlie Coats

unread,
Jun 21, 2010, 9:00:10 AM6/21/10
to

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


Philipp E. Weidmann

unread,
Jun 21, 2010, 10:14:14 AM6/21/10
to


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

Arjen Markus

unread,
Jun 22, 2010, 2:56:08 AM6/22/10
to

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

Regards,

Arj_e_n

0 new messages