1 |
IMPORT "johnpye/grena/sunpos"; |
2 |
|
3 |
REQUIRE "atoms.a4l"; |
4 |
|
5 |
MODEL location_grena; |
6 |
latitude IS_A angle_constant; |
7 |
longitude IS_A angle_constant; |
8 |
timezone IS_A time_constant; |
9 |
END location_grena; |
10 |
|
11 |
MODEL sunpos_grena; |
12 |
loc IS_A location_grena; |
13 |
|
14 |
p IS_A pressure; |
15 |
T IS_A temperature; |
16 |
zenith, azimuth IS_A angle; |
17 |
t_UTC IS_A time; |
18 |
t IS_A time; |
19 |
t = t_UTC + loc.timezone; |
20 |
|
21 |
solar: sunpos( |
22 |
t_UTC, p, T : INPUT; |
23 |
zenith, azimuth : OUTPUT; |
24 |
loc : DATA |
25 |
); |
26 |
|
27 |
altitude IS_A angle; |
28 |
altitude = 0.5{PI} - zenith; |
29 |
|
30 |
END sunpos_grena; |
31 |
|
32 |
|
33 |
MODEL sunpos_grena_test REFINES sunpos_grena; |
34 |
loc.latitude :== -35 {deg}; |
35 |
loc.longitude :== 149 {deg}; |
36 |
loc.timezone :== 10 {h}; |
37 |
METHODS |
38 |
METHOD on_load; |
39 |
FIX p, T, t; |
40 |
p := 1 {atm}; |
41 |
T := 20 {K} + 273.15 {K}; |
42 |
t := 5 {d}; |
43 |
END on_load; |
44 |
END sunpos_grena_test; |