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