HydPy-Evap-PET-M-LC (month-based land cover adjustment of reference evapotranspiration)¶
Use evap_pet_mlc as a plug-in between a main model like lland_dd and another
submodel like evap_ret_tw2002 to adjust the reference evapotranspiration given by
evap_ret_tw2002 by month and land cover.
Integration tests¶
Note
When new to HydPy, consider reading section Integration Tests first.
Application model evap_pet_mlc does not define any land cover types by itself but
takes the ones of the respective main model. Here, we manually introduce the land
cover types of grass, trees, and water to apply evap_pet_mlc as a stand-alone model:
>>> from hydpy.core.parametertools import Constants
>>> GRASS, TREES, WATER = 0, 1, 2
>>> constants = Constants(GRASS=GRASS, TREES=TREES, WATER=WATER)
>>> from hydpy.models.evap.evap_control import HRUType, LandMonthFactor
>>> with HRUType.modify_constants(constants), LandMonthFactor.modify_rows(constants):
... from hydpy.models.evap_pet_mlc import *
... parameterstep()
Application model evap_pet_mlc requires no input from another model and does not
supply any outlet sequence. Hence, assigning a model instance to a blank Element
instance is sufficient:
>>> from hydpy import Element
>>> element = Element("element")
>>> element.model = model
In our simple test-setting, the submodel of type evap_ret_io supplies different
reference evapotranspiration values for two hydrological response units of type “trees”
and “water” for the last of January and the first of February 2000. evap_pet_mlc
applies individual adjustment factors for both months and land cover types and “damps”
the second unit’s result value:
>>> from hydpy import pub
>>> pub.timegrids = "2000-01-31", "2000-02-02", "1d"
>>> nmbhru(2)
>>> hrutype(TREES, WATER)
>>> hruarea(0.2, 0.8)
>>> landmonthfactor.trees_jan = 1.2
>>> landmonthfactor.trees_feb = 1.4
>>> landmonthfactor.water_jan = 1.6
>>> landmonthfactor.water_feb = 1.8
>>> dampingfactor(1.0, 0.5)
>>> with model.add_retmodel_v1("evap_ret_io"):
... evapotranspirationfactor(0.8, 1.2)
>>>
>>> from hydpy import IntegrationTest
>>> test = IntegrationTest(element)
>>> test.dateformat = "%Y-%d-%m"
>>> test.inits = ((model.sequences.logs.loggedpotentialevapotranspiration, 1.92),)
>>>
>>> model.retmodel.sequences.inputs.referenceevapotranspiration.series = 1.0, 2.0
>>> test()
Click to see the table
- class hydpy.models.evap_pet_mlc.Model[source]¶
Bases:
Main_RET_PETModel_V1,Sub_ETModel,PETModel_V1HydPy-Evap-PET-M-LC (month-based land cover adjustment of reference evapotranspiration).
- The following “run methods” are called in the given sequence during each simulation step:
Calc_ReferenceEvapotranspiration_V4Let a submodel that complies with thePETModel_V1interface calculate the reference evapotranspiration.Calc_PotentialEvapotranspiration_V2Calculate month- and land cover-specific potential evaporation based on reference evapotranspiration.Update_PotentialEvapotranspiration_V1Damp the given potential evapotranspiration and update the corresponding log sequence.Calc_MeanPotentialEvapotranspiration_V1Calculate the average potential evapotranspiration.
- The following interface methods are available to main models using the defined model as a submodel:
Determine_PotentialEvapotranspiration_V1Interface method that applies the complete application model by executing all “run methods”.Get_PotentialEvapotranspiration_V2Get the current potential evapotranspiration from the selected hydrological response unit.Get_MeanPotentialEvapotranspiration_V2Get the averaged potential evapotranspiration.
- 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:
Calc_ReferenceEvapotranspiration_PETModel_V1Let a submodel that complies with thePETModel_V1interface calculate the reference evapotranspiration.
- Users can hook submodels into the defined main model if they satisfy one of the following interfaces:
PETModel_V1Simple interface for calculating all potential evapotranspiration values in one step.
- DOCNAME: DocName = ('Evap-PET-M-LC', 'month-based land cover adjustment of reference evapotranspiration')¶
- retmodel: SubmodelProperty¶
Required submodel that complies with the following interface: PETModel_V1.
- REUSABLE_METHODS: ClassVar[tuple[type[ReusableMethod], ...]] = ()¶
- cymodel: CyModelProtocol | None¶
- parameters: parametertools.Parameters¶
- sequences: sequencetools.Sequences¶
- masks: masktools.Masks¶
- class hydpy.models.evap_pet_mlc.ControlParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParametersControl parameters of model evap_pet_mlc.
- The following classes are selected:
NmbHRU()The number of separately modelled hydrological response units [-].HRUType()Hydrological response unit type [-].HRUArea()The area of each hydrological response unit [km²].LandMonthFactor()Factor for converting general potential evaporation or evapotranspiration (usually grass reference evapotranspiration) to land-use- and month-specific potential evaporation or evapotranspiration [-].DampingFactor()Damping factor (temporal weighting factor) for potential evapotranspiration [-].
- class hydpy.models.evap_pet_mlc.DerivedParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParametersDerived parameters of model evap_pet_mlc.
- The following classes are selected:
MOY()References the “global” month of the year index array [-].HRUAreaFraction()The area fraction of each hydrological response unit [-].
- class hydpy.models.evap_pet_mlc.FluxSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
FluxSequencesFlux sequences of model evap_pet_mlc.
- The following classes are selected:
ReferenceEvapotranspiration()Reference (grass) evapotranspiration [mm/T].PotentialEvapotranspiration()Potential (land type-specific) evapotranspiration [mm/T].MeanPotentialEvapotranspiration()Mean potential evapotranspiration [mm/T].
- class hydpy.models.evap_pet_mlc.LogSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
LogSequencesLog sequences of model evap_pet_mlc.
- The following classes are selected:
LoggedPotentialEvapotranspiration()Logged (damped) potential evapotranspiration [mm/T].