50 void setup(
const double latitude_rad);
52 const double &
daylength(
const int day)
const {
return mDaylength_h[day]; }
59 int mDayWithMaxLength;
60 double mDaylength_h[366];
71 const QString &
name()
const {
return mName; }
80 double days(
const int month)
const;
84 void toDate(
const int yearday,
int *rDay=0,
int *rMonth=0,
int *rYear=0)
const;
91 double annualPrecipitation()
const {
double r=0.;
for (
int i=0;i<12;++i) r+=mPrecipitationMonth[i];
return r;}
99 const Sun &
sun()
const {
return mSun; }
104 bool mDoRandomSampling;
109 void setupPhenology();
110 void climateCalculations(
const ClimateDay &lastDay);
116 double mTemperatureShift;
117 double mPrecipitationShift;
120 QVector<ClimateDay> mStore;
121 QVector<int> mDayIndices;
122 QSqlQuery mClimateQuery;
123 QList<Phenology> mPhenology;
124 QVector<int> mRandomYearList;
125 int mRandomListIndex;
126 double mAnnualRadiation;
127 double mPrecipitationMonth[12];
128 double mTemperatureMonth[12];
129 double mMeanAnnualTemperature;
130 static QVector<int> sampled_years;
Climate handles climate input data and performs some basic related calculations on that data.
Definition: climate.h:66
const ClimateDay * day(const int month, const int day) const
gets pointer to climate structure of given day (0-based indices, i.e. month=11=december!...
Definition: climate.cpp:87
const QString & name() const
table name of this climate
Definition: climate.h:71
void monthRange(const int month, const ClimateDay **rBegin, const ClimateDay **rEnd) const
returns two pointer (arguments!!!) to the begin and one after end of the given month (month: 0....
Definition: climate.cpp:93
void toDate(const int yearday, int *rDay=0, int *rMonth=0, int *rYear=0) const
decode "yearday" to the actual year, month, day if provided
Definition: climate.cpp:111
double days(const int month) const
returns number of days of given month (0..11)
Definition: climate.cpp:100
double daylength_h(const int doy) const
length of the day in hours
Definition: climate.h:100
Climate()
Definition: climate.cpp:76
void setup()
setup routine that opens database connection
Definition: climate.cpp:119
double annualPrecipitation() const
annual precipitation sum (mm)
Definition: climate.h:91
void nextYear()
Definition: climate.cpp:303
double totalRadiation() const
return radiation sum (MJ) of the whole year
Definition: climate.h:86
const double * temperatureMonth() const
get a array with mean temperatures per month (deg C)
Definition: climate.h:93
int phenologyGroupCount() const
Definition: climate.h:97
const Sun & sun() const
solar radiation class
Definition: climate.h:99
bool isSetup() const
Definition: climate.h:70
const double * precipitationMonth() const
Definition: climate.h:87
const ClimateDay * dayOfYear(const int dayofyear) const
get pointer to climate structure by day of year (0-based-index)
Definition: climate.h:75
double meanAnnualTemperature() const
the mean annual temperature of the current year (degree C)
Definition: climate.h:89
const ClimateDay * begin() const
STL-like (pointer)-iterator to the first day of the current year.
Definition: climate.h:82
const Phenology & phenology(const int phenologyGroup) const
phenology class of given type
Definition: climate.cpp:416
int whichDayOfYear(const ClimateDay *climate) const
get the 0-based index of the climate given by 'climate' within the current year
Definition: climate.h:77
const ClimateDay * end() const
STL-like pointer iterator to the day after last day of the current year.
Definition: climate.h:83
int daysOfYear() const
returns number of days of current year.
Definition: climate.cpp:104
int climateDataYear() const
retrieve the year provided in the climate table
Definition: climate.h:95
Definition: phenology.h:25
Sun handles calculations of day lengths, etc.
Definition: climate.h:48
int dayShorter10_5hrs() const
Definition: climate.h:55
bool northernHemishere() const
Definition: climate.h:54
int dayShorter14_5hrs() const
Definition: climate.h:56
int longestDay() const
Definition: climate.h:53
QString dump()
Definition: climate.cpp:68
void setup(const double latitude_rad)
Definition: climate.cpp:36
const double & daylength(const int day) const
Definition: climate.h:52
current climate variables of a day.
Definition: climate.h:28
double mean_temp() const
Definition: climate.h:35
double min_temperature
Definition: climate.h:33
double vpd
Definition: climate.h:39
static double co2
Definition: climate.h:40
double preciptitation
Definition: climate.h:37
int id() const
Definition: climate.h:43
int month
Definition: climate.h:30
bool isValid() const
Definition: climate.h:42
double temp_delayed
Definition: climate.h:36
int dayOfMonth
Definition: climate.h:31
QString toString() const
Definition: climate.h:41
double temperature
Definition: climate.h:32
double max_temperature
Definition: climate.h:34
double radiation
Definition: climate.h:38
int year
Definition: climate.h:29