//--------------------------------------------------------------------- public EcoregionPnETVariables(IObservedClimate climate_dataset, DateTime Date, bool Wythers, bool DTemp, List <ISpeciesPNET> Species, float Latitude) { this._date = Date; this.obs_clim = climate_dataset; speciesVariables = new Dictionary <string, SpeciesPnETVariables>(); _tave = (float)0.5 * (climate_dataset.Tmin + climate_dataset.Tmax); _dayspan = EcoregionPnETVariables.Calculate_DaySpan(Date.Month); float hr = Calculate_hr(Date.DayOfYear, Latitude); //hours of daylight _daylength = Calculate_DayLength(hr); float nightlength = Calculate_NightLength(hr); _tday = (float)0.5 * (climate_dataset.Tmax + _tave); _vpd = EcoregionPnETVariables.Calculate_VPD(Tday, climate_dataset.Tmin); foreach (ISpeciesPNET spc in Species) { SpeciesPnETVariables speciespnetvars = GetSpeciesVariables(ref climate_dataset, Wythers, DTemp, Daylength, nightlength, spc); speciesVariables.Add(spc.Name, speciespnetvars); } }
public ClimateRegionPnETVariables(MonthlyClimateRecord monthlyClimateRecord, DateTime date, bool wythers, bool dTemp, List <ISpeciesPNET> Species, float latitude) { _monthlyClimateRecord = monthlyClimateRecord; _date = date; speciesVariables = new Dictionary <string, SpeciesPnETVariables>(); _tave = (float)(0.5 * (monthlyClimateRecord.Tmin + monthlyClimateRecord.Tmax)); _dayspan = EcoregionPnETVariables.Calculate_DaySpan(date.Month); float hr = EcoregionPnETVariables.Calculate_hr(date.DayOfYear, latitude); _daylength = EcoregionPnETVariables.Calculate_DayLength(hr); float nightlength = EcoregionPnETVariables.Calculate_NightLength(hr); _tday = (float)(0.5 * (monthlyClimateRecord.Tmax + _tave)); _vpd = EcoregionPnETVariables.Calculate_VPD(Tday, (float)monthlyClimateRecord.Tmin); foreach (ISpeciesPNET spc in Species) { SpeciesPnETVariables speciespnetvars = GetSpeciesVariables(monthlyClimateRecord, wythers, dTemp, Daylength, nightlength, spc); speciesVariables.Add(spc.Name, speciespnetvars); } }