climate/solar_angles.h

00001 #include <math.h>
00002 
00003 #define HR_PER_RADIAN (12.0 / PI)
00004 #define PI_OVER_180 (PI / 180)
00005 
00006 static short days_thru_month[] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};  // Ignores leap years...
00007 
00008 class SolarAngles {
00009 private:
00010     // No instance data (for now).  Someday it may be useful to
00011     // keep latitude, longitude, and standard meridian as member
00012     // data, but that would complicate using the class for multiple
00013     // locations sequentially...
00014 
00015 public:
00016 
00017     // The order of the arguments across methods is not always
00018     // consistent.  They're that way to match the S-PLUS and C
00019     // implementations, which are that way for no particular reason...
00020 
00021     SolarAngles(void);
00022     ~SolarAngles(void);
00023 
00024     double eq_time(short day_of_yr);                                    // hours
00025     double solar_time(double std_time, short day_of_yr, double std_meridian, double longitude);     // decimal hours
00026     double local_time(double std_time, short day_of_yr, double std_meridian, double longitude);     // decimal hours
00027     double declination(short day_of_yr);                                    // radians
00028     double cos_incident(double lititude, double slope, double az, double sol_time, short day_of_yr);    // unitless
00029     double incident(double lititude, double slope, double az, double sol_time, short day_of_yr);        // radians
00030     double zenith(short day_of_yr, double lititude, double sol_time);                   // radians
00031     double altitude(short day_of_yr, double lititude, double sol_time);                 // radians
00032     double hr_sunrise(short day_of_yr, double lititude);                            // decimal hours
00033     double day_len(short day_of_yr, double lititude);                           // decimal hours
00034     short  day_of_yr(short month, short day);                               // julian days
00035 };

GridLAB-DTM Version 1.0
An open-source project initiated by the US Department of Energy