DAS  3.1.6 - 18/09/2017
CalcSZA.c
Go to the documentation of this file.
1 #include <math.h>
2 #include <string.h>
3 #include <stdio.h>
4 
5 #include "solpos.h" /* <-- There is the 'include' I was talking about */
6 /*============================================================================
7 *
8 * NAME: soltest.c
9 *
10 * PURPOSE: Exercises the solar position algorithms in 'solpos.c'.
11 *
12 * S_solpos
13 * INPUTS: year, daynum, hour, minute, second, latitude,
14 * longitude, timezone
15 *
16 * OPTIONAL: press DEFAULT 1013.0 (standard pressure)
17 * temp DEFAULT 10.0 (standard temperature)
18 * tilt DEFAULT 0.0 (horizontal panel)
19 * aspect DEFAULT 180.0 (South-facing panel)
20 * month (if the S_DOY function is turned off)
21 * day ( " " " )
22 *
23 * OUTPUTS: amass, ampress, azim, cosinc, coszen, day, daynum,
24 * elevref, etr, etrn, etrtilt, month, prime,
25 * sbcf, sretr, ssetr, unprime, zenref
26 *
27 * S_init (optional initialization for all input parameters in
28 * the posdata struct)
29 * INPUTS: struct posdata*
30 * OUTPUTS: struct posdata*
31 *
32 * (Note: initializes the required S_solpos INPUTS above
33 * to out-of-bounds conditions, forcing the user to
34 * supply the parameters; initializes the OPTIONAL
35 * S_solpos inputs above to nominal values.)
36 *
37 * S_decode (optional utility for decoding the S_solpos return code)
38 * INPUTS: long int S_solpos return value, struct posdata*
39 * OUTPUTS: text to stderr
40 *
41 *
42 * All variables are defined as members of the struct posdata
43 * in 'solpos.h'.
44 *
45 * Usage:
46 * In calling program, along with other 'includes', insert:
47 *
48 * #include "solpos.h"
49 *
50 * Martin Rymes
51 * National Renewable Energy Laboratory
52 * 25 March 1998
53 *
54 * 28 March 2001 REVISION: SMW changed benchmark numbers to reflect the
55 * February 2001 changes to solpos00.c
56 *
57 *----------------------------------------------------------------------------*/
58 
59 
89 int SZACalc(double d_lat, double d_long, double d_tzone, int d_year, int d_daynum,
90  int d_hour, int d_minute, int d_second, float d_temp, float d_press,
91  float d_tilt, float d_aspect)
92 {
93  //Coordinate TNB
94  // S_longitude = 164.123; /* Note that latitude and longitude are */
95  // S_latitude = -74.695; /* in DECIMAL DEGREES, not Deg/Min/Sec */
96  // S_timezone = 11.0; /* Eastern time zone, even though longitude would
97  // suggest Central. We use what they use.
98  // DO NOT ADJUST FOR DAYLIGHT SAVINGS TIME. */
99  //Coordinate StaraZagora BG
100  // S_longitude = 25.633;
101  // S_latitude = 42.416;
102  // S_timezone = 2;
103 
104  //Coordinate Bologna
105  // S_longitude = 11.333;
106  // S_latitude = 44.483;
107  // S_timezone = 1;
108 
109  //Coordinate GreenWitch
110  // S_longitude = 0;
111  // S_latitude = 51.29;
112  // S_timezone = 0;
113 
114  //Coordinate 0,90,0
115  // S_longitude = 0;
116  // S_latitude = 90;
117  // S_timezone = 0;
118 
119  //Coordinate Mt Cimone
120  // S_longitude = 10.42;
121  // S_latitude = 44.11;
122  // S_timezone = 1;
123 
124  S_longitude = d_long;
125  S_latitude = d_lat;
126  S_timezone = d_tzone;
127  S_year = d_year;
128  S_daynum = d_daynum;
129 
130  S_date ( );
131 
132  S_hour = d_hour;
133  S_minute = d_minute;
134  S_second = d_second;
135 
136  S_temp = d_temp;
137  S_press = d_press;
138 
139  S_tilt = S_latitude; /* Tilted at latitude */
140  S_aspect = d_aspect; /* 135 deg. = SE */
141 
142  S_solpos ( );
143 
144  return 0;
145 }
146 
double S_press
Definition: SOLPOS.C:75
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
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_latitude
I: Latitude, degrees north (south negative) */.
Definition: SOLPOS.C:69
double S_aspect
Definition: SOLPOS.C:43
*double S_tilt
I: Degrees tilt from horizontal of panel */.
Definition: SOLPOS.C:85
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
int S_hour
I: Hour of day, 0 - 23, DEFAULT = 12 I: Hour of day, 0 - 23, DEFAULT = 12.
Definition: SOLPOS.C:35
int S_solpos(void)
Returns ..... This function calculates the apparent solar position and intensity (theoretical maximu...
Definition: SOLPOS.C:246
double S_timezone
Definition: SOLPOS.C:86
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
int SZACalc(double d_lat, double d_long, double d_tzone, int d_year, int d_daynum, int d_hour, int d_minute, int d_second, float d_temp, float d_press, float d_tilt, float d_aspect)
Calc. Solar angles and radiatives quantities. .
Definition: CalcSZA.c:89
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:06 for DAS - Rel. 3.1.6 - 18/09/2017.