DAS  3.1.6 - 18/09/2017
SOLPOS.H
Go to the documentation of this file.
1 
2 
18 /*============================================================================
19 *
20 * NAME: solpos.h
21 *
22 * Contains:
23 * S_date (computes the date from the day number)
24 * INPUTS: S_year, S_daynum
25 * OUTPUTS: S_year, S_month, S_day
26 *
27 * S_solpos (computes the solar position and intensity
28 * from time and place)
29 * INPUTS: S_month, S_day, S_latitude, S_longitude, S_timezone
30 * OPTIONAL:
31 * S_year DEFAULT 2001 (non-leap)
32 * S_hour DEFAULT 12 (noon)
33 * S_minute DEFAULT 0 ( " )
34 * S_second DEFAULT 0 ( " )
35 * S_press DEFAULT 1013.0 (standard pressure)
36 * S_temp DEFAULT 10.0 (standard temperature)
37 * S_tilt DEFAULT 0.0 (horizontal panel)
38 * S_aspect DEFAULT 180.0 (South-facing panel)
39 *
40 * OUTPUTS: S_daynum, S_amass, S_ampress, S_azim, S_cosinc,
41 * S_elevref, S_etr, S_etrn, S_etrtilt, S_prime,
42 * S_sbcf, S_sunrise, S_sunset, S_unprime, S_zenref
43 *
44 * Usage:
45 * In calling program, along with other 'includes', insert:
46 *
47 * #include "solpos.h"
48 *
49 * Martin Rymes
50 * National Renewable Energy Laboratory
51 * 25 March 1998
52 *----------------------------------------------------------------------------*/
53 
54 /***** ALPHABETICAL LIST OF COMMON VARIABLES *****/
55  /* Each comment begins with a 1-column letter code:
56  I: INPUT variable
57  O: OUTPUT variable
58  T: TRANSITIONAL variable used in the algorithm,
59  of interest only to the solar radiation
60  modelers, and available to you because you
61  may be one of them */
62 /***** INTEGERS *****/
63 
64 extern int S_day;
65 
69 extern int S_daynum;
70 
74 extern int S_hour;
75 
77 extern int S_minute;
78 
80 extern int S_month;
81 
85 extern int S_second;
86 
88 extern int S_year;
89 
92 /***** FLOATS *****/
93 
94 extern double S_amass;
95 extern double S_ampress;
96 extern double S_aspect;
97 extern double S_azim;
100 extern double S_cosinc;
101 extern double S_dayang;
102 extern double S_declin;
103 extern double S_eclong;
105 extern double S_ecobli;
106 extern double S_ectime;
107 extern double S_elevref;
108 extern double S_eqntim;
110 extern double S_erv;
111 extern double S_etr;
113 extern double S_etrn;
115 extern double S_etrtilt;
117 extern double S_gmst;
119 extern double S_hrang;
120 extern double S_julday;
122 extern double S_latitude;
124 extern double S_longitude;
125 extern double S_lmst;
126 extern double S_mnanom;
127 extern double S_mnlong;
128 extern double S_rascen;
129 extern double S_press;
130 extern double S_prime;
132 extern double S_sbcf;
133 extern double S_solcon;
134 extern double S_ssha;
135 extern double S_sunrise;
136 extern double S_sunset;
138 extern double S_temp;
140 extern double S_tilt;
142 extern double S_timezone;
143 extern double S_tst;
145 extern double S_tstfix;
146 extern double S_unprime;
147 extern double S_utime;
148 extern double S_zenetr;
149 extern double S_zenref;
151 
153 /*============================================================================
154 * Integer function S_date, adapted from the NREL VAX solar libraries
155 *
156 * This function calculates the month and day of month, given the
157 * day number (number of day in year, sometimes confusingly called
158 * the "Julian Day", but I know that you will never call it that).
159 *
160 * Requires:
161 * Year and day number:
162 * S_year NOTE: 2-digit year "xx" is assumed "19xx"
163 * DEFAULT S_year = 2001
164 * S_daynum RANGE: -1 to a large positive integer
165 *
166 * Returns:
167 * Year, month, day:
168 * S_year
169 * S_month
170 * S_day
171 *----------------------------------------------------------------------------*/
172  extern int S_date (void);
186 
187 
188 /*============================================================================
189 * Integer function S_solpos, adapted from the NREL VAX solar libraries
190 *
191 * This function calculates the apparent solar position and intensity
192 * (theoretical maximum solar energy) based on the date, time, and
193 * location on Earth.\n
194 *
195 * Requires:
196 * Date and time:
197 * S_year DEFAULT 2001
198 * S_month
199 * S_day
200 * S_hour DEFAULT 12
201 * S_minute DEFAULT 0
202 * S_second DEFAULT 0
203 * Location:
204 * S_latitude
205 * S_longitude
206 * Location/time adjuster:
207 * S_timezone
208 * Atmospheric pressure and temperature:
209 * S_press DEFAULT 1013.0 mb
210 * S_temp DEFAULT 10.0 degrees C
211 * Tilt of flat surface that receives solar energy:
212 * S_aspect DEFAULT 180 (South)
213 * S_tilt DEFAULT 0 (Horizontal)
214 *
215 * Returns:
216 * everything defined at the top of this listing.
217 *----------------------------------------------------------------------------*/ extern int S_solpos (void);
*double S_gmst
T: Greenwich mean sidereal time, hours */.
Definition: SOLPOS.C:64
double S_sbcf
O: Shadow-band correction factor */.
Definition: SOLPOS.C:77
double S_zenetr
Definition: SOLPOS.C:92
double S_declin
Definition: SOLPOS.C:48
double S_press
Definition: SOLPOS.C:75
double S_ampress
O: Pressure-corrected airmass.
Definition: SOLPOS.C:42
double S_azim
O: Solar azimuth angle: N=0, E=90, S=180, W=270.
Definition: SOLPOS.C:45
double S_mnanom
T: Mean anomaly, degrees */.
Definition: SOLPOS.C:72
double S_mnlong
T: Mean longitude, degrees */.
Definition: SOLPOS.C:73
int S_date(void)
Returns date. This function calculates the month and day of month, given the day number (number of d...
Definition: SOLPOS.C:166
double S_eclong
T: Ecliptic longitude, degrees */.
Definition: SOLPOS.C:50
*double S_etrn
Definition: SOLPOS.C:60
double S_solcon
T: Solar constant, 1367 W/sq m */.
Definition: SOLPOS.C:78
int S_minute
I: Minute of hour, 0 - 59, DEFAULT = 0 I: Minute of hour, 0 - 59, DEFAULT = 0.
Definition: SOLPOS.C:36
double S_amass
O: Relative optical airmass.
Definition: SOLPOS.C:41
*double S_latitude
I: Latitude, degrees north (south negative) */.
Definition: SOLPOS.C:69
double S_rascen
T: Right ascension, degrees */.
Definition: SOLPOS.C:74
double S_aspect
Definition: SOLPOS.C:43
*double S_tilt
I: Degrees tilt from horizontal of panel */.
Definition: SOLPOS.C:85
*double S_etrtilt
Definition: SOLPOS.C:62
*double S_sunset
Definition: SOLPOS.C:82
double S_lmst
T: Local mean sidereal time, degrees */.
Definition: SOLPOS.C:71
double S_longitude
I: Longitude, degrees east (west negative) */.
Definition: SOLPOS.C:70
int S_daynum
I/O: Day number (day of year; Feb 1 = 32 ) I/O: Day number (day of year; Feb 1 = 32 ) S_date needs th...
Definition: SOLPOS.C:34
*double S_temp
Definition: SOLPOS.C:84
double S_utime
T: Universal (Greenwich) standard time */.
Definition: SOLPOS.C:91
int S_hour
I: Hour of day, 0 - 23, DEFAULT = 12 I: Hour of day, 0 - 23, DEFAULT = 12.
Definition: SOLPOS.C:35
double S_sunrise
Definition: SOLPOS.C:80
int S_day
I/O: Day of month (May 27 = 27, etc.) I/O: Day of month (May 27 = 27, etc.) S_solpos needs this...
Definition: SOLPOS.C:33
*double S_eqntim
T: Equation of time (TST - LMT), minutes */.
Definition: SOLPOS.C:55
double S_dayang
T: Day angle (daynum*360/year-length) degrees.
Definition: SOLPOS.C:47
double S_ectime
T: Time of ecliptic calculations */.
Definition: SOLPOS.C:52
double S_unprime
O: Factor that denormalizes Kt', Kn', etc. */.
Definition: SOLPOS.C:90
double S_ssha
T: Sunset(/rise) hour angle, degrees */.
Definition: SOLPOS.C:79
double S_hrang
Definition: SOLPOS.C:65
*double S_tst
T: True solar time, minutes from midnight */.
Definition: SOLPOS.C:88
int S_solpos(void)
Returns ..... This function calculates the apparent solar position and intensity (theoretical maximu...
Definition: SOLPOS.C:246
double S_elevref
Definition: SOLPOS.C:53
*double S_julday
Definition: SOLPOS.C:67
double S_timezone
Definition: SOLPOS.C:86
double S_ecobli
T: Obliquity of ecliptic */.
Definition: SOLPOS.C:51
*double S_zenref
Definition: SOLPOS.C:94
double S_cosinc
O: Cosine of solar incidence angle on panel.
Definition: SOLPOS.C:46
int S_month
I/O: Month number (Jan = 1, Feb = 2, etc.) I/O: Month number (Jan = 1, Feb = 2, etc.) S_solpos needs this, but S_date will calculate it from S_daynum.
Definition: SOLPOS.C:37
double S_tstfix
T: True solar time - local standard time */.
Definition: SOLPOS.C:89
double S_erv
Definition: SOLPOS.C:56
int S_year
I: 4-digit year (2-digit is assumed 19xx) I: 4-digit year (2-digit is assumed 19xx) DEFAULT = 2001...
Definition: SOLPOS.C:39
*double S_etr
Definition: SOLPOS.C:58
*double S_prime
O: Factor that normalizes Kt, Kn, etc. */.
Definition: SOLPOS.C:76
int S_second
I: Second of minute, 0 - 59, DEFAULT = 0 I: Second of minute, 0 - 59, DEFAULT = 0.
Definition: SOLPOS.C:38
______________________________________________________________________________________
Generated on Mon Sep 18 2017 11:44:09 for DAS - Rel. 3.1.6 - 18/09/2017.