meteo_v004¶
Model for estimating sunshine duration based on global radiation following the LARSIM model.
meteo_v004 is similar to meteo_v003 but uses GlobalRadiation to
estimate SunshineDuration, while meteo_v003 uses
SunshineDuration to estimate GlobalRadiation.  So, the
relationship of meteo_v004 and meteo_v003 corresponds to the one of meteo_v002
and meteo_v001.  However, opposed to meteo_v002 and meteo_v001, meteo_v004
“inverts” meteo_v003 only approximately for sub-daily simulation time steps.  This
deficit is primarily due to the “daily radiation adjustment” described in the
documentation of meteo_v003.
Note
meteo_v004 is still under discussion.  Please be aware that we might modify it
later if we find a way to achieve higher agreements with meteo_v003.
Integration tests¶
Note
When new to HydPy, consider reading section How to understand integration tests? first.
We design all integration tests as similar to those of meteo_v003.  This time, we
select SunshineDuration and PossibleSunshineDuration as
output sequences:
>>> from hydpy import Element, Node
>>> from hydpy.outputs import meteo_SunshineDuration, meteo_PossibleSunshineDuration
>>> node1 = Node("node1", variable=meteo_SunshineDuration)
>>> node2 = Node("node2", variable=meteo_PossibleSunshineDuration)
>>> from hydpy.models.meteo_v004 import *
>>> parameterstep()
>>> element = Element("element", outputs=(node1, node2))
>>> element.model = model
We take all parameter values without modifications.  But note that meteo_v004 does
not use the parameter AngstromAlternative (ideas to include it sensibly are welcome):
>>> latitude(54.1)
>>> longitude(9.7)
>>> angstromconstant(0.25)
>>> angstromfactor(0.5)
daily simulation summer¶
We repeat the daily simulation summer example of meteo_v003 but use
its global radiation result as input:
>>> from hydpy import IntegrationTest, pub
>>> pub.timegrids = "1997-08-01", "1997-09-01", "1d"
>>> test = IntegrationTest(element)
>>> test.axis1 = (inputs.globalradiation,)
>>> test.axis2 = (factors.sunshineduration, factors.possiblesunshineduration,)
>>> test.dateformat = "%Y-%d-%m"
>>> inputs.globalradiation.series = (
...     190.25149, 127.660782, 164.401298, 269.020502, 287.848667, 274.674263,
...     284.047892, 262.971263, 272.256414, 267.019218, 269.626547, 270.878291,
...     261.697164, 227.962115, 216.356321, 226.637904, 235.528503, 232.849428,
...     199.71349, 233.771902, 246.121286, 90.58551, 171.944993, 216.549813, 166.91683,
...     145.985611, 165.54389, 87.693346, 84.356885, 142.309203, 126.722078)
meteo_v004 calculates a sunshine duration series equal to the one we use in the
daily simulation summer example of meteo_v003 as input:
>>> test("meteo_v004_daily_summer")
Click to see the table
Click to see the graphdaily simulation winter¶
We repeat the daily simulation winter example of meteo_v003 but use
its global radiation results as input:
>>> pub.timegrids = "2010-12-01", "2011-01-01", "1d"
>>> inputs.globalradiation.series = (
...     31.942798, 9.873898, 16.6835, 31.807427, 9.532511, 16.141484, 9.341429,
...     9.256764, 33.405815, 15.591158, 15.891544, 17.823519, 8.941324, 19.668068,
...     26.831581, 8.837738, 8.817416, 8.804185, 8.798044, 15.464746, 17.879541,
...     8.822161, 8.844396, 8.873743, 27.759642, 32.328755, 9.004582, 28.982321,
...     9.127645, 9.19999, 32.062234)
Again, there is a perfect agreement regarding the sunshine duration:
>>> test("meteo_v004_daily_winter")
Click to see the table
Click to see the graphhourly simulation summer¶
We repeat the hourly simulation summer example of meteo_v003 but
use its global radiation results as input and prepare the log sequences
LoggedGlobalRadiation and LoggedUnadjustedSunshineDuration instead of
LoggedSunshineDuration and LoggedUnadjustedSunshineDuration:
>>> pub.timegrids = "1997-08-03", "1997-08-06", "1h"
>>> test = IntegrationTest(element)
>>> test.axis1 = (inputs.globalradiation,)
>>> test.axis2 = (factors.sunshineduration, factors.possiblesunshineduration,)
>>> test.dateformat = "%Y-%d-%m %H:00"
>>> inputs.globalradiation.series = (
...     0.0, 0.0, 0.0, 0.0, 1.943686, 21.932441, 57.256187, 109.332844, 170.949152,
...     311.762624, 501.583299, 615.018727, 626.544326, 496.133417, 419.520994,
...     387.887354, 278.496873, 137.138608, 51.080715, 13.632816, 0.185943, 0.0, 0.0,
...     0.0, 0.0, 0.0, 0.0, 0.0, 1.590516, 19.950903, 62.985774, 285.776389, 475.225247,
...     614.006719, 643.806508, 600.26298, 620.51414, 599.441386, 613.551223,
...     517.107047, 377.836616, 252.204639, 128.576715, 42.072585, 0.812898, 0.0, 0.0,
...     0.0, 0.0, 0.0, 0.0, 0.0, 1.482348, 21.135568, 125.883451, 305.954943,
...     511.104575, 629.51924, 765.81659, 767.145843, 736.263854, 768.006183, 735.92937,
...     620.374953, 450.095263, 273.614141, 133.368104, 40.326502, 0.867122, 0.0, 0.0,
...     0.0)
>>> test.inits = (
...     (logs.loggedglobalradiation,
...      [0.0, 0.0, 0.0, 0.0, 0.0, 27.777778, 55.555556, 138.888889, 222.222222,
...      305.555556, 333.333333, 388.888889, 527.777778, 444.444444, 250.0, 222.222222,
...      166.666667, 111.111111, 55.555556, 27.777778, 0.0, 0.0, 0.0, 0.0]),
...     (logs.loggedunadjustedsunshineduration,
...      [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.1, 0.2, 0.1, 0.2, 0.2, 0.3, 0.0,
...       0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]))
For this hourly simulation, there are relevant differences between the “real” sunshine
durations defined in the hourly simulation summer example and the
estimates of meteo_v004.  The “daily sunshine adjustment” approach implemented by
method Calc_SunshineDuration_V2 improves the agreement but cannot achieve equality:
>>> test("meteo_v004_hourly_summer")
Click to see the table
Click to see the graphhourly simulation winter¶
We repeat the hourly simulation winter example of meteo_v003 but
use its global radiation results as input and prepare the log sequences
LoggedGlobalRadiation and LoggedUnadjustedSunshineDuration instead of
LoggedSunshineDuration and LoggedUnadjustedSunshineDuration:
>>> pub.timegrids = "2010-12-10", "2010-12-13", "1h"
>>> inputs.globalradiation.series = (
...     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.10761, 18.663203, 56.267907,
...     107.168237, 91.473333, 80.475535, 43.120591, 10.320091, 0.028102, 0.0, 0.0,
...     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.900734,
...     17.26751, 52.61761, 80.135633, 80.276118, 75.835403, 42.227911, 12.613921,
...     0.021912, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
...     0.0, 0.894145, 17.71254, 54.302585, 81.504146, 81.665294, 77.078959, 60.254042,
...     14.837301, 0.168856, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
>>> test.inits = (
...     (logs.loggedglobalradiation,
...      [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 27.777778, 55.555556,
...       111.111111, 166.666667, 138.888889, 55.555556, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
...       0.0, 0.0, 0.0]),
...     (logs.loggedunadjustedsunshineduration,
...      [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.04, 0.25, 0.59, 0.91,
...       0.97, 1.0, 0.65, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]))
In this short period with little sunshine, relative differences between the original and the estimated sunshine duration are more severe than in the summer example. The “daily sunshine adjustment” approach does not improve the agreement but worsens it slightly (which needs further investigation):
>>> test("meteo_v004_hourly_winter")
Click to see the table
Click to see the graph- class hydpy.models.meteo_v004.Model[source]¶
 Bases:
AdHocModelVersion 4 of the Meteo model.
- The following “run methods” are called in the given sequence during each simulation step:
 Calc_EarthSunDistance_V1Calculate the relative inverse distance between the earth and the sun according to Allen et al. (1998).Calc_SolarDeclination_V2Calculate the solar declination according to LEG (2020).Calc_TimeOfSunrise_TimeOfSunset_V1Calculate the time of sunrise and sunset of the current day according to LEG (2020), based on Thompson et al. (1981).Calc_DailyPossibleSunshineDuration_V1Calculate the astronomically possible daily sunshine duration.Calc_PossibleSunshineDuration_V2Calculate the astronomically possible sunshine duration according to LEG (2020).Update_LoggedGlobalRadiation_V1Log the global radiation values of the last 24 hours.Calc_DailyGlobalRadiation_V2Calculate the global radiation sum of the last 24 hours.Calc_ExtraterrestrialRadiation_V2Calculate the amount of extraterrestrial radiation according to LEG (2020), based on Thompson et al. (1981).Calc_DailySunshineDuration_V2Calculate the daily sunshine duration reversely toCalc_DailyGlobalRadiation_V1.Calc_PortionDailyRadiation_V1Calculate the relative sum of radiation according to LEG (2020).Calc_UnadjustedSunshineDuration_V1Calculate the unadjusted sunshine duration reversely toCalc_UnadjustedGlobalRadiation_V1.Update_LoggedUnadjustedSunshineDuration_V1Log the unadjusted sunshine duration values of the last 24 hours.Calc_SunshineDuration_V2Adjust the current sunshine duration to the daily sunshine duration likeCalc_GlobalRadiation_V2adjusts the current global radiation to the daily global radiation.
- The following “additional methods” might be called by one or more of the other methods or are meant to be directly called by the user:
 Return_SunshineDuration_V1Calculate the sunshine duration reversely toReturn_DailyGlobalRadiation_V1and return it.
- class hydpy.models.meteo_v004.ControlParameters(master: Parameters, cls_fastaccess: Type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
 Bases:
SubParametersControl parameters of model meteo_v004.
- The following classes are selected:
 Latitude()The latitude [decimal degrees].Longitude()The longitude [decimal degrees].AngstromConstant()The Ångström “a” coefficient for calculating global radiation [-].AngstromFactor()The Ångström “b” coefficient for calculating global radiation [-].
- class hydpy.models.meteo_v004.DerivedParameters(master: Parameters, cls_fastaccess: Type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
 Bases:
SubParametersDerived parameters of model meteo_v004.
- The following classes are selected:
 DOY()References the “global” day of the year index array [-].MOY()References the “global” month of the year index array [-].Hours()The length of the actual simulation step size in hours [h].SCT()References the “global” standard clock time array [h].NmbLogEntries()The number of log entries required for memorising one day’s data [-].UTCLongitude()Longitude of the centre of the local time zone [°].LatitudeRad()The latitude [rad].
- class hydpy.models.meteo_v004.FactorSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
 Bases:
FactorSequencesFactor sequences of model meteo_v004.
- The following classes are selected:
 EarthSunDistance()The relative inverse distance between the earth and the sun [-].SolarDeclination()Solar declination [-].TimeOfSunrise()Time of sunrise [h].TimeOfSunset()Time of sunset [h].PossibleSunshineDuration()Astronomically possible sunshine duration [h].DailyPossibleSunshineDuration()Astronomically possible daily sunshine duration [h/d].UnadjustedSunshineDuration()Unadjusted sunshine duration [h].SunshineDuration()Actual sunshine duration [h].DailySunshineDuration()Actual daily sunshine duration [h/d].PortionDailyRadiation()Portion of the daily radiation sum [%].
- class hydpy.models.meteo_v004.FixedParameters(master: Parameters, cls_fastaccess: Type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
 Bases:
SubParametersFixed parameters of model meteo_v004.
- The following classes are selected:
 Pi()π [-].SolarConstant()Solar constant [W/m²].
- class hydpy.models.meteo_v004.FluxSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
 Bases:
FluxSequencesFlux sequences of model meteo_v004.
- The following classes are selected:
 ExtraterrestrialRadiation()Extraterrestial radiation [W/m²].DailyGlobalRadiation()Daily sum of global radiation [W/m²].
- class hydpy.models.meteo_v004.InputSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
 Bases:
InputSequencesInput sequences of model meteo_v004.
- The following classes are selected:
 GlobalRadiation()Global radiation [W/m²].
- class hydpy.models.meteo_v004.LogSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
 Bases:
LogSequencesLog sequences of model meteo_v004.
- The following classes are selected:
 LoggedGlobalRadiation()Logged global radiation [W/m²].LoggedUnadjustedSunshineDuration()Logged unadjusted sunshine duration [h].