Loading [MathJax]/extensions/ams.js
 |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
#include <Weather.h>
|
| Weather (const char *a_weatherdatafile="default") |
|
| ~Weather (void) |
|
double | GetTempHour (int hour) |
| Get today's weather data at the given hour. More...
|
|
double | GetSoilTempHour (int hour) |
|
double | GetWindHour (int hour) |
|
double | GetRainHour (int hour) |
|
double | GetRadiationHour (int hour) |
|
double | GetDDDegs (long a_date) |
|
double | GetGlobalRadiation (long a_date) |
|
double | GetGlobalRadiation (void) |
|
double | GetTemp (long a_date) |
| Get the temperature on a particular date. More...
|
|
double | GetSoilTemp (void) |
| Get the current soil temperature. More...
|
|
double | GetSoilTemp (long a_date) |
| Get the soil temperature on a particular date. More...
|
|
double | GetTemp (void) |
| Get the temperature today. More...
|
|
double | GetTempAfterDays (int days) |
| Get the temperature at the given number of days which is the number of days after today. More...
|
|
double | GetMinTemp (void) |
| Get the min temperature today. More...
|
|
double | GetMaxTemp (void) |
| Get the max temperature today. More...
|
|
double | GetMinTempYesterday (void) |
| Get the min temperature yesterday. More...
|
|
double | GetMaxTempYesterday (void) |
| Get the max temperature yesterday. More...
|
|
double | GetMinTempTomorrow (void) |
| Get the min temperature tomorrow. More...
|
|
double | GetMaxTempTomorrow (void) |
| Get the max temperature tomorrow. More...
|
|
double | GetRadiation (void) |
| Get the max temperature today. More...
|
|
double | GetFlyingHours (void) |
| Get the max temperature today. More...
|
|
double | GetHumidity (void) |
| Get the humidity score today. More...
|
|
double | GetHumidity (long a_date) |
| Get the humidity score today. More...
|
|
double | GetMeanTemp (long a_date, unsigned int a_period) |
|
double | GetRain (long a_date) |
|
double | GetRain (void) |
|
double | GetWind (long a_date) |
|
double | GetWind (void) |
|
int | GetWindDirection (void) |
| Four wind directions N = 0, clockwise. More...
|
|
int | GetWindDirection8 (void) |
| Eight wind directions N = 0, NE = 1, ..., clockwise. More...
|
|
double | GetWindDirectionRadians (void) |
| East is 0, anticlockwise. More...
|
|
bool | GetSnow (long a_date) |
|
bool | GetSnow (void) |
|
double | GetSnowDepth (void) |
| Get the current snow depth. More...
|
|
bool | Raining (void) |
|
bool | Get_fsoiltemp (void) |
|
bool | Get_fsnow (void) |
|
bool | Get_fminmaxtemp (void) |
|
bool | Get_frelhumidity (void) |
|
bool | Get_fsoiltemptwilight (void) |
|
bool | Get_fradiation (void) |
|
int | GetNoDays (void) |
|
double | GetRainPeriod (long a_date, unsigned int a_period) |
|
double | GetWindPeriod (long a_date, unsigned int a_period) |
|
double | GetTempPeriod (long a_date, unsigned int a_period) |
|
double | GetRHPeriod (long a_date, unsigned int a_period) |
|
void | Tick (void) |
|
void | readWeatherFile (int NoDays, ifstream &inFile) |
|
void | readWeatherFileHourly (int NoHours, int NoDays, ifstream &inFile) |
|
◆ Weather()
Weather::Weather |
( |
const char * |
a_weatherdatafile = "default" | ) |
|
223 std::string filename;
225 if (strcmp(a_weatherdatafile,
"default") == 0)
228 filename = a_weatherdatafile;
230 std::cout <<
"Reading Weather File " << filename <<
"\n";
231 inFile.open(filename);
239 std::getline(inFile,buf);
242 NoDays = std::stoi(buf);
244 catch (
const std::invalid_argument& ia) {
246 std::getline(inFile, buf);
249 NoDays = std::stoi(buf);
251 catch (
const std::invalid_argument& ia) {
252 g_msg->
Warn(
WARN_FILE,
"Weather::Weather(): File format error, expected (optional: header line and) the total number of file entries.",
"");
262 std::getline(inFile, buf);
263 NoHours = std::stoi(buf);
265 g_msg->
Warn(
WARN_FILE,
"Weather::Weather(): File format error, expected total number of file entries, got ",
270 std::getline(inFile, buf);
References CFG_CUSTOM, g_msg, l_map_weather_file, m_NoDays, m_temp_variation, readWeatherFile(), readWeatherFileHourly(), Tick(), CfgFloat::value(), CfgStr::value(), MapErrorMsg::Warn(), and WARN_FILE.
Referenced by CreateWeather().
◆ ~Weather()
Weather::~Weather |
( |
void |
| ) |
|
◆ DeriveSnowCover()
double Weather::DeriveSnowCover |
( |
double |
a_snowdepth, |
|
|
double |
a_rainfall, |
|
|
double |
a_temperature |
|
) |
| |
|
protected |
670 double snowtempthreshold = -1.0;
671 if (a_snowdepth > 0.0 && a_temperature < snowtempthreshold) {
674 else if (a_snowdepth > 0.0)
676 a_snowdepth -= a_temperature;
678 if (a_temperature < snowtempthreshold && a_rainfall > 0.0) {
679 a_snowdepth += a_rainfall;
681 if (a_temperature > snowtempthreshold && a_rainfall > 0.0) {
682 a_snowdepth -= a_rainfall;
684 if (a_snowdepth < 0.0) a_snowdepth = 0.0;
Referenced by readWeatherFile().
◆ DeriveSoilTemp()
double Weather::DeriveSoilTemp |
( |
double |
a_temperature | ) |
|
|
protected |
◆ Get_fminmaxtemp()
bool Weather::Get_fminmaxtemp |
( |
void |
| ) |
|
|
inline |
◆ Get_fradiation()
bool Weather::Get_fradiation |
( |
void |
| ) |
|
|
inline |
◆ Get_frelhumidity()
bool Weather::Get_frelhumidity |
( |
void |
| ) |
|
|
inline |
◆ Get_fsnow()
bool Weather::Get_fsnow |
( |
void |
| ) |
|
|
inline |
◆ Get_fsoiltemp()
bool Weather::Get_fsoiltemp |
( |
void |
| ) |
|
|
inline |
◆ Get_fsoiltemptwilight()
bool Weather::Get_fsoiltemptwilight |
( |
void |
| ) |
|
|
inline |
◆ GetDDDegs()
double Weather::GetDDDegs |
( |
long |
a_date | ) |
|
◆ GetFlyingHours()
double Weather::GetFlyingHours |
( |
void |
| ) |
|
|
inline |
Get the max temperature today.
◆ GetGlobalRadiation() [1/2]
double Weather::GetGlobalRadiation |
( |
long |
a_date | ) |
|
|
inline |
◆ GetGlobalRadiation() [2/2]
double Weather::GetGlobalRadiation |
( |
void |
| ) |
|
|
inline |
◆ GetHumidity() [1/2]
double Weather::GetHumidity |
( |
long |
a_date | ) |
|
|
inline |
Get the humidity score today.
◆ GetHumidity() [2/2]
double Weather::GetHumidity |
( |
void |
| ) |
|
|
inline |
◆ GetMaxTemp()
double Weather::GetMaxTemp |
( |
void |
| ) |
|
|
inline |
◆ GetMaxTempTomorrow()
double Weather::GetMaxTempTomorrow |
( |
void |
| ) |
|
|
inline |
◆ GetMaxTempYesterday()
double Weather::GetMaxTempYesterday |
( |
void |
| ) |
|
|
inline |
◆ GetMeanTemp()
double Weather::GetMeanTemp |
( |
long |
a_date, |
|
|
unsigned int |
a_period |
|
) |
| |
◆ GetMinTemp()
double Weather::GetMinTemp |
( |
void |
| ) |
|
|
inline |
◆ GetMinTempTomorrow()
double Weather::GetMinTempTomorrow |
( |
void |
| ) |
|
|
inline |
◆ GetMinTempYesterday()
double Weather::GetMinTempYesterday |
( |
void |
| ) |
|
|
inline |
◆ GetNoDays()
int Weather::GetNoDays |
( |
void |
| ) |
|
|
inline |
◆ GetRadiation()
double Weather::GetRadiation |
( |
void |
| ) |
|
|
inline |
Get the max temperature today.
◆ GetRadiationHour()
double Weather::GetRadiationHour |
( |
int |
hour | ) |
|
|
inline |
◆ GetRain() [1/2]
double Weather::GetRain |
( |
long |
a_date | ) |
|
|
inline |
◆ GetRain() [2/2]
double Weather::GetRain |
( |
void |
| ) |
|
|
inline |
◆ GetRainHour()
double Weather::GetRainHour |
( |
int |
hour | ) |
|
|
inline |
◆ GetRainPeriod()
double Weather::GetRainPeriod |
( |
long |
a_date, |
|
|
unsigned int |
a_period |
|
) |
| |
692 for (
unsigned int i=0; i<a_period; i++ )
References GetRain().
Referenced by Farm::BulbHarvest(), Farm::BurnStrawStubble(), Farm::BurnTop(), Farm::CutToHay(), PTGrassGrazed::Do(), Farm::Harvest(), Farm::HarvestBF_Machine(), Farm::HarvestBushFruit(), Farm::HarvestLong(), Farm::HayBailing(), Farm::HayTurning(), Farm::IrrigationStart(), Farm::ManualWeeding(), Farm::RowCultivation(), Farm::StrawChopping(), Farm::Strigling(), Farm::StriglingSow(), Farm::StubbleHarrowing(), and Landscape::SupplyRainPeriod().
◆ GetRHPeriod()
double Weather::GetRHPeriod |
( |
long |
a_date, |
|
|
unsigned int |
a_period |
|
) |
| |
◆ GetSnow() [1/2]
bool Weather::GetSnow |
( |
long |
a_date | ) |
|
◆ GetSnow() [2/2]
bool Weather::GetSnow |
( |
void |
| ) |
|
|
inline |
◆ GetSnowDepth()
double Weather::GetSnowDepth |
( |
void |
| ) |
|
|
inline |
◆ GetSoilTemp() [1/2]
double Weather::GetSoilTemp |
( |
long |
a_date | ) |
|
|
inline |
Get the soil temperature on a particular date.
◆ GetSoilTemp() [2/2]
double Weather::GetSoilTemp |
( |
void |
| ) |
|
|
inline |
◆ GetSoilTempHour()
double Weather::GetSoilTempHour |
( |
int |
hour | ) |
|
|
inline |
◆ GetTemp() [1/2]
double Weather::GetTemp |
( |
long |
a_date | ) |
|
|
inline |
◆ GetTemp() [2/2]
double Weather::GetTemp |
( |
void |
| ) |
|
|
inline |
◆ GetTempAfterDays()
double Weather::GetTempAfterDays |
( |
int |
days | ) |
|
|
inline |
◆ GetTempHour()
double Weather::GetTempHour |
( |
int |
hour | ) |
|
|
inline |
◆ GetTempPeriod()
double Weather::GetTempPeriod |
( |
long |
a_date, |
|
|
unsigned int |
a_period |
|
) |
| |
◆ GetWind() [1/2]
double Weather::GetWind |
( |
long |
a_date | ) |
|
|
inline |
◆ GetWind() [2/2]
double Weather::GetWind |
( |
void |
| ) |
|
|
inline |
◆ GetWindDirection()
int Weather::GetWindDirection |
( |
void |
| ) |
|
|
inline |
◆ GetWindDirection8()
int Weather::GetWindDirection8 |
( |
void |
| ) |
|
|
inline |
◆ GetWindDirectionRadians()
double Weather::GetWindDirectionRadians |
( |
void |
| ) |
|
|
inline |
◆ GetWindHour()
double Weather::GetWindHour |
( |
int |
hour | ) |
|
|
inline |
◆ GetWindPeriod()
double Weather::GetWindPeriod |
( |
long |
a_date, |
|
|
unsigned int |
a_period |
|
) |
| |
◆ Raining()
bool Weather::Raining |
( |
void |
| ) |
|
|
inline |
Referenced by Farm::AutumnHarrow(), Farm::AutumnPlough(), Farm::AutumnRoll(), Farm::AutumnSow(), Farm::AutumnSowWithFerti(), Farm::BedForming(), Farm::BiocideTreat(), Farm::CutOrch(), Farm::CutToSilage(), Farm::CutWeeds(), Farm::DeepPlough(), Farm::FA_AmmoniumSulphate(), Farm::FA_Boron(), Farm::FA_Calcium(), Farm::FA_Cu(), Farm::FA_GreenManure(), Farm::FA_K(), Farm::FA_ManganeseSulphate(), Farm::FA_Manure(), Farm::FA_N(), Farm::FA_NK(), Farm::FA_NPK(), Farm::FA_NPKS(), Farm::FA_P(), Farm::FA_PK(), Farm::FA_PKS(), Farm::FA_RSM(), Farm::FA_SK(), Farm::FA_Sludge(), Farm::FA_Slurry(), Farm::FiberCovering(), Farm::FiberRemoval(), Farm::FlowerCutting(), Farm::FP_AmmoniumSulphate(), Farm::FP_Boron(), Farm::FP_Calcium(), Farm::FP_Cu(), Farm::FP_GreenManure(), Farm::FP_K(), Farm::FP_LiquidNH3(), Farm::FP_ManganeseSulphate(), Farm::FP_Manure(), Farm::FP_N(), Farm::FP_NC(), Farm::FP_NK(), Farm::FP_NPK(), Farm::FP_NPKS(), Farm::FP_NS(), Farm::FP_P(), Farm::FP_PK(), Farm::FP_PKS(), Farm::FP_RSM(), Farm::FP_SK(), Farm::FP_Sludge(), Farm::FP_Slurry(), Farm::FruitHarvest(), Farm::FungicideTreat(), Farm::GreenHarvest(), Farm::GrowthRegulator(), Farm::HarvestShoots(), Farm::HeavyCultivatorAggregate(), Farm::HerbicideTreat(), Farm::HillingUp(), Farm::InsecticideTreat(), Farm::Irrigation(), Farm::LeafThinning(), Farm::Molluscicide(), Farm::Mowing(), Farm::OrganicFungicide(), Farm::OrganicHerbicide(), Farm::OrganicInsecticide(), Farm::Pheromone(), Farm::PreseedingCultivator(), Farm::PreseedingCultivatorSow(), Farm::ProductApplication(), Farm::Pruning(), Farm::ShallowHarrow(), Farm::Shredding(), Farm::SpringHarrow(), Farm::SpringPlough(), Farm::SpringRoll(), Farm::SpringSow(), Farm::SpringSowWithFerti(), Farm::StrawCovering(), Farm::StrawRemoval(), Farm::StriglingHill(), Farm::StubbleCultivatorHeavy(), Farm::StubblePlough(), Farm::Suckering(), Farm::Swathing(), Farm::Water(), Farm::WinterHarrow(), and Farm::WinterPlough().
◆ readWeatherFile()
void Weather::readWeatherFile |
( |
int |
NoDays, |
|
|
ifstream & |
inFile |
|
) |
| |
489 int Day, Month, Year, FirstYear=0, LastYear=0;
490 double Temp, Rain, Wind, SoilTemp, SnowCover, minTemp, maxTemp, soilTempTwilight, relHumidity, Radiation, FlyingHours;
532 bool storing =
false;
533 unsigned int index = 0;
538 for (
int i=0; i<NoDays; i++) {
542 inFile >> Year >> Month >> Day >> Temp >> Wind >> Rain;
544 inFile >> minTemp >> maxTemp;
550 inFile >> relHumidity;
552 inFile >> soilTempTwilight;
556 inFile >> FlyingHours;
558 if ( Month == 2 && Day == 29 ) {
563 if ( Month == 1 && Day == 1 && !storing &&
596 double snowdepth = 0;
599 snowdepth =
m_snow[index - 1];
603 m_snow[index] = SnowCover;
639 if ( (Month == 12) && (Day == 31) && (storing) ) {
640 cout <<
"LastYear: " << Year <<
"\n";
651 "not contain at least one year of data!" );
References DeriveSnowCover(), DeriveSoilTemp(), g_date, g_msg, Calendar::GetLastYear(), l_weather_flyinghours, l_weather_minmaxtemp, l_weather_radiation, l_weather_relhumidity, l_weather_snowcover, l_weather_soiltemp, l_weather_soiltemptwilight, l_weather_starting_year, m_datemodulus, m_fflyinghours, m_flyinghours, m_fminmaxtemp, m_fradiation, m_frelhumidity, m_fsnow, m_fsoiltemp, m_fsoiltemptwilight, m_hourly_flag, m_maxtemp, m_mintemp, m_radiation, m_rain, m_relhumidity, m_snow, m_snowdepth, m_soiltemp, m_soiltemptwilight, m_temp, m_wind, Calendar::Reset(), Calendar::SetFirstYear(), Calendar::SetLastYear(), CfgInt::value(), CfgBool::value(), MapErrorMsg::Warn(), and WARN_FILE.
Referenced by Weather().
◆ readWeatherFileHourly()
void Weather::readWeatherFileHourly |
( |
int |
NoHours, |
|
|
int |
NoDays, |
|
|
ifstream & |
inFile |
|
) |
| |
- Note
- cover it to J for daily
284 int Hour, Day, Month, Year, FirstYear=0, LastYear=0;
285 double Temp, Rain, Wind, Winddir, Radiation, SoilTemp, SnowCover, minTemp, maxTemp, soilTempTwilight, relHumidity;
288 double sum_temp = 0.0, sum_rain = 0.0, sum_wind = 0.0, sum_winddir = 0.0, sum_winddir8 = 0.0, sum_soiltemp = 0.0, sum_snow = 0.0, sum_humidity = 0.0, sum_radiation = 0.0;
315 for(
int i = 0; i < NoDays; i++){
334 bool storing =
false;
335 unsigned int index = 0;
339 int hour_counter = -1;
343 for (
int i=0; i<NoHours; i++) {
344 inFile >> Year >> Month >> Day >> Hour >> Temp >> Wind >> Winddir >> Rain >> SoilTemp >> SnowCover >> relHumidity >> Radiation;
347 if ( Month == 2 && Day == 29 ) {
352 if ( Month == 1 && Day == 1 && Hour == 0 && !storing &&
370 if (hour_counter == 24)
375 if (hour_counter == 0){
390 m_rain_h.at(index).at(hour_counter) = Rain;
392 m_wind_h.at(index).at(hour_counter) = Wind;
395 sum_winddir += Winddir;
397 m_temp_h.at(index).at(hour_counter) = Temp;
399 if(Temp > maxTemp) maxTemp = Temp;
400 if(Temp < minTemp) minTemp = Temp;
402 sum_radiation += Radiation*3600;
404 sum_soiltemp += SoilTemp;
409 if(hour_counter == 5){
413 m_snow_h.at(index).at(hour_counter) = SnowCover;
414 sum_snow += SnowCover;
416 sum_humidity += relHumidity;
420 if(hour_counter == 23)
422 m_rain[ index ] = sum_rain;
424 m_wind[ index ] = sum_wind/24.0;
448 m_temp[ index ] = sum_temp/24.0;
455 m_snow[index] = sum_snow/24.0;
462 if ( (Month == 12) && (Day == 31) && (storing) ) {
463 cout <<
"LastYear: " << Year <<
"\n";
479 "not contain at least one year of data!" );
References g_date, g_msg, Calendar::GetLastYear(), l_weather_starting_year, m_datemodulus, m_fminmaxtemp, m_frelhumidity, m_fsnow, m_fsoiltemp, m_fsoiltemptwilight, m_hourly_flag, m_humidity_h, m_maxtemp, m_mintemp, M_PI, m_radiation, m_radiation_h, m_rain, m_rain_h, m_relhumidity, m_snow, m_snow_h, m_snowdepth, m_soiltemp, m_soiltemp_h, m_soiltemptwilight, m_temp, m_temp_h, m_wind, m_wind_h, m_winddir, m_winddir8, m_winddir8_h, m_winddir_h, m_WindDirRadians, Calendar::Reset(), Calendar::SetFirstYear(), Calendar::SetLastYear(), CfgInt::value(), MapErrorMsg::Warn(), and WARN_FILE.
Referenced by Weather().
◆ Tick()
void Weather::Tick |
( |
void |
| ) |
|
The complicated calculation of m_weather_day is due to the potential to run off either end of the rain data, especially since this is called on Day0
Humidity calculation. This is based on an assumption that humidity is relative to rainfall in the days before. The humidity score is the mean of rainfall over the last 5 days assuming 50% loss each day. Therefore rainfall of 10,0,0,2,0 mm in the previous 5 days would give a humidity of 0.625+0+0+1+0 = 1.625/5 = 0.325 But we also need to calculate temperature into this. Lets assume <10 degrees has no effect, 10-20 and this figure is halved, 20-40 and it is half again.
datemodulus is added to prevent negative overun on the rain or temperature data array, important since this is called on Day0
Wind directions is based on probabilities. Can also use the WindDirections array which allows monthly probabilities
136 double rainscale = 0;
137 for (
int i = 0; i < 5; i++) {
142 if (temp > 10.0) rainscale *= 0.5;
143 if (temp > 20.0) rainscale *= 0.5;
144 if (temp > 30.0) rainscale *= 0.5;
References c_insolation, Calendar::Date(), Calendar::DayInYear(), g_date, g_rand_uni_fnc(), GetRain(), GetTempPeriod(), m_datemodulus, m_fflyinghours, m_flyinghours, m_flyinghourstoday, m_fminmaxtemp, m_fradiation, m_hourly_flag, m_hourly_today_index, m_humiditytoday, m_insolation, m_maxtemp, m_maxtemptoday, m_maxtemptomorrow, m_maxtempyesterday, m_mintemp, m_mintemptoday, m_mintemptomorrow, m_mintempyesterday, m_radiation, m_radiationtoday, m_rain, m_rainingtoday, m_raintoday, m_relhumidity, m_snow, m_snowtoday, m_soiltemp, m_soiltemptoday, m_temp, m_temp_variation, m_temptoday, m_weather_day, m_wind, m_winddir, m_winddir8, m_winddir8today, m_WindDirRadians, m_winddirtoday, m_WindDirTodayRadians, and m_windtoday.
Referenced by Landscape::Tick(), and Weather().
◆ m_datemodulus
long Weather::m_datemodulus |
|
private |
◆ m_fflyinghours
bool Weather::m_fflyinghours = false |
|
private |
◆ m_flyinghours
vector<double> Weather::m_flyinghours |
|
private |
◆ m_flyinghourstoday
double Weather::m_flyinghourstoday |
|
private |
◆ m_fminmaxtemp
bool Weather::m_fminmaxtemp = false |
|
private |
◆ m_fradiation
bool Weather::m_fradiation = false |
|
private |
◆ m_frelhumidity
bool Weather::m_frelhumidity = false |
|
private |
◆ m_fsnow
bool Weather::m_fsnow = false |
|
private |
◆ m_fsoiltemp
bool Weather::m_fsoiltemp = false |
|
private |
◆ m_fsoiltemptwilight
bool Weather::m_fsoiltemptwilight = false |
|
private |
◆ m_hourly_flag
bool Weather::m_hourly_flag |
|
private |
◆ m_hourly_today_index
int Weather::m_hourly_today_index |
|
private |
◆ m_humidity_h
vector<vector<double> > Weather::m_humidity_h |
|
private |
◆ m_humiditytoday
double Weather::m_humiditytoday |
|
private |
◆ m_insolation
double Weather::m_insolation |
|
private |
◆ m_maxtemp
vector<double> Weather::m_maxtemp |
|
private |
◆ m_maxtemptoday
double Weather::m_maxtemptoday |
|
private |
◆ m_maxtemptomorrow
double Weather::m_maxtemptomorrow |
|
private |
◆ m_maxtempyesterday
double Weather::m_maxtempyesterday |
|
private |
◆ m_mintemp
vector<double> Weather::m_mintemp |
|
private |
◆ m_mintemptoday
double Weather::m_mintemptoday |
|
private |
◆ m_mintemptomorrow
double Weather::m_mintemptomorrow |
|
private |
◆ m_mintempyesterday
double Weather::m_mintempyesterday |
|
private |
◆ m_NoDays
Holds the number of days we have weather data for.
Referenced by Weather().
◆ m_radiation
vector<double> Weather::m_radiation |
|
private |
◆ m_radiation_h
vector<vector<double> > Weather::m_radiation_h |
|
private |
◆ m_radiationtoday
double Weather::m_radiationtoday |
|
private |
◆ m_rain
vector<double> Weather::m_rain |
|
private |
◆ m_rain_h
vector<vector<double> > Weather::m_rain_h |
|
private |
◆ m_rainingtoday
bool Weather::m_rainingtoday |
|
private |
◆ m_raintoday
double Weather::m_raintoday |
|
private |
◆ m_relhumidity
vector<double> Weather::m_relhumidity |
|
private |
◆ m_snow
vector<double> Weather::m_snow |
|
private |
◆ m_snow_h
vector<vector<double> > Weather::m_snow_h |
|
private |
◆ m_snowdepth
double Weather::m_snowdepth |
|
private |
◆ m_snowtoday
bool Weather::m_snowtoday |
|
private |
◆ m_soiltemp
vector<double> Weather::m_soiltemp |
|
private |
◆ m_soiltemp_h
vector<vector<double> > Weather::m_soiltemp_h |
|
private |
◆ m_soiltemptoday
double Weather::m_soiltemptoday |
|
private |
◆ m_soiltemptwilight
vector<double> Weather::m_soiltemptwilight |
|
private |
◆ m_temp
vector<double> Weather::m_temp |
|
private |
◆ m_temp_h
vector<vector<double> > Weather::m_temp_h |
|
private |
◆ m_temp_variation
double Weather::m_temp_variation {0} |
|
private |
◆ m_temptoday
double Weather::m_temptoday |
|
private |
◆ m_weather_day
int Weather::m_weather_day |
|
private |
◆ m_wind
vector<double> Weather::m_wind |
|
private |
◆ m_wind_h
vector<vector<double> > Weather::m_wind_h |
|
private |
◆ m_wind_valid
bool Weather::m_wind_valid |
|
private |
◆ m_winddir
vector<double> Weather::m_winddir |
|
private |
◆ m_winddir8
vector<double> Weather::m_winddir8 |
|
private |
◆ m_winddir8_h
vector<vector<double> > Weather::m_winddir8_h |
|
private |
◆ m_winddir8_valid
bool Weather::m_winddir8_valid |
|
private |
◆ m_winddir8today
int Weather::m_winddir8today |
|
private |
◆ m_winddir_h
vector<vector<double> > Weather::m_winddir_h |
|
private |
◆ m_winddir_valid
bool Weather::m_winddir_valid |
|
private |
◆ m_WindDirRadians
vector<double> Weather::m_WindDirRadians |
|
private |
◆ m_winddirtoday
int Weather::m_winddirtoday |
|
private |
◆ m_WindDirTodayRadians
double Weather::m_WindDirTodayRadians |
|
private |
◆ m_windtoday
double Weather::m_windtoday |
|
private |
The documentation for this class was generated from the following files:
int m_winddir8today
Definition: Weather.h:430
#define M_PI
Definition: sunset.h:33
bool m_hourly_flag
Flag for hourly data.
Definition: Weather.h:458
Definition: MapErrorMsg.h:37
double g_rand_uni_fnc()
Definition: ALMaSS_Random.cpp:56
double m_snowdepth
The snow depth in cm.
Definition: Weather.h:455
static CfgBool l_weather_relhumidity("WEATHER_RELHUMIDITY", CFG_CUSTOM, false)
vector< double > m_radiation
Definition: Weather.h:399
vector< double > m_soiltemp
Definition: Weather.h:393
double GetWind(void)
Definition: Weather.h:509
vector< double > m_temp
Definition: Weather.h:392
double m_radiationtoday
Definition: Weather.h:443
double m_temptoday
Definition: Weather.h:426
void SetFirstYear(int a_year)
Definition: Calendar.h:81
bool m_fradiation
Definition: Weather.h:421
vector< vector< double > > m_winddir8_h
Definition: Weather.h:406
char * value() const
Definition: Configurator.h:182
vector< double > m_relhumidity
Definition: Weather.h:397
static CfgBool l_weather_radiation("WEATHER_RADIATION", CFG_CUSTOM, false)
class Calendar * g_date
Definition: Calendar.cpp:37
double m_humiditytoday
Definition: Weather.h:435
static CfgBool l_weather_soiltemp("WEATHER_SOILTEMP", CFG_CUSTOM, false)
double GetRain(void)
Definition: Weather.h:507
static CfgBool l_weather_minmaxtemp("WEATHER_MINMAXTEMP", CFG_CUSTOM, false)
bool m_fminmaxtemp
Definition: Weather.h:418
static CfgBool l_weather_flyinghours("WEATHER_FLYINGHOURS", CFG_CUSTOM, false)
static CfgStr l_map_weather_file("MAP_WEATHER_FILE", CFG_CUSTOM, "weather.pre")
bool m_fsoiltemptwilight
Definition: Weather.h:420
long m_datemodulus
Definition: Weather.h:452
void SetLastYear(int a_year)
Definition: Calendar.h:82
vector< double > m_snow
Definition: Weather.h:394
void Tick(void)
Definition: Weather.cpp:66
double m_mintemptomorrow
Definition: Weather.h:441
vector< double > m_rain
Definition: Weather.h:387
bool value() const
Definition: Configurator.h:164
double m_soiltemptoday
Definition: Weather.h:436
bool m_fflyinghours
Definition: Weather.h:422
vector< vector< double > > m_temp_h
Definition: Weather.h:407
bool m_frelhumidity
Definition: Weather.h:419
bool m_snowtoday
Definition: Weather.h:432
double GetTemp(void)
Get the temperature today.
Definition: Weather.h:482
void readWeatherFileHourly(int NoHours, int NoDays, ifstream &inFile)
Definition: Weather.cpp:282
vector< double > m_WindDirRadians
Definition: Weather.h:391
vector< vector< double > > m_snow_h
Definition: Weather.h:410
long Date(void)
Definition: Calendar.h:57
void Reset(void)
Definition: Calendar.cpp:39
double GetHumidity(void)
Get the humidity score today.
Definition: Weather.h:502
vector< vector< double > > m_radiation_h
Definition: Weather.h:408
double m_mintemptoday
Definition: Weather.h:439
double m_maxtemptomorrow
Definition: Weather.h:442
double DeriveSoilTemp(double a_temperature)
Definition: Weather.cpp:663
int GetLastYear(void)
Definition: Calendar.h:70
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
double m_maxtempyesterday
Definition: Weather.h:438
vector< vector< double > > m_wind_h
Definition: Weather.h:404
bool m_rainingtoday
Definition: Weather.h:433
vector< double > m_soiltemptwilight
Definition: Weather.h:398
double m_WindDirTodayRadians
Definition: Weather.h:431
double m_windtoday
Definition: Weather.h:428
vector< double > m_winddir
Definition: Weather.h:389
static CfgBool l_weather_soiltemptwilight("WEATHER_SOILTEMPTWILIGHT", CFG_CUSTOM, false)
double m_temp_variation
Definition: Weather.h:445
int value() const
Definition: Configurator.h:116
const double c_insolation[365]
Definition: Weather.h:16
vector< vector< double > > m_rain_h
Definition: Weather.h:403
bool m_fsnow
Definition: Weather.h:417
vector< vector< double > > m_humidity_h
Definition: Weather.h:411
int m_weather_day
Definition: Weather.h:461
bool m_fsoiltemp
Definition: Weather.h:416
double DeriveSnowCover(double a_snowdepth, double a_rainfall, double a_temperature)
Definition: Weather.cpp:668
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
vector< vector< double > > m_winddir_h
Definition: Weather.h:405
int m_hourly_today_index
Definition: Weather.h:414
int m_NoDays
Holds the number of days we have weather data for.
Definition: Weather.h:460
double GetTempPeriod(long a_date, unsigned int a_period)
Definition: Weather.cpp:707
vector< double > m_flyinghours
Definition: Weather.h:400
vector< double > m_wind
Definition: Weather.h:388
double m_insolation
Definition: Weather.h:434
double m_raintoday
Definition: Weather.h:427
vector< double > m_maxtemp
Definition: Weather.h:396
Double configurator entry class.
Definition: Configurator.h:126
double m_mintempyesterday
Definition: Weather.h:437
vector< double > m_mintemp
Definition: Weather.h:395
vector< vector< double > > m_soiltemp_h
Definition: Weather.h:409
Definition: Configurator.h:70
int g_random_fnc(const int a_range)
Definition: ALMaSS_Random.cpp:74
int DayInYear(void)
Definition: Calendar.h:58
static CfgInt l_weather_starting_year("WEATHER_STARTING_YEAR", CFG_CUSTOM, 0)
static CfgBool l_weather_snowcover("WEATHER_SNOWCOVER", CFG_CUSTOM, false)
vector< double > m_winddir8
Definition: Weather.h:390
void readWeatherFile(int NoDays, ifstream &inFile)
Definition: Weather.cpp:487
int m_winddirtoday
Definition: Weather.h:429
double m_maxtemptoday
Definition: Weather.h:440
double m_flyinghourstoday
Definition: Weather.h:444