meteo_v003¶
Model for calculating radiation terms based on sunshine duration following the LARSIM model.
Version 3 of HydPy-Meteo applies the equations given in LEG (2020) and
LEG (2020) for estimating global radiation. It is pretty similar to
meteo_v001
for daily simulations. However, it is more complicated for hourly (or
other short) timesteps, as it implements an approach of adjusting hourly global
radiation values to directly calculated daily global radiation sums. The documentation
on method Calc_GlobalRadiation_V2
explains this in more detail.
Users that strive for high consistency with LARSIM’s results should note meteo_v003
works slightly different regarding the mentioned approach for adjusting hourly global
radiation values. LARSIM normalises them so that their sum is identical with the
directly calculated global radiation sum of the current calendar day. Hence,
estimating the global radiation for the early morning takes the sunshine duration
measured for the late evening into account. HydPy generally does not support looking
into the future for calculating current states or fluxes. Instead, we decided to let
meteo_v003
always uses data of the last 24 hours for this adjustment process. Hence,
there are noticeable differences in individual hourly radiation estimates of LARSIM
and meteo_v003
, but these are random short term fluctuations that do not introduce
any long term bias.
Integration tests¶
Note
When new to HydPy, consider reading section How to understand integration tests? first.
Application model meteo_v003
calculates multiple meteorological factors hydrological
models could require. We design the following integration tests so that their output
can serve as input for the integration tests of lland_v3
. Among others, lland_v3
requires global radiation and possible sunshine duration as input, which is why we
select the corresponding sequences GlobalRadiation
and
PossibleSunshineDuration
as outputs. We hand them over to the Node
instances
node1 and node2:
>>> from hydpy import Element, Node
>>> from hydpy.outputs import meteo_GlobalRadiation, meteo_PossibleSunshineDuration
>>> node1 = Node("node1", variable=meteo_GlobalRadiation)
>>> node2 = Node("node2", variable=meteo_PossibleSunshineDuration)
We prepare a meteo_v003
instance and assign it to an element connected to those
nodes:
>>> from hydpy.models.meteo_v003 import *
>>> parameterstep()
>>> element = Element("element", outputs=(node1, node2))
>>> element.model = model
We will use the same coordinates and Ångström coefficients in all examples:
>>> latitude(54.1)
>>> longitude(9.7)
>>> angstromconstant(0.25)
>>> angstromfactor(0.5)
>>> angstromalternative(0.15)
daily simulation summer¶
The first example takes place in a summer period, for which we calculate daily values
of global radiation and possible sunshine duration. Besides preparing an
IntegrationTest
instance for running the test, we only need to provide the time
series of (measured) sunshine duration:
>>> from hydpy import IntegrationTest, pub
>>> pub.timegrids = "1997-08-01", "1997-09-01", "1d"
>>> test = IntegrationTest(element)
>>> test.axis1 = (fluxes.globalradiation,)
>>> test.axis2 = (factors.possiblesunshineduration,)
>>> test.dateformat = "%Y-%d-%m"
>>> inputs.sunshineduration.series = (
... 6.3, 1.7, 4.5, 12.4, 13.9, 13.0, 13.8, 12.3, 13.1, 12.8, 13.1, 13.3, 12.7,
... 10.2, 9.4, 10.3, 11.1, 11.0, 8.5, 11.3, 12.4, 0.1, 6.7, 10.4, 6.5, 4.9, 6.6,
... 0.3, 0.1, 5.0, 3.8)
>>> test("meteo_v003_daily_summer")
Click to see the table
Click to see the graph
daily simulation winter¶
This test is similar to the daily simulation summer example but deals with winter conditions:
>>> pub.timegrids = "2010-12-01", "2011-01-01", "1d"
>>> inputs.sunshineduration.series = (
... 3.5, 0.0, 0.1, 3.7, 0.0, 0.1, 0.0, 0.0, 4.4, 0.1, 0.2, 0.7, 0.0, 1.2, 3.0, 0.0,
... 0.0, 0.0, 0.0, 0.2, 0.8, 0.0, 0.0, 0.0, 3.2, 4.3, 0.0, 3.4, 0.0, 0.0, 4.0)
>>> test("meteo_v003_daily_winter")
Click to see the table
Click to see the graph
hourly simulation summer¶
When choosing a simulation timestep smaller one day, we additionally must provide
sunshine duration and “unadjusted” global radiation values for the last 24 hours, which
we pass to the sequences LoggedSunshineDuration
and LoggedUnadjustedGlobalRadiation
:
>>> pub.timegrids = "1997-08-03", "1997-08-06", "1h"
>>> test = IntegrationTest(element)
>>> test.axis1 = (fluxes.globalradiation,)
>>> test.axis2 = (factors.possiblesunshineduration,)
>>> test.dateformat = "%Y-%d-%m %H:00"
>>> inputs.sunshineduration.series = (
... 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.5, 0.7, 0.8, 0.5, 0.4, 0.5,
... 0.5, 0.3, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.9,
... 1.0, 1.0, 0.9, 0.8, 0.9, 0.8, 0.9, 0.9, 0.9, 1.0, 1.0, 1.0, 0.3, 0.0, 0.0, 0.0,
... 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, 0.9, 1.0, 0.9, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
... 1.0, 1.0, 1.0, 1.0, 0.5, 0.0, 0.0, 0.0)
>>> test.inits = (
... (logs.loggedsunshineduration,
... [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]),
... (logs.loggedunadjustedglobalradiation,
... [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]))
>>> test("meteo_v003_hourly_summer")
Click to see the table
Click to see the graph
hourly simulation winter¶
This test is similar to the hourly simulation summer example but deals with winter conditions:
>>> pub.timegrids = "2010-12-10", "2010-12-13", "1h"
>>> inputs.sunshineduration.series = (
... 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 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.0, 0.0, 0.0, 0.0, 0.0,
... 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 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.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.2,
... 0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
>>> test.inits = (
... (logs.loggedsunshineduration,
... [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]),
... (logs.loggedunadjustedglobalradiation,
... [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]))
>>> test("meteo_v003_hourly_winter")
Click to see the table
Click to see the graph
- class hydpy.models.meteo_v003.Model[source]¶
Bases:
AdHocModel
Version 3 of the Meteo model.
- The following “run methods” are called in the given sequence during each simulation step:
Calc_EarthSunDistance_V1
Calculate the relative inverse distance between the earth and the sun according to Allen et al. (1998).Calc_SolarDeclination_V2
Calculate the solar declination according to LEG (2020).Calc_TimeOfSunrise_TimeOfSunset_V1
Calculate the time of sunrise and sunset of the current day according to LEG (2020), based on Thompson et al. (1981).Calc_DailyPossibleSunshineDuration_V1
Calculate the astronomically possible daily sunshine duration.Calc_PossibleSunshineDuration_V2
Calculate the astronomically possible sunshine duration according to LEG (2020).Update_LoggedSunshineDuration_V1
Log the sunshine duration values of the last 24 hours.Calc_DailySunshineDuration_V1
Calculate the sunshine duration sum of the last 24 hours.Calc_ExtraterrestrialRadiation_V2
Calculate the amount of extraterrestrial radiation according to LEG (2020), based on Thompson et al. (1981).Calc_DailyGlobalRadiation_V1
Calculate the daily global radiation.Calc_PortionDailyRadiation_V1
Calculate the relative sum of radiation according to LEG (2020).Calc_UnadjustedGlobalRadiation_V1
Calculate the unadjusted global radiation according to LEG (2020).Update_LoggedUnadjustedGlobalRadiation_V1
Log the unadjusted global radiation values of the last 24 hours.Calc_GlobalRadiation_V2
Adjust the current global radiation to the daily global radiation according to LEG (2020).
- 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_DailyGlobalRadiation_V1
Calculate and return the daily global radiation according to LEG (2020).
- class hydpy.models.meteo_v003.ControlParameters(master: Parameters, cls_fastaccess: Type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParameters
Control parameters of model meteo_v003.
- 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 [-].AngstromAlternative()
An alternative Ångström coefficient for replacing coefficient “c” (AngstromConstant
) on days without any direct sunshine [-].
- class hydpy.models.meteo_v003.DerivedParameters(master: Parameters, cls_fastaccess: Type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParameters
Derived parameters of model meteo_v003.
- 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].Days()
The length of the actual simulation step size in days [d].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_v003.FactorSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
FactorSequences
Factor sequences of model meteo_v003.
- 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].DailySunshineDuration()
Actual daily sunshine duration [h/d].PortionDailyRadiation()
Portion of the daily radiation sum [%].
- class hydpy.models.meteo_v003.FixedParameters(master: Parameters, cls_fastaccess: Type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParameters
Fixed parameters of model meteo_v003.
- The following classes are selected:
Pi()
π [-].SolarConstant()
Solar constant [W/m²].
- class hydpy.models.meteo_v003.FluxSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
FluxSequences
Flux sequences of model meteo_v003.
- The following classes are selected:
ExtraterrestrialRadiation()
Extraterrestial radiation [W/m²].UnadjustedGlobalRadiation()
Unadjusted global radiation [W/m²].DailyGlobalRadiation()
Daily sum of global radiation [W/m²].GlobalRadiation()
Global radiation [W/m²].
- class hydpy.models.meteo_v003.InputSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
InputSequences
Input sequences of model meteo_v003.
- The following classes are selected:
SunshineDuration()
Sunshine duration [h].
- class hydpy.models.meteo_v003.LogSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
LogSequences
Log sequences of model meteo_v003.
- The following classes are selected:
LoggedSunshineDuration()
Logged sunshine duration [h].LoggedUnadjustedGlobalRadiation()
Logged unadjusted global radiation [W/m²].