1 |
IMPORT "johnpye/nrel/sunpos_nrel"; |
2 |
|
3 |
REQUIRE "atoms.a4l"; |
4 |
|
5 |
MODEL location; |
6 |
latitude IS_A angle_constant; |
7 |
longitude IS_A angle_constant; |
8 |
elevation IS_A real_constant; |
9 |
|
10 |
(* can include both timezone as well as date offsets here. Note |
11 |
1 Jan 2000, 12pm GMT corresponds to 2451545.0. *) |
12 |
t_offset "Actual JD value referred to by t = 0." IS_A time_constant; |
13 |
END location; |
14 |
|
15 |
MODEL sunpos_nrel; |
16 |
loc IS_A location; |
17 |
|
18 |
t_JD IS_A time; |
19 |
p IS_A pressure; |
20 |
T IS_A temperature; |
21 |
|
22 |
zenith, azimuth IS_A angle; |
23 |
|
24 |
t IS_A time; |
25 |
t_JD - t = loc.t_offset; |
26 |
|
27 |
solar: sunpos_nrel( |
28 |
t_JD, p, T : INPUT; |
29 |
zenith, azimuth : OUTPUT; |
30 |
loc : DATA |
31 |
); |
32 |
|
33 |
altitude IS_A angle; |
34 |
altitude = 0.5{PI} - zenith; |
35 |
|
36 |
END sunpos_nrel; |
37 |
|
38 |
|
39 |
MODEL sunpos_test REFINES sunpos_nrel; |
40 |
loc.latitude :== +35 {deg} + 6.{deg}/60 + 39.{deg}/3600; |
41 |
loc.longitude :== -106{deg} + 36.{deg}/60 + 36.{deg}/3600; |
42 |
loc.elevation :== 1619 {m}; |
43 |
loc.t_offset :== 2451545. {d} - 12 {h}; |
44 |
METHODS |
45 |
METHOD on_load; |
46 |
FIX p, T, t; |
47 |
p := 1 {atm}; |
48 |
T := 20 {K} + 273.15 {K}; |
49 |
t := 0.5 {d}; |
50 |
END on_load; |
51 |
END sunpos_test; |