/[ascend]/trunk/models/johnpye/datareader/testtmy.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/datareader/testtmy.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 842 - (show annotations) (download) (as text)
Sun Sep 10 06:15:00 2006 UTC (14 years, 1 month ago) by johnpye
File MIME type: text/x-ascend
File size: 979 byte(s)
Reformating tmy.c to be more concise.
In testtmy.a4c, assume that the tmy file is in the datareader directory under models.
1 REQUIRE "ivpsystem.a4l";
2 REQUIRE "atoms.a4l";
3
4 IMPORT "johnpye/datareader/datareader";
5
6 MODEL drconf;
7 filename IS_A symbol_constant;
8 format IS_A symbol_constant;
9 format :== 'TMY2';
10 END drconf;
11
12 MODEL testtmy;
13 t IS_A time;
14 G IS_A solver_var;
15 Gbn IS_A solver_var;
16 Gd IS_A solver_var;
17 T IS_A solver_var;
18 v_wind IS_A solver_var;
19 E IS_A solver_var; (* total radiation *)
20 Gb IS_A solver_var;
21
22 (* source data: http://rredc.nrel.gov/solar/old_data/nsrdb/tmy2/unix/23161.tm2.Z *)
23 tmydata IS_A drconf;
24 tmydata.filename :== 'johnpye/datareader/23161.tm2';
25
26 filereader:datareader(
27 t : INPUT;
28 G, Gbn, Gd, T, v_wind : OUTPUT;
29 tmydata : DATA
30 );
31
32 Gb = G - Gd;
33
34 METHODS
35
36 METHOD default_self;
37 END default_self;
38
39 METHOD on_load;
40 RUN default_self; RUN specify; RUN values;
41 END on_load;
42
43 METHOD specify;
44 E.ode_id := 1; E.ode_type := 1;
45 G.ode_id := 1; G.ode_type := 2;
46
47 t.ode_type :=-1;
48 FIX t;
49 END specify;
50
51 METHOD values;
52 t := 0 {s};
53 E := 0;
54 END values;
55
56 END testtmy;

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22