1 |
greg |
1.2 |
{ RCSid $Id$ } |
2 |
greg |
1.1 |
{* |
3 |
|
|
* SOLAR CALCULATIONS |
4 |
|
|
* |
5 |
|
|
* 7/25/84 |
6 |
|
|
* 10/10/86 |
7 |
|
|
* |
8 |
|
|
*} |
9 |
|
|
|
10 |
|
|
RLAT = 0.66; {* Site latitude (radians) *} |
11 |
|
|
|
12 |
|
|
RLON = 2.13; {* Site longitude (radians) *} |
13 |
|
|
|
14 |
|
|
RSM = 120 * PI/180; {* Standard meridian (radians) *} |
15 |
|
|
|
16 |
|
|
|
17 |
|
|
stadj(jd) {* solar time adjustment (hours) *} |
18 |
|
|
{ jd is days into year } |
19 |
|
|
= |
20 |
|
|
0.170 * sin( 4*PI/373 * (jd - 80) ) - |
21 |
|
|
0.129 * sin( 2*PI/355 * (jd - 8 ) ) + |
22 |
|
|
12*(RSM-RLON)/PI |
23 |
|
|
; |
24 |
|
|
|
25 |
|
|
|
26 |
|
|
sdec(jd) {* solar declination angle (radians) *} |
27 |
|
|
{ jd is days into year } |
28 |
|
|
= |
29 |
|
|
0.4093 * sin( 2*PI/368 * (jd - 81) ) |
30 |
|
|
; |
31 |
|
|
|
32 |
|
|
|
33 |
|
|
salt(sd, st) {* solar altitude (radians) *} |
34 |
|
|
{ sd is solar declination, st is solar time (hours) } |
35 |
|
|
= |
36 |
|
|
asin( sin(RLAT) * sin(sd) - cos(RLAT) * cos(sd) * |
37 |
|
|
cos(st*PI/12) ) |
38 |
|
|
; |
39 |
|
|
|
40 |
|
|
|
41 |
|
|
sazi(sd, st) {* the solar azimuth (radians) *} |
42 |
|
|
{ sd is solar declination, st is solar time (hours) } |
43 |
|
|
= |
44 |
|
|
-atan2( cos(sd) * sin(st*PI/12), |
45 |
|
|
-cos(RLAT)*sin(sd) - |
46 |
|
|
sin(RLAT)*cos(sd)*cos(st*PI/12) ) |
47 |
|
|
; |
48 |
|
|
|
49 |
|
|
|
50 |
|
|
SAZI = sazi(SDEC, STIME) * 180/PI; |
51 |
|
|
|
52 |
|
|
SALT = salt(SDEC, STIME) * 180/PI; |
53 |
|
|
|
54 |
|
|
SDEC = sdec(JDATE); |
55 |
|
|
|
56 |
|
|
STIME = TIME + stadj(JDATE); |
57 |
|
|
|
58 |
|
|
JDATE = DAY + select(MONTH,0,31,59,90,120,151,181,212,243,273,304,334); |