108 181, 212, 243, 273, 304, 334,
109 0, 0, 31, 60, 91, 121, 152,
110 182, 213, 244, 274, 305, 335 };
171 printf (
"S_date => Please fix the day number: %10d\n",
S_daynum );
180 if ( ((
S_year % 4) == 0) &&
191 if ( ((
S_year % 4) == 0) &&
251 printf (
"S_solpos => Please fix the month: %10d\n",
S_month );
256 printf (
"S_solpos => Please fix the day of month: %10d\n",
S_day );
263 printf (
"S_solpos => Please fix the hour: %10d\n",
S_hour );
268 printf (
"S_solpos => Please fix the minute: %10d\n",
S_minute );
273 printf (
"S_solpos => Please fix the second: %10d\n",
S_second );
278 printf (
"S_solpos => Please fix the time zone: %10.4f\n",
284 printf (
"S_solpos => Please fix the longitude: %10.4f\n",
289 printf (
"S_solpos => Please fix the latitude: %10.4f\n",
295 if ( fabs (
S_temp) > 100.0 ) {
296 printf (
"S_solpos => Please fix the temperature: %10.4f\n",
S_temp );
300 printf (
"S_solpos => Please fix the pressure: %10.4f\n",
S_press );
317 if ( ((
S_year % 4) == 0) &&
337 S_erv = 1.000110 + 0.034221 *
cd + 0.001280 *
sd;
356 if ( ( (
S_year % 100) == 0 ) && ( (
S_year % 400) != 0) )
393 0.020 * sin ( 2.0 *
S_mnanom * raddeg );
418 bottom = cos ( raddeg * S_eclong );
466 sd = sin ( raddeg * S_declin );
467 sl = sin ( raddeg * S_latitude );
472 if ( fabs (
cz) > 1.0 ) {
491 if ( fabs (
cdcl ) >= 0.001 ) {
497 else if (
cssha > 1.0 )
506 p = 0.1526 * pow (
cd,3);
523 else if (
S_ssha >= 179.0 ) {
536 se = cos ( raddeg * S_zenetr );
540 if ( fabs (
cecl ) >= 0.001 ) {
544 else if (
ca < -1.0 )
570 0.000086 / ( pow (
tanelev,5) );
571 else if ( elev >= -0.575 )
572 refcor = 1735.0 + elev * ( -518.2 + elev * ( 103.4 +
573 elev * ( -12.79 + elev * 0.711 ) ) );
596 if ( S_zenref > 93.0 )
599 S_amass = 1.0 / (
cz + 0.50572 * pow ((96.07995 - S_zenref),-1.6364) );
619 sa = sin ( raddeg * S_azim );
620 sp = sin ( raddeg * S_aspect );
621 st = sin ( raddeg * S_tilt );
622 sz = sin ( raddeg * S_zenref );
double S_mnanom
T: Mean anomaly, degrees */.
double S_gmst
T: Greenwich mean sidereal time, hours */.
double S_tst
T: True solar time, minutes from midnight */.
double S_dayang
T: Day angle (daynum*360/year-length) degrees.
int S_minute
I: Minute of hour, 0 - 59, DEFAULT = 0 I: Minute of hour, 0 - 59, DEFAULT = 0.
int S_second
I: Second of minute, 0 - 59, DEFAULT = 0 I: Second of minute, 0 - 59, DEFAULT = 0.
int S_hour
I: Hour of day, 0 - 23, DEFAULT = 12 I: Hour of day, 0 - 23, DEFAULT = 12.
int S_solpos(void)
Returns ..... This function calculates the apparent solar position and intensity (theoretical maximu...
double S_latitude
I: Latitude, degrees north (south negative) */.
double S_eqntim
T: Equation of time (TST - LMT), minutes */.
double S_tstfix
T: True solar time - local standard time */.
double S_rascen
T: Right ascension, degrees */.
double S_prime
O: Factor that normalizes Kt, Kn, etc. */.
double S_eclong
T: Ecliptic longitude, degrees */.
double S_cosinc
O: Cosine of solar incidence angle on panel.
double S_sbcf
O: Shadow-band correction factor */.
int S_date(void)
Returns date. This function calculates the month and day of month, given the day number (number of d...
double S_lmst
T: Local mean sidereal time, degrees */.
double S_ectime
T: Time of ecliptic calculations */.
double S_ampress
O: Pressure-corrected airmass.
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...
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...
double S_utime
T: Universal (Greenwich) standard time */.
double S_mnlong
T: Mean longitude, degrees */.
double S_ecobli
T: Obliquity of ecliptic */.
double S_ssha
T: Sunset(/rise) hour angle, degrees */.
static int month_days[2][13]
int S_year
I: 4-digit year (2-digit is assumed 19xx) I: 4-digit year (2-digit is assumed 19xx) DEFAULT = 2001...
double S_solcon
T: Solar constant, 1367 W/sq m */.
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.
double S_unprime
O: Factor that denormalizes Kt', Kn', etc. */.
double S_amass
O: Relative optical airmass.
double S_tilt
I: Degrees tilt from horizontal of panel */.
double S_longitude
I: Longitude, degrees east (west negative) */.
double S_azim
O: Solar azimuth angle: N=0, E=90, S=180, W=270.