hydromt_delwaq.DelwaqModel.setup_hydrology_forcing#
- DelwaqModel.setup_hydrology_forcing(hydro_forcing_fn: str, starttime: str, endtime: str, timestepsecs: int = 86400, add_volume_offset: bool = True, min_volume: float = 0.1, override: List = [])[source]#
Prepare Delwaq hydrological fluxes.
As the fluxes order should precisely match the pointer defined in setup_basemaps, the variables names in
hydro_forcing_fn
should match names defined in thefluxes
argument of setup_basemaps. These names should also have been saved in the file config/B7_flow.inc.If several sub-variables in
hydro_forcing_fn
need to be summed up to get the expected flux in pointer, they can be named {flux_name_in_pointer}_{number} (eg “sfw>sfw_1” and “sfw>sfw_2” to get “sfw>sfw”) and the function will sum them on the fly. To remove (- instead of +) use unit_mult attribute of the data catalogwith -1 for the sub-variables of interest. To override rather than sum fluxes, use theoverride
argument and name of the concerned flux (eg “sfw>sfw”). The flux are overwritten (excluding nodata) in the order of the list, so the last one will be the one used.Unit conversions are possible from mm/area to m3/s for fluxes, volumes should be provided directly in m3. For conversion from mm to m3/s, it is possible to specify over wich surface area the mm are calculated. If ‘mm’ (default), the cellarea is assumed. Else, you can use ‘mm/{surfacearea}’ where {surfacearea} should be a map available in hydromaps (rivarea, lakearea, resarea).
Adds model layers:
B1_timestamp config: timestamp at the beginning of the simulation.
B2_outputtimes config: start and end timestamp for the delwaq outputs.
B2_sysclock config: model timestep.
B2_timers config: timers info (start, end, timstep…).
flow dynmap: water fluxes [m3/s]
volume dynmap: water volumes [m3]
- Parameters:
hydro_forcing_fn ({'None', 'name in local_sources.yml'}) –
Either None, or name in a local or global data_sources.yml file. Names of fluxes should match those as set in the
fluxes
list of setup_basemaps methods (pointer creation).Required variables (to be deprecated): [‘time’, ‘run’, ‘vol’ or ‘lev’, ‘inwater’]
startime (str) – Timestamp of the start of Delwaq simulation. Format: YYYY-mm-dd HH:MM:SS
endtime (str) – Timestamp of the end of Delwaq simulation.Format: YYYY-mm-dd HH:MM:SS
timestepsecs (int) – Model timestep in seconds. By default 86400.
add_volume_offset (bool, optional) – Delwaq needs water volumes at the beginning of the timestep. In some models, like wflow, volumes are written at the end of the timestep and therefore an offset of one timestep needs to be added for consistency.
min_volume (float, optional) – Add a minimum value to all the volumes in Delwaq to avoid zeros. Default is 0.1m3.
override (list, optional) – List of fluxes/volumes to override for non nodata values rather than sum. The last one (based on _number) has priority.