HydPy-Exch-WL (submodel for querying the water level from a remote node)

exch_waterlevel informs its main model about the current water level simulated by another model or passed in as a time series by the user. Use it, for example, to couple wland_wag and dam_pump so that the water level at a pumping station (modelled by dam_pump) can affect the upstream groundwater level (modelled by wland_wag).

Integration test

Note

When new to HydPy, consider reading section Integration Tests first.

The only functionality of exch_waterlevel is querying water levels from a remote node. Hence, we include such a node in the following simple test setting, which does not require further explanation:

>>> from hydpy.models.exch_waterlevel import *
>>> parameterstep()
>>> from hydpy import Element, Node
>>> node = Node("node", variable="WaterLevel")
>>> element = Element("element", receivers=node)
>>> element.model = model
>>> from hydpy import IntegrationTest, pub
>>> pub.timegrids = "2000-01-01", "2000-01-03", "1d"
>>> test = IntegrationTest(element)
>>> test.dateformat = "%Y-%d-%m"
>>> node.sequences.sim.series = [2.0, 4.0]
>>> test()
Click to see the table
>>> from hydpy import round_
>>> round_(model.get_waterlevel_v1())
4.0
class hydpy.models.exch_waterlevel.Model[source]

Bases: AdHocModel, WaterLevelModel_V1

HydPy-Exch-WL (submodel for querying the water level from a remote node).

The following “receiver update methods” are called in the given sequence before performing a simulation step:
The following interface methods are available to main models using the defined model as a submodel:
DOCNAME: DocName = ('Exch-WL', 'submodel for querying the water level from a remote node')
REUSABLE_METHODS: ClassVar[tuple[type[ReusableMethod], ...]] = ()
class hydpy.models.exch_waterlevel.ReceiverSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)

Bases: ReceiverSequences

Receiver sequences of model exch_waterlevel.

The following classes are selected:
  • WaterLevel() The water level at a single remote location [m].