From b0d6818899c86c484f178f026399defcc300e494 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Thu, 23 Apr 2026 14:57:38 +0000 Subject: [PATCH 01/35] Added MCT Headwater module (wiring) --- src/lisflood/Lisflood_initial.py | 15 ++ src/lisflood/global_modules/checkers.py | 2 +- .../hydrological_modules/mctheadwater.py | 156 ++++++++++++++++++ .../hydrological_modules/reservoir.py | 2 +- src/lisflood/hydrological_modules/routing.py | 5 +- 5 files changed, 177 insertions(+), 3 deletions(-) create mode 100755 src/lisflood/hydrological_modules/mctheadwater.py diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index 346c1dff..6f31a679 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -49,6 +49,7 @@ from .hydrological_modules.surface_routing import surface_routing from .hydrological_modules.reservoir import Reservoir from .hydrological_modules.lakes import lakes +from .hydrological_modules.mctheadwater import mctheadwater from .hydrological_modules.polder import polder from .hydrological_modules.waterabstraction import waterabstraction from .hydrological_modules.indicatorcalc import indicatorcalc @@ -138,6 +139,7 @@ def __init__(self): self.surface_routing_module = surface_routing(self) self.reservoir_module = Reservoir(self) # get_reservoir(option['reservoirHanazaki']) self.lakes_module = lakes(self) + self.mctheadwater_module = mctheadwater(self) self.polder_module = polder(self) self.waterabstraction_module = waterabstraction(self) self.indicatorcalc_module = indicatorcalc(self) @@ -220,6 +222,19 @@ def __init__(self): if option.get('MCTRouting'): self.routing_module.initialMCT() # initialising Muskingum-Cunge-Todini routing for channel + self.mctheadwater_module.initial() + # adding MCT checkpoints to structures + + # #### inflowbug + # self.structures_module.initial() + # # Structures such as reservoirs and lakes are modelled by interrupting the channel flow paths + + # #### + # self.routing_module.initialSecond() + # # CHANNEL INITIAL SPLIT UP IN SECOND CHANNEL + # self.surface_routing_module.initialSecond() + # # #### inflowbug + self.evapowater_module.initial() self.riceirrigation_module.initial() diff --git a/src/lisflood/global_modules/checkers.py b/src/lisflood/global_modules/checkers.py index 33bc1c24..f701fd7a 100755 --- a/src/lisflood/global_modules/checkers.py +++ b/src/lisflood/global_modules/checkers.py @@ -26,7 +26,7 @@ from ..hydrological_modules import (surface_routing, evapowater, snow, routing, leafarea, inflow, waterlevel, waterbalance, wateruse, waterabstraction, lakes, riceirrigation, indicatorcalc, landusechange, frost, groundwater, miscInitial, soilloop, soil, - reservoir, transmission) + reservoir, transmission, mctheadwater) class ModulesInputs: diff --git a/src/lisflood/hydrological_modules/mctheadwater.py b/src/lisflood/hydrological_modules/mctheadwater.py new file mode 100755 index 00000000..715d553b --- /dev/null +++ b/src/lisflood/hydrological_modules/mctheadwater.py @@ -0,0 +1,156 @@ +""" + +Copyright 2019 European Union + +Licensed under the EUPL, Version 1.2 or as soon they will be approved by the European Commission +subsequent versions of the EUPL (the "Licence"); + +You may not use this work except in compliance with the Licence. +You may obtain a copy of the Licence at: + +https://joinup.ec.europa.eu/sites/default/files/inline-files/EUPL%20v1_2%20EN(1).txt + +Unless required by applicable law or agreed to in writing, +software distributed under the Licence is distributed on an "AS IS" basis, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the Licence for the specific language governing permissions and limitations under the Licence. + +""" + +from __future__ import print_function, absolute_import + +from pcraster import scalar, numpy2pcr, Nominal, setclone, Boolean, pcr2numpy, upstream +from pcraster import Scalar, numpy2pcr, Nominal, setclone, Boolean, pcr2numpy + +from nine import range + +import warnings + +from pcraster.operations import ifthen, boolean, defined, lookupscalar +import numpy as np + +from ..global_modules.settings import LisSettings, MaskInfo +from ..global_modules.add1 import loadmap, compressArray, decompress, makenumpy +from ..global_modules.errors import LisfloodWarning +from . import HydroModule + + +class mctheadwater(HydroModule): + """ + Adds upstream discharge as a lateral flux at headwater and source grid cells when MCT routing is enabled. + + This module handles the initialization and dynamic simulation of checkpoints, accounting for + inflow and outflow. It can be used in MCT channels to account for headwater/source grid cells. + It injects upstream discharge to the downstream grid cell as lateral inflow. + + Attributes: + ----------- + var (object): An object containing all the variables used within the reservoir module. + + Methods: + -------- + initial(): Sets up the initial conditions and parameters for the simulation, + including headwater/source locations. + dynamic_inloop(NoRoutingExecuted: int): Performs dynamic calculations within the routing + loop to simulate inflow and outflow from the headwater/source. + """ + + # input_files_keys = {'mctheadwater': ['Checkpoints']} + module_name = 'MCTHeadwater' + + def __init__(self, mctheadwater_variable): + self.var = mctheadwater_variable + + def __init__(self, mctheadwater_variable): + """ + Initializes the MCT headwater/source module with a given variable object. + + Parameters: + ----------- + mctheadwater_variable: object + An object containing the variables needed for the MCT headwater/source simulation. + """ + + self.var = mctheadwater_variable + + def initial(self): + """ + Initiates the MCT headwater/source module by loading the necessary data and maps. + """ + + settings = LisSettings.instance() + option = settings.options + binding = settings.binding + maskinfo = MaskInfo.instance() + if option['MCTRouting']: + + mctsource = loadmap('InflowPoints') ### temporary da cambiare addiungendo una chiave in settings + mctsource[(mctsource < 1) | (self.var.IsChannel == 0)] = 0 + # load MCT source locations and keep only those on the channel network + + + UpStreamPcr = upstream(self.var.LddChan, scalar(self.var.IsChannelPcr)) + UpStream = pcr2numpy(UpStreamPcr, 0) + # identify all channel pixels that do not have any contributing pixel from upstream (head pixels) + + UpStreamMCTPcr = upstream(self.var.LddChan, scalar(self.var.IsChannelMCTPcr)) + UpStreamMCT = pcr2numpy(UpStreamMCTPcr, 0) + # identify all MCT pixels that do not have any contributing pixel from upstream (MCT head pixels) + + mctheadwater = (self.var.mctmask & (UpStreamMCT == 0) & (UpStream != 0)).astype(int) + # identify pixels in the MCT network that are head MCT pixels and are not general head pixels + + mctheadwater = compressArray(numpy2pcr(Scalar, mctheadwater, 0)) + mctheadwater[np.isnan(mctheadwater)] = 0.0 + # flatten and add mask + + self.var.CheckpointSitesC = ((mctsource == 1) | (mctheadwater == 1)).astype(int) #np + # merge source points and headwater points to create the full list of checkpoints + + self.var.CheckpointSitesC = mctsource + self.var.CheckpointSitesCC = np.compress(mctsource > 0, mctsource) + self.var.CheckpointIndex = np.nonzero(mctsource)[0] + + + def dynamic_inloop(self, NoRoutingExecuted: int): + """ + Performs the dynamic simulation of MCT headwater/source within the routing loop. This method + injects upstream discharge to the downstream grid cell as lateral inflow. + + Parameters: + ----------- + NoRoutingExecuted: integer + The number of routing sub-steps that have been executed. This parameter is used to manage + the accumulation of inflow and outflow over the routing steps. + """ + + settings = LisSettings.instance() + option = settings.options + maskinfo = MaskInfo.instance() + + if option['MCTRouting'] and not option['InitLisflood']: + + InvDtSecDay = 1 / float(86400) + # InvDtSecDay=self.var.InvDtSec + + # reservoir inflow in [m3/s] + # (LddStructuresKinematic equals LddKinematic, but without the pits/sinks upstream of the structure + # locations; note that using Ldd here instead would introduce MV!) + inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.ReservoirIndex] + + # reservoir outflow in [m3] per sub step + outflow_m3 = inflow * self.var.DtRouting + + # expanding the size as input for routing routine + # this is released to the channel again at each sub timestep + self.var.QResOutM3Dt = maskinfo.in_zero() + np.put(self.var.QResOutM3Dt, self.var.ReservoirIndex, outflow_m3) + + + if NoRoutingExecuted == (self.var.NoRoutSteps - 1): + + # expanding the size after last sub timestep + self.var.ReservoirStorageM3 = maskinfo.in_zero() + self.var.ReservoirFill = maskinfo.in_zero() + np.put(self.var.ReservoirStorageM3, self.var.ReservoirIndex, self.var.ReservoirStorageM3CC) + np.put(self.var.ReservoirFill, self.var.ReservoirIndex, self.var.ReservoirFillCC) diff --git a/src/lisflood/hydrological_modules/reservoir.py b/src/lisflood/hydrological_modules/reservoir.py index 26d0b72a..cd15b6a4 100755 --- a/src/lisflood/hydrological_modules/reservoir.py +++ b/src/lisflood/hydrological_modules/reservoir.py @@ -52,7 +52,7 @@ class Reservoir(HydroModule): dynamic_inloop(NoRoutingExecuted: int): Performs dynamic calculations within the routing loop to simulate inflow, storage, and controlled outflow from the reservoirs. - Referenecs: + References: ----------- Hanazaki, R., Yamazaki, D., Yoshimura, K.: Development of a Reservoir Flood Control Scheme for Global Flood Models, Journal of Advances in Modeling Earth Systems, 14, diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index feb2fc7d..676801f3 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -16,7 +16,7 @@ """ from __future__ import print_function, absolute_import -from pcraster import lddmask, accuflux, boolean, downstream, pit, path, lddrepair, ifthenelse, cover, nominal, uniqueid, \ +from pcraster import lddmask, accuflux, boolean, scalar, downstream, pit, path, lddrepair, ifthenelse, cover, nominal, uniqueid, \ catchment, upstream, pcr2numpy import warnings @@ -30,6 +30,7 @@ from .transmission import transmission from .kinematic_wave_parallel import kinematicWave, kwpt from .mct import MCTWave +from .mctheadwater import mctheadwater from ..global_modules.settings import LisSettings, MaskInfo from ..global_modules.errors import LisfloodWarning @@ -61,6 +62,7 @@ def __init__(self, routing_variable): self.polder_module = polder(self.var) self.inflow_module = inflow(self.var) self.transmission_module = transmission(self.var) + self.mctheadwater_module = mctheadwater(self.var) # -------------------------------------------------------------------------- # -------------------------------------------------------------------------- @@ -603,6 +605,7 @@ def initialMCT(self): self.var.PrevDm0 = np.where(PrevDmMCT == -9999, maskinfo.in_zero(), PrevDmMCT) #np # Reynolds number (Dm) for MCT at previous time step t0 + # ************************************************************ # ***** INITIALISE MUSKINGUM-CUNGE-TODINI WAVE ROUTER ******** # ************************************************************ From 2e90d0a581eeb4522565e90788792b4655f82732 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Tue, 28 Apr 2026 13:28:27 +0000 Subject: [PATCH 02/35] MCT Headwater pixels now getting contribution from upstream as sideflow (wiring 2) --- src/lisflood/Lisflood_initial.py | 10 ++--- .../hydrological_modules/mctheadwater.py | 43 +++++++++++-------- src/lisflood/hydrological_modules/routing.py | 23 ++++++++-- 3 files changed, 49 insertions(+), 27 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index 6f31a679..500dd34f 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -209,8 +209,8 @@ def __init__(self): self.transmission_module.initial() - self.structures_module.initial() - # Structures such as reservoirs and lakes are modelled by interrupting the channel flow paths + # self.structures_module.initial() + # # Structures such as reservoirs and lakes are modelled by interrupting the channel flow paths # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- @@ -223,11 +223,11 @@ def __init__(self): self.routing_module.initialMCT() # initialising Muskingum-Cunge-Todini routing for channel self.mctheadwater_module.initial() - # adding MCT checkpoints to structures + # adding MCT headwater to structures # #### inflowbug - # self.structures_module.initial() - # # Structures such as reservoirs and lakes are modelled by interrupting the channel flow paths + self.structures_module.initial() + # Structures such as reservoirs and lakes and MCT headwater are modelled by interrupting the channel flow paths # #### # self.routing_module.initialSecond() diff --git a/src/lisflood/hydrological_modules/mctheadwater.py b/src/lisflood/hydrological_modules/mctheadwater.py index 715d553b..3d336eed 100755 --- a/src/lisflood/hydrological_modules/mctheadwater.py +++ b/src/lisflood/hydrological_modules/mctheadwater.py @@ -84,9 +84,9 @@ def initial(self): maskinfo = MaskInfo.instance() if option['MCTRouting']: - mctsource = loadmap('InflowPoints') ### temporary da cambiare addiungendo una chiave in settings - mctsource[(mctsource < 1) | (self.var.IsChannel == 0)] = 0 - # load MCT source locations and keep only those on the channel network + # mctsource = loadmap('InflowPoints') ### temporary da cambiare addiungendo una chiave in settings + # mctsource[(mctsource < 1) | (self.var.IsChannel == 0)] = 0 + # # load MCT source locations and keep only those on the channel network UpStreamPcr = upstream(self.var.LddChan, scalar(self.var.IsChannelPcr)) @@ -104,12 +104,21 @@ def initial(self): mctheadwater[np.isnan(mctheadwater)] = 0.0 # flatten and add mask - self.var.CheckpointSitesC = ((mctsource == 1) | (mctheadwater == 1)).astype(int) #np - # merge source points and headwater points to create the full list of checkpoints + # self.var.CheckpointSitesC = ((mctsource == 1) | (mctheadwater == 1)).astype(int) #np + # # merge source points and headwater points to create the full list of checkpoints - self.var.CheckpointSitesC = mctsource - self.var.CheckpointSitesCC = np.compress(mctsource > 0, mctsource) - self.var.CheckpointIndex = np.nonzero(mctsource)[0] + self.var.MCTHeadwaterSitesC = mctheadwater + self.var.MCTHeadwaterSitesCC = np.compress(mctheadwater > 0, mctheadwater) + self.var.MCTHeadwaterIndex = np.nonzero(mctheadwater)[0] + + # Add MCT headwater locations to structures map + # (used to modify LddKinematic and to calculate LddStructuresKinematic) + self.var.IsStructureKinematic = np.where(self.var.MCTHeadwaterSitesC > 0, np.bool8(1), self.var.IsStructureKinematic) + # Add reservoir locations to structures map (used to modify LddKinematic + # and to calculate LddStructuresKinematic) + self.var.IsStructureChan = np.where(self.var.MCTHeadwaterSitesC > 0, np.bool8(1), self.var.IsStructureChan) + # Add reservoir locations to structures map (used to modify LddChan + # and to calculate LddStructuresChan) def dynamic_inloop(self, NoRoutingExecuted: int): @@ -136,21 +145,17 @@ def dynamic_inloop(self, NoRoutingExecuted: int): # reservoir inflow in [m3/s] # (LddStructuresKinematic equals LddKinematic, but without the pits/sinks upstream of the structure # locations; note that using Ldd here instead would introduce MV!) - inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.ReservoirIndex] + inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.MCTHeadwaterIndex] # reservoir outflow in [m3] per sub step outflow_m3 = inflow * self.var.DtRouting + ###### + # outflow_m3 = outflow_m3 / outflow_m3 * 999999 + ##### + # expanding the size as input for routing routine # this is released to the channel again at each sub timestep - self.var.QResOutM3Dt = maskinfo.in_zero() - np.put(self.var.QResOutM3Dt, self.var.ReservoirIndex, outflow_m3) - - - if NoRoutingExecuted == (self.var.NoRoutSteps - 1): + self.var.QHeadOutM3Dt = maskinfo.in_zero() + np.put(self.var.QHeadOutM3Dt, self.var.MCTHeadwaterIndex, outflow_m3) - # expanding the size after last sub timestep - self.var.ReservoirStorageM3 = maskinfo.in_zero() - self.var.ReservoirFill = maskinfo.in_zero() - np.put(self.var.ReservoirStorageM3, self.var.ReservoirIndex, self.var.ReservoirStorageM3CC) - np.put(self.var.ReservoirFill, self.var.ReservoirIndex, self.var.ReservoirFillCC) diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 676801f3..833520de 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -647,6 +647,7 @@ def dynamic(self, NoRoutingExecuted): self.inflow_module.dynamic_inloop(NoRoutingExecuted) self.transmission_module.dynamic_inloop(NoRoutingExecuted) + # ************************************************************ # ***** CHANNEL FLOW ROUTING: KINEMATIC WAVE **************** # ************************************************************ @@ -784,9 +785,10 @@ def dynamic(self, NoRoutingExecuted): # This is calculated for MCT grid cell only but takes the output of kinematic or split routing. # First, Kinematic/Split routing is solved on all pixels (including MCT pixels) then results are updated # for the MCT pixels. - - # Sideflow contribution to MCT grid cells expressed in [m3/s] - SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql + + + # # Sideflow contribution to MCT grid cells expressed in [m3/s] + # SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql # Grab outflow at the end of the previous routing step t for all pixels) - current state of the MCT pixel ChanQ_0 = self.var.ChanQ.copy() # Outflow (x+dx) at time t (end of previous routing step) (instant) -> used to calc q00 @@ -798,6 +800,21 @@ def dynamic(self, NoRoutingExecuted): self.var.ChanM3 = ChanM3 self.var.ChanQAvgDt = ChanQAvgDt # -> used to calc q0m + + #################### + + self.mctheadwater_module.dynamic_inloop(NoRoutingExecuted) + # calculate sideflow from MCT headwater pixels + + SideflowChanM3 += self.var.QHeadOutM3Dt + # MCT headwater pixles outflow volume per routing sub step [m3] + + # Sideflow contribution to MCT grid cells expressed in [m3/s] + SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql + + #################### + + # Solve MCT routing and update current state at MCT pixels self.mct_river_router.routing( ChanQ_0, # -> used to calc q00 From 825110db9a10363b10aab994496fbf38cb6bc17c Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Tue, 28 Apr 2026 18:10:08 +0000 Subject: [PATCH 03/35] Wiring of MCT headwater is working but needs changes to self.river_router = kinematicWave --- src/lisflood/Lisflood_initial.py | 5 +++- .../hydrological_modules/mctheadwater.py | 23 +++++++++++-------- src/lisflood/hydrological_modules/routing.py | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index 500dd34f..c127c22d 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -219,16 +219,19 @@ def __init__(self): # CHANNEL INITIAL SPLIT UP IN SECOND CHANNEL self.surface_routing_module.initialSecond() + if option.get('MCTRouting'): self.routing_module.initialMCT() # initialising Muskingum-Cunge-Todini routing for channel self.mctheadwater_module.initial() # adding MCT headwater to structures - # #### inflowbug self.structures_module.initial() # Structures such as reservoirs and lakes and MCT headwater are modelled by interrupting the channel flow paths + + + # #### # self.routing_module.initialSecond() # # CHANNEL INITIAL SPLIT UP IN SECOND CHANNEL diff --git a/src/lisflood/hydrological_modules/mctheadwater.py b/src/lisflood/hydrological_modules/mctheadwater.py index 3d336eed..2002e1ab 100755 --- a/src/lisflood/hydrological_modules/mctheadwater.py +++ b/src/lisflood/hydrological_modules/mctheadwater.py @@ -111,6 +111,8 @@ def initial(self): self.var.MCTHeadwaterSitesCC = np.compress(mctheadwater > 0, mctheadwater) self.var.MCTHeadwaterIndex = np.nonzero(mctheadwater)[0] + self.var.QInHeadM3Old = np.where(self.var.MCTHeadwaterSitesC > 0, self.var.ChanQAvgDt * self.var.DtSec, 0) # self.var.QInM3Old + # Add MCT headwater locations to structures map # (used to modify LddKinematic and to calculate LddStructuresKinematic) self.var.IsStructureKinematic = np.where(self.var.MCTHeadwaterSitesC > 0, np.bool8(1), self.var.IsStructureKinematic) @@ -121,6 +123,10 @@ def initial(self): # and to calculate LddStructuresChan) + + + + def dynamic_inloop(self, NoRoutingExecuted: int): """ Performs the dynamic simulation of MCT headwater/source within the routing loop. This method @@ -145,17 +151,14 @@ def dynamic_inloop(self, NoRoutingExecuted: int): # reservoir inflow in [m3/s] # (LddStructuresKinematic equals LddKinematic, but without the pits/sinks upstream of the structure # locations; note that using Ldd here instead would introduce MV!) - inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.MCTHeadwaterIndex] + inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.MCTHeadwaterIndex] #same as Qin + inflow = self.var.ChanQAvgDt[7] #this is just to make it the same as the inflow run REMOVE - # reservoir outflow in [m3] per sub step - outflow_m3 = inflow * self.var.DtRouting + self.var.QInHeadM3 = maskinfo.in_zero() + np.put(self.var.QInHeadM3, self.var.MCTHeadwaterIndex, inflow * self.var.DtSec) + self.var.QDeltaM3 = (self.var.QInHeadM3 - self.var.QInHeadM3Old) * self.var.InvNoRoutSteps - ###### - # outflow_m3 = outflow_m3 / outflow_m3 * 999999 - ##### + self.var.QHeadM3Dt = (self.var.QInHeadM3Old + (NoRoutingExecuted + 1) * self.var.QDeltaM3) * self.var.InvNoRoutSteps + pass - # expanding the size as input for routing routine - # this is released to the channel again at each sub timestep - self.var.QHeadOutM3Dt = maskinfo.in_zero() - np.put(self.var.QHeadOutM3Dt, self.var.MCTHeadwaterIndex, outflow_m3) diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 833520de..1176d8b5 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -806,7 +806,7 @@ def dynamic(self, NoRoutingExecuted): self.mctheadwater_module.dynamic_inloop(NoRoutingExecuted) # calculate sideflow from MCT headwater pixels - SideflowChanM3 += self.var.QHeadOutM3Dt + SideflowChanM3 += self.var.QHeadM3Dt # MCT headwater pixles outflow volume per routing sub step [m3] # Sideflow contribution to MCT grid cells expressed in [m3/s] From e90f15b6d1ae2189d3c7a1fe1f558835c6b2352b Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Wed, 29 Apr 2026 13:13:26 +0000 Subject: [PATCH 04/35] MCT headwater point giving same output as inflow point - downstream routing needs fixing --- src/lisflood/Lisflood_initial.py | 21 ++-- .../hydrological_modules/mctheadwater.py | 22 ++++- src/lisflood/hydrological_modules/routing.py | 98 ++++++++++++++----- 3 files changed, 99 insertions(+), 42 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index c127c22d..e06528b2 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -207,36 +207,29 @@ def __init__(self): self.lakes_module.initial() self.polder_module.initial() + self.mctheadwater_module.initial() + self.transmission_module.initial() - # self.structures_module.initial() - # # Structures such as reservoirs and lakes are modelled by interrupting the channel flow paths + self.structures_module.initial() + # Structures such as reservoirs and lakes are modelled by interrupting the channel flow paths # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- self.routing_module.initialSecond() # CHANNEL INITIAL SPLIT UP IN SECOND CHANNEL + self.surface_routing_module.initialSecond() + self.routing_module.initialKinematicWave() if option.get('MCTRouting'): self.routing_module.initialMCT() # initialising Muskingum-Cunge-Todini routing for channel - self.mctheadwater_module.initial() + self.mctheadwater_module.dynamic_init() # adding MCT headwater to structures - self.structures_module.initial() - # Structures such as reservoirs and lakes and MCT headwater are modelled by interrupting the channel flow paths - - - - - # #### - # self.routing_module.initialSecond() - # # CHANNEL INITIAL SPLIT UP IN SECOND CHANNEL - # self.surface_routing_module.initialSecond() - # # #### inflowbug self.evapowater_module.initial() diff --git a/src/lisflood/hydrological_modules/mctheadwater.py b/src/lisflood/hydrological_modules/mctheadwater.py index 2002e1ab..0cf07db9 100755 --- a/src/lisflood/hydrological_modules/mctheadwater.py +++ b/src/lisflood/hydrological_modules/mctheadwater.py @@ -111,8 +111,6 @@ def initial(self): self.var.MCTHeadwaterSitesCC = np.compress(mctheadwater > 0, mctheadwater) self.var.MCTHeadwaterIndex = np.nonzero(mctheadwater)[0] - self.var.QInHeadM3Old = np.where(self.var.MCTHeadwaterSitesC > 0, self.var.ChanQAvgDt * self.var.DtSec, 0) # self.var.QInM3Old - # Add MCT headwater locations to structures map # (used to modify LddKinematic and to calculate LddStructuresKinematic) self.var.IsStructureKinematic = np.where(self.var.MCTHeadwaterSitesC > 0, np.bool8(1), self.var.IsStructureKinematic) @@ -123,7 +121,21 @@ def initial(self): # and to calculate LddStructuresChan) + def dynamic_init(self): + """ Initialization of the dynamic part of the MCT headwater module + init mct headwater before sub step routing + """ + # ************************************************************ + # ***** HEADWATER INIT + # ************************************************************ + settings = LisSettings.instance() + option = settings.options + if option['MCTRouting']: + self.var.QInHeadM3Old = np.where(self.var.MCTHeadwaterSitesC > 0, self.var.ChanQAvgDt * self.var.DtSec, 0) # self.var.QInM3Old + # difference between old and new headwater flow per sub step + # in order to calculate the amount of headwater flow in the routing loop + pass @@ -152,13 +164,17 @@ def dynamic_inloop(self, NoRoutingExecuted: int): # (LddStructuresKinematic equals LddKinematic, but without the pits/sinks upstream of the structure # locations; note that using Ldd here instead would introduce MV!) inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.MCTHeadwaterIndex] #same as Qin - inflow = self.var.ChanQAvgDt[7] #this is just to make it the same as the inflow run REMOVE + # inflow = self.var.ChanQAvgDt[7] #this is just to make it the same as the inflow run REMOVE self.var.QInHeadM3 = maskinfo.in_zero() np.put(self.var.QInHeadM3, self.var.MCTHeadwaterIndex, inflow * self.var.DtSec) self.var.QDeltaM3 = (self.var.QInHeadM3 - self.var.QInHeadM3Old) * self.var.InvNoRoutSteps self.var.QHeadM3Dt = (self.var.QInHeadM3Old + (NoRoutingExecuted + 1) * self.var.QDeltaM3) * self.var.InvNoRoutSteps + # output to the MCT headwater cells + + self.var.QInHeadM3Old = self.var.QInHeadM3.copy() + # save the upstream inflow for next step pass diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 1176d8b5..c05452a0 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -176,6 +176,46 @@ def initial(self): self.var.LddKinematic = self.var.LddChan self.var.LddKinematicNp = compressArray(self.var.LddKinematic) # np + + # ************************************************************ + # ***** MCT DRAINAGE NETWORK GEOMETRY - LDD ***************** + # ************************************************************ + if option['MCTRouting']: + + self.var.IsChannelMCTPcr = boolean(loadmap('ChannelsMCT', pcr=True)) # pcr + # load mask of MCT river grid cells + self.var.IsChannelMCT = np.bool8(compressArray(self.var.IsChannelMCTPcr)) # bool + + # even if MCT is active, it should be deactivated if there is no MCT cell in the domain + if self.var.IsChannelMCT.sum() == 0: + warnings.warn(LisfloodWarning('There are no MCT grid cell. MCT routing is deactivated')) + option['MCTRouting'] = False + # rebuild lists of reported files with MCTRouting = False + settings.build_reportedmaps_dicts() + + if option['MCTRouting'] and not option['InitLisflood']: + + self.var.IsChannelMCTPcr = boolean(decompress(self.var.IsChannelMCT)) # pcr + # Identify channel pixels where Muskingum-Cunge-Todini is used + + self.var.mctmask = np.bool8(pcr2numpy(self.var.IsChannelMCTPcr,0)) + # Create a mask with cells using MCT + + self.var.IsChannelKinematicPcr = (self.var.IsChannelPcr == 1) & (self.var.IsChannelMCTPcr == 0) #pcr + self.var.IsChannelKinematic = np.bool8(compressArray(self.var.IsChannelKinematicPcr)) #np + # Identify channel pixels where Kinematic wave is used instead of MCT + + self.var.LddMCT = lddmask(self.var.LddChan, self.var.IsChannelMCTPcr) #pcr + # Ldd for MCT routing + + self.var.LddKinematic = lddmask(self.var.LddChan, self.var.IsChannelKinematicPcr) #pcr + # Ldd for kinematic routing + + + # ************************************************************ + # ***** MCT DRAINAGE NETWORK GEOMETRY - LDD ***************** + # ************************************************************ + self.var.AtLastPoint = boolean(pit(self.var.Ldd)) #pcr # Assign True to each of the grid cells where there are outlet points # Function 'pit' assigns a unique number starting from 1 to pit cells (ldd=5) in the Ldd @@ -489,6 +529,14 @@ def initialSecond(self): self.var.ChanQKin = (self.var.ChanM3Kin * self.var.InvChanLength * self.var.InvChannelAlpha) ** (self.var.InvBeta) # (Real) outflow from main channel when second line of routing is active (= using riverbed Manning coeff 2) + def initialKinematicWave(self): + """ Initialization of the parallel kinematic wave router for Kinematic routing and SplitRouting: + main channel-only routing if self.var.ChannelAlpha2 is None; else split-routing(main channel + floodplains). + Initialization uses LDD for kinematic routing (LddKinematic) + """ + settings = LisSettings.instance() + option = settings.options + flags = settings.flags # ************************************************************ # ***** INITIALISE PARALLEL KINEMATIC WAVE ROUTER ************ @@ -556,34 +604,34 @@ def initialMCT(self): # ***** INITIALISATION FOR MCT ROUTING ************ # ************************************************************ - # even if MCT is active, it should be deactivated if there is no MCT cell in the domain - if option['MCTRouting']: - self.var.IsChannelMCTPcr = boolean(loadmap('ChannelsMCT', pcr=True)) #pcr - self.var.IsChannelMCT = np.bool8(compressArray(self.var.IsChannelMCTPcr)) #bool - if self.var.IsChannelMCT.sum()==0: - warnings.warn(LisfloodWarning('There are no MCT grid cell. MCT routing is deactivated')) - option['MCTRouting'] = False - # rebuild lists of reported files with MCTRouting = False - settings.build_reportedmaps_dicts() + # # even if MCT is active, it should be deactivated if there is no MCT cell in the domain + # if option['MCTRouting']: + # self.var.IsChannelMCTPcr = boolean(loadmap('ChannelsMCT', pcr=True)) #pcr + # self.var.IsChannelMCT = np.bool8(compressArray(self.var.IsChannelMCTPcr)) #bool + # if self.var.IsChannelMCT.sum()==0: + # warnings.warn(LisfloodWarning('There are no MCT grid cell. MCT routing is deactivated')) + # option['MCTRouting'] = False + # # rebuild lists of reported files with MCTRouting = False + # settings.build_reportedmaps_dicts() if option['MCTRouting'] and not option['InitLisflood']: maskinfo = MaskInfo.instance() - self.var.IsChannelMCTPcr = boolean(decompress(self.var.IsChannelMCT)) # pcr - # Identify channel pixels where Muskingum-Cunge-Todini is used - - self.var.mctmask = np.bool8(pcr2numpy(self.var.IsChannelMCTPcr,0)) - # Create a mask with cells using MCT - - self.var.IsChannelKinematicPcr = (self.var.IsChannelPcr == 1) & (self.var.IsChannelMCTPcr == 0) #pcr - self.var.IsChannelKinematic = np.bool8(compressArray(self.var.IsChannelKinematicPcr)) #np - # Identify channel pixels where Kinematic wave is used instead of MCT - - self.var.LddMCT = lddmask(self.var.LddChan, self.var.IsChannelMCTPcr) #pcr - # Ldd for MCT routing - - self.var.LddKinematic = lddmask(self.var.LddChan, self.var.IsChannelKinematicPcr) #pcr - # Ldd for kinematic routing + # self.var.IsChannelMCTPcr = boolean(decompress(self.var.IsChannelMCT)) # pcr + # # Identify channel pixels where Muskingum-Cunge-Todini is used + # + # self.var.mctmask = np.bool8(pcr2numpy(self.var.IsChannelMCTPcr,0)) + # # Create a mask with cells using MCT + # + # self.var.IsChannelKinematicPcr = (self.var.IsChannelPcr == 1) & (self.var.IsChannelMCTPcr == 0) #pcr + # self.var.IsChannelKinematic = np.bool8(compressArray(self.var.IsChannelKinematicPcr)) #np + # # Identify channel pixels where Kinematic wave is used instead of MCT + # + # self.var.LddMCT = lddmask(self.var.LddChan, self.var.IsChannelMCTPcr) #pcr + # # Ldd for MCT routing + # + # self.var.LddKinematic = lddmask(self.var.LddChan, self.var.IsChannelKinematicPcr) #pcr + # # Ldd for kinematic routing ChanGradMaxMCT = loadmap('ChanGradMaxMCT') # Maximum riverbed slope for MCT rivers @@ -811,7 +859,7 @@ def dynamic(self, NoRoutingExecuted): # Sideflow contribution to MCT grid cells expressed in [m3/s] SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql - + SideflowChanMCTM3 = np.where(self.var.IsChannelMCT, SideflowChanM3, 0) #################### From b56a995424fe320316624f9d2a945dd7339b1b26 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Thu, 30 Apr 2026 13:34:44 +0000 Subject: [PATCH 05/35] Added initial kinematic wave funcion --- src/lisflood/Lisflood_initial.py | 13 +- .../hydrological_modules/mctheadwater.py | 4 +- src/lisflood/hydrological_modules/routing.py | 113 +++++------------- 3 files changed, 36 insertions(+), 94 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index e06528b2..a8073a1e 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -139,7 +139,7 @@ def __init__(self): self.surface_routing_module = surface_routing(self) self.reservoir_module = Reservoir(self) # get_reservoir(option['reservoirHanazaki']) self.lakes_module = lakes(self) - self.mctheadwater_module = mctheadwater(self) + # self.mctheadwater_module = mctheadwater(self) self.polder_module = polder(self) self.waterabstraction_module = waterabstraction(self) self.indicatorcalc_module = indicatorcalc(self) @@ -207,7 +207,8 @@ def __init__(self): self.lakes_module.initial() self.polder_module.initial() - self.mctheadwater_module.initial() + # MCT HEADWATER + # self.mctheadwater_module.initial() self.transmission_module.initial() @@ -220,18 +221,16 @@ def __init__(self): self.routing_module.initialSecond() # CHANNEL INITIAL SPLIT UP IN SECOND CHANNEL - self.surface_routing_module.initialSecond() - self.routing_module.initialKinematicWave() + self.surface_routing_module.initialSecond() + if option.get('MCTRouting'): self.routing_module.initialMCT() # initialising Muskingum-Cunge-Todini routing for channel - self.mctheadwater_module.dynamic_init() + # self.mctheadwater_module.dynamic_init() # adding MCT headwater to structures - - self.evapowater_module.initial() self.riceirrigation_module.initial() self.waterabstraction_module.initial() diff --git a/src/lisflood/hydrological_modules/mctheadwater.py b/src/lisflood/hydrological_modules/mctheadwater.py index 0cf07db9..3e6b577f 100755 --- a/src/lisflood/hydrological_modules/mctheadwater.py +++ b/src/lisflood/hydrological_modules/mctheadwater.py @@ -163,8 +163,8 @@ def dynamic_inloop(self, NoRoutingExecuted: int): # reservoir inflow in [m3/s] # (LddStructuresKinematic equals LddKinematic, but without the pits/sinks upstream of the structure # locations; note that using Ldd here instead would introduce MV!) - inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.MCTHeadwaterIndex] #same as Qin - # inflow = self.var.ChanQAvgDt[7] #this is just to make it the same as the inflow run REMOVE + # inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.MCTHeadwaterIndex] #same as Qin + inflow = self.var.ChanQAvgDt[7] #this is just to make it the same as the inflow run REMOVE self.var.QInHeadM3 = maskinfo.in_zero() np.put(self.var.QInHeadM3, self.var.MCTHeadwaterIndex, inflow * self.var.DtSec) diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index c05452a0..23cb293b 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -176,46 +176,6 @@ def initial(self): self.var.LddKinematic = self.var.LddChan self.var.LddKinematicNp = compressArray(self.var.LddKinematic) # np - - # ************************************************************ - # ***** MCT DRAINAGE NETWORK GEOMETRY - LDD ***************** - # ************************************************************ - if option['MCTRouting']: - - self.var.IsChannelMCTPcr = boolean(loadmap('ChannelsMCT', pcr=True)) # pcr - # load mask of MCT river grid cells - self.var.IsChannelMCT = np.bool8(compressArray(self.var.IsChannelMCTPcr)) # bool - - # even if MCT is active, it should be deactivated if there is no MCT cell in the domain - if self.var.IsChannelMCT.sum() == 0: - warnings.warn(LisfloodWarning('There are no MCT grid cell. MCT routing is deactivated')) - option['MCTRouting'] = False - # rebuild lists of reported files with MCTRouting = False - settings.build_reportedmaps_dicts() - - if option['MCTRouting'] and not option['InitLisflood']: - - self.var.IsChannelMCTPcr = boolean(decompress(self.var.IsChannelMCT)) # pcr - # Identify channel pixels where Muskingum-Cunge-Todini is used - - self.var.mctmask = np.bool8(pcr2numpy(self.var.IsChannelMCTPcr,0)) - # Create a mask with cells using MCT - - self.var.IsChannelKinematicPcr = (self.var.IsChannelPcr == 1) & (self.var.IsChannelMCTPcr == 0) #pcr - self.var.IsChannelKinematic = np.bool8(compressArray(self.var.IsChannelKinematicPcr)) #np - # Identify channel pixels where Kinematic wave is used instead of MCT - - self.var.LddMCT = lddmask(self.var.LddChan, self.var.IsChannelMCTPcr) #pcr - # Ldd for MCT routing - - self.var.LddKinematic = lddmask(self.var.LddChan, self.var.IsChannelKinematicPcr) #pcr - # Ldd for kinematic routing - - - # ************************************************************ - # ***** MCT DRAINAGE NETWORK GEOMETRY - LDD ***************** - # ************************************************************ - self.var.AtLastPoint = boolean(pit(self.var.Ldd)) #pcr # Assign True to each of the grid cells where there are outlet points # Function 'pit' assigns a unique number starting from 1 to pit cells (ldd=5) in the Ldd @@ -604,34 +564,34 @@ def initialMCT(self): # ***** INITIALISATION FOR MCT ROUTING ************ # ************************************************************ - # # even if MCT is active, it should be deactivated if there is no MCT cell in the domain - # if option['MCTRouting']: - # self.var.IsChannelMCTPcr = boolean(loadmap('ChannelsMCT', pcr=True)) #pcr - # self.var.IsChannelMCT = np.bool8(compressArray(self.var.IsChannelMCTPcr)) #bool - # if self.var.IsChannelMCT.sum()==0: - # warnings.warn(LisfloodWarning('There are no MCT grid cell. MCT routing is deactivated')) - # option['MCTRouting'] = False - # # rebuild lists of reported files with MCTRouting = False - # settings.build_reportedmaps_dicts() + # even if MCT is active, it should be deactivated if there is no MCT cell in the domain + if option['MCTRouting']: + self.var.IsChannelMCTPcr = boolean(loadmap('ChannelsMCT', pcr=True)) #pcr + self.var.IsChannelMCT = np.bool8(compressArray(self.var.IsChannelMCTPcr)) #bool + if self.var.IsChannelMCT.sum()==0: + warnings.warn(LisfloodWarning('There are no MCT grid cell. MCT routing is deactivated')) + option['MCTRouting'] = False + # rebuild lists of reported files with MCTRouting = False + settings.build_reportedmaps_dicts() if option['MCTRouting'] and not option['InitLisflood']: maskinfo = MaskInfo.instance() - # self.var.IsChannelMCTPcr = boolean(decompress(self.var.IsChannelMCT)) # pcr - # # Identify channel pixels where Muskingum-Cunge-Todini is used - # - # self.var.mctmask = np.bool8(pcr2numpy(self.var.IsChannelMCTPcr,0)) - # # Create a mask with cells using MCT - # - # self.var.IsChannelKinematicPcr = (self.var.IsChannelPcr == 1) & (self.var.IsChannelMCTPcr == 0) #pcr - # self.var.IsChannelKinematic = np.bool8(compressArray(self.var.IsChannelKinematicPcr)) #np - # # Identify channel pixels where Kinematic wave is used instead of MCT - # - # self.var.LddMCT = lddmask(self.var.LddChan, self.var.IsChannelMCTPcr) #pcr - # # Ldd for MCT routing - # - # self.var.LddKinematic = lddmask(self.var.LddChan, self.var.IsChannelKinematicPcr) #pcr - # # Ldd for kinematic routing + self.var.IsChannelMCTPcr = boolean(decompress(self.var.IsChannelMCT)) # pcr + # Identify channel pixels where Muskingum-Cunge-Todini is used + + self.var.mctmask = np.bool8(pcr2numpy(self.var.IsChannelMCTPcr,0)) + # Create a mask with cells using MCT + + self.var.IsChannelKinematicPcr = (self.var.IsChannelPcr == 1) & (self.var.IsChannelMCTPcr == 0) #pcr + self.var.IsChannelKinematic = np.bool8(compressArray(self.var.IsChannelKinematicPcr)) #np + # Identify channel pixels where Kinematic wave is used instead of MCT + + self.var.LddMCT = lddmask(self.var.LddChan, self.var.IsChannelMCTPcr) #pcr + # Ldd for MCT routing + + self.var.LddKinematic = lddmask(self.var.LddChan, self.var.IsChannelKinematicPcr) #pcr + # Ldd for kinematic routing ChanGradMaxMCT = loadmap('ChanGradMaxMCT') # Maximum riverbed slope for MCT rivers @@ -653,7 +613,6 @@ def initialMCT(self): self.var.PrevDm0 = np.where(PrevDmMCT == -9999, maskinfo.in_zero(), PrevDmMCT) #np # Reynolds number (Dm) for MCT at previous time step t0 - # ************************************************************ # ***** INITIALISE MUSKINGUM-CUNGE-TODINI WAVE ROUTER ******** # ************************************************************ @@ -695,7 +654,6 @@ def dynamic(self, NoRoutingExecuted): self.inflow_module.dynamic_inloop(NoRoutingExecuted) self.transmission_module.dynamic_inloop(NoRoutingExecuted) - # ************************************************************ # ***** CHANNEL FLOW ROUTING: KINEMATIC WAVE **************** # ************************************************************ @@ -761,6 +719,7 @@ def dynamic(self, NoRoutingExecuted): self.var.AddedTRUN -= np.take(np.bincount(self.var.Catchments, weights=self.var.WUseAddM3Dt.copy()),self.var.Catchments) # Sideflow contribution to kinematic and split routing grid cells expressed in [cu m /s / m channel length] + SideflowChan = np.where(self.var.IsChannelKinematic, SideflowChanM3 * self.var.InvChanLength * self.var.InvDtRouting,0) # ************************************************************ @@ -833,10 +792,9 @@ def dynamic(self, NoRoutingExecuted): # This is calculated for MCT grid cell only but takes the output of kinematic or split routing. # First, Kinematic/Split routing is solved on all pixels (including MCT pixels) then results are updated # for the MCT pixels. - - - # # Sideflow contribution to MCT grid cells expressed in [m3/s] - # SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql + + # Sideflow contribution to MCT grid cells expressed in [m3/s] + SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql # Grab outflow at the end of the previous routing step t for all pixels) - current state of the MCT pixel ChanQ_0 = self.var.ChanQ.copy() # Outflow (x+dx) at time t (end of previous routing step) (instant) -> used to calc q00 @@ -848,21 +806,6 @@ def dynamic(self, NoRoutingExecuted): self.var.ChanM3 = ChanM3 self.var.ChanQAvgDt = ChanQAvgDt # -> used to calc q0m - - #################### - - self.mctheadwater_module.dynamic_inloop(NoRoutingExecuted) - # calculate sideflow from MCT headwater pixels - - SideflowChanM3 += self.var.QHeadM3Dt - # MCT headwater pixles outflow volume per routing sub step [m3] - - # Sideflow contribution to MCT grid cells expressed in [m3/s] - SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql - SideflowChanMCTM3 = np.where(self.var.IsChannelMCT, SideflowChanM3, 0) - #################### - - # Solve MCT routing and update current state at MCT pixels self.mct_river_router.routing( ChanQ_0, # -> used to calc q00 From 0553809e565d5d58af443713bbdec69f742614ce Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Thu, 30 Apr 2026 14:10:12 +0000 Subject: [PATCH 06/35] Moved initialisation of mct_mask from initialMCT to initial --- src/lisflood/hydrological_modules/routing.py | 61 +++++++++++++++----- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 23cb293b..580c1093 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -74,7 +74,6 @@ def initial(self): flags = settings.flags maskinfo = MaskInfo.instance() - # ************************************************************ # ***** NUMBER OF ROUTING STEPS ********************* # ************************************************************ @@ -176,6 +175,37 @@ def initial(self): self.var.LddKinematic = self.var.LddChan self.var.LddKinematicNp = compressArray(self.var.LddKinematic) # np + # ************************************************************ + # ***** MCT DRAINAGE NETWORK GEOMETRY - LDD ***************** + # ************************************************************ + + if option['MCTRouting']: + + self.var.IsChannelMCTPcr = boolean(loadmap('ChannelsMCT', pcr=True)) # pcr + # load mask of MCT river grid cells + self.var.IsChannelMCT = np.bool8(compressArray(self.var.IsChannelMCTPcr)) # bool + + # even if MCT is active, it should be deactivated if there is no MCT cell in the domain + if self.var.IsChannelMCT.sum() == 0: + warnings.warn(LisfloodWarning('There are no MCT grid cell. MCT routing is deactivated')) + option['MCTRouting'] = False + # rebuild lists of reported files with MCTRouting = False + settings.build_reportedmaps_dicts() + + if option['MCTRouting'] and not option['InitLisflood']: + + self.var.IsChannelMCTPcr = boolean(decompress(self.var.IsChannelMCT)) # pcr + # Identify channel pixels where Muskingum-Cunge-Todini is used + + self.var.mctmask = np.bool8(pcr2numpy(self.var.IsChannelMCTPcr,0)) + # Create a mask with cells using MCT + + # both variables are necessary to include MCT headwater pixels in the LDD as structures + + # ************************************************************ + # ***** MCT DRAINAGE NETWORK GEOMETRY - LDD ***************** + # ************************************************************ + self.var.AtLastPoint = boolean(pit(self.var.Ldd)) #pcr # Assign True to each of the grid cells where there are outlet points # Function 'pit' assigns a unique number starting from 1 to pit cells (ldd=5) in the Ldd @@ -564,24 +594,25 @@ def initialMCT(self): # ***** INITIALISATION FOR MCT ROUTING ************ # ************************************************************ - # even if MCT is active, it should be deactivated if there is no MCT cell in the domain - if option['MCTRouting']: - self.var.IsChannelMCTPcr = boolean(loadmap('ChannelsMCT', pcr=True)) #pcr - self.var.IsChannelMCT = np.bool8(compressArray(self.var.IsChannelMCTPcr)) #bool - if self.var.IsChannelMCT.sum()==0: - warnings.warn(LisfloodWarning('There are no MCT grid cell. MCT routing is deactivated')) - option['MCTRouting'] = False - # rebuild lists of reported files with MCTRouting = False - settings.build_reportedmaps_dicts() + # the following lines where moved to initial + # # even if MCT is active, it should be deactivated if there is no MCT cell in the domain + # if option['MCTRouting']: + # self.var.IsChannelMCTPcr = boolean(loadmap('ChannelsMCT', pcr=True)) #pcr + # self.var.IsChannelMCT = np.bool8(compressArray(self.var.IsChannelMCTPcr)) #bool + # if self.var.IsChannelMCT.sum()==0: + # warnings.warn(LisfloodWarning('There are no MCT grid cell. MCT routing is deactivated')) + # option['MCTRouting'] = False + # # rebuild lists of reported files with MCTRouting = False + # settings.build_reportedmaps_dicts() if option['MCTRouting'] and not option['InitLisflood']: maskinfo = MaskInfo.instance() - self.var.IsChannelMCTPcr = boolean(decompress(self.var.IsChannelMCT)) # pcr - # Identify channel pixels where Muskingum-Cunge-Todini is used - - self.var.mctmask = np.bool8(pcr2numpy(self.var.IsChannelMCTPcr,0)) - # Create a mask with cells using MCT + # the following lines where moved to initial + # self.var.IsChannelMCTPcr = boolean(decompress(self.var.IsChannelMCT)) # pcr + # # Identify channel pixels where Muskingum-Cunge-Todini is used + # self.var.mctmask = np.bool8(pcr2numpy(self.var.IsChannelMCTPcr,0)) + # # Create a mask with cells using MCT self.var.IsChannelKinematicPcr = (self.var.IsChannelPcr == 1) & (self.var.IsChannelMCTPcr == 0) #pcr self.var.IsChannelKinematic = np.bool8(compressArray(self.var.IsChannelKinematicPcr)) #np From f51848ef5573879e65526eb4a5c147ef1e50ad5d Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Thu, 30 Apr 2026 15:35:10 +0000 Subject: [PATCH 07/35] ported all MCT headwater changes - needs work --- src/lisflood/Lisflood_initial.py | 12 ++++++------ src/lisflood/hydrological_modules/routing.py | 18 ++++++++++++++++-- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index a8073a1e..5a546d23 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -139,7 +139,7 @@ def __init__(self): self.surface_routing_module = surface_routing(self) self.reservoir_module = Reservoir(self) # get_reservoir(option['reservoirHanazaki']) self.lakes_module = lakes(self) - # self.mctheadwater_module = mctheadwater(self) + self.mctheadwater_module = mctheadwater(self) self.polder_module = polder(self) self.waterabstraction_module = waterabstraction(self) self.indicatorcalc_module = indicatorcalc(self) @@ -208,7 +208,7 @@ def __init__(self): self.polder_module.initial() # MCT HEADWATER - # self.mctheadwater_module.initial() + self.mctheadwater_module.initial() self.transmission_module.initial() @@ -219,16 +219,16 @@ def __init__(self): # ---------------------------------------------------------------------- self.routing_module.initialSecond() - # CHANNEL INITIAL SPLIT UP IN SECOND CHANNEL - - self.routing_module.initialKinematicWave() + # CHANNEL INITIAL SPLIT UP IN SECOND CHANNEL self.surface_routing_module.initialSecond() + self.routing_module.initialKinematicWave() + if option.get('MCTRouting'): self.routing_module.initialMCT() # initialising Muskingum-Cunge-Todini routing for channel - # self.mctheadwater_module.dynamic_init() + self.mctheadwater_module.dynamic_init() # adding MCT headwater to structures self.evapowater_module.initial() diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 580c1093..d6bc2bb6 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -824,8 +824,8 @@ def dynamic(self, NoRoutingExecuted): # First, Kinematic/Split routing is solved on all pixels (including MCT pixels) then results are updated # for the MCT pixels. - # Sideflow contribution to MCT grid cells expressed in [m3/s] - SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql + # # Sideflow contribution to MCT grid cells expressed in [m3/s] + # SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql # Grab outflow at the end of the previous routing step t for all pixels) - current state of the MCT pixel ChanQ_0 = self.var.ChanQ.copy() # Outflow (x+dx) at time t (end of previous routing step) (instant) -> used to calc q00 @@ -837,6 +837,20 @@ def dynamic(self, NoRoutingExecuted): self.var.ChanM3 = ChanM3 self.var.ChanQAvgDt = ChanQAvgDt # -> used to calc q0m + # #################### + # + # self.mctheadwater_module.dynamic_inloop(NoRoutingExecuted) + # # calculate sideflow from MCT headwater pixels + # + # SideflowChanM3 += self.var.QHeadM3Dt + # # MCT headwater pixles outflow volume per routing sub step [m3] + # + # #################### + + # Sideflow contribution to MCT grid cells expressed in [m3/s] + SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql + SideflowChanMCTM3 = np.where(self.var.IsChannelMCT, SideflowChanM3, 0) + # Solve MCT routing and update current state at MCT pixels self.mct_river_router.routing( ChanQ_0, # -> used to calc q00 From 6d4c912db0be4e7338bf2c175453e9150e63e28c Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Thu, 30 Apr 2026 16:11:02 +0000 Subject: [PATCH 08/35] Added MCT headwater points (inflows) for MCT cells with upstream contribution from Kinematic cells only --- src/lisflood/Lisflood_initial.py | 5 +- .../hydrological_modules/mctheadwater.py | 5 +- src/lisflood/hydrological_modules/routing.py | 48 +++++++------------ 3 files changed, 21 insertions(+), 37 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index 5a546d23..e06528b2 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -207,7 +207,6 @@ def __init__(self): self.lakes_module.initial() self.polder_module.initial() - # MCT HEADWATER self.mctheadwater_module.initial() self.transmission_module.initial() @@ -219,7 +218,7 @@ def __init__(self): # ---------------------------------------------------------------------- self.routing_module.initialSecond() - # CHANNEL INITIAL SPLIT UP IN SECOND CHANNEL + # CHANNEL INITIAL SPLIT UP IN SECOND CHANNEL self.surface_routing_module.initialSecond() @@ -231,6 +230,8 @@ def __init__(self): self.mctheadwater_module.dynamic_init() # adding MCT headwater to structures + + self.evapowater_module.initial() self.riceirrigation_module.initial() self.waterabstraction_module.initial() diff --git a/src/lisflood/hydrological_modules/mctheadwater.py b/src/lisflood/hydrological_modules/mctheadwater.py index 3e6b577f..53ff28ac 100755 --- a/src/lisflood/hydrological_modules/mctheadwater.py +++ b/src/lisflood/hydrological_modules/mctheadwater.py @@ -135,7 +135,6 @@ def dynamic_init(self): self.var.QInHeadM3Old = np.where(self.var.MCTHeadwaterSitesC > 0, self.var.ChanQAvgDt * self.var.DtSec, 0) # self.var.QInM3Old # difference between old and new headwater flow per sub step # in order to calculate the amount of headwater flow in the routing loop - pass @@ -163,8 +162,7 @@ def dynamic_inloop(self, NoRoutingExecuted: int): # reservoir inflow in [m3/s] # (LddStructuresKinematic equals LddKinematic, but without the pits/sinks upstream of the structure # locations; note that using Ldd here instead would introduce MV!) - # inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.MCTHeadwaterIndex] #same as Qin - inflow = self.var.ChanQAvgDt[7] #this is just to make it the same as the inflow run REMOVE + inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.MCTHeadwaterIndex] #same as Qin self.var.QInHeadM3 = maskinfo.in_zero() np.put(self.var.QInHeadM3, self.var.MCTHeadwaterIndex, inflow * self.var.DtSec) @@ -175,6 +173,5 @@ def dynamic_inloop(self, NoRoutingExecuted: int): self.var.QInHeadM3Old = self.var.QInHeadM3.copy() # save the upstream inflow for next step - pass diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index d6bc2bb6..ad06751b 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -74,6 +74,7 @@ def initial(self): flags = settings.flags maskinfo = MaskInfo.instance() + # ************************************************************ # ***** NUMBER OF ROUTING STEPS ********************* # ************************************************************ @@ -175,10 +176,12 @@ def initial(self): self.var.LddKinematic = self.var.LddChan self.var.LddKinematicNp = compressArray(self.var.LddKinematic) # np + # ************************************************************ # ***** MCT DRAINAGE NETWORK GEOMETRY - LDD ***************** # ************************************************************ + # This is done here to be able to add MCT headwater pixels to structures if option['MCTRouting']: self.var.IsChannelMCTPcr = boolean(loadmap('ChannelsMCT', pcr=True)) # pcr @@ -199,8 +202,6 @@ def initial(self): self.var.mctmask = np.bool8(pcr2numpy(self.var.IsChannelMCTPcr,0)) # Create a mask with cells using MCT - - # both variables are necessary to include MCT headwater pixels in the LDD as structures # ************************************************************ # ***** MCT DRAINAGE NETWORK GEOMETRY - LDD ***************** @@ -593,27 +594,10 @@ def initialMCT(self): # ************************************************************ # ***** INITIALISATION FOR MCT ROUTING ************ # ************************************************************ - - # the following lines where moved to initial - # # even if MCT is active, it should be deactivated if there is no MCT cell in the domain - # if option['MCTRouting']: - # self.var.IsChannelMCTPcr = boolean(loadmap('ChannelsMCT', pcr=True)) #pcr - # self.var.IsChannelMCT = np.bool8(compressArray(self.var.IsChannelMCTPcr)) #bool - # if self.var.IsChannelMCT.sum()==0: - # warnings.warn(LisfloodWarning('There are no MCT grid cell. MCT routing is deactivated')) - # option['MCTRouting'] = False - # # rebuild lists of reported files with MCTRouting = False - # settings.build_reportedmaps_dicts() if option['MCTRouting'] and not option['InitLisflood']: maskinfo = MaskInfo.instance() - # the following lines where moved to initial - # self.var.IsChannelMCTPcr = boolean(decompress(self.var.IsChannelMCT)) # pcr - # # Identify channel pixels where Muskingum-Cunge-Todini is used - # self.var.mctmask = np.bool8(pcr2numpy(self.var.IsChannelMCTPcr,0)) - # # Create a mask with cells using MCT - self.var.IsChannelKinematicPcr = (self.var.IsChannelPcr == 1) & (self.var.IsChannelMCTPcr == 0) #pcr self.var.IsChannelKinematic = np.bool8(compressArray(self.var.IsChannelKinematicPcr)) #np # Identify channel pixels where Kinematic wave is used instead of MCT @@ -632,7 +616,6 @@ def initialMCT(self): self.var.ChanGrad[MCT_slope_mask] = ChanGradMaxMCT # set max channel slope for MCT pixels - # cmcheck # This could become a calibration parameter if we want to use MCT+SplitRouting self.var.ChanManMCT = (self.var.ChanMan / self.var.CalChanMan) * loadmap('CalChanMan3') # Mannings coefficient for MCT pixels (same as second line of split routing) @@ -644,6 +627,7 @@ def initialMCT(self): self.var.PrevDm0 = np.where(PrevDmMCT == -9999, maskinfo.in_zero(), PrevDmMCT) #np # Reynolds number (Dm) for MCT at previous time step t0 + # ************************************************************ # ***** INITIALISE MUSKINGUM-CUNGE-TODINI WAVE ROUTER ******** # ************************************************************ @@ -685,6 +669,7 @@ def dynamic(self, NoRoutingExecuted): self.inflow_module.dynamic_inloop(NoRoutingExecuted) self.transmission_module.dynamic_inloop(NoRoutingExecuted) + # ************************************************************ # ***** CHANNEL FLOW ROUTING: KINEMATIC WAVE **************** # ************************************************************ @@ -750,7 +735,6 @@ def dynamic(self, NoRoutingExecuted): self.var.AddedTRUN -= np.take(np.bincount(self.var.Catchments, weights=self.var.WUseAddM3Dt.copy()),self.var.Catchments) # Sideflow contribution to kinematic and split routing grid cells expressed in [cu m /s / m channel length] - SideflowChan = np.where(self.var.IsChannelKinematic, SideflowChanM3 * self.var.InvChanLength * self.var.InvDtRouting,0) # ************************************************************ @@ -823,7 +807,8 @@ def dynamic(self, NoRoutingExecuted): # This is calculated for MCT grid cell only but takes the output of kinematic or split routing. # First, Kinematic/Split routing is solved on all pixels (including MCT pixels) then results are updated # for the MCT pixels. - + + # # Sideflow contribution to MCT grid cells expressed in [m3/s] # SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql @@ -837,19 +822,20 @@ def dynamic(self, NoRoutingExecuted): self.var.ChanM3 = ChanM3 self.var.ChanQAvgDt = ChanQAvgDt # -> used to calc q0m - # #################### - # - # self.mctheadwater_module.dynamic_inloop(NoRoutingExecuted) - # # calculate sideflow from MCT headwater pixels - # - # SideflowChanM3 += self.var.QHeadM3Dt - # # MCT headwater pixles outflow volume per routing sub step [m3] - # - # #################### + + #################### + + self.mctheadwater_module.dynamic_inloop(NoRoutingExecuted) + # calculate sideflow from MCT headwater pixels + + SideflowChanM3 += self.var.QHeadM3Dt + # MCT headwater pixles outflow volume per routing sub step [m3] # Sideflow contribution to MCT grid cells expressed in [m3/s] SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql SideflowChanMCTM3 = np.where(self.var.IsChannelMCT, SideflowChanM3, 0) + #################### + # Solve MCT routing and update current state at MCT pixels self.mct_river_router.routing( From 2c4589c019bd065ec75a5b824f4806eb0b0e4ebb Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Tue, 5 May 2026 08:31:28 +0000 Subject: [PATCH 09/35] Working on the mass balance when using MCT headwater pixels --- src/lisflood/Lisflood_dynamic.py | 1 - .../hydrological_modules/mctheadwater.py | 31 ++++++++++++++++--- .../hydrological_modules/reservoir.py | 10 ++++++ src/lisflood/hydrological_modules/routing.py | 2 +- .../hydrological_modules/waterbalance.py | 11 ++++--- 5 files changed, 44 insertions(+), 11 deletions(-) diff --git a/src/lisflood/Lisflood_dynamic.py b/src/lisflood/Lisflood_dynamic.py index e5ffe47d..022475ce 100644 --- a/src/lisflood/Lisflood_dynamic.py +++ b/src/lisflood/Lisflood_dynamic.py @@ -209,7 +209,6 @@ def splitlanduse(array1, array2=None, array3=None): # # Total channel storage [m3] = Volume in main channel (ChanM3Kin) + volume above bankfull (Chan2M3Kin - Chan2M3Start) # # at t+dt - self.TotalCrossSectionArea = self.ChanM3 * self.InvChanLength # Total river channel cross-section area at t+dt diff --git a/src/lisflood/hydrological_modules/mctheadwater.py b/src/lisflood/hydrological_modules/mctheadwater.py index 53ff28ac..dd6e8045 100755 --- a/src/lisflood/hydrological_modules/mctheadwater.py +++ b/src/lisflood/hydrological_modules/mctheadwater.py @@ -19,8 +19,9 @@ from __future__ import print_function, absolute_import -from pcraster import scalar, numpy2pcr, Nominal, setclone, Boolean, pcr2numpy, upstream -from pcraster import Scalar, numpy2pcr, Nominal, setclone, Boolean, pcr2numpy +from pcraster import scalar, upstream +from pcraster import Scalar, numpy2pcr, pcr2numpy,downstream, boolean +import pcraster from nine import range @@ -120,6 +121,19 @@ def initial(self): # Add reservoir locations to structures map (used to modify LddChan # and to calculate LddStructuresChan) + # # PCRaster part + # # ----------------------- + # MCTHeadwaterSitePcr = numpy2pcr(Scalar, mctheadwater, 0) + # MCTHeadwaterSitePcr = pcraster.ifthen((pcraster.defined(MCTHeadwaterSitePcr) & pcraster.boolean(decompress(self.var.IsChannel))), MCTHeadwaterSitePcr) + # IsStructureMCTheadwater = pcraster.boolean(MCTHeadwaterSitePcr) + # # additional structure map only for lakes to calculate water balance + # # self.var.IsUpsOfStructureLake = pcraster.downstream(self.var.LddKinematic, pcraster.cover(IsStructureLake, 0)) + # self.var.IsUpsOfStructureMCTHeadwater = pcraster.downstream(self.var.LddChan, pcraster.cover(IsStructureMCTheadwater, 0)) + # # Get all pixels just upstream of MCT headwater cells to calulate water balance + # # ----------------------- + + + def dynamic_init(self): """ Initialization of the dynamic part of the MCT headwater module @@ -137,7 +151,6 @@ def dynamic_init(self): # in order to calculate the amount of headwater flow in the routing loop - def dynamic_inloop(self, NoRoutingExecuted: int): """ Performs the dynamic simulation of MCT headwater/source within the routing loop. This method @@ -153,6 +166,8 @@ def dynamic_inloop(self, NoRoutingExecuted: int): settings = LisSettings.instance() option = settings.options maskinfo = MaskInfo.instance() + + self.var.QHeadADDEDM3 = maskinfo.in_zero() if option['MCTRouting'] and not option['InitLisflood']: @@ -162,7 +177,11 @@ def dynamic_inloop(self, NoRoutingExecuted: int): # reservoir inflow in [m3/s] # (LddStructuresKinematic equals LddKinematic, but without the pits/sinks upstream of the structure # locations; note that using Ldd here instead would introduce MV!) - inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.MCTHeadwaterIndex] #same as Qin + # inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.MCTHeadwaterIndex] #same as Qin + + ######## + inflow = self.var.ChanQAvgDt[7] # this is just to make it the same as the inflow run REMOVE + ######## self.var.QInHeadM3 = maskinfo.in_zero() np.put(self.var.QInHeadM3, self.var.MCTHeadwaterIndex, inflow * self.var.DtSec) @@ -174,4 +193,8 @@ def dynamic_inloop(self, NoRoutingExecuted: int): self.var.QInHeadM3Old = self.var.QInHeadM3.copy() # save the upstream inflow for next step + self.var.QHeadADDEDM3 += self.var.QHeadM3Dt + # adding volume to the water balance + + diff --git a/src/lisflood/hydrological_modules/reservoir.py b/src/lisflood/hydrological_modules/reservoir.py index cd15b6a4..4d32e597 100755 --- a/src/lisflood/hydrological_modules/reservoir.py +++ b/src/lisflood/hydrological_modules/reservoir.py @@ -24,6 +24,7 @@ from pcraster.operations import ifthen, boolean, defined, lookupscalar import numpy as np +import pcraster from ..global_modules.settings import LisSettings, MaskInfo from ..global_modules.add1 import loadmap, compressArray, decompress, makenumpy @@ -126,6 +127,15 @@ def initial(self): # (following logic of 'old' code the inflow into these reservoirs is # always zero, so either change this or leave them out!) ReservoirSitePcr = ifthen((defined(ReservoirSitePcr) & boolean(decompress(self.var.IsChannel))), ReservoirSitePcr) + + # # PCRaster part + # # ----------------------- + # IsStructureReservoir = pcraster.boolean(ReservoirSitePcr) + # # additional structure map only for reservoirs to calculate water balance + # self.var.IsUpsOfStructureReservoir = pcraster.downstream(self.var.LddChan, pcraster.cover(IsStructureReservoir, 0)) + # # Get all pixels just upstream of reservoirs + # # ----------------------- + # RESERVOIR CHARACTERISTICS diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index ad06751b..d3281a63 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -728,7 +728,7 @@ def dynamic(self, NoRoutingExecuted): else: self.var.AddedTRUN += np.take(np.bincount(self.var.Catchments, weights=self.var.ToChanM3RunoffDt.copy()),self.var.Catchments) if option['inflow']: - self.var.AddedTRUN += np.take(np.bincount(self.var.Catchments, weights=self.var.QInDt),self.var.Catchments) + self.var.AddedTRUN += np.take(np.bincount(self.var.Catchments, weights=self.var.QInDt),self.var.Catchments) if option['openwaterevapo']: self.var.AddedTRUN -= np.take(np.bincount(self.var.Catchments, weights=self.var.EvaAddM3Dt.copy()),self.var.Catchments) if option['wateruse']: diff --git a/src/lisflood/hydrological_modules/waterbalance.py b/src/lisflood/hydrological_modules/waterbalance.py index 723d4ed4..09b8ba2e 100755 --- a/src/lisflood/hydrological_modules/waterbalance.py +++ b/src/lisflood/hydrological_modules/waterbalance.py @@ -91,7 +91,7 @@ def initial(self): # self.var.IsUpsOfStructureKinematic, self.var.ChanQ * self.var.DtRouting), scalar(0.0)) # DisStructure = np.where(self.var.IsUpsOfStructureKinematicC, self.var.ChanQ * self.var.DtRouting, 0) - DisStructure = np.where(self.var.IsUpsOfStructureChanC, self.var.ChanQAvgDt * self.var.DtRouting, 0) + DisStructure = np.where(self.var.IsUpsOfStructureChanC, self.var.ChanQAvgDt * self.var.DtRouting, 0) #np # Average Discharge upstream of structure locations (coded as pits) in [m3/time step] # Needed for mass balance error calculations (see comment to calculation of WaterInit below) # Inclusion of DischargeM3Structures: adding this corrects a (relatively small) offset that occurs otherwise @@ -99,10 +99,12 @@ def initial(self): # calculation of structur influence happens before routing, therefore the initial state is used at the structure onece to often # (because it is not routed yet to the structure) + # DisStructure = np.where(self.var.IsUpsOfStructureReservoir, self.var.ChanQAvgDt * self.var.DtRouting, 0) + # CM if option['simulateLakes']: # DisStructure += np.where(compressArray(self.var.IsUpsOfStructureLake), 0.5 * self.var.ChanQ * self.var.DtRouting, 0) - DisStructure += np.where(compressArray(self.var.IsUpsOfStructureLake), 0.5 * self.var.ChanQAvgDt * self.var.DtRouting, 0) + DisStructure += np.where(compressArray(self.var.IsUpsOfStructureLake), 0.5 * self.var.ChanQAvgDt * self.var.DtRouting, 0) #np # DisStructure += cover(ifthen(self.var.IsUpsOfStructureLake, # 0.5 * self.var.ChanQ * self.var.DtRouting), scalar(0.0)) @@ -246,11 +248,11 @@ def dynamic(self): # added cumulative transmission loss # DisStru = np.where(self.var.IsUpsOfStructureKinematicC, self.var.ChanQ * self.var.DtRouting, 0) - DisStru = np.where(self.var.IsUpsOfStructureChanC, self.var.ChanQAvgDt * self.var.DtRouting, 0) + DisStru = np.where(self.var.IsUpsOfStructureChanC, self.var.ChanQAvgDt * self.var.DtRouting, 0) #np # using average discharge DisStru[self.var.AtLastPointC == 1 ] = 0 # this line avoids double-counting when a reservoir or a lake is located at the outlet of the cacthment - DischargeM3Structures = np.take(np.bincount(self.var.Catchments, weights=DisStru), self.var.Catchments) + DischargeM3Structures = np.take(np.bincount(self.var.Catchments, weights=DisStru), self.var.Catchments) #np # on the last time step lakes and reservoirs calculated with the previous routing results # so the last (now routed) discharge has to be added to the mass balance # (-> the calculation odf the structures is done before the routing) @@ -276,7 +278,6 @@ def dynamic(self): # Needed for mass balance error calculations, because of double counting of structure # storage and water in the channel. - # Mass balance: self.var.MBError = self.var.WaterInit + WaterIn - WaterStored - WaterOut - DischargeM3Structures # Total mass balance error per catchment [cu m]. Mass balance error is computed for each computational time step. From 27c7b60a8d56627a80338ec726f6fc3070345f83 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Thu, 7 May 2026 10:42:16 +0000 Subject: [PATCH 10/35] Added MCT Confluence module (wiring) --- src/lisflood/Lisflood_initial.py | 10 +++++++- src/lisflood/global_modules/checkers.py | 2 +- .../hydrological_modules/mctheadwater.py | 12 ++++----- src/lisflood/hydrological_modules/routing.py | 25 ++++++++++++++++--- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index e06528b2..0044f4c4 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -50,6 +50,7 @@ from .hydrological_modules.reservoir import Reservoir from .hydrological_modules.lakes import lakes from .hydrological_modules.mctheadwater import mctheadwater +from .hydrological_modules.mctconfluence import mctconfluence from .hydrological_modules.polder import polder from .hydrological_modules.waterabstraction import waterabstraction from .hydrological_modules.indicatorcalc import indicatorcalc @@ -140,6 +141,7 @@ def __init__(self): self.reservoir_module = Reservoir(self) # get_reservoir(option['reservoirHanazaki']) self.lakes_module = lakes(self) self.mctheadwater_module = mctheadwater(self) + self.mctconfluence_module = mctconfluence(self) self.polder_module = polder(self) self.waterabstraction_module = waterabstraction(self) self.indicatorcalc_module = indicatorcalc(self) @@ -208,6 +210,7 @@ def __init__(self): self.polder_module.initial() self.mctheadwater_module.initial() + # initialising MCT headwater pixels self.transmission_module.initial() @@ -227,8 +230,13 @@ def __init__(self): if option.get('MCTRouting'): self.routing_module.initialMCT() # initialising Muskingum-Cunge-Todini routing for channel + + self.mctconfluence_module.initial() + # initialising MCT confluence pixels + self.mctheadwater_module.dynamic_init() - # adding MCT headwater to structures + self.mctconfluence_module.dynamic_init() + diff --git a/src/lisflood/global_modules/checkers.py b/src/lisflood/global_modules/checkers.py index f701fd7a..4e88038c 100755 --- a/src/lisflood/global_modules/checkers.py +++ b/src/lisflood/global_modules/checkers.py @@ -26,7 +26,7 @@ from ..hydrological_modules import (surface_routing, evapowater, snow, routing, leafarea, inflow, waterlevel, waterbalance, wateruse, waterabstraction, lakes, riceirrigation, indicatorcalc, landusechange, frost, groundwater, miscInitial, soilloop, soil, - reservoir, transmission, mctheadwater) + reservoir, transmission, mctheadwater, mctconfluence) class ModulesInputs: diff --git a/src/lisflood/hydrological_modules/mctheadwater.py b/src/lisflood/hydrological_modules/mctheadwater.py index dd6e8045..bf1e4080 100755 --- a/src/lisflood/hydrological_modules/mctheadwater.py +++ b/src/lisflood/hydrological_modules/mctheadwater.py @@ -105,8 +105,8 @@ def initial(self): mctheadwater[np.isnan(mctheadwater)] = 0.0 # flatten and add mask - # self.var.CheckpointSitesC = ((mctsource == 1) | (mctheadwater == 1)).astype(int) #np - # # merge source points and headwater points to create the full list of checkpoints + # mctheadwater[compressArray(self.var.AtLastPoint) == 1] = 0 + # # remove outlets points if any self.var.MCTHeadwaterSitesC = mctheadwater self.var.MCTHeadwaterSitesCC = np.compress(mctheadwater > 0, mctheadwater) @@ -177,11 +177,11 @@ def dynamic_inloop(self, NoRoutingExecuted: int): # reservoir inflow in [m3/s] # (LddStructuresKinematic equals LddKinematic, but without the pits/sinks upstream of the structure # locations; note that using Ldd here instead would introduce MV!) - # inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.MCTHeadwaterIndex] #same as Qin + inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.MCTHeadwaterIndex] #same as Qin - ######## - inflow = self.var.ChanQAvgDt[7] # this is just to make it the same as the inflow run REMOVE - ######## + # ######## + # inflow = self.var.ChanQAvgDt[7] # this is just to make it the same as the inflow run REMOVE + # ######## self.var.QInHeadM3 = maskinfo.in_zero() np.put(self.var.QInHeadM3, self.var.MCTHeadwaterIndex, inflow * self.var.DtSec) diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index d3281a63..c204c961 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -31,6 +31,7 @@ from .kinematic_wave_parallel import kinematicWave, kwpt from .mct import MCTWave from .mctheadwater import mctheadwater +from .mctconfluence import mctconfluence from ..global_modules.settings import LisSettings, MaskInfo from ..global_modules.errors import LisfloodWarning @@ -63,6 +64,7 @@ def __init__(self, routing_variable): self.inflow_module = inflow(self.var) self.transmission_module = transmission(self.var) self.mctheadwater_module = mctheadwater(self.var) + self.mctconfluence_module = mctconfluence(self.var) # -------------------------------------------------------------------------- # -------------------------------------------------------------------------- @@ -608,6 +610,11 @@ def initialMCT(self): self.var.LddKinematic = lddmask(self.var.LddChan, self.var.IsChannelKinematicPcr) #pcr # Ldd for kinematic routing + + # # INITIALISE MCT CONFLUENCE + # self.mctconfluence_module.initial() + # ##################################################### + ChanGradMaxMCT = loadmap('ChanGradMaxMCT') # Maximum riverbed slope for MCT rivers # Check where IsChannelMCT is True and values in ChanGrad > ChanGradMaxMCT @@ -824,18 +831,30 @@ def dynamic(self, NoRoutingExecuted): #################### + # MCT HEADWATER self.mctheadwater_module.dynamic_inloop(NoRoutingExecuted) # calculate sideflow from MCT headwater pixels SideflowChanM3 += self.var.QHeadM3Dt - # MCT headwater pixles outflow volume per routing sub step [m3] + # MCT headwater pixels outflow volume per routing sub step [m3] + + #################### + # MCT CONFLUENCE + + self.mctconfluence_module.dynamic_inloop(NoRoutingExecuted) + # calculate sideflow from MCT confluence pixels + + SideflowChanM3 += self.var.QConfM3Dt + # MCT confluence pixels outflow volume per routing sub step [m3] + + #################### + + # Sideflow contribution to MCT grid cells expressed in [m3/s] SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql SideflowChanMCTM3 = np.where(self.var.IsChannelMCT, SideflowChanM3, 0) - #################### - # Solve MCT routing and update current state at MCT pixels self.mct_river_router.routing( From 988105ac39936c5291c58844550d9a38b9f974f6 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Thu, 7 May 2026 16:52:20 +0000 Subject: [PATCH 11/35] Added MCT confluence points (sideflows) for MCT cells with upstream contribution from Kinematic and MCT cells --- src/lisflood/Lisflood_initial.py | 3 - .../hydrological_modules/mctconfluence.py | 160 ++++++++++++++++++ .../hydrological_modules/mctheadwater.py | 56 ++---- src/lisflood/hydrological_modules/routing.py | 18 +- 4 files changed, 179 insertions(+), 58 deletions(-) create mode 100755 src/lisflood/hydrological_modules/mctconfluence.py diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index 0044f4c4..08531ca7 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -237,9 +237,6 @@ def __init__(self): self.mctheadwater_module.dynamic_init() self.mctconfluence_module.dynamic_init() - - - self.evapowater_module.initial() self.riceirrigation_module.initial() self.waterabstraction_module.initial() diff --git a/src/lisflood/hydrological_modules/mctconfluence.py b/src/lisflood/hydrological_modules/mctconfluence.py new file mode 100755 index 00000000..e407a910 --- /dev/null +++ b/src/lisflood/hydrological_modules/mctconfluence.py @@ -0,0 +1,160 @@ +""" + +Copyright 2019 European Union + +Licensed under the EUPL, Version 1.2 or as soon they will be approved by the European Commission +subsequent versions of the EUPL (the "Licence"); + +You may not use this work except in compliance with the Licence. +You may obtain a copy of the Licence at: + +https://joinup.ec.europa.eu/sites/default/files/inline-files/EUPL%20v1_2%20EN(1).txt + +Unless required by applicable law or agreed to in writing, +software distributed under the Licence is distributed on an "AS IS" basis, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the Licence for the specific language governing permissions and limitations under the Licence. + +""" + +from __future__ import print_function, absolute_import +from pcraster import Scalar, numpy2pcr, pcr2numpy,downstream, boolean +from nine import range +import numpy as np +from ..global_modules.settings import LisSettings, MaskInfo +from ..global_modules.add1 import loadmap, compressArray, decompress, makenumpy +from ..global_modules.errors import LisfloodWarning +from . import HydroModule + + +class mctconfluence(HydroModule): + """ + Adds contribution from Kinematic cells to MCT cells as a lateral flow when MCT routing is enabled. + This is for MCT cells that have upstream contributions from both kinematic and MCT cells. + + This module handles the initialization and dynamic simulation of Kinematic to MCT cells confluence. + It injects side discharge to the downstream grid cell as lateral flow. + + Attributes: + ----------- + var (object): An object containing all the variables used within the mctconfluence module. + + Methods: + -------- + initial(): Sets up the initial conditions and parameters for the simulation, + including confluence locations. + dynamic_inloop(NoRoutingExecuted: int): Performs dynamic calculations within the routing + loop to simulate the kinematic to MCT confluence. + """ + + module_name = 'MCTConfluence' + + def __init__(self, mctconfluence_variable): + self.var = mctconfluence_variable + + def __init__(self, mctconfluence_variable): + """ + Initializes the MCT confluence module with a given variable object. + + Parameters: + ----------- + mctconfluence_variable: object + An object containing the variables needed for the MCT confluence simulation. + """ + + self.var = mctconfluence_variable + + def initial(self): + """ + Initiates the MCT confluence module by loading the necessary data and maps. + """ + + settings = LisSettings.instance() + option = settings.options + binding = settings.binding + maskinfo = MaskInfo.instance() + if option['MCTRouting']: + + inArPcr = decompress(np.arange(maskinfo.info.mapC[0], dtype="int32")) # pcr + # Assign a number to each non-missing pixel as cell id, starting from 0 + inAr = compressArray(inArPcr) + + down = (compressArray(downstream(self.var.LddStructuresChan, inArPcr))).astype("int32") # np + # assign to each pixel the cell id of the pixel it is contributing to + + maskKinematic = (compressArray(self.var.LddKinematic) == 5) & (self.var.IsUpsOfStructureKinematicC != 1) + maskKinematic[compressArray(self.var.AtLastPoint) == 1] = False + # find location of KIN pixels (only) in LddKin that are at the confluence with an MCT pixel + # do not include sinks upstream of structures (lakes, reservoirs, MCT headwater pixels) and outlets + + self.var.UpsOfMCTConfluence = np.where(maskKinematic, down, 0) + # find last KIN pixels upstream of the confluence with an MCT pixel and assign it the id of the downstream MCT pixel + + mctconfluence = maskinfo.in_zero() + mctconfluence[np.isin(inAr, self.var.UpsOfMCTConfluence[self.var.UpsOfMCTConfluence != 0])] = 1 + # for each element in UpsOfMCTConfluence (they are Kinematic cells), get the value of the downstream cell and find the position ix of that same value in inAr, read the inAr value and put 1 in the corrisponding position in mctconfluence + # identify location of MCT pixels that receive a contribution from an upstream KIN pixel (with no structure on it) + + # mctconfluence[self.var.MCTHeadwaterSitesC == 1] = 0 + # # remove headwater cells from the list of confluence cells because they are treated differently + # mctconfluence[compressArray(self.var.AtLastPoint) == 1] = 0 + # # remove outlets points if any + + self.var.MCTConfluenceSitesC = mctconfluence + self.var.MCTConfluenceSitesCC = np.compress(mctconfluence > 0, mctconfluence) + self.var.MCTConfluenceIndex = np.nonzero(mctconfluence)[0] + + + def dynamic_init(self): + """ Initialization of the dynamic part of the MCT confluence module + init mct confluence before sub step routing + """ + settings = LisSettings.instance() + option = settings.options + if option['MCTRouting']: + self.var.QInConfM3Old = np.where(self.var.MCTConfluenceSitesC > 0, self.var.ChanQAvgDt * self.var.DtSec, 0) + + + def dynamic_inloop(self, NoRoutingExecuted: int): + """ + Performs the dynamic simulation of MCT confluence within the routing loop. This method + injects upstream discharge to the downstream grid cell as lateral inflow. + + Parameters: + ----------- + NoRoutingExecuted: integer + The number of routing sub-steps that have been executed. This parameter is used to manage + the accumulation of inflow and outflow over the routing steps. + """ + + settings = LisSettings.instance() + option = settings.options + maskinfo = MaskInfo.instance() + + self.var.QConfADDEDM3 = maskinfo.in_zero() + + if option['MCTRouting'] and not option['InitLisflood']: + + InvDtSecDay = 1 / float(86400) + # InvDtSecDay=self.var.InvDtSec + + lateralflow = np.bincount(self.var.UpsOfMCTConfluence, weights=self.var.ChanQAvgDt)[self.var.MCTConfluenceIndex] #same as Qin + # contribution to the MCT pixel from upstream Kinematic pixels + + self.var.QInConfM3 = maskinfo.in_zero() + np.put(self.var.QInConfM3, self.var.MCTConfluenceIndex, lateralflow * self.var.DtSec) + self.var.QDeltaConfM3 = (self.var.QInConfM3 - self.var.QInConfM3Old) * self.var.InvNoRoutSteps + # difference between old and new lateral flow per sub step + # in order to calculate the amount of lateral flow in the routing loop + + self.var.QConfM3Dt = (self.var.QInConfM3Old + (NoRoutingExecuted + 1) * self.var.QDeltaConfM3) * self.var.InvNoRoutSteps + # output to the MCT confluence cell + + self.var.QInConfM3Old = self.var.QInConfM3.copy() + # save the lateral flow for next step + + self.var.QConfADDEDM3 += self.var.QConfM3Dt + # adding volume to the water balance + + + diff --git a/src/lisflood/hydrological_modules/mctheadwater.py b/src/lisflood/hydrological_modules/mctheadwater.py index bf1e4080..be994d9f 100755 --- a/src/lisflood/hydrological_modules/mctheadwater.py +++ b/src/lisflood/hydrological_modules/mctheadwater.py @@ -20,16 +20,9 @@ from __future__ import print_function, absolute_import from pcraster import scalar, upstream -from pcraster import Scalar, numpy2pcr, pcr2numpy,downstream, boolean -import pcraster - +from pcraster import Scalar, numpy2pcr, pcr2numpy from nine import range - -import warnings - -from pcraster.operations import ifthen, boolean, defined, lookupscalar import numpy as np - from ..global_modules.settings import LisSettings, MaskInfo from ..global_modules.add1 import loadmap, compressArray, decompress, makenumpy from ..global_modules.errors import LisfloodWarning @@ -38,25 +31,24 @@ class mctheadwater(HydroModule): """ - Adds upstream discharge as a lateral flux at headwater and source grid cells when MCT routing is enabled. + Adds contribution from Kinematic cells to MCT cells as a lateral flow when MCT routing is enabled. + This is for MCT cells that have upstream contributions from both kinematic cells only. - This module handles the initialization and dynamic simulation of checkpoints, accounting for - inflow and outflow. It can be used in MCT channels to account for headwater/source grid cells. - It injects upstream discharge to the downstream grid cell as lateral inflow. + This module handles the initialization and dynamic simulation of MCT headwater cells. + It injects upstream discharge from kinematic cells to the downstream MCT grid cell as lateral flow. Attributes: ----------- - var (object): An object containing all the variables used within the reservoir module. + var (object): An object containing all the variables used within the mctheadwater module. Methods: -------- initial(): Sets up the initial conditions and parameters for the simulation, - including headwater/source locations. + including headwater locations. dynamic_inloop(NoRoutingExecuted: int): Performs dynamic calculations within the routing - loop to simulate inflow and outflow from the headwater/source. + loop to simulate the kinematic to MCT confluence. """ - - # input_files_keys = {'mctheadwater': ['Checkpoints']} + module_name = 'MCTHeadwater' def __init__(self, mctheadwater_variable): @@ -64,19 +56,19 @@ def __init__(self, mctheadwater_variable): def __init__(self, mctheadwater_variable): """ - Initializes the MCT headwater/source module with a given variable object. + Initializes the MCT headwater module with a given variable object. Parameters: ----------- mctheadwater_variable: object - An object containing the variables needed for the MCT headwater/source simulation. + An object containing the variables needed for the MCT headwater simulation. """ self.var = mctheadwater_variable def initial(self): """ - Initiates the MCT headwater/source module by loading the necessary data and maps. + Initiates the MCT headwater module by loading the necessary data and maps. """ settings = LisSettings.instance() @@ -85,11 +77,6 @@ def initial(self): maskinfo = MaskInfo.instance() if option['MCTRouting']: - # mctsource = loadmap('InflowPoints') ### temporary da cambiare addiungendo una chiave in settings - # mctsource[(mctsource < 1) | (self.var.IsChannel == 0)] = 0 - # # load MCT source locations and keep only those on the channel network - - UpStreamPcr = upstream(self.var.LddChan, scalar(self.var.IsChannelPcr)) UpStream = pcr2numpy(UpStreamPcr, 0) # identify all channel pixels that do not have any contributing pixel from upstream (head pixels) @@ -133,27 +120,19 @@ def initial(self): # # ----------------------- - - def dynamic_init(self): """ Initialization of the dynamic part of the MCT headwater module init mct headwater before sub step routing """ - - # ************************************************************ - # ***** HEADWATER INIT - # ************************************************************ settings = LisSettings.instance() option = settings.options if option['MCTRouting']: self.var.QInHeadM3Old = np.where(self.var.MCTHeadwaterSitesC > 0, self.var.ChanQAvgDt * self.var.DtSec, 0) # self.var.QInM3Old - # difference between old and new headwater flow per sub step - # in order to calculate the amount of headwater flow in the routing loop def dynamic_inloop(self, NoRoutingExecuted: int): """ - Performs the dynamic simulation of MCT headwater/source within the routing loop. This method + Performs the dynamic simulation of MCT headwater within the routing loop. This method injects upstream discharge to the downstream grid cell as lateral inflow. Parameters: @@ -174,24 +153,25 @@ def dynamic_inloop(self, NoRoutingExecuted: int): InvDtSecDay = 1 / float(86400) # InvDtSecDay=self.var.InvDtSec - # reservoir inflow in [m3/s] - # (LddStructuresKinematic equals LddKinematic, but without the pits/sinks upstream of the structure - # locations; note that using Ldd here instead would introduce MV!) inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.MCTHeadwaterIndex] #same as Qin + # contribution to the MCT pixel from upstream Kinematic pixels # ######## + # debug # inflow = self.var.ChanQAvgDt[7] # this is just to make it the same as the inflow run REMOVE # ######## self.var.QInHeadM3 = maskinfo.in_zero() np.put(self.var.QInHeadM3, self.var.MCTHeadwaterIndex, inflow * self.var.DtSec) self.var.QDeltaM3 = (self.var.QInHeadM3 - self.var.QInHeadM3Old) * self.var.InvNoRoutSteps + # difference between old and new headwater flow per sub step + # in order to calculate the amount of headwater flow in the routing loop self.var.QHeadM3Dt = (self.var.QInHeadM3Old + (NoRoutingExecuted + 1) * self.var.QDeltaM3) * self.var.InvNoRoutSteps # output to the MCT headwater cells self.var.QInHeadM3Old = self.var.QInHeadM3.copy() - # save the upstream inflow for next step + # save the upstream flow for next step self.var.QHeadADDEDM3 += self.var.QHeadM3Dt # adding volume to the water balance diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index c204c961..d28e91ca 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -610,11 +610,6 @@ def initialMCT(self): self.var.LddKinematic = lddmask(self.var.LddChan, self.var.IsChannelKinematicPcr) #pcr # Ldd for kinematic routing - - # # INITIALISE MCT CONFLUENCE - # self.mctconfluence_module.initial() - # ##################################################### - ChanGradMaxMCT = loadmap('ChanGradMaxMCT') # Maximum riverbed slope for MCT rivers # Check where IsChannelMCT is True and values in ChanGrad > ChanGradMaxMCT @@ -829,32 +824,21 @@ def dynamic(self, NoRoutingExecuted): self.var.ChanM3 = ChanM3 self.var.ChanQAvgDt = ChanQAvgDt # -> used to calc q0m - - #################### # MCT HEADWATER - self.mctheadwater_module.dynamic_inloop(NoRoutingExecuted) # calculate sideflow from MCT headwater pixels - SideflowChanM3 += self.var.QHeadM3Dt # MCT headwater pixels outflow volume per routing sub step [m3] - #################### # MCT CONFLUENCE - self.mctconfluence_module.dynamic_inloop(NoRoutingExecuted) # calculate sideflow from MCT confluence pixels - SideflowChanM3 += self.var.QConfM3Dt # MCT confluence pixels outflow volume per routing sub step [m3] - #################### - - - # Sideflow contribution to MCT grid cells expressed in [m3/s] SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql - SideflowChanMCTM3 = np.where(self.var.IsChannelMCT, SideflowChanM3, 0) + # SideflowChanMCTM3 = np.where(self.var.IsChannelMCT, SideflowChanM3, 0) # Solve MCT routing and update current state at MCT pixels self.mct_river_router.routing( From 3e19e3881a086baeca9d70d5f287fe227da6618a Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Tue, 12 May 2026 16:09:01 +0000 Subject: [PATCH 12/35] Working on MCT confluence - needs more work --- src/lisflood/Lisflood_initial.py | 5 +++++ .../hydrological_modules/mctconfluence.py | 18 +++++++++++++----- .../hydrological_modules/mctheadwater.py | 1 + src/lisflood/hydrological_modules/routing.py | 4 ++++ .../hydrological_modules/structures.py | 1 + 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index 08531ca7..af5adf99 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -205,6 +205,8 @@ def __init__(self): self.inflow_module.initial() self.surface_routing_module.initial() + # At this point LddChan and LddKinematic do not have any structure reservoirs/lakes MCT headwater MCT confluence + self.reservoir_module.initial() self.lakes_module.initial() self.polder_module.initial() @@ -216,6 +218,7 @@ def __init__(self): self.structures_module.initial() # Structures such as reservoirs and lakes are modelled by interrupting the channel flow paths + # At this point we have reservoirs/lakes MCT headwater in the LDD # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- @@ -225,6 +228,7 @@ def __init__(self): self.surface_routing_module.initialSecond() + # MCT confluence must be in the LddKinematic when I get here self.routing_module.initialKinematicWave() if option.get('MCTRouting'): @@ -237,6 +241,7 @@ def __init__(self): self.mctheadwater_module.dynamic_init() self.mctconfluence_module.dynamic_init() + self.evapowater_module.initial() self.riceirrigation_module.initial() self.waterabstraction_module.initial() diff --git a/src/lisflood/hydrological_modules/mctconfluence.py b/src/lisflood/hydrological_modules/mctconfluence.py index e407a910..387ead80 100755 --- a/src/lisflood/hydrological_modules/mctconfluence.py +++ b/src/lisflood/hydrological_modules/mctconfluence.py @@ -18,7 +18,7 @@ """ from __future__ import print_function, absolute_import -from pcraster import Scalar, numpy2pcr, pcr2numpy,downstream, boolean +from pcraster import Scalar, numpy2pcr, pcr2numpy,downstream, boolean,lddrepair,ifthenelse from nine import range import numpy as np from ..global_modules.settings import LisSettings, MaskInfo @@ -86,13 +86,20 @@ def initial(self): maskKinematic[compressArray(self.var.AtLastPoint) == 1] = False # find location of KIN pixels (only) in LddKin that are at the confluence with an MCT pixel # do not include sinks upstream of structures (lakes, reservoirs, MCT headwater pixels) and outlets + maskKinematicPcr = boolean(decompress(maskKinematic)) - self.var.UpsOfMCTConfluence = np.where(maskKinematic, down, 0) + self.var.LddChan = ifthenelse(maskKinematicPcr, 5, self.var.LddChan) + # Adding sink at the last KIN pixels upstream of the confluence with an MCT pixel to LddChan + # already added to LddKinematic + + self.var.KinematicUpsOfMCTConfluence = np.where(maskKinematic, down, 0) # find last KIN pixels upstream of the confluence with an MCT pixel and assign it the id of the downstream MCT pixel mctconfluence = maskinfo.in_zero() - mctconfluence[np.isin(inAr, self.var.UpsOfMCTConfluence[self.var.UpsOfMCTConfluence != 0])] = 1 - # for each element in UpsOfMCTConfluence (they are Kinematic cells), get the value of the downstream cell and find the position ix of that same value in inAr, read the inAr value and put 1 in the corrisponding position in mctconfluence + mctconfluence[np.isin(inAr, self.var.KinematicUpsOfMCTConfluence[self.var.KinematicUpsOfMCTConfluence != 0])] = 1 + # for each element in KinematicUpsOfMCTConfluence (they are Kinematic cells), get the value of the downstream cell, + # then find the position ix of that same value in inAr (vector with numbering of all cells) this is the position of the MCT confluence cell, + # read the inAr value and put 1 in the corrisponding position in mctconfluence # identify location of MCT pixels that receive a contribution from an upstream KIN pixel (with no structure on it) # mctconfluence[self.var.MCTHeadwaterSitesC == 1] = 0 @@ -103,6 +110,7 @@ def initial(self): self.var.MCTConfluenceSitesC = mctconfluence self.var.MCTConfluenceSitesCC = np.compress(mctconfluence > 0, mctconfluence) self.var.MCTConfluenceIndex = np.nonzero(mctconfluence)[0] + pass def dynamic_init(self): @@ -138,7 +146,7 @@ def dynamic_inloop(self, NoRoutingExecuted: int): InvDtSecDay = 1 / float(86400) # InvDtSecDay=self.var.InvDtSec - lateralflow = np.bincount(self.var.UpsOfMCTConfluence, weights=self.var.ChanQAvgDt)[self.var.MCTConfluenceIndex] #same as Qin + lateralflow = np.bincount(self.var.KinematicUpsOfMCTConfluence, weights=self.var.ChanQAvgDt)[self.var.MCTConfluenceIndex] #same as Qin # contribution to the MCT pixel from upstream Kinematic pixels self.var.QInConfM3 = maskinfo.in_zero() diff --git a/src/lisflood/hydrological_modules/mctheadwater.py b/src/lisflood/hydrological_modules/mctheadwater.py index be994d9f..5f80a63e 100755 --- a/src/lisflood/hydrological_modules/mctheadwater.py +++ b/src/lisflood/hydrological_modules/mctheadwater.py @@ -107,6 +107,7 @@ def initial(self): self.var.IsStructureChan = np.where(self.var.MCTHeadwaterSitesC > 0, np.bool8(1), self.var.IsStructureChan) # Add reservoir locations to structures map (used to modify LddChan # and to calculate LddStructuresChan) + pass # # PCRaster part # # ----------------------- diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index d28e91ca..ba5a7458 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -144,6 +144,7 @@ def initial(self): self.var.LddToChan = lddrepair(ifthenelse(self.var.IsChannelPcr, 5, self.var.Ldd)) #pcr self.var.LddToChanNp=compressArray(self.var.LddToChan) #np # Routing of runoff (incl. groundwater) to the river channel + # LDD for routing runoff (incl. groundwater) to the channel if option['dynamicWave']: pass @@ -178,6 +179,8 @@ def initial(self): self.var.LddKinematic = self.var.LddChan self.var.LddKinematicNp = compressArray(self.var.LddKinematic) # np + # At this point, LddChan and LddKinematic do not have sinks at reservoirs/lakes or MCT headwater and MCT confluences + # LddMCT does not exist yet # ************************************************************ # ***** MCT DRAINAGE NETWORK GEOMETRY - LDD ***************** @@ -538,6 +541,7 @@ def initialKinematicWave(self): # Initialise parallel kinematic wave router: main channel-only routing if self.var.ChannelAlpha2 is None; else split-routing(main channel + floodplains) # Initialization includes LDD for kinematic routing maskinfo = MaskInfo.instance() + self.river_router = kinematicWave(compressArray(self.var.LddKinematic), ~maskinfo.info.mask, self.var.ChannelAlpha, self.var.Beta, self.var.ChanLength, self.var.DtRouting, alpha_floodplains=self.var.ChannelAlpha2, flagnancheck=flags['nancheck']) diff --git a/src/lisflood/hydrological_modules/structures.py b/src/lisflood/hydrological_modules/structures.py index 44dbeaa8..706101dd 100755 --- a/src/lisflood/hydrological_modules/structures.py +++ b/src/lisflood/hydrological_modules/structures.py @@ -81,3 +81,4 @@ def initial(self): # Update LddKinematic by adding a pit in the pixel immediately upstream of a structure self.var.LddChan = lddrepair(ifthenelse(IsUpsOfStructureChan, 5, self.var.LddChan)) #pcr map # Update LddChan by adding a pit in the pixel immediately upstream of a structure + pass From 0e7b95d74a585f52f417f86b26b7f8443393eea9 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Wed, 13 May 2026 11:05:21 +0000 Subject: [PATCH 13/35] Fixed MCT confluence points (sideflows) for MCT cells with upstream contribution from Kinematic and MCT cells --- src/lisflood/Lisflood_initial.py | 13 +++++++++---- .../hydrological_modules/mctconfluence.py | 18 +++++++++++++----- src/lisflood/hydrological_modules/routing.py | 11 ++++++++--- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index af5adf99..014c9c70 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -218,7 +218,10 @@ def __init__(self): self.structures_module.initial() # Structures such as reservoirs and lakes are modelled by interrupting the channel flow paths - # At this point we have reservoirs/lakes MCT headwater in the LDD + # At this point we have reservoirs/lakes and MCT headwater points in the LDD + + self.mctconfluence_module.initial() + # initialising MCT confluence points and adding MCT confluence to the LDD # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- @@ -235,12 +238,14 @@ def __init__(self): self.routing_module.initialMCT() # initialising Muskingum-Cunge-Todini routing for channel - self.mctconfluence_module.initial() - # initialising MCT confluence pixels - self.mctheadwater_module.dynamic_init() self.mctconfluence_module.dynamic_init() + # self.routing_module.initialKinematicWave() + # this cannot be here because I need river_router in the MCT initialization + + + self.evapowater_module.initial() self.riceirrigation_module.initial() diff --git a/src/lisflood/hydrological_modules/mctconfluence.py b/src/lisflood/hydrological_modules/mctconfluence.py index 387ead80..1bfe6b9c 100755 --- a/src/lisflood/hydrological_modules/mctconfluence.py +++ b/src/lisflood/hydrological_modules/mctconfluence.py @@ -18,7 +18,7 @@ """ from __future__ import print_function, absolute_import -from pcraster import Scalar, numpy2pcr, pcr2numpy,downstream, boolean,lddrepair,ifthenelse +from pcraster import Scalar, numpy2pcr, pcr2numpy,downstream, boolean,lddrepair,ifthenelse,lddmask from nine import range import numpy as np from ..global_modules.settings import LisSettings, MaskInfo @@ -79,18 +79,26 @@ def initial(self): # Assign a number to each non-missing pixel as cell id, starting from 0 inAr = compressArray(inArPcr) - down = (compressArray(downstream(self.var.LddStructuresChan, inArPcr))).astype("int32") # np + down = (compressArray(downstream(self.var.LddChan, inArPcr))).astype("int32") # np # assign to each pixel the cell id of the pixel it is contributing to + # At this point, LddChan do not contain structures + + LddKinematic = lddmask(self.var.LddChan, self.var.IsChannelKinematicPcr) + # this is the same as the self.var.LddKinematic with only kinematic cells and no structures + # MCT pixels are masked out + + maskKinematic = (compressArray(LddKinematic) == 5) & (self.var.IsUpsOfStructureKinematicC != 1) - maskKinematic = (compressArray(self.var.LddKinematic) == 5) & (self.var.IsUpsOfStructureKinematicC != 1) maskKinematic[compressArray(self.var.AtLastPoint) == 1] = False # find location of KIN pixels (only) in LddKin that are at the confluence with an MCT pixel # do not include sinks upstream of structures (lakes, reservoirs, MCT headwater pixels) and outlets maskKinematicPcr = boolean(decompress(maskKinematic)) self.var.LddChan = ifthenelse(maskKinematicPcr, 5, self.var.LddChan) - # Adding sink at the last KIN pixels upstream of the confluence with an MCT pixel to LddChan - # already added to LddKinematic + self.var.LddKinematic = ifthenelse(maskKinematicPcr, 5, self.var.LddKinematic) + # Adding sinks to Ldd at the last KIN pixels upstream of the confluence with an MCT pixel to LddChan and LddKinematic + # This similar to what is done in structures + # At this point LddChan and LddKinematic only have points upstream of a Kin-MCT confluence self.var.KinematicUpsOfMCTConfluence = np.where(maskKinematic, down, 0) # find last KIN pixels upstream of the confluence with an MCT pixel and assign it the id of the downstream MCT pixel diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index ba5a7458..5f2cd6d3 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -208,6 +208,11 @@ def initial(self): self.var.mctmask = np.bool8(pcr2numpy(self.var.IsChannelMCTPcr,0)) # Create a mask with cells using MCT + self.var.IsChannelKinematicPcr = (self.var.IsChannelPcr == 1) & (self.var.IsChannelMCTPcr == 0) #pcr + self.var.IsChannelKinematic = np.bool8(compressArray(self.var.IsChannelKinematicPcr)) #np + # Identify channel pixels where Kinematic wave is used instead of MCT + + # ************************************************************ # ***** MCT DRAINAGE NETWORK GEOMETRY - LDD ***************** # ************************************************************ @@ -604,9 +609,9 @@ def initialMCT(self): if option['MCTRouting'] and not option['InitLisflood']: maskinfo = MaskInfo.instance() - self.var.IsChannelKinematicPcr = (self.var.IsChannelPcr == 1) & (self.var.IsChannelMCTPcr == 0) #pcr - self.var.IsChannelKinematic = np.bool8(compressArray(self.var.IsChannelKinematicPcr)) #np - # Identify channel pixels where Kinematic wave is used instead of MCT + # self.var.IsChannelKinematicPcr = (self.var.IsChannelPcr == 1) & (self.var.IsChannelMCTPcr == 0) #pcr + # self.var.IsChannelKinematic = np.bool8(compressArray(self.var.IsChannelKinematicPcr)) #np + # # Identify channel pixels where Kinematic wave is used instead of MCT self.var.LddMCT = lddmask(self.var.LddChan, self.var.IsChannelMCTPcr) #pcr # Ldd for MCT routing From 187e7480924423b6b6d71fbf3564c6ff7bc520d4 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Thu, 14 May 2026 10:48:49 +0000 Subject: [PATCH 14/35] Included MCT Headwater into MCT Confluence then removed MCT headwater. Water balance is closing. --- src/lisflood/Lisflood_initial.py | 18 +++--- .../hydrological_modules/mctconfluence.py | 11 ++-- .../hydrological_modules/mctheadwater.py | 56 +++++++++++-------- src/lisflood/hydrological_modules/routing.py | 12 ++-- .../hydrological_modules/structures.py | 14 ++--- .../hydrological_modules/waterbalance.py | 3 + 6 files changed, 64 insertions(+), 50 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index 014c9c70..10593b8d 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -140,7 +140,7 @@ def __init__(self): self.surface_routing_module = surface_routing(self) self.reservoir_module = Reservoir(self) # get_reservoir(option['reservoirHanazaki']) self.lakes_module = lakes(self) - self.mctheadwater_module = mctheadwater(self) + # self.mctheadwater_module = mctheadwater(self) self.mctconfluence_module = mctconfluence(self) self.polder_module = polder(self) self.waterabstraction_module = waterabstraction(self) @@ -211,18 +211,19 @@ def __init__(self): self.lakes_module.initial() self.polder_module.initial() - self.mctheadwater_module.initial() - # initialising MCT headwater pixels - self.transmission_module.initial() - self.structures_module.initial() - # Structures such as reservoirs and lakes are modelled by interrupting the channel flow paths - # At this point we have reservoirs/lakes and MCT headwater points in the LDD + # self.mctheadwater_module.initial() + # # initialising MCT headwater pixels and adding pixels upstream of MCT headwater to the LDD self.mctconfluence_module.initial() # initialising MCT confluence points and adding MCT confluence to the LDD + # At this point LddKinematic and LddChan have pits upstream of (structures) reservoirs and lakes but not at MCT interface pixels + self.structures_module.initial() + # Structures such as reservoirs and lakes are modelled by interrupting the channel flow paths + # At this point LddKinematic and LddChan have pits upstream of (structures) reservoirs and lakes and at MCT interface pixels + # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- @@ -238,7 +239,7 @@ def __init__(self): self.routing_module.initialMCT() # initialising Muskingum-Cunge-Todini routing for channel - self.mctheadwater_module.dynamic_init() + # self.mctheadwater_module.dynamic_init() self.mctconfluence_module.dynamic_init() # self.routing_module.initialKinematicWave() @@ -247,6 +248,7 @@ def __init__(self): + self.evapowater_module.initial() self.riceirrigation_module.initial() self.waterabstraction_module.initial() diff --git a/src/lisflood/hydrological_modules/mctconfluence.py b/src/lisflood/hydrological_modules/mctconfluence.py index 1bfe6b9c..be7cfafe 100755 --- a/src/lisflood/hydrological_modules/mctconfluence.py +++ b/src/lisflood/hydrological_modules/mctconfluence.py @@ -85,13 +85,14 @@ def initial(self): LddKinematic = lddmask(self.var.LddChan, self.var.IsChannelKinematicPcr) # this is the same as the self.var.LddKinematic with only kinematic cells and no structures + # pits added at the last Kin pixel before confluence to MCT pixels # MCT pixels are masked out - maskKinematic = (compressArray(LddKinematic) == 5) & (self.var.IsUpsOfStructureKinematicC != 1) + maskKinematic = (compressArray(LddKinematic) == 5) #& (self.var.IsUpsOfStructureKinematicC != 1) maskKinematic[compressArray(self.var.AtLastPoint) == 1] = False # find location of KIN pixels (only) in LddKin that are at the confluence with an MCT pixel - # do not include sinks upstream of structures (lakes, reservoirs, MCT headwater pixels) and outlets + # this does NOT include sinks upstream of structures (lakes, reservoirs) and outlets maskKinematicPcr = boolean(decompress(maskKinematic)) self.var.LddChan = ifthenelse(maskKinematicPcr, 5, self.var.LddChan) @@ -147,7 +148,7 @@ def dynamic_inloop(self, NoRoutingExecuted: int): option = settings.options maskinfo = MaskInfo.instance() - self.var.QConfADDEDM3 = maskinfo.in_zero() + # self.var.QConfADDEDM3 = maskinfo.in_zero() if option['MCTRouting'] and not option['InitLisflood']: @@ -169,8 +170,8 @@ def dynamic_inloop(self, NoRoutingExecuted: int): self.var.QInConfM3Old = self.var.QInConfM3.copy() # save the lateral flow for next step - self.var.QConfADDEDM3 += self.var.QConfM3Dt - # adding volume to the water balance + # self.var.QConfADDEDM3 += self.var.QConfM3Dt + diff --git a/src/lisflood/hydrological_modules/mctheadwater.py b/src/lisflood/hydrological_modules/mctheadwater.py index 5f80a63e..fb956764 100755 --- a/src/lisflood/hydrological_modules/mctheadwater.py +++ b/src/lisflood/hydrological_modules/mctheadwater.py @@ -21,6 +21,7 @@ from pcraster import scalar, upstream from pcraster import Scalar, numpy2pcr, pcr2numpy +from pcraster import downstream, boolean, cover, lddrepair, ifthenelse from nine import range import numpy as np from ..global_modules.settings import LisSettings, MaskInfo @@ -88,7 +89,9 @@ def initial(self): mctheadwater = (self.var.mctmask & (UpStreamMCT == 0) & (UpStream != 0)).astype(int) # identify pixels in the MCT network that are head MCT pixels and are not general head pixels - mctheadwater = compressArray(numpy2pcr(Scalar, mctheadwater, 0)) + mctheadwaterPcr = numpy2pcr(Scalar, mctheadwater, 0) + + mctheadwater = compressArray(mctheadwaterPcr) mctheadwater[np.isnan(mctheadwater)] = 0.0 # flatten and add mask @@ -99,26 +102,32 @@ def initial(self): self.var.MCTHeadwaterSitesCC = np.compress(mctheadwater > 0, mctheadwater) self.var.MCTHeadwaterIndex = np.nonzero(mctheadwater)[0] - # Add MCT headwater locations to structures map - # (used to modify LddKinematic and to calculate LddStructuresKinematic) - self.var.IsStructureKinematic = np.where(self.var.MCTHeadwaterSitesC > 0, np.bool8(1), self.var.IsStructureKinematic) - # Add reservoir locations to structures map (used to modify LddKinematic - # and to calculate LddStructuresKinematic) - self.var.IsStructureChan = np.where(self.var.MCTHeadwaterSitesC > 0, np.bool8(1), self.var.IsStructureChan) - # Add reservoir locations to structures map (used to modify LddChan - # and to calculate LddStructuresChan) - pass - - # # PCRaster part - # # ----------------------- - # MCTHeadwaterSitePcr = numpy2pcr(Scalar, mctheadwater, 0) - # MCTHeadwaterSitePcr = pcraster.ifthen((pcraster.defined(MCTHeadwaterSitePcr) & pcraster.boolean(decompress(self.var.IsChannel))), MCTHeadwaterSitePcr) - # IsStructureMCTheadwater = pcraster.boolean(MCTHeadwaterSitePcr) - # # additional structure map only for lakes to calculate water balance - # # self.var.IsUpsOfStructureLake = pcraster.downstream(self.var.LddKinematic, pcraster.cover(IsStructureLake, 0)) - # self.var.IsUpsOfStructureMCTHeadwater = pcraster.downstream(self.var.LddChan, pcraster.cover(IsStructureMCTheadwater, 0)) - # # Get all pixels just upstream of MCT headwater cells to calulate water balance - # # ----------------------- + # # Add MCT headwater locations to structures map + # # (used to modify LddKinematic and to calculate LddStructuresKinematic) + # self.var.IsStructureKinematic = np.where(self.var.MCTHeadwaterSitesC > 0, np.bool8(1), self.var.IsStructureKinematic) + # # Add reservoir locations to structures map (used to modify LddKinematic + # # and to calculate LddStructuresKinematic) + # self.var.IsStructureChan = np.where(self.var.MCTHeadwaterSitesC > 0, np.bool8(1), self.var.IsStructureChan) + # # Add reservoir locations to structures map (used to modify LddChan + # # and to calculate LddStructuresChan) + + # at this point, Ldd already have pits upstream of reservoirs and lakes + IsUpsOfMCTHeadwaterKinematic = downstream( #pcr map + self.var.LddKinematic, + cover(boolean(decompress(self.var.MCTHeadwaterSitesC)), boolean(0)) + ) + # Find location of pixels immediately upstream of an MCT Headwater pixel on the LddKinematic + + IsUpsOfMCTHeadwaterChan = downstream( #pcr map + self.var.LddChan, + cover(boolean(decompress(self.var.MCTHeadwaterSitesC)), boolean(0)) + ) + # Find location of pixels immediately upstream of a structure on the LddChan + + self.var.LddKinematic = lddrepair(ifthenelse(IsUpsOfMCTHeadwaterKinematic, 5, self.var.LddKinematic)) #pcr map + # Update LddKinematic by adding a pit in the pixel immediately upstream of a MCT headwater pixel + self.var.LddChan = lddrepair(ifthenelse(IsUpsOfMCTHeadwaterChan, 5, self.var.LddChan)) #pcr map + # Update LddChan by adding a pit in the pixel immediately upstream of a MCT headwater pixel def dynamic_init(self): @@ -147,7 +156,7 @@ def dynamic_inloop(self, NoRoutingExecuted: int): option = settings.options maskinfo = MaskInfo.instance() - self.var.QHeadADDEDM3 = maskinfo.in_zero() + # self.var.QHeadADDEDM3 = maskinfo.in_zero() if option['MCTRouting'] and not option['InitLisflood']: @@ -174,8 +183,7 @@ def dynamic_inloop(self, NoRoutingExecuted: int): self.var.QInHeadM3Old = self.var.QInHeadM3.copy() # save the upstream flow for next step - self.var.QHeadADDEDM3 += self.var.QHeadM3Dt - # adding volume to the water balance + # self.var.QHeadADDEDM3 += self.var.QHeadM3Dt diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 5f2cd6d3..a927683d 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -63,7 +63,7 @@ def __init__(self, routing_variable): self.polder_module = polder(self.var) self.inflow_module = inflow(self.var) self.transmission_module = transmission(self.var) - self.mctheadwater_module = mctheadwater(self.var) + # self.mctheadwater_module = mctheadwater(self.var) self.mctconfluence_module = mctconfluence(self.var) # -------------------------------------------------------------------------- @@ -833,11 +833,11 @@ def dynamic(self, NoRoutingExecuted): self.var.ChanM3 = ChanM3 self.var.ChanQAvgDt = ChanQAvgDt # -> used to calc q0m - # MCT HEADWATER - self.mctheadwater_module.dynamic_inloop(NoRoutingExecuted) - # calculate sideflow from MCT headwater pixels - SideflowChanM3 += self.var.QHeadM3Dt - # MCT headwater pixels outflow volume per routing sub step [m3] + # # MCT HEADWATER + # self.mctheadwater_module.dynamic_inloop(NoRoutingExecuted) + # # calculate sideflow from MCT headwater pixels + # SideflowChanM3 += self.var.QHeadM3Dt + # # MCT headwater pixels outflow volume per routing sub step [m3] # MCT CONFLUENCE self.mctconfluence_module.dynamic_inloop(NoRoutingExecuted) diff --git a/src/lisflood/hydrological_modules/structures.py b/src/lisflood/hydrological_modules/structures.py index 706101dd..5b20a6fa 100755 --- a/src/lisflood/hydrological_modules/structures.py +++ b/src/lisflood/hydrological_modules/structures.py @@ -62,7 +62,7 @@ def initial(self): cover(boolean(decompress(self.var.IsStructureKinematic)), boolean(0)) ) # Downstream assigns to result the expression value of the neighbouring downstream cell - # Over is used to cover missing values on an expression with values taken from one or more different expression(s) + # Cover is used to cover missing values on an expression with values taken from one or more different expression(s) # Decompress is numpy2pcr # Find location of pixels immediately upstream of a structure on the LddKinematic @@ -72,13 +72,13 @@ def initial(self): ) # Find location of pixels immediately upstream of a structure on the LddChan - self.var.IsUpsOfStructureKinematicC = compressArray(IsUpsOfStructureKinematic) #np compressed array - # Location of pixels immediately upstream of a structure on the LddKinematic - self.var.IsUpsOfStructureChanC = compressArray(IsUpsOfStructureChan) #np compressed array - # Location of pixels immediately upstream of a structure on the LddChan - self.var.LddKinematic = lddrepair(ifthenelse(IsUpsOfStructureKinematic, 5, self.var.LddKinematic)) #pcr map # Update LddKinematic by adding a pit in the pixel immediately upstream of a structure self.var.LddChan = lddrepair(ifthenelse(IsUpsOfStructureChan, 5, self.var.LddChan)) #pcr map # Update LddChan by adding a pit in the pixel immediately upstream of a structure - pass + # At this point LddKinematic and LddChan have pits upstream of (structures) reservoirs and lakes but not at MCT interface pixels + + self.var.IsUpsOfStructureKinematicC = compressArray(IsUpsOfStructureKinematic) #np compressed array + # Location of pixels immediately upstream of a structure on the LddKinematic + self.var.IsUpsOfStructureChanC = compressArray(IsUpsOfStructureChan) #np compressed array + # Location of pixels immediately upstream of a structure on the LddChan diff --git a/src/lisflood/hydrological_modules/waterbalance.py b/src/lisflood/hydrological_modules/waterbalance.py index 09b8ba2e..006e5d40 100755 --- a/src/lisflood/hydrological_modules/waterbalance.py +++ b/src/lisflood/hydrological_modules/waterbalance.py @@ -250,6 +250,7 @@ def dynamic(self): # DisStru = np.where(self.var.IsUpsOfStructureKinematicC, self.var.ChanQ * self.var.DtRouting, 0) DisStru = np.where(self.var.IsUpsOfStructureChanC, self.var.ChanQAvgDt * self.var.DtRouting, 0) #np # using average discharge + # At this point self.var.IsUpsOfStructureChanC only includes structures (reservoirs and lakes) DisStru[self.var.AtLastPointC == 1 ] = 0 # this line avoids double-counting when a reservoir or a lake is located at the outlet of the cacthment DischargeM3Structures = np.take(np.bincount(self.var.Catchments, weights=DisStru), self.var.Catchments) #np @@ -288,6 +289,8 @@ def dynamic(self): self.var.WaterInit = WaterStored + DischargeM3Structures + + if option['TransientLandUseChange'] and (self.var.DynamicLandCoverDelta > 0.0): self.var.WaterInit = WaterStored_nextstep + DischargeM3Structures # update the water storage From 8bd0192d2cc00ff626584355bec5877b88e6e35d Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Thu, 14 May 2026 16:57:18 +0000 Subject: [PATCH 15/35] Fixed double counting of Kinematic pixel contribution when res/lake is on the MCT confluence cell --- src/lisflood/Lisflood_initial.py | 14 +++++----- .../hydrological_modules/mctconfluence.py | 26 +++++++++---------- src/lisflood/hydrological_modules/routing.py | 4 --- .../hydrological_modules/structures.py | 8 +++--- 4 files changed, 22 insertions(+), 30 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index 10593b8d..bb0a0626 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -205,7 +205,7 @@ def __init__(self): self.inflow_module.initial() self.surface_routing_module.initial() - # At this point LddChan and LddKinematic do not have any structure reservoirs/lakes MCT headwater MCT confluence + # At this point LddChan and LddKinematic do not have any structure reservoirs/lakes MCT confluence self.reservoir_module.initial() self.lakes_module.initial() @@ -213,16 +213,14 @@ def __init__(self): self.transmission_module.initial() + self.structures_module.initial() + # Structures such as reservoirs and lakes are modelled by interrupting the channel flow paths + # At this point LddKinematic and LddChan have pits upstream of (structures) reservoirs and lakes + # self.mctheadwater_module.initial() # # initialising MCT headwater pixels and adding pixels upstream of MCT headwater to the LDD - self.mctconfluence_module.initial() - # initialising MCT confluence points and adding MCT confluence to the LDD - - # At this point LddKinematic and LddChan have pits upstream of (structures) reservoirs and lakes but not at MCT interface pixels - self.structures_module.initial() - # Structures such as reservoirs and lakes are modelled by interrupting the channel flow paths - # At this point LddKinematic and LddChan have pits upstream of (structures) reservoirs and lakes and at MCT interface pixels + # initialising MCT confluence points and adding MCT confluence sinks to the LDD # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- diff --git a/src/lisflood/hydrological_modules/mctconfluence.py b/src/lisflood/hydrological_modules/mctconfluence.py index be7cfafe..7a383956 100755 --- a/src/lisflood/hydrological_modules/mctconfluence.py +++ b/src/lisflood/hydrological_modules/mctconfluence.py @@ -77,21 +77,21 @@ def initial(self): inArPcr = decompress(np.arange(maskinfo.info.mapC[0], dtype="int32")) # pcr # Assign a number to each non-missing pixel as cell id, starting from 0 - inAr = compressArray(inArPcr) + inAr = compressArray(inArPcr) #np - down = (compressArray(downstream(self.var.LddChan, inArPcr))).astype("int32") # np + down = (compressArray(downstream(self.var.LddStructuresChan, inArPcr))).astype("int32") # np # assign to each pixel the cell id of the pixel it is contributing to - # At this point, LddChan do not contain structures + # LddStructuresChan do not contain structures, LddStructuresKinematic is same as LddStructuresChan - LddKinematic = lddmask(self.var.LddChan, self.var.IsChannelKinematicPcr) - # this is the same as the self.var.LddKinematic with only kinematic cells and no structures - # pits added at the last Kin pixel before confluence to MCT pixels - # MCT pixels are masked out + LddKinematic = lddmask(self.var.LddStructuresChan, self.var.IsChannelKinematicPcr) + # Mask of LddKinematic with only kinematic cells and no structures + # Sinks are added at the last Kin pixel before confluence with MCT pixels maskKinematic = (compressArray(LddKinematic) == 5) #& (self.var.IsUpsOfStructureKinematicC != 1) + # find location of KIN pixels (only) in LddKin that are upstream of the confluence with an MCT pixel maskKinematic[compressArray(self.var.AtLastPoint) == 1] = False - # find location of KIN pixels (only) in LddKin that are at the confluence with an MCT pixel + # remove sinks that are outlets # this does NOT include sinks upstream of structures (lakes, reservoirs) and outlets maskKinematicPcr = boolean(decompress(maskKinematic)) @@ -99,7 +99,7 @@ def initial(self): self.var.LddKinematic = ifthenelse(maskKinematicPcr, 5, self.var.LddKinematic) # Adding sinks to Ldd at the last KIN pixels upstream of the confluence with an MCT pixel to LddChan and LddKinematic # This similar to what is done in structures - # At this point LddChan and LddKinematic only have points upstream of a Kin-MCT confluence + # At this point LddChan and LddKinematic have sinks upstteam of structures and of a Kin-MCT confluence and outlets self.var.KinematicUpsOfMCTConfluence = np.where(maskKinematic, down, 0) # find last KIN pixels upstream of the confluence with an MCT pixel and assign it the id of the downstream MCT pixel @@ -109,12 +109,10 @@ def initial(self): # for each element in KinematicUpsOfMCTConfluence (they are Kinematic cells), get the value of the downstream cell, # then find the position ix of that same value in inAr (vector with numbering of all cells) this is the position of the MCT confluence cell, # read the inAr value and put 1 in the corrisponding position in mctconfluence - # identify location of MCT pixels that receive a contribution from an upstream KIN pixel (with no structure on it) + # identify location of MCT pixels that receive a contribution from an upstream KIN pixel - # mctconfluence[self.var.MCTHeadwaterSitesC == 1] = 0 - # # remove headwater cells from the list of confluence cells because they are treated differently - # mctconfluence[compressArray(self.var.AtLastPoint) == 1] = 0 - # # remove outlets points if any + mctconfluence = np.where(self.var.IsStructureChan, 0, mctconfluence) + # remove the MCT cells with a structure (reservoir/lake) on them self.var.MCTConfluenceSitesC = mctconfluence self.var.MCTConfluenceSitesCC = np.compress(mctconfluence > 0, mctconfluence) diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index a927683d..7d565522 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -819,10 +819,6 @@ def dynamic(self, NoRoutingExecuted): # First, Kinematic/Split routing is solved on all pixels (including MCT pixels) then results are updated # for the MCT pixels. - - # # Sideflow contribution to MCT grid cells expressed in [m3/s] - # SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql - # Grab outflow at the end of the previous routing step t for all pixels) - current state of the MCT pixel ChanQ_0 = self.var.ChanQ.copy() # Outflow (x+dx) at time t (end of previous routing step) (instant) -> used to calc q00 ChanM3_0 = self.var.ChanM3.copy() # Channel storage at time t (end of previous routing step) (instant) V00 diff --git a/src/lisflood/hydrological_modules/structures.py b/src/lisflood/hydrological_modules/structures.py index 5b20a6fa..66feb771 100755 --- a/src/lisflood/hydrological_modules/structures.py +++ b/src/lisflood/hydrological_modules/structures.py @@ -45,13 +45,13 @@ def initial(self): """ self.var.LddStructuresKinematic = self.var.LddKinematic #pcr map LddStructuresKinematicNp = compressArray(self.var.LddStructuresKinematic) - # Unmodified version of LddKinematic is needed to connect inflow and outflow points - # of each structure (called LddStructuresKinematic now) + # Unmodified version of LddKinematic is needed for MCT confluence + # Legacy not used keeping for consistency self.var.LddStructuresChan = self.var.LddChan #pcr map LddStructuresChanNp = compressArray(self.var.LddStructuresChan) - # Unmodified version of LddChan is needed to connect inflow and outflow points - # of each structure (called LddStructuresChan now) + # Unmodified version of LddChan is used in evapowater, indicatorcalc and waterabstreaction + # It is neded to identify MCT confluences settings = LisSettings.instance() option = settings.options From 0b274c830982591abc424ee3631b69b6aa834340 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Fri, 15 May 2026 16:18:01 +0000 Subject: [PATCH 16/35] Fixed large outflow at the first simulation step when repMBE=1 --- src/lisflood/Lisflood_initial.py | 4 +++- src/lisflood/hydrological_modules/routing.py | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index bb0a0626..3be7a194 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -193,10 +193,12 @@ def __init__(self): self.snow_module.initial() self.frost_module.initial() + self.leafarea_module.initial() - self.soilloop_module.initial() + self.soilloop_module.initial() self.soil_module.initial() + self.routing_module.initial() self.groundwater_module.initial() diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 7d565522..3d21a1a0 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -291,6 +291,10 @@ def initial(self): TotalCrossSectionAreaHalfBankFull = BankFullPerc * self.var.TotalCrossSectionAreaBankFull # set BankFullPerc to 0.5 for half bankfull + # # Channel volume initialization for MCT cells + # TotalCrossSectionAreaHalfBankFull = np.where(self.var.IsChannelKinematic, TotalCrossSectionAreaHalfBankFull, 0.01 * self.var.TotalCrossSectionAreaBankFull) + # # set initial volume in MCT cells to 1% of bankfull + TotalCrossSectionAreaInitValue = loadmap('TotalCrossSectionAreaInitValue') self.var.TotalCrossSectionArea = np.where(TotalCrossSectionAreaInitValue == -9999, TotalCrossSectionAreaHalfBankFull, TotalCrossSectionAreaInitValue) # Total cross-sectional area [m2]: if initial value in binding equals -9999 the value at half bankfull is used, @@ -557,7 +561,7 @@ def initialKinematicWave(self): if option['InitLisflood'] and option['repMBTs']: # Calculate initial water storage in rivers (no lakes no reservoirs) # self.var.StorageStepINIT= self.var.ChanM3Kin - self.var.StorageStepINIT = self.var.ChanM3 + self.var.StorageStepINIT = self.var.ChanM3.copy() # Initial water volume in river channels self.var.DischargeM3StructuresIni = maskinfo.in_zero() if option['simulateReservoirs']: @@ -567,7 +571,7 @@ def initialKinematicWave(self): self.var.StorageStepINIT = np.take(np.bincount(self.var.Catchments, weights=self.var.StorageStepINIT), self.var.Catchments) if not option['InitLisflood'] and option['repMBTs']: - self.var.StorageStepINIT = self.var.ChanM3 + self.var.StorageStepINIT = self.var.ChanM3.copy() # DisStructure = np.where(self.var.IsUpsOfStructureKinematicC, self.var.ChanQ * self.var.DtRouting, 0) DisStructure = np.where(self.var.IsUpsOfStructureChanC, self.var.ChanQ * self.var.DtRouting, 0) if not(option['SplitRouting']): From dfb72740aa04080e9e5ecfc33851818e9e0c4531 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Fri, 15 May 2026 16:19:45 +0000 Subject: [PATCH 17/35] Changed initialization of MCT cells to 1% of bankfull --- src/lisflood/hydrological_modules/routing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 3d21a1a0..4d7c1809 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -291,9 +291,9 @@ def initial(self): TotalCrossSectionAreaHalfBankFull = BankFullPerc * self.var.TotalCrossSectionAreaBankFull # set BankFullPerc to 0.5 for half bankfull - # # Channel volume initialization for MCT cells - # TotalCrossSectionAreaHalfBankFull = np.where(self.var.IsChannelKinematic, TotalCrossSectionAreaHalfBankFull, 0.01 * self.var.TotalCrossSectionAreaBankFull) - # # set initial volume in MCT cells to 1% of bankfull + # Channel volume initialization for MCT cells + TotalCrossSectionAreaHalfBankFull = np.where(self.var.IsChannelKinematic, TotalCrossSectionAreaHalfBankFull, 0.01 * self.var.TotalCrossSectionAreaBankFull) + # set initial volume in MCT cells to 1% of bankfull TotalCrossSectionAreaInitValue = loadmap('TotalCrossSectionAreaInitValue') self.var.TotalCrossSectionArea = np.where(TotalCrossSectionAreaInitValue == -9999, TotalCrossSectionAreaHalfBankFull, TotalCrossSectionAreaInitValue) From 707f1a7bc410534ceebdf528791596a1d17ba585 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Mon, 18 May 2026 10:17:06 +0000 Subject: [PATCH 18/35] Read calibration inflow points and make them available to mct routing (wiring) --- src/lisflood/hydrological_modules/inflow.py | 13 +++++++++++++ src/lisflood/hydrological_modules/mct.py | 20 ++++++++++++-------- src/lisflood/hydrological_modules/routing.py | 3 ++- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/lisflood/hydrological_modules/inflow.py b/src/lisflood/hydrological_modules/inflow.py index ebbe712d..22691a44 100755 --- a/src/lisflood/hydrological_modules/inflow.py +++ b/src/lisflood/hydrological_modules/inflow.py @@ -54,6 +54,19 @@ def initial(self): # ************************************************************ settings = LisSettings.instance() option = settings.options + + + ##################################################################################### + #cm + + self.var.CalInflowPoints = loadmap('InflowPoints') # 1D array size is pixels belonging to basin mask + # read location of calibration inflow points + # this is the location of grid cells that are used as inflows in the calibration suite + # this is the grid cell where the calibration point is contributing to + ##################################################################################### + + + if option['inflow']: self.var.InflowPoints = loadmap('InflowPoints') #1D array size is pixels belonging to basin mask diff --git a/src/lisflood/hydrological_modules/mct.py b/src/lisflood/hydrological_modules/mct.py index 99f0ad22..5230beb0 100644 --- a/src/lisflood/hydrological_modules/mct.py +++ b/src/lisflood/hydrological_modules/mct.py @@ -20,6 +20,7 @@ def __init__( dt, # computation time step for routing [s] river_router, # class mapping_mct, # MCT pixels mapping + CalInflowPoints, # inflow points used by the calibration suite ): # Process flow direction matrix: downstream and upstream lookups, and routing orders @@ -37,6 +38,7 @@ def __init__( self.dt = dt self.river_router = river_router self.mapping_mct = mapping_mct + self.CalInflowPoints = CalInflowPoints def _setMCTRoutingOrders(self): @@ -103,10 +105,11 @@ def routing( PrevCm0, # Courant number in input: at time t; in output: at time t+dt PrevDm0, # Reynolds number in input: at time t; in output: at time t+dt ChanM3, # V11 as output + self.CalInflowPoints, # inflow points used by the calibration suite ) -@njit(parallel=True, fastmath=False, cache=True) +# @njit(parallel=True, fastmath=False, cache=True) def mct_routing( # static inputs (not changing between time steps) ChanLength, # Channel length @@ -130,6 +133,7 @@ def mct_routing( PrevCm0, # Courant number in input: at time t; in output: at time t+dt PrevDm0, # Reynolds number in input: at time t; in output: at time t+dt ChanM3, # V11 as output + CalInflowPoints, # inflow points used by the calibration suite ): """This function implements Muskingum-Cunge-Todini routing method MCT routing is calculated on MCT pixels only but gets inflow from both Kinematic/Split and MCT upstream pixels. @@ -202,7 +206,7 @@ def mct_routing( PrevDm0[kinpix] = Dm1 # Reynolds number at the end of routing step t+dt (instant) -@njit(nogil=True, fastmath=False, cache=True) +# @njit(nogil=True, fastmath=False, cache=True) def MCTRouting_single( V00, q10, q01, q00, ql, q0mm, Cm0, Dm0, dt, xpix, s0, Balv, ANalv, Nalv ): @@ -353,7 +357,7 @@ def MCTRouting_single( return q11, q1mm, V11, Cm1, Dm1 -@njit(nogil=True, fastmath=False, cache=True) +# @njit(nogil=True, fastmath=False, cache=True) def hoq(q, s0, Balv, ANalv, Nalv): """Water depth h from discharge q. Given a generic cross-section (rectangular, triangular or trapezoidal) and a steady-state discharge q=Q*, it computes @@ -431,7 +435,7 @@ def hoq(q, s0, Balv, ANalv, Nalv): return y -@njit(nogil=True, fastmath=False, cache=True) +# @njit(nogil=True, fastmath=False, cache=True) def qoh(y, s0, Balv, ANalv, Nalv): """Discharge q from water depth h. Given a generic river cross-section (rectangular, triangular and trapezoidal) @@ -485,7 +489,7 @@ def qoh(y, s0, Balv, ANalv, Nalv): return q, a, b, p, cel -@njit(nogil=True, fastmath=False, cache=True) +# @njit(nogil=True, fastmath=False, cache=True) def hoV(V, xpix, Balv, ANalv): """Water depth h from volume V. Given a generic river cross-section (rectangular, triangular and trapezoidal) and a river channel volume V, @@ -520,7 +524,7 @@ def hoV(V, xpix, Balv, ANalv): return y -@njit(nogil=True, fastmath=False, cache=True) +# @njit(nogil=True, fastmath=False, cache=True) def qoV(V, xpix, s0, Balv, ANalv, Nalv): """Discharge q from river channel volume V. Given a generic river cross-section (rectangular, triangular and trapezoidal) @@ -542,13 +546,13 @@ def qoV(V, xpix, s0, Balv, ANalv, Nalv): return q -@njit(nogil=True, fastmath=False, cache=True) +# @njit(nogil=True, fastmath=False, cache=True) def cotan(x): """There is no cotangent function in numpy""" return np.cos(x) / np.sin(x) -@njit(nogil=True, fastmath=False, cache=True) +# @njit(nogil=True, fastmath=False, cache=True) def rad_from_dxdy(dxdy): """Calculate radians""" rad = np.arctan(1 / dxdy) diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 4d7c1809..c710231c 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -662,7 +662,8 @@ def initialMCT(self): self.var.ChanSdXdY, # Riverbed side slope self.var.DtRouting, # computation time step for routing [s] self.river_router, # class - mapping_mct # MCT pixels mapping + mapping_mct, # MCT pixels mapping + self.var.CalInflowPoints, # inflow points used by the calibration suite ) From 59bb86225542d9d99dc79e2fc20b8478155e096f Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Mon, 18 May 2026 11:07:29 +0000 Subject: [PATCH 19/35] Fixed wiring --- src/lisflood/Lisflood_initial.py | 5 ++++- src/lisflood/hydrological_modules/routing.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index 3be7a194..87908c1e 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -199,12 +199,15 @@ def __init__(self): self.soilloop_module.initial() self.soil_module.initial() + self.inflow_module.initial() + # moved here because I am using it to read the calibration inflow points location + self.routing_module.initial() self.groundwater_module.initial() self.waterlevel_module.initial() - self.inflow_module.initial() + # self.inflow_module.initial() self.surface_routing_module.initial() # At this point LddChan and LddKinematic do not have any structure reservoirs/lakes MCT confluence diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index c710231c..83e39959 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -649,6 +649,9 @@ def initialMCT(self): mct_ldd = self.compress_mct(compressArray(self.var.LddMCT)) # Compress LddMCT to array with MCT pixels only + mct_CalInflowPoints = self.compress_mct(self.var.CalInflowPoints) + # Compress CalInflowPoints to array with MCT pixels only + mapping_mct = self.compress_mct(range(len(self.var.ChanLength))) # create mapping from global domain pixels index to MCT pixels index @@ -663,7 +666,7 @@ def initialMCT(self): self.var.DtRouting, # computation time step for routing [s] self.river_router, # class mapping_mct, # MCT pixels mapping - self.var.CalInflowPoints, # inflow points used by the calibration suite + mct_CalInflowPoints, # inflow points used by the calibration suite ) From b0bd6490f117606110915f39cd10d41546beafba Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Mon, 18 May 2026 15:20:16 +0000 Subject: [PATCH 20/35] Introduced feature to inject streamflow as lateral inflow at calibration points on MCT grid cells. --- src/lisflood/Lisflood_initial.py | 5 +-- src/lisflood/hydrological_modules/inflow.py | 12 ------- .../kinematic_wave_parallel.py | 9 +++++ src/lisflood/hydrological_modules/mct.py | 33 ++++++++++++++----- src/lisflood/hydrological_modules/routing.py | 23 ++++++++++--- 5 files changed, 54 insertions(+), 28 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index 87908c1e..3be7a194 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -199,15 +199,12 @@ def __init__(self): self.soilloop_module.initial() self.soil_module.initial() - self.inflow_module.initial() - # moved here because I am using it to read the calibration inflow points location - self.routing_module.initial() self.groundwater_module.initial() self.waterlevel_module.initial() - # self.inflow_module.initial() + self.inflow_module.initial() self.surface_routing_module.initial() # At this point LddChan and LddKinematic do not have any structure reservoirs/lakes MCT confluence diff --git a/src/lisflood/hydrological_modules/inflow.py b/src/lisflood/hydrological_modules/inflow.py index 22691a44..2f7b598b 100755 --- a/src/lisflood/hydrological_modules/inflow.py +++ b/src/lisflood/hydrological_modules/inflow.py @@ -55,18 +55,6 @@ def initial(self): settings = LisSettings.instance() option = settings.options - - ##################################################################################### - #cm - - self.var.CalInflowPoints = loadmap('InflowPoints') # 1D array size is pixels belonging to basin mask - # read location of calibration inflow points - # this is the location of grid cells that are used as inflows in the calibration suite - # this is the grid cell where the calibration point is contributing to - ##################################################################################### - - - if option['inflow']: self.var.InflowPoints = loadmap('InflowPoints') #1D array size is pixels belonging to basin mask diff --git a/src/lisflood/hydrological_modules/kinematic_wave_parallel.py b/src/lisflood/hydrological_modules/kinematic_wave_parallel.py index 1f4d5fd2..dbb50b02 100755 --- a/src/lisflood/hydrological_modules/kinematic_wave_parallel.py +++ b/src/lisflood/hydrological_modules/kinematic_wave_parallel.py @@ -74,6 +74,7 @@ def streamLookups(flow_dir, land_mask): ''' Compute the downstream lookup vector for a D8 water flow channel network, i.e. the adjecency list of the directed graph describing flow direction from each pixel. + Each land_mask pixel is assigned a unique id from 0 to numpix-1, numbered by row Arguments: flow_dir (numpy.ndarray): LISFLOOD flow matrix values (FLOW_CODE). land_mask (numpy.ndarray): land mask on coordinate mesh. @@ -82,12 +83,20 @@ def streamLookups(flow_dir, land_mask): upstream lookup (numpy.ndarray): each row gives the immediately upstream pixels (-1 = fill value); size = num_pixels, max_ups_pixs <= 8 ''' flow_dir[~land_mask] = 8 # exceeds number of rows of IX_ADDS + # assign 8 to all pixels not belonging to land_mask num_pixs = land_mask.sum() + # count number of pixels in land_mask + # Create 2D array of indices of land pixels (each index is unique) # The IDs are numbered from 0 to num_pixs-1 land_points = -np.ones(land_mask.shape, int) land_points[land_mask] = np.arange(num_pixs, dtype=int) + # every land pixel has now a unique id (pixel id) + downstream_lookup, upstream_lookup = kwpt.upDownLookups(flow_dir, np.ascontiguousarray(land_mask).astype(np.uint8), land_points, num_pixs, IX_ADDS) + # downstream_lookup[i] = index of the cell receiving flow from node i + # upstream_lookup[i, :] = indices of all cells draining into node i + max_num_ups_pixs = max(1, np.any(upstream_lookup != -1, 0).sum()) # maximum number of upstreams pixels return downstream_lookup, np.ascontiguousarray(upstream_lookup[:,:max_num_ups_pixs]).astype(int) diff --git a/src/lisflood/hydrological_modules/mct.py b/src/lisflood/hydrological_modules/mct.py index 5230beb0..bfb5091d 100644 --- a/src/lisflood/hydrological_modules/mct.py +++ b/src/lisflood/hydrological_modules/mct.py @@ -20,12 +20,13 @@ def __init__( dt, # computation time step for routing [s] river_router, # class mapping_mct, # MCT pixels mapping - CalInflowPoints, # inflow points used by the calibration suite + CalibPointsIds, # calibration points pixels ids ): # Process flow direction matrix: downstream and upstream lookups, and routing orders flow_dir = decodeFlowMatrix(rebuildFlowMatrix(compressed_encoded_ldd, land_mask)) self.downstream_lookup, self.upstream_lookup = streamLookups(flow_dir, land_mask) + # Inside streamLookups each land_mask pixel is assigned a unique id from 0 to numpix-1, numbered by row self.num_upstream_pixels = (self.upstream_lookup != -1).sum(1).astype(int) # astype for cython import in windows (to avoid 'long long' buffer dtype mismatch) # Routing order: decompose domain into batches; within each batch, pixels can be routed in parallel self._setMCTRoutingOrders() @@ -38,7 +39,7 @@ def __init__( self.dt = dt self.river_router = river_router self.mapping_mct = mapping_mct - self.CalInflowPoints = CalInflowPoints + self.CalibPointsIds = CalibPointsIds def _setMCTRoutingOrders(self): @@ -105,7 +106,7 @@ def routing( PrevCm0, # Courant number in input: at time t; in output: at time t+dt PrevDm0, # Reynolds number in input: at time t; in output: at time t+dt ChanM3, # V11 as output - self.CalInflowPoints, # inflow points used by the calibration suite + self.CalibPointsIds, # inflow points used by the calibration suite ) @@ -133,7 +134,7 @@ def mct_routing( PrevCm0, # Courant number in input: at time t; in output: at time t+dt PrevDm0, # Reynolds number in input: at time t; in output: at time t+dt ChanM3, # V11 as output - CalInflowPoints, # inflow points used by the calibration suite + CalibPointsIds, # inflow points used by the calibration suite ): """This function implements Muskingum-Cunge-Todini routing method MCT routing is calculated on MCT pixels only but gets inflow from both Kinematic/Split and MCT upstream pixels. @@ -152,6 +153,8 @@ def mct_routing( ChanM3, # V11 channel storage volume at t+dt (instant) """ + + num_orders = mct_order_start_stop.shape[0] # loop on orders @@ -164,6 +167,7 @@ def mct_routing( mctpix = mct_pixels_ordered[index] # Find the corresponding pixel id in the full LDD kinpix = mapping_mct[mctpix] + # Find id of upstream contributing pixels (from full LDD) upstream_pixels = upstream_lookup[kinpix] @@ -171,11 +175,25 @@ def mct_routing( q00 = 0.0 q0m = 0.0 q01 = 0.0 + + ql = SideflowChanMCT[kinpix] # Sideflow during step dt + for ups_ix in range(num_upstream_pixels[kinpix]): ups_pix = upstream_pixels[ups_ix] # upstream pixel id - q00 += ChanQ_0[ups_pix] # Inflow (x) to the pixel at previous step t (instant) - q0m += ChanQAvgDt[ups_pix] # Average inflow (x) to the pixel at previous step t (average) - q01 += ChanQ[ups_pix] # Inflow (x) at current step t+dt (instant) + + ##################################################################################################### + # This is necessary for EFAS6/GloFAs5 calibration + if np.any(CalibPointsIds == ups_pix): + # this upstream pixel is a calibration point - add to sideflow + ql += ChanQAvgDt[ups_pix] + # Sideflow during step dt including contribution from calibration pixel + else: + # not a calibration point - go as usual + q00 += ChanQ_0[ups_pix] # Inflow (x) to the pixel at previous step t (instant) + q0m += ChanQAvgDt[ups_pix] # Average inflow (x) to the pixel at previous step t (average) + q01 += ChanQ[ups_pix] # Inflow (x) at current step t+dt (instant) + + ##################################################################################################### # get outflow from the pixel at previous step t q10 = ChanQ_0[kinpix] # Outflow (x+dx) from the pixel at previous step t (instant) @@ -185,7 +203,6 @@ def mct_routing( Cm0 = PrevCm0[kinpix] # Courant number at the end of previous step t Dm0 = PrevDm0[kinpix] # Reynolds number at the end of previous step t - ql = SideflowChanMCT[kinpix] # Sideflow during step dt # static data xpix = ChanLength[kinpix] # Channel length diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 83e39959..80331ef0 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -52,7 +52,8 @@ class routing(HydroModule): 'ChanBottomWMult', 'ChanDepthTMult', 'ChanSMult'], 'SplitRouting': ['CrossSection2AreaInitValue', 'PrevSideflowInitValue', 'CalChanMan2'], 'dynamicWave': ['ChannelsDynamic'], - 'MCTRouting': ['ChannelsMCT', 'ChanGradMaxMCT', 'PrevCmMCTInitValue', 'PrevDmMCTInitValue', 'CalChanMan3']} + 'MCTRouting': ['ChannelsMCT', 'ChanGradMaxMCT', 'PrevCmMCTInitValue', 'PrevDmMCTInitValue', 'CalChanMan3'], + 'inflow': ['InflowPoints']} module_name = 'Routing' def __init__(self, routing_variable): @@ -643,14 +644,28 @@ def initialMCT(self): # Reynolds number (Dm) for MCT at previous time step t0 + # ************************************************************ + # ***** CALIBRATION INFLOW POINTS ******** + # ************************************************************ + + CalibPoints = loadmap('InflowPoints') # 1D array size + # read location of calibration points + + inAr = np.arange(maskinfo.info.mapC[0], dtype="int32") # np + # Assign a number to each non-missing pixel as cell id, by row starting from 0 + + CalibPointsIds = inAr[CalibPoints != 0] + # pixel id of calibration points + + # ************************************************************ # ***** INITIALISE MUSKINGUM-CUNGE-TODINI WAVE ROUTER ******** # ************************************************************ mct_ldd = self.compress_mct(compressArray(self.var.LddMCT)) # Compress LddMCT to array with MCT pixels only - mct_CalInflowPoints = self.compress_mct(self.var.CalInflowPoints) - # Compress CalInflowPoints to array with MCT pixels only + # mct_CalInflowPoints = self.compress_mct(self.var.CalInflowPoints) + # # Compress CalInflowPoints to array with MCT pixels only mapping_mct = self.compress_mct(range(len(self.var.ChanLength))) # create mapping from global domain pixels index to MCT pixels index @@ -666,7 +681,7 @@ def initialMCT(self): self.var.DtRouting, # computation time step for routing [s] self.river_router, # class mapping_mct, # MCT pixels mapping - mct_CalInflowPoints, # inflow points used by the calibration suite + CalibPointsIds, # id of calibrationn points in full LDD ) From 9cd982f98cac32e4f53c0d3aa4b0c7412e0b8d7d Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Mon, 18 May 2026 16:04:01 +0000 Subject: [PATCH 21/35] Switching on the parallelisation in mct.py --- src/lisflood/hydrological_modules/mct.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lisflood/hydrological_modules/mct.py b/src/lisflood/hydrological_modules/mct.py index bfb5091d..9678734e 100644 --- a/src/lisflood/hydrological_modules/mct.py +++ b/src/lisflood/hydrological_modules/mct.py @@ -110,7 +110,7 @@ def routing( ) -# @njit(parallel=True, fastmath=False, cache=True) +@njit(parallel=True, fastmath=False, cache=True) def mct_routing( # static inputs (not changing between time steps) ChanLength, # Channel length @@ -223,7 +223,7 @@ def mct_routing( PrevDm0[kinpix] = Dm1 # Reynolds number at the end of routing step t+dt (instant) -# @njit(nogil=True, fastmath=False, cache=True) +@njit(nogil=True, fastmath=False, cache=True) def MCTRouting_single( V00, q10, q01, q00, ql, q0mm, Cm0, Dm0, dt, xpix, s0, Balv, ANalv, Nalv ): @@ -374,7 +374,7 @@ def MCTRouting_single( return q11, q1mm, V11, Cm1, Dm1 -# @njit(nogil=True, fastmath=False, cache=True) +@njit(nogil=True, fastmath=False, cache=True) def hoq(q, s0, Balv, ANalv, Nalv): """Water depth h from discharge q. Given a generic cross-section (rectangular, triangular or trapezoidal) and a steady-state discharge q=Q*, it computes @@ -452,7 +452,7 @@ def hoq(q, s0, Balv, ANalv, Nalv): return y -# @njit(nogil=True, fastmath=False, cache=True) +@njit(nogil=True, fastmath=False, cache=True) def qoh(y, s0, Balv, ANalv, Nalv): """Discharge q from water depth h. Given a generic river cross-section (rectangular, triangular and trapezoidal) @@ -506,7 +506,7 @@ def qoh(y, s0, Balv, ANalv, Nalv): return q, a, b, p, cel -# @njit(nogil=True, fastmath=False, cache=True) +@njit(nogil=True, fastmath=False, cache=True) def hoV(V, xpix, Balv, ANalv): """Water depth h from volume V. Given a generic river cross-section (rectangular, triangular and trapezoidal) and a river channel volume V, @@ -541,7 +541,7 @@ def hoV(V, xpix, Balv, ANalv): return y -# @njit(nogil=True, fastmath=False, cache=True) +@njit(nogil=True, fastmath=False, cache=True) def qoV(V, xpix, s0, Balv, ANalv, Nalv): """Discharge q from river channel volume V. Given a generic river cross-section (rectangular, triangular and trapezoidal) @@ -563,13 +563,13 @@ def qoV(V, xpix, s0, Balv, ANalv, Nalv): return q -# @njit(nogil=True, fastmath=False, cache=True) +@njit(nogil=True, fastmath=False, cache=True) def cotan(x): """There is no cotangent function in numpy""" return np.cos(x) / np.sin(x) -# @njit(nogil=True, fastmath=False, cache=True) +@njit(nogil=True, fastmath=False, cache=True) def rad_from_dxdy(dxdy): """Calculate radians""" rad = np.arctan(1 / dxdy) From 33699ecdccdcc7ae6055e56ff0e88b2f9249278e Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Tue, 19 May 2026 14:29:20 +0000 Subject: [PATCH 22/35] Added option simulateCalibrationPoints (default:off) and key CalibrationPoints to settings file --- src/lisflood/global_modules/default_options.py | 1 + src/lisflood/hydrological_modules/routing.py | 14 +++++++------- src/lisfloodSettings_reference.xml | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/lisflood/global_modules/default_options.py b/src/lisflood/global_modules/default_options.py index 94181f80..aa2a9968 100644 --- a/src/lisflood/global_modules/default_options.py +++ b/src/lisflood/global_modules/default_options.py @@ -1288,6 +1288,7 @@ 'repwateruseGauges': False, 'repwateruseSites': False, 'riceIrrigation': False, + 'simulateCalibrationPoints': False, 'simulateLakes': False, 'simulatePF': False, 'simulatePolders': False, diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 80331ef0..3313b654 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -53,7 +53,7 @@ class routing(HydroModule): 'SplitRouting': ['CrossSection2AreaInitValue', 'PrevSideflowInitValue', 'CalChanMan2'], 'dynamicWave': ['ChannelsDynamic'], 'MCTRouting': ['ChannelsMCT', 'ChanGradMaxMCT', 'PrevCmMCTInitValue', 'PrevDmMCTInitValue', 'CalChanMan3'], - 'inflow': ['InflowPoints']} + 'simulateCalibrationPoints': ['CalibrationPoints']} module_name = 'Routing' def __init__(self, routing_variable): @@ -645,16 +645,16 @@ def initialMCT(self): # ************************************************************ - # ***** CALIBRATION INFLOW POINTS ******** + # ***** CALIBRATION POINTS ******** # ************************************************************ - - CalibPoints = loadmap('InflowPoints') # 1D array size - # read location of calibration points + CalibPoints = maskinfo.in_zero() + if option['simulateCalibrationPoints']: + CalibPoints = loadmap('CalibrationPoints') # 1D array size all catchment pixels + # read location of calibration points inAr = np.arange(maskinfo.info.mapC[0], dtype="int32") # np # Assign a number to each non-missing pixel as cell id, by row starting from 0 - - CalibPointsIds = inAr[CalibPoints != 0] + CalibPointsIds = inAr[CalibPoints > 0] # pixel id of calibration points diff --git a/src/lisfloodSettings_reference.xml b/src/lisfloodSettings_reference.xml index 8c45ae72..4f6024c7 100644 --- a/src/lisfloodSettings_reference.xml +++ b/src/lisfloodSettings_reference.xml @@ -1723,6 +1723,13 @@ You can use builtin path variables in this template and reference to other paths + + + location of calibration points + OPTIONAL: nominal map with locations of calibration points + + + OPTIONAL: observed or simulated input hydrographs as time series [cu m / s] @@ -5639,6 +5646,13 @@ You can use builtin path variables in this template and reference to other paths + + + location of calibration points + OPTIONAL: nominal map with locations of calibration points + + + Observed or simulated input hydrographs as From ed36e5989d06268e9be8e464e54c284e4cd21c4b Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Tue, 19 May 2026 16:00:49 +0000 Subject: [PATCH 23/35] Added option MCTRoutingInterface (default:off) --- src/lisflood/Lisflood_initial.py | 11 ++++++----- src/lisflood/global_modules/default_options.py | 1 + src/lisflood/hydrological_modules/mctconfluence.py | 6 +++--- src/lisflood/hydrological_modules/routing.py | 10 ++++++---- src/lisfloodSettings_reference.xml | 1 + 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index 3be7a194..314b3171 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -221,8 +221,9 @@ def __init__(self): # self.mctheadwater_module.initial() # # initialising MCT headwater pixels and adding pixels upstream of MCT headwater to the LDD - self.mctconfluence_module.initial() - # initialising MCT confluence points and adding MCT confluence sinks to the LDD + if option.get('MCTRoutingInterface'): + self.mctconfluence_module.initial() + # initialising MCT confluence points and adding MCT confluence sinks to the LDD # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- @@ -238,9 +239,9 @@ def __init__(self): if option.get('MCTRouting'): self.routing_module.initialMCT() # initialising Muskingum-Cunge-Todini routing for channel - - # self.mctheadwater_module.dynamic_init() - self.mctconfluence_module.dynamic_init() + if option.get('MCTRoutingInterface'): + # self.mctheadwater_module.dynamic_init() + self.mctconfluence_module.dynamic_init() # self.routing_module.initialKinematicWave() # this cannot be here because I need river_router in the MCT initialization diff --git a/src/lisflood/global_modules/default_options.py b/src/lisflood/global_modules/default_options.py index aa2a9968..9b1fc742 100644 --- a/src/lisflood/global_modules/default_options.py +++ b/src/lisflood/global_modules/default_options.py @@ -10,6 +10,7 @@ 'MonteCarlo': False, 'SplitRouting': False, 'MCTRouting': False, + 'MCTRoutingInterface': False, 'TemperatureInKelvin': False, 'TransLoss': False, 'TransientLandUseChange': False, diff --git a/src/lisflood/hydrological_modules/mctconfluence.py b/src/lisflood/hydrological_modules/mctconfluence.py index 7a383956..bfc66ec8 100755 --- a/src/lisflood/hydrological_modules/mctconfluence.py +++ b/src/lisflood/hydrological_modules/mctconfluence.py @@ -73,7 +73,7 @@ def initial(self): option = settings.options binding = settings.binding maskinfo = MaskInfo.instance() - if option['MCTRouting']: + if option['MCTRouting'] and option['MCTRoutingInterface']: inArPcr = decompress(np.arange(maskinfo.info.mapC[0], dtype="int32")) # pcr # Assign a number to each non-missing pixel as cell id, starting from 0 @@ -126,7 +126,7 @@ def dynamic_init(self): """ settings = LisSettings.instance() option = settings.options - if option['MCTRouting']: + if option['MCTRouting'] and option['MCTRoutingInterface']: self.var.QInConfM3Old = np.where(self.var.MCTConfluenceSitesC > 0, self.var.ChanQAvgDt * self.var.DtSec, 0) @@ -148,7 +148,7 @@ def dynamic_inloop(self, NoRoutingExecuted: int): # self.var.QConfADDEDM3 = maskinfo.in_zero() - if option['MCTRouting'] and not option['InitLisflood']: + if option['MCTRouting'] and option['MCTRoutingInterface'] and not option['InitLisflood']: InvDtSecDay = 1 / float(86400) # InvDtSecDay=self.var.InvDtSec diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 3313b654..91a9ea05 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -198,6 +198,7 @@ def initial(self): if self.var.IsChannelMCT.sum() == 0: warnings.warn(LisfloodWarning('There are no MCT grid cell. MCT routing is deactivated')) option['MCTRouting'] = False + option['MCTRoutingInterface'] = False # rebuild lists of reported files with MCTRouting = False settings.build_reportedmaps_dicts() @@ -859,10 +860,11 @@ def dynamic(self, NoRoutingExecuted): # # MCT headwater pixels outflow volume per routing sub step [m3] # MCT CONFLUENCE - self.mctconfluence_module.dynamic_inloop(NoRoutingExecuted) - # calculate sideflow from MCT confluence pixels - SideflowChanM3 += self.var.QConfM3Dt - # MCT confluence pixels outflow volume per routing sub step [m3] + if option['MCTRoutingInterface']: + self.mctconfluence_module.dynamic_inloop(NoRoutingExecuted) + # calculate sideflow from MCT confluence pixels + SideflowChanM3 += self.var.QConfM3Dt + # MCT confluence pixels outflow volume per routing sub step [m3] # Sideflow contribution to MCT grid cells expressed in [m3/s] SideflowChanMCT = np.where(self.var.IsChannelMCT, SideflowChanM3 * self.var.InvDtRouting, 0) #Ql diff --git a/src/lisfloodSettings_reference.xml b/src/lisfloodSettings_reference.xml index 4f6024c7..0e93737a 100644 --- a/src/lisfloodSettings_reference.xml +++ b/src/lisfloodSettings_reference.xml @@ -50,6 +50,7 @@ You can use builtin path variables in this template and reference to other paths + # use inflow data From 10445f31509600f8cb5e087dcd01f8b3bc12c047 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Tue, 19 May 2026 16:04:43 +0000 Subject: [PATCH 24/35] Restored initialization of channel volume for MCT pixels to BankFullPerc --- src/lisflood/hydrological_modules/routing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 91a9ea05..5e3b8481 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -293,9 +293,9 @@ def initial(self): TotalCrossSectionAreaHalfBankFull = BankFullPerc * self.var.TotalCrossSectionAreaBankFull # set BankFullPerc to 0.5 for half bankfull - # Channel volume initialization for MCT cells - TotalCrossSectionAreaHalfBankFull = np.where(self.var.IsChannelKinematic, TotalCrossSectionAreaHalfBankFull, 0.01 * self.var.TotalCrossSectionAreaBankFull) - # set initial volume in MCT cells to 1% of bankfull + # # Channel volume initialization for MCT cells + # TotalCrossSectionAreaHalfBankFull = np.where(self.var.IsChannelKinematic, TotalCrossSectionAreaHalfBankFull, 0.01 * self.var.TotalCrossSectionAreaBankFull) + # # set initial volume in MCT cells to 1% of bankfull TotalCrossSectionAreaInitValue = loadmap('TotalCrossSectionAreaInitValue') self.var.TotalCrossSectionArea = np.where(TotalCrossSectionAreaInitValue == -9999, TotalCrossSectionAreaHalfBankFull, TotalCrossSectionAreaInitValue) From c3f391ec9054c19726a051dd77d95e53725303d6 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Wed, 20 May 2026 10:04:50 +0000 Subject: [PATCH 25/35] Cosmetic changes to variable name in inflow.py. Adding M3 to the variable name to be consistent with the rest of volume variables in the code --- src/lisflood/hydrological_modules/inflow.py | 6 +++--- src/lisflood/hydrological_modules/mctheadwater.py | 4 ++-- src/lisflood/hydrological_modules/routing.py | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lisflood/hydrological_modules/inflow.py b/src/lisflood/hydrological_modules/inflow.py index 2f7b598b..e24cf55e 100755 --- a/src/lisflood/hydrological_modules/inflow.py +++ b/src/lisflood/hydrological_modules/inflow.py @@ -111,7 +111,7 @@ def dynamic_init(self): settings = LisSettings.instance() option = settings.options if option['inflow']: - self.var.QDelta = (self.var.QInM3 - self.var.QInM3Old) * self.var.InvNoRoutSteps + self.var.QDeltaM3 = (self.var.QInM3 - self.var.QInM3Old) * self.var.InvNoRoutSteps # difference between old and new inlet flow per sub step # in order to calculate the amount of inlet flow in the routing loop @@ -147,6 +147,6 @@ def dynamic_inloop(self, NoRoutingExecuted): if option['inflow']: - self.var.QInDt = (self.var.QInM3Old + (NoRoutingExecuted + 1) * self.var.QDelta) * self.var.InvNoRoutSteps + self.var.QInM3Dt = (self.var.QInM3Old + (NoRoutingExecuted + 1) * self.var.QDeltaM3) * self.var.InvNoRoutSteps # flow from inlets per sub step - self.var.QinADDEDM3 += self.var.QInDt + self.var.QinADDEDM3 += self.var.QInM3Dt diff --git a/src/lisflood/hydrological_modules/mctheadwater.py b/src/lisflood/hydrological_modules/mctheadwater.py index fb956764..c6309048 100755 --- a/src/lisflood/hydrological_modules/mctheadwater.py +++ b/src/lisflood/hydrological_modules/mctheadwater.py @@ -173,11 +173,11 @@ def dynamic_inloop(self, NoRoutingExecuted: int): self.var.QInHeadM3 = maskinfo.in_zero() np.put(self.var.QInHeadM3, self.var.MCTHeadwaterIndex, inflow * self.var.DtSec) - self.var.QDeltaM3 = (self.var.QInHeadM3 - self.var.QInHeadM3Old) * self.var.InvNoRoutSteps + self.var.QDeltaHeadM3 = (self.var.QInHeadM3 - self.var.QInHeadM3Old) * self.var.InvNoRoutSteps # difference between old and new headwater flow per sub step # in order to calculate the amount of headwater flow in the routing loop - self.var.QHeadM3Dt = (self.var.QInHeadM3Old + (NoRoutingExecuted + 1) * self.var.QDeltaM3) * self.var.InvNoRoutSteps + self.var.QHeadM3Dt = (self.var.QInHeadM3Old + (NoRoutingExecuted + 1) * self.var.QDeltaHeadM3) * self.var.InvNoRoutSteps # output to the MCT headwater cells self.var.QInHeadM3Old = self.var.QInHeadM3.copy() diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 5e3b8481..9416a26f 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -727,7 +727,7 @@ def dynamic(self, NoRoutingExecuted): SideflowChanM3 -= self.var.WUseAddM3Dt # Water use abstraction from rivers - withdrawal [m3] if option['inflow']: - SideflowChanM3 += self.var.QInDt + SideflowChanM3 += self.var.QInM3Dt # Flow volume from inlets per sub step [m3] if option['TransLoss']: SideflowChanM3 -= self.var.TransLossM3Dt @@ -755,7 +755,7 @@ def dynamic(self, NoRoutingExecuted): if (NoRoutingExecuted<1): self.var.AddedTRUN = np.take(np.bincount(self.var.Catchments, weights=self.var.ToChanM3RunoffDt.copy()),self.var.Catchments) if option['inflow']: - self.var.AddedTRUN += np.take(np.bincount(self.var.Catchments, weights=self.var.QInDt),self.var.Catchments) + self.var.AddedTRUN += np.take(np.bincount(self.var.Catchments, weights=self.var.QInM3Dt),self.var.Catchments) if option['openwaterevapo']: self.var.AddedTRUN -= np.take(np.bincount(self.var.Catchments, weights=self.var.EvaAddM3Dt.copy()),self.var.Catchments) if option['wateruse']: @@ -763,7 +763,7 @@ def dynamic(self, NoRoutingExecuted): else: self.var.AddedTRUN += np.take(np.bincount(self.var.Catchments, weights=self.var.ToChanM3RunoffDt.copy()),self.var.Catchments) if option['inflow']: - self.var.AddedTRUN += np.take(np.bincount(self.var.Catchments, weights=self.var.QInDt),self.var.Catchments) + self.var.AddedTRUN += np.take(np.bincount(self.var.Catchments, weights=self.var.QInM3Dt),self.var.Catchments) if option['openwaterevapo']: self.var.AddedTRUN -= np.take(np.bincount(self.var.Catchments, weights=self.var.EvaAddM3Dt.copy()),self.var.Catchments) if option['wateruse']: From e8b4100d0b2d8c1724995fa96267ff1e8ecda441 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Wed, 20 May 2026 15:20:15 +0000 Subject: [PATCH 26/35] Fix template settings file and adding map for debugging --- src/lisfloodSettings_reference.xml | 3 ++- tests/data/LF_MCT_UseCase/maps/basin_p1.nc | Bin 0 -> 13034 bytes tests/data/LF_MCT_UseCase/maps/basin_p6.nc | Bin 0 -> 13034 bytes tests/data/LF_MCT_UseCase/maps/basin_up.nc | Bin 0 -> 13034 bytes tests/data/LF_MCT_UseCase/maps/chanmct_conf.nc | Bin 0 -> 13548 bytes .../maps/chanmct_outlet_at_conf.nc | Bin 0 -> 13548 bytes .../LF_MCT_UseCase/maps/chanmct_sink_at_conf.nc | Bin 0 -> 13548 bytes .../LF_MCT_UseCase/maps/chanmct_start_in_5.nc | Bin 0 -> 13548 bytes .../LF_MCT_UseCase/maps/ec_ldd_sink_in_p6.nc | Bin 0 -> 17381 bytes .../data/LF_MCT_UseCase/maps/ec_ldd_sink_up.nc | Bin 0 -> 17381 bytes .../LF_MCT_UseCase/maps/interbasin_for_p2.nc | Bin 0 -> 13644 bytes .../LF_MCT_UseCase/maps/mask_one_up_inflow.nc | Bin 0 -> 13034 bytes tests/data/LF_MCT_UseCase/maps/outlets.csv | 10 ++++++++++ tests/data/LF_MCT_UseCase/maps/p2.nc | Bin 0 -> 13034 bytes tests/data/LF_MCT_UseCase/maps/p7.nc | Bin 0 -> 13034 bytes tests/data/LF_MCT_UseCase/maps/p8.nc | Bin 0 -> 13034 bytes tests/data/LF_MCT_UseCase/maps/point_p1.nc | Bin 0 -> 13034 bytes tests/data/LF_MCT_UseCase/maps/point_p6.nc | Bin 0 -> 13034 bytes tests/data/LF_MCT_UseCase/maps/point_up.nc | Bin 0 -> 13034 bytes 19 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 tests/data/LF_MCT_UseCase/maps/basin_p1.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/basin_p6.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/basin_up.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/chanmct_conf.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/chanmct_outlet_at_conf.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/chanmct_sink_at_conf.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/chanmct_start_in_5.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/ec_ldd_sink_in_p6.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/ec_ldd_sink_up.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/interbasin_for_p2.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/mask_one_up_inflow.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/outlets.csv create mode 100644 tests/data/LF_MCT_UseCase/maps/p2.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/p7.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/p8.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/point_p1.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/point_p6.nc create mode 100644 tests/data/LF_MCT_UseCase/maps/point_up.nc diff --git a/src/lisfloodSettings_reference.xml b/src/lisfloodSettings_reference.xml index 0e93737a..928ca2b2 100644 --- a/src/lisfloodSettings_reference.xml +++ b/src/lisfloodSettings_reference.xml @@ -46,11 +46,12 @@ You can use builtin path variables in this template and reference to other paths + - + # use inflow data diff --git a/tests/data/LF_MCT_UseCase/maps/basin_p1.nc b/tests/data/LF_MCT_UseCase/maps/basin_p1.nc new file mode 100644 index 0000000000000000000000000000000000000000..8f5b9605d76262ff6f6b2af534ca1dd951f86b1d GIT binary patch literal 13034 zcmeHNYiv|S6h6DRTej_OU9^^mBrFfLR#ItGOfbCKeRLbjwsr|5YP`AZz0iyMD7#zJ z8l$0qj5MNR;xAH?8VySPVUS<`;13bRsF08tqY3x}3{7mJ0Ymf$o->bq(FWRzCF#s& z@3}K`=JlO(cF&oaw~rhq-K$xdRw1fn zlX6<^1{bmTeDqxGrYAs<6VRLKMT2Va0``y8P5X~eBxm^BZe6%MJ*)Hd= zLAg9-p3C#JSkzWIae_8q`2Ne!vJjiNr25F=$UIFcPmsM^fsA1V@weU{95N za)T)+mu0gfMw(qx-w0Scjmj<;TtohNI-Rkcl$o>r>An7eOnSc^&pGLo{v5y}wl=2m z*_@fO%#2mg`X!=^LK9=iDD?Kp%`2Dg)K*kOmhyC#+Io#yDav3m?{7>{DN7%-8-S%^ zJg%)$CuAwt4ass>I%{n`5L@y-X&N6dE-Wc22CQVZ>=GJ^1~KF*lJ?iJ`axf;v4j{NlG%5W?ef<1M-%5}>HUeXr0dg>kh zGn%6w;#yzF70ZYQdNb(({C#q4u3)Q?o0`08XR@d#n_JhVnA&e{Yu?!0vaa9SyJ2%n zb4zP;D_`zk^z(>mJ16Y<=daZXdfEDXZ#&UdyExTeCQx8agH{ zNl!(%($b~omH3nnP`+TA7xbc!NwTlYL=J~z=w^W&S-K38O3n)CMQ@UP zD_+wn+_}dDgQVlXd_KaQtuw+mEjU|OzP)&`$ZZ}ja+~9gm$&5I=C#zN8^ZwUE)!go z?#Syj8HzagoV?&!M6X&C%S*4gvCJ#Jd-O!!APrZK5e@|`BEkvegNAHroP(Ygb0@Kp zqrbPi5lHqv7N9C z=Rr%OsE8@`G)PQ{_0n1h8JVXQj9*KP-4=^5CO^1vSN7lMQcm&d$QV6hf4iCFx|%SX+@$W8NKYIGa37%8W`+@+Ie^m+Y zC892oYKcTkRHRh2#oAP&CnW-ZcddEyzN|@gy08)G4D@u<4~z7R*gIzBzrXzVlmCb1 zy)5Kssx1QY@a0foT)AfWa%=Lh!( zWmL7N`JhN*e&!L51UvHgG1(L*U-pywPWDeK wmA9n1*#9tgb5GZu`G|AB=$xPR%LV zX^qjqixDC!CO(mp)M!xRgF&8r;DrccR7gmS(FA+|Llc{5zz}`FbLMCN+J^p!kTA2^ zd+yAfIWzN}GrQ-^%-fM*xVCzEwcG0jnQn_T(ZWkMh>BBh9C*Da66|y9=iRGWnN}gH zWRr4Q?FJXI_pAHG(#N~rvGz9vN01aQmPaWt4qY<@p zajU;I=p-Ere26pe)z8?eXFW(|8q`2Ne!vJjiNr25F>Ft(FjB8XM^chPilf1KP*Noy z+;GatW!dP6kw%x)Hv-nqV6w{v*N8u!PG>A9W#(*uy5B#PN$<7eIVYXcp95IL=Ef{O zn=@0EnXw91zeI>AG%-eug0xR=Ub!^YTG0$y%F}sT>ovAYQ3s2;yfHzgE`4m>04x># zach+}AxpV!NR~U&d0Xqg*pm0j(s+Myv67Oa!%DW6UBW_fL5z5cwEgwD?MFIyMuMnk zR4Yx>YMgk2H?4vyA!BJ0>KIoQanVvnuEuh%BR@U4G8~JAU{4*da@}%)m#hV@o_a_B zjK-*kxYgHj!!n|Q-b{K3f1ezi8`x^(rY5i2nJn7L=9cv-X7-y~n>IEzuOGDf+cq~h zHMcai@ag_VKaZHUbHbi~{#u=&mo3ltb`V{)i&O1IPOloAp0zmr)Zz3{iqmA4)5B{z zS^M+LIIZ+?iXw|3q#jgK2q**;0tx|zfI{GYKp@-~=|vxdoC)E~(Ws=0hK>nK(o+$x zv~;O?B|fDClrNa!1-+|+gT;6n(M6b8C)w9$B8S5$a#sQCj|hNYp9*8LgL{Y9*Uc}_+ZjbJAH#6_HjUb``jL)YKfE9x`ZQ!N9M03(G+V>F@!EHN2(b%@0sL{PGwiA}&IB04V z6)~fp0f`AQUz!UcBl9$a@oS0k*{up`QhA%s+ct{9w7^xtHakep-yb!6Umkokunhs~ zL-um%@t=Pv4?Y@LP*cn`+3;4^{8rePLWy!^Njh0Gxwms?cNhVGim+q>FF^NkzYo5l z;p1v1U~U{-xfXU)f!J<1^V^4;U=KB6K`y|#k!Skg0CBLG9}WG`{(~?^1uVqJy&b*% z1E{4YEbvC^jC}z|sQ@Dx(s;v--@oG4+<`ev@$W8NKYIGa37%8WyMh4Ie^m+YC8{pb zYKcZmOr%t`#nx0}CnXAhcddEyuFOdZeXtSe3iNc-4~z7R*gIzBzrXzVlmCb12QV1vn6aoqXg@8gpA)pXY2q**;0tx|zfI{HjAfWa%?+xzvORs8A z^M299y%|S1670<1$7Dm8eA#2p=@3qC8A?i0@|Ohz-5s$QyDUg2RLV zX^qjqixDC!CO(mp)M!xRgF&8r;DrccR7gmS(FA+|Llc{5zz}`FbLMCN+J^p!kTA2^ zd+yAfIWzN}GrQ-^%-fM*xVCzEwcG0jnQn_T(ZWkMh>BBh9C*Da66|y9=iRGWnN}gH zWRr4Q?FJXI_pAHG(#N~rvGz9vN01aQmPaWt4qY<@p zajU;I=p-Ere26pe)z8?eXFW(|8q`2Ne!vJjiNr25F>Ft(FjB8XM^chPilf1KP*Noy z+;GatW!dP6kw%x)Hv-nqV6w{v*N8u!PG>A9W#(*uy5B#PN$<7eIVYXcp95IL=Ef{O zn=@0EnXw91zeI>AG%-eug0xR=Ub!^YTG0$y%F}sT>ovAYQ3s2;yfHzgE`4m>04x># zach+}AxpV!NR~U&d0Xqg*pm0j(s+Myv67Oa!%DW6UBW_fL5z5cwEgwD?MFIyMuMnk zR4Yx>YMgk2H?4vyA!BJ0>KIoQanVvnuEuh%BR@U4G8~JAU{4*da@}%)m#hV@o_a_B zjK-*kxYgHj!!n|Q-b{K3f1ezi8`x^(rY5i2nJn7L=9cv-X7-y~n>IEzuOGDf+cq~h zHMcai@ag_VKaZHUbHbi~{#u=&mo3ltb`V{)i&O1IPOloAp0zmr)Zz3{iqmA4)5B{z zS^M+LIIZ+?T7(~oS4knD5Kssx1QY@af%^o3a9^YseGGCYgfmA2lP(%MCM-!$MYz(^ zrRJ6Rlnzk7V1^g;t_lto<7vdmV`80TU!RE_4#&{V0@<_lAtaTY70`>`B>7gnrc1bU zj|m1z$A9_!0CTp^2;a2eY+d>G;{GDHd9=uFjyGOz&%4cQNu(RY0O>9hT$HBdbs7vs z9DGb(@GPQNZ5_)?ueh0Sj{{v5};FL^81M z5W4=Dn|YR8Qt2S)C61mH093A_cCHGEhi`Z&Zsy{HNjsIpSUda5gm84< z>pk4eyxTT{hypM^pF#ju4BoVXm;MsXNyBL0M^FT}?FdC<+j^o#_qNzhScc=EsZmtK zjCuwnCd7PcE`*HC(+tM1CB|pBDx^u}Z8~q;C&Yj(11pFz&k_Ef~-N*et_=bj$ ztC@hgad72Y*i8juyWz}lA8vv@)Px1O0Ov-Y>4O8r!D45Fht;^!5*+ zmYT4@8>ut)1stUUjATgT4L5%Oid%CB<}k&-yKw#J=@Tb-PCf4m0!;r^CAgQUxk)Q;D6FDE!^E=E=Jy)5Kssx1QY@afqR31+S9x@xZf|msy)s7 zMHBaC9N|c?Gk+hG4Po+Sk2$A9IJspgDM`s+77TQE#A58SAe~szE@I&@D;DVJ4k7Ez zmmcSE-SNM;=$Ie%G*=wweYuh5Fu!Y!bpE%2&j0#C;ZR>F8VK?8zh@CfLenyHX4cLX z4gxI)44tAq|Kj@@|Ht}&08L&^xd?%O0j6VGvH$=8 literal 0 HcmV?d00001 diff --git a/tests/data/LF_MCT_UseCase/maps/chanmct_conf.nc b/tests/data/LF_MCT_UseCase/maps/chanmct_conf.nc new file mode 100644 index 0000000000000000000000000000000000000000..d5ff8c3d3f8b195f9822a8c7949e4645bb991c6b GIT binary patch literal 13548 zcmeHNeQZ-z6hE(z&8>DY5I30^9*p3`ZFXHjhv3-y;l@5-AEJrITGlsx+PyCA8?+iT zFn;0?6Qc1CLkx)t3}S*N{-MSUqo5LjK#WnNF($?@G{z94CI-*BAMM^gw1X^0eYa^( z?>*<-kKZ}>zH{HbPqYNXCGHBhtEdQMIxo^$KQHkLMq$@$e{5_CcDqXYU9M%UP@N-q zQfDG{yFek4%NGNQs>Lwp60Y*Bpl=9TxRA;fSs^IteJ(C3IU);6rnf+F%D9fov!I&# zwyWlg%$uxXk#Wes5rJPuKYE;d94HF&50|1S(o-c>7m|<7*BXJBtOx(4;6IN}Q81S{ z>PjgI@au5S6aA$elb3}192NPZ1yrsoe%2zudM*Z#razNPB{x6nxfY!~KT#ni-2U6> z_1`r2wghpISVB%7s~V}|GR06Vgu6xqdvOYNHg$yHGAtuy`eyJu_Wkqw05%3%+NK+! zXE8~uP=Jk0RZAME`zn6sf`=p`ox0T*>-PtZ0V4*bh%=wR8fz5W1W%C4RJart;s+vO zBOc!zjSuNl8jQ><(UFvDA;Wprpg~#FtaB+VYR00;Sj3DD=xnUzC`Mx)OeXHt`z#}2 zM$(bKL?Rh8%&4V%8UPAW-^~XXPndV-bSs2zTFWVDiGD3tmq!D*1l0?<`jBZ@Db_5l zMbvDEZt2PA-G?5Y?6KMP3B@Q~sK<^n&jeUYrp2^HP-#y~cUSa4^>Xt=v&6B?EJJq{U(8upnbISAq5($hH;f8`9!7EJR8 zCkUS-$mdm8A@zHtxLZAVWa2#civ=t<&kw~qjxniXLc0W&V^w}PuOlbbaLZ%qa1X8- zAV(o5m87!OIj{+rH(E|O=dMD|xl#y7dg_aclIGs_FyhrrlC^v^yEQ554m+93%HY^RkJXt z<})^1+stZn3!Bp%f8@tEXJt%IrTHTeZV5JL!+554e)qPYRh-rA!F-RAvJ%M*dp6#R zY+BXhMyfxaNW_LLBW_rRp3?e;tbyoYO7qszC#G-Jd|scg#_Ox``Lw##Yy8)1ZY_}1 z@xdL_dWUo^tZ&i0^;+ExYrM#9K=Ha&Dn=o!&Ax=WRX6F8&!5S(I8eKRa7|t9Y8BUY z9y26{l6`t4mFTy&MUy;gsLa2M*@wSnSaGh6>mO^VT?|lTgX&Ktwa`#9F{npPEu~wQ zVcxB6h?+yur091s@6dgEW*f#QywmjXp-#)Xszn_tE|257&wyPrK{nSM>p+b*xWxvL zVWzOt_(_;dpB7wdYeRQHYw^})f#h;%CLt$*B)JfZ&E-9bbOtuj@RDRpR^c*H;Z{AF zLgjV7YLkVA>-@D1wRP3^#QImQtE;W^)%sA-N&jX9{yJX5K#nCD*=3`hY}CW~7Z)#$ zR7(V1HN$NaBcYL%vJKhF_RmkRU;*djlLF3p+G!u{5A5N7#cdBX@IZctqAaKCT(~)r zfxL*vSX4s1Y+h_dmxxhoP+kP(!zfYUrpQWN$x#>^mLdCypY#FlV!yc;C2BTomw~9H z9t@x;9$JWtAML2b7A%n6=%nl$G2BtnOs6ENFcEmxQ*bu*=4|p1rrw;54SVjOnpK#G z%Pe*%*xC{5>}lQD8EJ3r>4inuF0E{|J0qB=7TFI;sXrsAN{PzG=LzzrJ?}n~pVvwA z&XU)8sfU!xH+Q=yM(HEWO=u?|z0R}y<%&tZxq{b_lRA04`cWRG%ef=%BPrLQP}?4* zpB4KR8J$ad_0b#KF094}Xu-!MYm)Ti=iaa_+>KqEnn-TxW=_@HIsGca>9H862MkW1 zG&vnear#tcGt+;65vPTv%}qB4Hny`7i&4qZ%gH6*`bn>uSUz!b%J+xVPfGjeaq9d! z2sj8h2sj8h2sj8h2sj8h2sj8h2sj8h2sjA*a|noY#hYp0&(7-cRrr3b6yBpQ1^Gea zxt&Xv1Dz^>xJU8!*Uzqn5>jE;0|4GlU)K!}kp#QUfG^0N+_4k(QUN?Sbv2 zqVbbQF!mmX7pNf4-%*vF`{8wdzSV?uR- zZ7yQ-1{m*6cB79sc;&`JRGL2m&iv0GtN)^;GyngKR?UA*>|TMql*!a~zFPLv zj1Ic!8BR%3`ky_u541P+^svKfI$)qvgxpb8PoSwigrd{me4N3Z$Egq0CSOmT`aq5P z{OfS`sC~xw9548WV-~1s?l#g1pO;Sfxy*&%n-7c&NQ zlWqe*5%Kxar^ZeIrGX@sx3*=TKycFk3jsF&{Lf5#!#NAoKREyYUmov_)`q~^#Ycg@ENyQDnDEW=q?X{@ M^pMBo#_0TKN6zx4?_%z312Zm6aNrn&?u-xG!SFdXpD*R3ym?vpozhA?nm3V5A9eM1HRj| zr}y4-?#J((d*8Y5+{as6LZ$9Xx2w1qWV#^ISwAoFii)BQum82KwWZ5d+V65LV1;Ud zsFO0IsoMn#v0PmR#HyA+!4+KOIYHkLv}g{ME3!dQQu|z-Q`U$qDCwR;QB%%kRGtOZ z)VI!^Ei!Mijzz{Hmm&hcAN=$&ZgHR}%syO-qDV`XRGmXMHd|{1Ua}heGr)fVjiPWS z)u>A)C&2mPtR?!(I3_O(^Eoc^#aB|fs`y!t0INA0K#Km1DV4SPQO^x%-SCy6CwWlXKTZ{oC3T22hU%wjb6#E2E3zexb1Loid z!XYCT+Zc%r>EkMl)GN`Elv*Lhc~+o8S=VfENh@MTBZ+9(j11^(t`*2ea~({?@7Mb* zBW{LM;l6l05jD(+rF$9xicsFoCl`yGo3gT%LN=vk1+;j-mTk+U0bGINMO=KyG^`}+ zmi8j*wnMk{#0&1jyT)2J?P#(-IbY4XYz*KRxaBir(I|$#1Enay`fkswYUGPkrRedgIpqx{{!>SgZX*)F; zBO^1(Pd8VE&hC%&#`HQ(re$#Dy_E+;U9Ia;sWk2!WF%@hW|rh6goR5>=au*?S74@K zfv4Od?S$9dSHx?s6AY4m{B>n%b5DB+@oFZ{IzF2xJ6BgEUv z)&KDImGfaY6)fRRo_KQY0{D|eg22FzE&H+-&QJkzkbzj`l_40Uf?H{!1AOu0t2^Ki z`~z*Y=>Tll`R*<_L>xF!8lakNd>fb#U||l^gAXk{vFy~T13c&aP74A||0OouZK}2z zf=z)oo3ZKIrdFF-*o@}n!@s;aEpu`j%^!hKYfE#+jb~yPp5FSKimRGEm^T|qE1pQR zXXBk%O}l!`NcP9#@#v6c#0<;OlUm=9H4qt0YTi2fMD;D2&+GHmdVRG%pH{zoh5u&F ztpyS~KDeV=&ycQ#^j^)oOsl_Tg%@iZkiGsU6}=GFXJ6dhqMP){=g(x?9H`$wsJ6at zxr+Nb_Zi|ti9S7?jQ3kxBMI&`EX;q1nTNk+STQb*`ycD5T})78lj@HrwBS%8KBz}b zEvZ|UVQ$jaM9iT`LX5kF59k3sy%qfvK4^OQ(4b{oHKGj_x5u2}GhpY9;>~u)22iUF z_Syh4%p?vPKXH@E(}qiZt?3GAt={?!kemy{WIv+AR=~71EpZz6t~34v8E$Xu?tyEuU)tH|bVe{yD{>r?(s)KtloFNY<_YqqJ?}l6 zpVdkAPLtJnX@rz2Hg>s3d+8(0Oz0#atoF4vCKkEC3J zTy49TepZ}Uq<1dqlH<3oy|@;)(T0ynwj}9i&%a^YxEnXDZz8_=8#z_)=JeYzrzfJE z9xyn4!sK)y$>~!Io0nEYCu?}l`JEO7a^s2ucblqh zTD57^W+FCgfLv>`D?L}?>65A2X_=GLX#NN|>py?2E=Nvh{a=n+&3{hpUV*%n$;5WQ zR{rax0$ubBrz9!;&qVD5?M>a?ELcqe28tqNLsi{@ruHDRPJHum5_cZQ52%g3o;rR& zjmCU_I1_50^gYLmzTubwYJ$6s6yftygs&?Y3U&oM13@0)TaHi?qS1&I!OITWP+!y- z&`r7x0L4_#L!TOp07?Z(DsOGeJb~b({}%#m{mUz^Z0c1XrOKzY{>hv&W<8blpT=hL zy7SC?oce9&$*uo%&OPUUS^wz?Z#ZXw`VZIt|I6Z?+1e0TS#=!f%hL8nfZQ(@X6lF` Mr_LrP`Nr1&4PA}mjQ{`u literal 0 HcmV?d00001 diff --git a/tests/data/LF_MCT_UseCase/maps/chanmct_sink_at_conf.nc b/tests/data/LF_MCT_UseCase/maps/chanmct_sink_at_conf.nc new file mode 100644 index 0000000000000000000000000000000000000000..c79498d464a382c29cc330571bc6d30509858e91 GIT binary patch literal 13548 zcmeHNeQXp}5TCtmOM70SD7I2-SiwlewqB0|EP|!I-qAu^psi@4@woQ3xO&}d?zV8J zF$E*2wSFW<;va+<6B9m+37Yta7=uPZB?8eHqef#)jG}0aAqGth&b*Ji+kWVkrXlLS z%kAvGH}gJzGw2?(tgG?7hI_u{-UQtlA>GeN1w6=7)O8Z@|g)CDo z5M@$kEOom;A(ktvfLPTMD44}X_6Yihphfd2Uy&7pl6t|#Ic14>1SQ>5C`!t?jLIKD zHTCV+%oPuBvWCTjL;j5j{C4ouN4dp;qA>e#DT*R3RZ?{x+1OmI5qQoT@LvZ03uqLD zv#CT~A~^xh4`(gWU&b+cS(wi;@mzd4<*SOHwFt0=vjL>&W?Zf;&5wF+L?h3SRd5Nj zKNDH;eREH13l0)<$jGDBqt%?J1WE++rh|cfIE6Z!I)ZQo=8-V{)A&F7+Ojh>c8COA4s_D*k4Jhd9EWy44r$_qP}WMij~rXFh*5)+n|Ko)*ee;WC(q zKM046SZs47Hl$CeFjB8XM^dVV6z5rq3S~{R&Lypg8I2^OVKXwIv$0kn8;x}^5x-aO zvy8YIPKEp8@kG=xBbM%I04PFvHy>OqZf?!WRtnjamKD(A{aUszj|MOc#f!N3kZD*+ z)-0_>)NF@t>50AWmmVH(v6=M=*(hDC#U5mq39yP(i>X&osZUE->{Yy&S*!wbO_sT3 z!pMlA8lTM9I?!s>#j)2!%oF#_eB0v=Yh=;OAN zQ!z3!ll*jZMd zm|9Y|EW_NYt&5mLk%Z`X3GdK-dU`whC%n`2@}W-4x@trnDlU&X-Dkiq7{i-wj&-0` z8|<|KWSB|pH2&fylcxoj+FI8Y&|1Cq86Y_ys!8xkAc-%CY_oY!!kvMQG`s}ql2y1+ zRJct~BvE*^uf}Aq;c9^+VY7Huip<)<03f<&csY^HtM~9`$KI$iVfGzBr{ZOK2 z+;-`RO6oxeiu|E@xcJeIN^HRbnT<};z7fM670q-?k_r`pXAL=L6K~GO4`JfX+0kLo zT~xCQb8wl(4z;v(1UtLiHgtyD+q!#TKDJ9M8|}^rCaOjDLsII`D2h^|yxeDkyy=b%rLN)?;C++)4;QD!Ez6OdNtdFqwQakhCquOZ8I>O{?M?xoAQBlROG zmmpW$?xmj<`xWV(OS<^jE$c6?#s_G@$0Tc#^t0#Qur1t;n>IEP-?f`LRqy2V+c2lc zqnsWvIDOpYbRfy;lZ%>}{0H+nEh=knS{vBV&PFUoB}XqOm;CA{t!8Zg*vTosA5uRl z?VrP`b9E4K5O5H15O5H15O5H15O5H15O5H15O5H15V&**h`8cf+V`_qJ$?$`ua&|3 z)TI_4XgoKv;5wkF0*G@I?|ips6_k<)J01Y=Uh1YUc!)UIVFvs__V~^b*hd*GtPG%g zZhZ!Jkch@3k6`RO49`Q)&JPIP*V$tp1Cf&iwx`YBm2cv2z9TP$m-_ zd9D1HDFwRd9ZpG7y3a)I1MN-S-7Hv50S1a9WJ6Wmfu{B#vQB>TaSCT1Cl08MKb|^q zK#lr*emE0qpYl1!i$39)0cw)7jTGVYQiQK77z%a;I|D%;;aiSS5~9(F6~V&}*-&59 z7|=~R4FJVd&O@IXivUUmNh(im%Vz??N&hbd*!-7AT-ng8PNmAHHUG(+GG;xU`JcvW z@;dX(Tb%xB=c&#Abj~^Ff0+O2Nl!RufVzb9|Nmw2&S-52tg1Q&^k->DW0ulA{xfA# QDknd;jNOYeDTjG~0WXT-&Hw-a literal 0 HcmV?d00001 diff --git a/tests/data/LF_MCT_UseCase/maps/chanmct_start_in_5.nc b/tests/data/LF_MCT_UseCase/maps/chanmct_start_in_5.nc new file mode 100644 index 0000000000000000000000000000000000000000..f952d29be4f7fc829a00ca058169a176d217ecd4 GIT binary patch literal 13548 zcmeHNeQZ-z6hE(z&8>DY0XLl(9v{Jp+w4jO$A@F2U@h zRHH7IoB+QMW-ZZQ$}xFWn9nhhFPcf^s^Vuo0<7k204e%2rc~DEM?JTok>|%MxP;lC zjV$}VvAekmCy6Cwp^k?3Ak4xt5~gn&zej$2VL!myKy&Lv zGxW?MZWRi!lkr+f0S#Zp&vft*N4P_`dZNAlCZo@YLMh_R*RRGp#XiB)L}e;m4YTnB z;gAuFZHUAM^l=qN>Xqn7O0AIMJj+p`tZO#7q!lrvkwi3XM*4I%*K%Z|x%MaG59vLY z5jVrBa8Ep*h#F?Z(mizmg(&allZ(a82ePsiLN=vk1+;jtmTk+U0bGURgIOIlrGj{N0?;-tR&T9+9asdrzI@*I$q5zRsp#u%hFO| z=aPxj@k=LfuGku(fvNoMf*V6!T|xLpZ1Kub1?pL4<+Nwgtm<iomb+oT!EQ_ z3I5;$;cEozdDE3h{T|8gR$n=qyUzV$1Iw=SgVFZmjH{T?EaWFS^qMF{$-UV{V;lT| zf1rgn9f0+ZzxM>ZLL4|y8lal2e+QTkU||l^BabaOzU0)YmwC?loe~6?{)=t6+f;2c z1e*eFHe=JZO|3Swuo=zC?LQx$k~ukz=8r(Axv4SZ#xt=Cd$#T|Bzt4=cyz!rVuoetNv&tV>WlOzHE#`lqWWgd=k@ujy}oLnPpe(J+`mk7 zYk`E05ALYeJ)mnLeUs*0qSfBM+>5n!$Xlk9f5T;y#(o!H8@{1 zxLHpmQFxWF%4DwLDt}E~O>NbK(caru)z;MdYJAA(r2jGk|LiZJBgc~T>@wa?#_Qqr zm*y`GS4jk2)q}0Mp3v}O*@x_9>sO~2F^6;K7>9F)cG^eh1G~FlanGZ5+>zg=C=01M z7amTeBQN|h=9N%gCNGYnbH%JRC@+HYLF6cKlV_za<|rH)lrH5O2aR^&J&rSS}-C?zTzohQf}_MUh) zKdY1Kog%CA(g-P)Z|HRAdg;T=Oz0#at77e@)3Ft;7uVvWwBcitElK*>^M`C3cm4Wx4a7HZ1E=b}oPHbT^mvrh zmkmyLnVj||IemITBa{E&dQJ;V8yoHntZid67PFGGmy1ij^^;bUTb{c(<@-Y#C#3^3 zICXv<1RMk$1RMk$1RMk$1RMk$1RMk$1RMk$1RMk|9|9t-cqg6vS*#vkg&)vL;e8rX z6Av_=ADX)mD5?PB9>u%gJ+~4{NQ7Mv063AlwG$pE4tALVUy$wEHU#^qfQ6L-bk7}o zVJnGfJn{&}zSrPIDv0rSRAuLXdYi|$8n6&k&xaqMJ+kAIH9Y71P6+~|s_F_fv;~oM;+v0?xbrxEKyB>x)bRsq zH0Iw2GokiL-*dd^8;%*ECb-*35k4($T6owWW4OJJT5l+hWIl&U9!?{l}hjKX&)A z8%YNkf(-A8a3;iKydvQr&#&Lz9}UN< z>JyGCH;Z)Eh%}k!d|Fop4q}-*m#&Aa=n4?#1Y8NaaY8Nr%>dY?=gpk47v^JREB=T( zt>=f+xm;@0)YH1DYk6g8)Xb=R@`|^S{!-eQ;`jRf4PJkP->>*qt!{2r>J--vfG>7} zi%TBLWyiFvspqnJCY_2+(nFmMzQ$F=TvcS&vw2fD@rAjpg}EmdQX)QAluGP`xm%aRuw(us{h{c3S^jD`-?HR0x2zsfn>8ix+W5UY4U#cg4PA@5+N-%H z`+^%HOnp=Y`i%n>pL9J3?FeB^_G#u&YPdP9XY>@zMZgGK0EMyBohwXnPM8e~@DGxm zdOE#HO^<376-Mfn=txRZNO4rSYLryN3pbk8O>VlxNTtiT0)VMbsN)>zTy`XxRWsZK zuN7S5%1|z6r1Y$6YD#Wc*<<8(YeQt(uGIiDS>2fLOgiWu(R5b29|_xB~^ zp8zkhMWf+GgxlCo0&Ha zJv-w2n`mPwb>`swqa?v~8~@In--fg!59LqbH%-BRRmo~*DBP)}^o*9xqyH&8M@=Q0 zGmA-Ms-dep(^{h8Z~|#N{s4b;PjQbTz2_DlCwV9hNDxu{ z(KDsdJ)?Awzjl14I6K$~*a+AN*a+AN*a%!80-dqw0QNDc_agd`BuEanusg|u>|csr zq8teEM7+vwYawEi8|)JoyTy!W1vuc$&63^wgQW{P^Gk zgUnP83RO68VDL5@**e~IfSV2TUO0Kk(HZUTDCm!J!Wo7FQa0!*`j4#C#B)!cDA?07 z%29=r0dmkRYy?L+JQSYAV7kKKtd83nuil9X3F2;%b%&57&COZxXjvjjT{zGnpcmkj z2f{3;JVJ$8guHd)17|Q0dKM&=c=Cb9&xC<|S8(Cnh&62O*mn;pUJjFGtsQ&U3EkH) z*Ko{`<1c4cyW=i$GYreUp;y=dshtnRD$Tr<<5hX)<-~+*8#R1RxB`s{%Uv9jG9z1r z?;|6Uwnb88r6r}xpAn4>)ui;9s`H7F>pG^^#>xh&&_W6{PzVbb*~Zdfi-lL49=@+^ z0-}kh6{i;7?dqE-n}BFJpX=e5?z`{8+UtK3uoz@JE$QupZ!YC2#q0ay_j3V^^xDFA zOuCVvG>I~mfUp;k=cY~HsEDvX2Ryayk-wMWCt8epHdRA!Sw8Z>Z_4l^gThec`u#Wh zAF|>n?MhOfgNkJR-YL=_1jBMcW1l{@wIk8niH+e=ifW))KY-rHl)12(B6_)vu77Nc z0;|cxx&WsX(e}4}r3b!4HIMR^^wc%K+5}%Co9^a_oZb-}gieY;K}6m-^3xr#nX+u5 zsY!sXEx$Vi3n?NrW0&56p%dy4`r8nx)# zqDhOMEv98L8jC6|_GK{xi-ONRu$ftASv~BC3qznQ)ZfcmF44yFR*ZW!Nt6?tvW<}q zrTqSqZ&Nrwp1hQTj4z$mruYZ1psO8h1Z)Is1Z)Is1Z)Is1Z)Is1Z)Is1Z)Is1Z)I8 z3v80cPhDCrVW`>saL&lE)vG1QL308A7B2;bh=N2sdX)wi zYiz_K@SjSz^xVf>g ztv|mGDvmPxm#E7IRpOm%z0 z!NkT5$jp+}Y%-x4hDLinQF2Th)(kC+JN)B&^QM+b`T}hMw*643(_51xkug??Qn27erx)WRR1q1Oex5wS;^#$D9w|f%(o4ev| z&4XS~$=~)08CLmQ+9<<740p(4LAwl1%if_6?Q&zza`|lmuaDR__H`!)-6?GZ*^#r+ z>uYUpY4QjBExtgYxv8l_)_~9Nr>x~dn+s*=?}>yGxJ!4?-78l1gN2p-2wT|?;>x}o ziyMsLj`~C-Ht0sXD10A=@EnF_xIHa?D@*A&MDqB&79RdR5RI_g)7*pzdn>WXPlnsW zS&)aLk0y`1=@7)JSC<3$48iD3ocM$3+3p>1kR6p_*9Ht1|yg{o3 z3(x-b$Ch;{TDv>^-0|a>W`|3Kz@+PcLe&sWn;b#G>#oEK|RKsj6km zogxCZ|4$L9%aqOb|I1XdQ>+&2|I72AEYCBuUp#(M{eO}&jk8=%-2KDm8Y&#JoZ?w7 z{>Dn%`^rzkPCmPEZlX}?3P&m@8HLb!Fd9}&ewdQ#aAC(NX%v5{Hnhq;lGFjS!$%hZ z=Ku0UEra2gi@Z-d`S6+G#K&vH)g|9er)l+JSUH~vrkf3H$J{%k!=Jw5*~Jz4N! O`2R=O^6i=v0{;aZM4vMN literal 0 HcmV?d00001 diff --git a/tests/data/LF_MCT_UseCase/maps/ec_ldd_sink_up.nc b/tests/data/LF_MCT_UseCase/maps/ec_ldd_sink_up.nc new file mode 100644 index 0000000000000000000000000000000000000000..2ce990d68c72896c1c43cc3ce9b52a7899c0eefd GIT binary patch literal 17381 zcmeHOeQaCR6+e!fG!0HaXrYvK^x?KED^6-VNfVd0#Icir4H7u8m#M(+HD;l+SrE1m?k>G_|n)IlVH*$1l!8QKBb9m9sjU%?uYFc zJCL-3P37Ih@4R>Kx#!*cJLlYYKMzF1o%MB>*HzWlf(-A9a3;iKydvQrPi@=R9}UN< z>JyGCH;Z)Eh%}jJI<2b$2eB+(OxI&obOi`=0-mv%E|(fJ^|Ws4T3#6*Gc)S`yy9)7zmztv_`QCAgV*2S_ba}Qo0?mdI>ogP@WoDW zammBE?6{US^;|a3q*Jj;dZ@F(*SL|GtBTBeHgD=CzA%@yF!#hlO2p@iQi+|gm`l#* z#*AStna_=wx2T53GOV6`*?|Gb>v8m7&M$L(!QohjGN8)ga7evK>Rd*ME>W(<_fu$x z=8K^DT_-^GLP~M2mz)4+r!HAZz=CrDEMXb|_*^y11`i8bdoevb9ZN*EcAg9{K{sWw zGIe&;bv3DBE|T0*e<-?5mcJUNTb6w0menI_v$^D5gWtQ=AQ>~&(6y4Qy_##X zFStFz)JH|2-vm(cN!JU}ju6IVpJooHMw-KVMo+mig^_wCI+BtUQXCbo8YR{6!i{BhlbbFvQt2|T0AQ*U>NrO_mmN)J)eJYm z%LUhjGMvj9DLt#2nvxq)_8Yl<+Ax{6YZJhHRyXE*c~i}%R3lXsv0R8KW=T#Yi_+GI zZ+^SnTG0$yDA04X*0D>tocWh>+90UZ<#obZFXPF=TBpZy+mI~pOV8O_8z%au$kO=x z-Vu#rhj?KP^JNFO6^wIC+*6|MUz}|EVMihwMlGURmtcD8sx#F3VOW5FJUsrB+-Dir z0^+L2NaR8Tpitym`Inc!)ftaR;Dm5?$5{u|lC{8SEVK8)a(&5yNGe*FD_0dvdwDG^ zpF#oEtR;8W@j4!6tp>msNj3)Qr}Jj?Qv#Q~Nf>mfHyDpIccY?G5yRcvBYpAi{=Q^9 z6zq+NPsZl?lnuWPoG_Q9wt7}B$!fk(dzi6>g%LD zvzRol8oIhCtu-n#_+b1`kE~|ziSUMHA$Rsh|@DkPM=M2 z`fZ)lLs?EUc}@?n?qK;}Sixz{Vn$zY$9@1NoJQJ?zX$L~_Y`*r(mSpNOepeD8jv8O z_@igyrF%x{9)IolOmTLw5wH=k5wH=k5wH;)!^b-PS_H3^&*(E_RC<&sE@nGuKFV?+;cl>x^UP804Ep0g%fY=D`3C*sj7z zp7OHjtbI(dN&4VdtE*TSIW9&N#V+z$rRSNF!OmpKU?=%pdVCh0=URF>&0bI$s^=4N zu4mI^K5VfuvL_=W&_RC*N|9=lr%Xh$d%?}@kQXJ zp>-_M8Hq*uLXl)|cRT?btFTXql2WRv<~0+5&?Br1{cWhFbS_O{Gb>UDl9rYRS)q07 z?jy`pjtEsaaA5Ez8`(NubAX!-^PYbGsG~F5-BHjV<%BZ~1*B}yQ}iEMsi`L)IbE=) zHI$Ug=QoI}{%UU}ow+h|Y zFxPO*ljARER=edkax)BTy`dM_0I8i1#463al;c%-=H>L1>n3XWoUjOu3Cmp^k}@M( zf$t+DlD0)sWThpg%AXO94b`OdnX2=N(JMM;*T%{Qs?b6TG*Ac&=h?>6V2gzpo9?@- zYyzT*rxm9b-s$R_Dw}|4na*|Jvv=KfZte9y30MrWotE_Gq1RUPl;ZWh@%y;|MtW`G zJ0{&oP?|)UO+eTS$aB-CZ&XCsp93Df>Hfc$;U`**dNx%ps`P%+}V-n?Zn3L1VuH_tRFz{DP=M2pom^>quWm1 zpui^bur9zUMYR2!zS0BVp_)f|OZw7fzq%g2MmF8e5qW)ga0ogn0tFFy_4rSB!w$-F z15Hf=>}>hnQMi;Mf;5{6aQD(b9D_UQZV*^Q@Z0*f2jC@qhVd%&Jb+zqy#74=o3ey> zH{z)$UVQ~#p)6QZ7n0#4_r3+JML?kxhF^T?t#$jad5k~V*D?f{{ufvE$XXAxcPU?X57U?X57U?X57U?X57U?X57U?X57U?X57 z@L?d(84Z`LPtd46xpp1y7_G;VJ3e)3xrCu+^CLMU!&a|WAqUL`_*=Xb6e0=|@#s|= zSd0@^;Uqaulhf8i+%TKclDUy&$qHJ|&`0$wRNAXrc>_ZX3Xo ztgMI>?gdL`G%TI2&J`w_ah?4tg`DvzrE--*#u4~-xDXMr`ajk1M>qc3JEt{1X(WB>z+K7(3pmB3! zVOxKGziR5ZmTYJvtl=6&USc1J_4kD0L+(f-7HF_gkYS_0rHwKS#Bhf!7PQOIwCpYV@Lo6OESKLF@cM{-u&+BYZ!+FU3@e@`Toz+JjS?q0F7A1tiwN7%}K5Lfoy zSlnO?chn~$u^~6wMdAA}jOQ>k!|iGDTUkoKA(F@EweaxofoO!?p5`V**jtH3elpx1 z&VoD~jf`d*2u3Bf1iT!!^13&9n_3VRCtM*K@siq{@7JyeEuWT}@hh6wGCF>x_T`ME zI-%$1^0{mOX5xk*+Wibctp9zIoEP_u)5;uM|9hVJ!+bIC?Sre<@I@iqvOtVa|MBQ% z*h6>hpa8&g6B}ai8Op-WO<*VD(47b2I7MIT2c z;L^AM`eVyF6s_GId-9=&FwG7h6aq7@{|QxFv}(~Pl$wZDwWZc%u@j5JzpzIA{s&bp zTkb3ou>F6QKwY40w*OzCik)S(SpQ$1|73X{zv!8V&a3}VQs!`$%Za;x*jz(}Lzc5V z%f;VVX?tJ!N!XcZ7tT%YmIU(?0)AygV literal 0 HcmV?d00001 diff --git a/tests/data/LF_MCT_UseCase/maps/interbasin_for_p2.nc b/tests/data/LF_MCT_UseCase/maps/interbasin_for_p2.nc new file mode 100644 index 0000000000000000000000000000000000000000..95c04b42a8d509bf30c6fa009337c617d9ab8dfc GIT binary patch literal 13644 zcmeHNeQZ-z6hChd<~BN*fJ3Lo$1pf?t6eG6p*Xg#rGtIIHc_Lomi0{@cCSnO2CKvf z#LqFn#Do}wXh=*D&;(5UM`F+@s6-?hMI$P~7^9*wh8Xo9Jm-G2dmWRGu^8~(rais) zo^wBb=iK|wedj(MY77<^l@;X`6o5=;L~5SLOFW`t>*RyIZK1~YyyEV>ymD5kP7rlc zCYu)JfkG@-Tm!_a7Q%$fxX4yP_Y0aooyry2ASnGi@;Ilg5m``DofAb(DVI@s7F1JT zbM56K^A_t^WE^raBJjtqV^49514Uu>k*6q%v{Xse>11PKw@l@aLl$OZ1g+OkNY_b8;Hb7fdCpDn8aDz(QUO&`*DcmCD-OsOu&)^4wSjmoWR| zdtN=&&>3pPNn!~Zd9-4%g7XwYp=DpO$+Ovev| zgGMa2JQC~E&#Ev|uS7>uYK0W%nvV))U9-U@t%wry+0uvrSrAeeatce8il2<%CcBXSnQR&8)mTz$URw>mI%9- zOq`y*boAzmtq~fS3Z8Qp20J#9z4r(*+~^ z!3DzC2-fqaE0FqJlD$aX{dV>`_lXTGv(EQKTMjXzA;WZEB^O~y#gQQ1KlodC0HU|-}2I6${*=%ZgxfJ#iZ-}e^ z@f*u#!T=TAz?(d@X-PT!O(Frb3?#9+Usu7WRDc|0AXaHv5PGTLHd^QaU;Xs@diV?f zKoe~`0LwPK_ZaLZ4jd>AP)*jo1I!1oFo)^kM`j(Gd*sL~Jm>t53j$34g*M!6svFX~TR-0MajOOs;zrHmtb8;HZ9f4q|u_5ioGqE#U*8HyGs%8)7l}6HvCsOR$ zco$aFt{yXz-LZH)+GiOt!!q=w*41bAM0%5&$4#H8zFPBoyxuC0x613)s%z%^ZqbS~ ze?rFxcU0@_)3uEUF&+gcMzaIaxj?n6vJ{4K+ZacSKDSVzrbf*PAtcRZm5`V#S8Jz{D} z-LeexL2Yrw?29DCxC{A!9@0~5&_CgWriTv=TDDaw+E8(O95Q?c>~&eZneNyCsH>iG#*Z++^~!;Zk3V+x=R|Q=JBq^P!pqp9GTl0?0O*k0jjcUrN(UkS18UJ&OShJ7#73I0eF6mcEUoJD#lh!YsRcZ7p}?pH`IXsk1yhoJdEW z92iQ&@}oM6%467|kGFP!ll03HHSM}fXH-%bI#Ja7bld=O7V;S8Pak%Y_QM#Ss%W)S zl2oEZ2Q&qnx&Q~X`>1slrr>sqgKBJQ3AA=JwY7$un>sq-D(ss~f=+1!A074NSR|z} z4GOJL+0Z;ez5K<6n{%^1d9FzN+85UPJUAGZPQ2isl}!HaM-+VHg9meF6%^b!)|L$0jvuFL* zEn8YoMKhOks@}`#_hC*CMLB)N;B=$OX-|^V&9fSq{D)U@nqSgTzsTR#Od6M`F!mp_ za}@_)e_^KA<7tTPk{mb9&&q>w%&QAnsAT`@`1Tp_oM2^#FkP`)_WC z4aC7NGvLdyjq3+sI~B07GJx*7<5^foA{vi8g0X!syhH^t{5n^tWawV8;`8eph3*_A$2;i<#@RpT-zr_tOIaMpkB zSY3*o&icO;wVL~!*u4UIDU*o}yixkwsDfPd45uV1{ZB{j{mu0q9V}QaBkh?GRfoU6 zIe@Gq-+Ua!oyQ9iOiPE_M}5!nyl*(Bfg0g%BSrQ+6xnMJ1Ox4XR)2s;_G&O7Lx@Hr zRs=6QWI}vVqenOCHUJb*JrBWYEb=E6B&oc$E%T%}C;h(=VC!FAab;6K*;MiTnASg; zQ`)S@vi?)pOip*6d5>ccrjKs@r-s~fKF9h`jd;U34b*?Q{{LSV@60xL1b(aIyyv1L PwK$U8Nc`F5=a&Bm}f2TNMo+HEjF){4x=K_&^eq8cmFe3H(806HyZ&B%0tk^SHZP+CW=rnlQ83 zd+yAfIWzN}GrQ-^%)WReR#&^A*6a6!OxHykS;bIqwoyrd5e5 z*<>`W^@4|30s(r?@zN6@!U^ahdeNX3{D6{D*~|_jW2SAm2aE5*FY((+BV}1e&h9sz zoNei?fFd=h<85~29Lq?X{ryg62Wz%aG)tN3ZFa6;m@hi%fx=ERW!Nta;M2_6CR8I6 z@b~YxzFW&CRR zbU>?t;X1|+{|KNK`*_}eH&M+qEb<$8F+h=CZYY(tw?_3x38IN4p_lW2A3M+;j(5oM zYcN`$GSBsSTFh!)Szm=KBR`Rh@n)!_g1o3dAJ<=3+vX_K8x4WJMWEqp_^Ah-U^Key zLekpa9C6Z)1p&mF_ZnpE)UzI;G7V-!1Af4WIjPhZGc{n3sW4KnL`PDRLW-lo`A||d zAKXC3DdgGch>=E@*4F^mj$^V51XnSb%w}_zlQ9c+FuOh2pUdvDlLaT6(VqaA#pcE= zK3_01mYK6kR)3!mQEFlojgqtvu3Y%>Mr%bgWXYwIwAKr3l>+4EaCwIXmAVYDbptR@ z^vA7L+Jr3Swjo(=N+)ft#j1`FSsL#zDOOTibXd*SvPW1bE{LM9Oxs_d?Ksrl7muKx zQLQvht7+sR-n0g4gp7G~MM@!)ZFt>A?rv zS^IPIIjs&bS_U6US4knD5Kssx1QY@afti9ptT*0+J_b1x!kMFyNf!+r6PBc>B3xozx%NH2x~(p@IFDBY0PX)qLV z@G<$pH;Z1ir7SPK;-*nv@y(+r@&>8928?hhU=a~c*bN%;m2nOREXzBb$1z^n-YC6A4fowqIigz^Eeoc zh?x=|^p$y<)#&iQ!uO_#)P6{Q;H6`h#*_U>;_jSe)@J9$s7U}|YeiRJAw={fQ#{|sf z{fipmDJl>f4PXBD);icmO;~sfaJKkZFANa}i}umP54^G;j#2>&?r~Q~Z+!#ms0jA$7|_X<^4XthG46(&-t z+Hz~Eu#*afzust`xGi&1LKOl48^hh5^z$P9BKD41`R_0P{pA0lEHB?SqULAB&I`S( zq!3UDCy)5Kssx1QY@a0foTKLO|_o&MbXQ_h{74=5!-Iv-*q0Bkk^e zOg6Mj&-%;>9m2^iLrF=Bds#5t*_KGK%Yt-nMZ1WlBdtWZtuuM^c3PWo~q&0%ua8tD{pIh_LbMq|<5XjeGOPXSjWjD)6T7R;k{PTJ1UMLF%aVd#&oQIsdYu~Oa%S|zI0Yk literal 0 HcmV?d00001 diff --git a/tests/data/LF_MCT_UseCase/maps/outlets.csv b/tests/data/LF_MCT_UseCase/maps/outlets.csv new file mode 100644 index 00000000..d47997c3 --- /dev/null +++ b/tests/data/LF_MCT_UseCase/maps/outlets.csv @@ -0,0 +1,10 @@ +ID,X,Y +1,4307500,2377500 +2,4292500,2377500 +3,4302500,2377500 +4,4302500,2372500 +5,4297500,2372500 +6,4312500,2377500 +7,4287500,2372500 +8,4282500,2367500 +9,4292500,2372500 diff --git a/tests/data/LF_MCT_UseCase/maps/p2.nc b/tests/data/LF_MCT_UseCase/maps/p2.nc new file mode 100644 index 0000000000000000000000000000000000000000..c1c9a72a9c6b614854485268e468f4b778ab5b42 GIT binary patch literal 13034 zcmeHNYiv|S6h6DRTeju4E?N-~!-9=gBr9McL1>}f2TNMo+HEjF){4x=K_&^eq8cmFe3H(806HyZ&B%0tk^SHZP+CW=rnlQ83 zd+yAfIWzN}GrQ-^%)WReR#&^A*6a6!OxHykS;bIqwoyrd5e5 z*<>`W^@4|30s(r?@zN6@!U^ahdeNX3{D6{D*~|_jW2SAm2aE5*FY((+BV}1e&h9sz zoNei?fFd=h<85~29Lq?X{ryg62Wz%aG)tN3ZFa6;m@hi%fx=ERW!Nta;M2_6CR8I6 z@b~YxzFW&CRR zbU>?t;X1|+{|KNK`*_}eH&M+qEb<$8F+h=CZYY(tw?_3x38IN4p_lW2A3M+;j(5oM zYcN`$GSBsSTFh!)Szm=KBR`Rh@n)!_g1o3dAJ<=3+vX_K8x4WJMWEqp_^Ah-U^Key zLekpa9C6Z)1p&mF_ZnpE)UzI;G7V-!1Af4WIjPhZGc{n3sW4KnL`PDRLW-lo`A||d zAKXC3DdgGch>=E@*4F^mj$^V51XnSb%w}_zlQ9c+FuOh2pUdvDlLaT6(VqaA#pcE= zK3_01mYK6kR)3!mQEFlojgqtvu3Y%>Mr%bgWXYwIwAKr3l>+4EaCwIXmAVYDbptR@ z^vA7L+Jr3Swjo(=N+)ft#j1`FSsL#zDOOTibXd*SvPW1bE{LM9Oxs_d?Ksrl7muKx zQLQvht7+sR-n0g4gp7G~MM@!)ZFt>A?rv zS^IPIIjs&bS_U6US4knD5Kssx1QY@afti9ptT*0+J_b1x!kMFyNf!+r6PBc>B3xozx%NH2x~(p@IFDBY0PX)qLV z@G<$pH;Z1ir7SPK;-*nv@y(+r@&>8928?hhU=a~c*bN%;m2nOREXzBb$1z^n-YC6A4fowqIigz^Eeoc zh?x=|^p$y<)#&iQ!uO_#)P6{Q;H6`h#*_U>;_jSe)@J9$s7U}|YeiRJAw={fQ#{|sf z{fipmDJl>f4PXBD);icmO;~sfaJKkZFANa}i}umP54^G;j#2>&?r~Q~Z+!#ms0jA$7|_X<^4XthG46(&-t z+Hz~Eu#*afzust`xGi&1LKOl48^hh5^z$P9BKD41`R_0P{pA0lEHB?SqULAB&I`S( zq!3UDCy)5Kssx1QY@a0foTKLO|_o&MbXQ_h{74=5!-Iv-*q0Bkk^e zOg6Mj&-%;>9m2^iLrF=Bds#5t*_KGK%Yt-nMZ1WlBdtWZtuuM^c3PWo~q&0%ua8tD{pIh_LbMq|<5XjeGOPXSjWjD)6T7R;k{PTJ1UMLF%aVd#&oQIsdYu~Oa%S|zI0Yk literal 0 HcmV?d00001 diff --git a/tests/data/LF_MCT_UseCase/maps/p7.nc b/tests/data/LF_MCT_UseCase/maps/p7.nc new file mode 100644 index 0000000000000000000000000000000000000000..9343e881a1035214b407aaa28ed862571c9d9392 GIT binary patch literal 13034 zcmeHNYiv|S6h6DRTeju4E?N-~!-7OBHY;EuK`7AfgC&%C-H{?ewheAd?1MlMiXOVLjRz#iB%IIB%0tk^SHZP+CW=NnlQ83 zd+yAfIWzN}GrQ-^%z=0$R#&^A*6a6!OxHykUdcje+71OoJ&e_@xIGVB-n@oDC46RMF3 z`1|)e-mPVmssoRwfy%uek4J(bsn$UAm=oN9y;9l;&9kBTx(48@ry6aUfDiH@Wsg%n4F^P!|_ zKDhpjQ^>Q?5hIN*t*-&B9mixB2(Dr`E*&{3z7evulrtPoKZ8_4mEgnHV zqgrX2R^#wPylD;82pRLzP|vt(h>Mmoay5?TI`Z?wi(-jH6n570D$g|!_{mz}(&^Xq zPiTyKlv{m0H!Pzg+?C7r;qQ}Ua|2s~+|*=`oy()0w5)8(FtcxI4y_42-n7f=S=F*4 zw4yn*nosvC{XAkqxo+Aw_szYO+3;jnE78TIC8LlJr!B zD=l4WUWrfX0J#O@yr6ega%OrbKE`B(cKsO6y&(a5zRB~297kZQATk)Dr z!kxQcFi3j*mrwUIXX^{$o0god&b@@fXfs+D&>IbNur%K{c+n04R1&p%u&kqY1_r1`s zSD9bCiol`Ji_fGKdX>XAX2_*KL$lE^&JPd>kbwaQ2`6?aaTuQ{|3}i z6BcqKb&h=ogH({>8lQXlkI%Usw_+it?FrUsHj5g{mvGTA|Sj z6RA{fxiwYTNrl2+UuvG5mN_Y*3ITvk;m&sYd69k*d&jK&_m}^E^8Zklmv0+U^Rr^- zh2B+C2q**;0tx|zfI>hapb$_9Cxt)0aqi8gr;Q{%)DJF9S2%Y+Ro5L zIq*|GKduY1tGiM;lFB1XnMZb&?mz_C`X3@|k?F7a(H&D-|723`N}9_0A3!m;blsWv iIQ5Ip?x-ie{s+dr+&r=MUw%L1cC3G?bw%$?1pWiQZB|bJ literal 0 HcmV?d00001 diff --git a/tests/data/LF_MCT_UseCase/maps/p8.nc b/tests/data/LF_MCT_UseCase/maps/p8.nc new file mode 100644 index 0000000000000000000000000000000000000000..89b4ab1859a6cec018cb9bef40dfa78932805d6f GIT binary patch literal 13034 zcmeHNYiv|S6h6DRTejQVx@fI{7#1X2k*t7)1bMdmU-U39*F_p!!b=v3ic@>`zSNb7_IUMk-g&G{s}WVQ z$#5F*f`?dwL3&R2(i0%c3Fu*Z(I5bRKuPIbcDs=^GdA3V#dqPC`0bRDwk#uW_nJ=L zw)EA2A~k5>ZMNqf%gC6$y-s#JYc^XnOPiUkcD`tsFFKjN;tn%y*e~?q)6Cl@)FKn` z_wTm66JV2S0FS4M%Do?yE zV7NYIp6m0pnAOUPzKTPGKaz~mW~ifryr@4P*I#Gb#u(EZ4S~KTpy6xyX#|~MG&=2K z%G%Z%bux|xLByH&8e;6!vmT`~4eFr@KVZb2bb7Oy?z2Z!7^zpHBPmHC#nIq=D5;hY zt}p8p3v6`6NTbW>%K>XgG1*yys}xG*a(TlzTwl?xA&ovMD$y(sjsn_(6 zX^eV|TYV!pETc2hozL~+?~`M51Dl83)MS^PFQA>QTCy<9%zjmCczO8og*&WmOIIxp zFK!Jl{4+y3v~?--_3) z6Ykvof-R`5rDje>dY-B4`+!_h=^(oj`%ee}Y9F9>o*Icqpf~4aix_1Wo*xu0?z`b% zt}?%NDS<RWinGzoKm3f-g=@q+9-r9PQ#^hSFYt<+Q(*)N8+vXrSufFwMba>biWLp8$hwSD1 zeSiEjJnRUvaHf)L=A<6B!Ng%ahOlJs)@<(=)DI^qcUBZMUjbpbj)3?IBs?W2hwcx68vr2-b*Ky$P2B;v-HQs#X_s_T;w_zcs)VJq<8#sOZIM1o)Z9#zPzpe`RDpgl$wMwH^ zCQ_~1N^7dJlPZP3KHofXTjr#MDg*%5MY=lZ=SBKO>>ac6-(UXw$^S!HUb$^V&CiIP z7kXDoA)pXY2q**;0tx|zfI>hapb$_9C z+ui$^Y-pFC^_gQjgp*r_l9CknvS6g6EtzDO1?k+1b`i@*TFFRTM+{jyH1$ zMMrnkBV2JD_vJ>K!}zW>(kb8~ItA>B#bZ6O&Pa@(0xm-s2~Eo^ngzR9J`S{;jGd*6 za^R&GLP&k-GKx$l)2>c7aW>!xC literal 0 HcmV?d00001 diff --git a/tests/data/LF_MCT_UseCase/maps/point_p1.nc b/tests/data/LF_MCT_UseCase/maps/point_p1.nc new file mode 100644 index 0000000000000000000000000000000000000000..66afeb07019387a62e09911ceb0ce8f1cbb6df23 GIT binary patch literal 13034 zcmeHNYitx%6h6DtE!#4!i&g|gS&(SOW~EIrL3y?NU>izXy95(7j?Q{H8)POA}3 zvP(6s_kxF50s*?t^U@U{!U^ahy3wE>{D6{D*~|_jW2SAm1FLVtFY((+BV}1e&K@+K zoNejr07Yuh!29gTIhK(&2M3+Z4%Th4=$10m19q-pm@hc#p~6lxW!TRR;nmF9Ce$Jm z@cZw#y;IL7)c_t(6V-b?9*+b=Qmu*RF)z3tN2Rg>+UG+16%D}GNG;k5$q8`zl{**H zbU>?vu?EHte+!_N`uMZ|cA}bROgwMk)c{4hnNTZRuZ`*t5k%7|!Y-%(8r|0$j&G9s zYfx=Z`ONKkLdv9wB9QtTei}h17>ypg zkhHe9N1U`{K>%^)qXro}jjTtgPJ_A7gdZ?sPAaw4ObywS8jQ><(UFv-kl{!k{ar#tsf$rGO48oHc;?56-imI>ic4qct!LOO1<1|g@(u|qZ5d$e24I00 zk9({130cd1L$X|z&e&UvHJd`@X?(n-SV?IyU@cqA9^s+5Ad0>+Ykz%m(}B({@d(-( z%}Ud>n#b?wUF)Du$XJkuM#fb~T(p#ttGSx%z|RjXi6s(I7--~8p35HalefUx~?~`M52U~{R)a7|Qmq$NY+t!j{ZojrYv^vzAno7={%?V@9Sj! zPc7uMHo)n0e^p$?)Qv(wA)pXY2q**;0@oFRSbw|^V+;x=L@-Cg$q)?#6INuTB0^~y zQu9W<$^gi%nBoSbt5Sf)c$zWu7+)dTTXOOJu>^)$AV-!ln52@k2Kq3Xq}YnLY!u<# z-GV{V(O*8^&4R7ZMQmCMwt8P2G0Vc{;j*wf*?fAP8#XT|kzPy#WVlRlQJL_plQNWX zaGm_%n?twS3id3c;^wNT`0CjcMT0b46J|J+u!syN>?RHQ$~*@X78XuoCrPP4 z*!n$^OJzPMlU={48~T7kQW+q-5{Hio0BY}{ex4eMNBv;d$rLcl&ObXYLfm&l=Pt3h zb`^m`sTZF~DfKFcZPJuWe~MUcPl3U> zm?_PIFpK^V(a_M5@z{0NVa-)kBKvZ#i*JX%n%Ua=R2WgNDM`=IJ-@4SOLq(be~_?bsV+eGkzfG6CG~L~6EGL{ zE?EvwP=(lN`102`*T4XEVd*Wv$>PKPu$wqowvR5p@729Pbv)l#&Yx6b(xbAst^F!81C(+pBEVyv3q=!|NipdPyQcP*UNuHSzo@LL}HJK z9T~b;MIoRNPzWdl6aoqXg@8gpA)pXY2q**;0t$f}gMixEyfL`nETgKO&6~v%H%5m{7rGL)30xQ7M9-5rSpJ1j`=t!Njq^hzrc?&yvp>(qxHr*Yiz zzc}dVYCXvj#~B}Pq&dv&SR=g!TuE;M`=haFf3znYQOq?R lcjhC`{-Cp~_4L>O@RWy}r?>vg&u9D}>t9-3(OVONe*x*TR)zoo literal 0 HcmV?d00001 diff --git a/tests/data/LF_MCT_UseCase/maps/point_p6.nc b/tests/data/LF_MCT_UseCase/maps/point_p6.nc new file mode 100644 index 0000000000000000000000000000000000000000..56462b3406a064d3045ca5eaa130fe7457e069be GIT binary patch literal 13034 zcmeHNYitx%6h6DtE!#4!i&g|gS&(SOW`(AhpuF0BuuV%_y95(7j>FCr2KP~Sw`QwG zBmM#+CXg631d|#SCH^qTFB9>H4)81vQPOA}3 zvP(6s_kxF50s*?t^U@U{!U^ahy3wE>{D6{D*~|_jW2SAm1FLVtFY((+BV}1e&K@+K zoNejr0Yz%i!29gTIhK(&2M3+Z4%Th4=$10m+wEMzFkf)eLxr7Y%CMgs!mF9HO{hgC z;P>Bed#9dFssTKnCaU*(JRS*#q*@crV_t9rj!I=Cw9SRKD;j{Wky^ABk`v(aD|arY z>3~)TXBrqg{4Ic5>f_J;+lgwPGvaw8uLda6%~iFs_4=s(5J5DRBJ6VZuaSMd;dqzS zUxR9U%4crRlVVnD%f>2_ZlnTzi$LmY_-O>4U^IH{ zLed&&i#Tb=f&k*oM-4J|8d;A}od$EE2|r-OoK$M7nHsVuG#Hszq9Z9uA;Xb!K9p3; zl^e=9g*?-a7)iUdz6P*$5|>>hxQfAKHk-4Yj9IXQ*@56-F1yQ47MyHGe-vO2n;Y}^ ze8J3EX3i>k{ar#tsf$rGO48mRKlkI+-imI>ic6>It>@S(1<1|g@(u|qZ5d$e24I00 zk9({130cd1L$X|xPTO0HHC-X{G(KKZtfaIUu$HZ5kMK}j5Jg{^wZA^qb)aKQJc4#c zv(hxJ=F$6k*E*;ZG8Uwvk#W@#7cFJvYOdxw@bd#pVu?f)wm0%7&t(tz$y?z3iP!ay zNJl-&y}pqhipu%cGyHYi-Few_n#5S`%8;veOz^y>3-# zRcok~Pxli2JYqq)Zn@WUkWG5S<9+Q^xpXV1+LN4~H#q&q;`Bp@(|s9E(|Jz!-`BzV zpI*pmZGcl0Sq7myth!MMC!b{2 z99$$wb#L>V`g`kW>c9uEgQv0)X0ksGp}s;!!`CbutCavh&Z5iV*kR(1lAZ zu3b&wQ0m2JQcAtbVVf}J(x0N)Xqe{*2!u%I=4el%v$x0S?o4cfg{T2dit-`m&XZs; zDrQQvAWY;l={|BHHFACHK{}J`&8}CY7%Vef4{V!*if-1yD!==Ji*BgQWvwvL$?iHr4uxf=xD_o?~ zwB_DZ;U^Uae`C3M{D#a)2~`LHYzp^w)6a{Hi`YFr%71_P?zp{y_8P9m{K z#f}W!tD+E42q**;0tx|zfI>hapb$_9C>!|aHfIO-n`KnBvw5>vVs`Y1 z#UmZ=c}%9l*wa39N-yE$mZ791#XT$-?ru*c*kM6>Z$-O^rB_;saC>(YStmdAIECYm z|HVN^SL+FmI8OU;Bh6uY#~SG^;7WQ6*dL8W`=dSKD1Qt12*OBcT4uq_+lA8WK+8$n z89FEjero5h>w@g)t~8FM@|C50Ms`(hK?K+h(->$)((tG?Vo|jAE|q lxHBJd<_Dc!t*5^JhbKMUJhk;-em>*>SpU-Mir$(C{0r%^R)zoo literal 0 HcmV?d00001 diff --git a/tests/data/LF_MCT_UseCase/maps/point_up.nc b/tests/data/LF_MCT_UseCase/maps/point_up.nc new file mode 100644 index 0000000000000000000000000000000000000000..354b2ffc1bae5499de8000df388060d84332ccd6 GIT binary patch literal 13034 zcmeHNYitx%6h6DtE!#4!i&g|gS&(SOW`(AhpuF0BuuV%_y95(7j>FCr2KP~Sw`QwG zBmM#+CXg631d|#SCH^qTFB9>H4)81vQPOA}3 zvP(6s_kxF50s*?t^U@U{!U^ahy3wE>{D6{D*~|_jW2SAm1FLVtFY((+BV}1e&K@+K zoNejr0Yz%i!29gTIhK(&2M3+Z4%Th4=$10m+wEMzFkf)eLxr7Y%CMgs!mF9HO{hgC z;P>Bed#9dFssTKnCaU*(JRS*#q*@crV_t9rj!I=Cw9SRKD;j{Wky^ABk`v(aD|arY z>3~)TXBrqg{4Ic5>f_J;+lgwPGvaw8uLda6%~iFs_4=s(5J5DRBJ6VZuaSMd;dqzS zUxR9U%4crRlVVnD%f>2_ZlnTzi$LmY_-O>4U^IH{ zLed&&i#Tb=f&k*oM-4J|8d;A}od$EE2|r-OoK$M7nHsVuG#Hszq9Z9uA;Xb!K9p3; zl^e=9g*?-a7)iUdz6P*$5|>>hxQfAKHk-4Yj9IXQ*@56-F1yQ47MyHGe-vO2n;Y}^ ze8J3EX3i>k{ar#tsf$rGO48mRKlkI+-imI>ic6>It>@S(1<1|g@(u|qZ5d$e24I00 zk9({130cd1L$X|xPTO0HHC-X{G(KKZtfaIUu$HZ5kMK}j5Jg{^wZA^qb)aKQJc4#c zv(hxJ=F$6k*E*;ZG8Uwvk#W@#7cFJvYOdxw@bd#pVu?f)wm0%7&t(tz$y?z3iP!ay zNJl-&y}pqhipu%cGyHYi-Few_n#5S`%8;veOz^y>3-# zRcok~Pxli2JYqq)Zn@WUkWG5S<9+Q^xpXV1+LN4~H#q&q;`Bp@(|s9E(|Jz!-`BzV zpI*pmZGh7<{M<3sjY2>npb$_9C70Mp|lLC zc_UtB0OVFoa)Z%TDZpYp&6s(Nu8{04x%mEA0>dnjBg+^{&*|%~etHwX-LR25Gn^%y1}S5gAU{O&ao*c@8ElES$tnl5&k?V*Qw~ z^?M|j%6v{Hx_(hN^Z|vWGC+1E4j&f))ZRn=JT(%J`oXM|DPWeJe|A)axbKE8Tw-zU zY66E+FFun}>QxTggejN)6wOA%JU>7nL^?M|dlH?!Jw|tDVhb!p4QNu74>5P11cOmA zQst@fnOtvny&A<}nc;e1+Z-h4wYQ#$RHq#QwiQ5Q$WeaS^T$8c zX-9xX_T^mTZ->5`-rD+97*Vb%Nyp}n?dsUl9Yeq$BrI8~3($Qu7=Uj{eO$)`%*DM+ zmctWNAvPMm{PoSXu${WF^cLV$@!@{hO&l!SM;G7s>RvcP6)d^OT^)V>L1>^ZEagV( z9QgzeQ$>nfeE!AXKjVJfj+I!F-<|pG@X2Gx_>;Qc5CoY0>nd=sFm;7hD=b>!B9*2s z_ofOzsWA8(%gy6AWKK$`LI7Y>xVM{rUSwRv?(tFn`^$en`F~hlFaHf?eff40i9ITI zWawTMg@8gpA)pXY2q**;0tx|zfI>hapb$_9C2S|uG8M+2_L)<92`9G+J_ry4%0iz}Ejc@)lYCj33%IqxDZN<*uZetp8yYb6v-s j`G_+==EY(7t^e}#8UM%nmsVHw)9kgc literal 0 HcmV?d00001 From b5668b268926a114b219c9a585d465dbb5a937b0 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Wed, 20 May 2026 15:34:55 +0000 Subject: [PATCH 27/35] Test for MCT inflow with calibration points - needs work --- .../settings/mct_inflow_calib.xml | 6164 +++++++++++++++++ tests/test_mct_dyn_inflow_calib.py | 137 + 2 files changed, 6301 insertions(+) create mode 100644 tests/data/LF_MCT_UseCase/settings/mct_inflow_calib.xml create mode 100644 tests/test_mct_dyn_inflow_calib.py diff --git a/tests/data/LF_MCT_UseCase/settings/mct_inflow_calib.xml b/tests/data/LF_MCT_UseCase/settings/mct_inflow_calib.xml new file mode 100644 index 00000000..c78f7c3e --- /dev/null +++ b/tests/data/LF_MCT_UseCase/settings/mct_inflow_calib.xml @@ -0,0 +1,6164 @@ + + + + + + + #----------------------------------------------------------- + # modelling and reporting options + #----------------------------------------------------------- + + + + # options to turn hydrological modules on/off + + + + + + + + + + + + + + + + + + + + + # use inflow data + + + # option to compute indicators + + + # option to initialize Lisflood + + + + + # option to read/write NetCDF + + + + + + + #----------------------------------------------------------- + # report time series + #----------------------------------------------------------- + # report discharge TS + + + # report gauges and sites + # sites (pixel average) + + + # gauges (catchment average) + + + + + # report reservoirs and lakes + + + + # report mass balance + + + #----------------------------------------------------------- + # report maps + #----------------------------------------------------------- + # report state maps + + + # report end maps + + + # report output maps + # forcings + + + + + + + # dicharge + + + + + + # variables + + + + + + + + + + + + + + + + #Surface runoff + #Surface runoff + UZ [mm] + #Surface runoff + UZ [mm] + LZ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ************************************************************** + netCDF parameters + ************************************************************** + + + + + !-- Optimization of netCDF I/O through chunking and caching. + + The option "NetCDFTimeChunks" may take the following values: + - "-1" : Load everything upfront + - "[positive integer number]" : Chunk size defined by user + - "auto" : Let xarray to decide + + + + + The option "MapsCaching" may take the following values: + - "True" : Cache maps during execution + - "False" : No caching + + + + ************************************************************** + PARALLELIZED KINEMATIC ROUTING + ************************************************************** + + + + + The option "OutputMapsChunks" may take the following values: + - "[positive integer number]" : Dump outputs to disk every X steps (default 1) + + + + + The option "OutputMapsDataType" sets the output data type and may take the following values: + - "float64" + - "float32" + + + + ************************************************************** + PARALLELISATION WITH NUMBA (USED IN ROUTING AND SOILLOOP) + ************************************************************** + + + + + !-- Parallelisation of using Numba runtime compiled library . + The option "numCPUs_parallelNumba" may take the following values: + - "0" : set to NUMBA_NUM_THREADS Environment Variable + (if NUMBA_NUM_THREADS is not set, will take the number of CPU cores determined by python's multiprocessing.cpu_count()) + - "1" : serial execution (not parallel) + - "2", "3", ... : manual setting of the number of parallel threads. + (if exceeding NUMBA_NUM_THREADS, the value is set to NUMBA_NUM_THREADS) --> + + + + ************************************************************** + AREA AND OUTLETS + ************************************************************** + + + + + MAPSDIR + Root directory (tables and parameters) + $(SettingsPath)/.. + + + + + + Clone map + col row cellsize xupleft yupleft + or pcraster maps or netcdf maps + + + + + 4297500 2372500 inflow point + 4307500 2377500 outlet + Nominal map with gauge locations (i.e cells for which simulated discharge + is written to file(1,2,3 etc) + lat lon (lat2 lon2 ...) + or pcraster maps or netcdf maps + + + + + + netcdf template used to copy metadata information for writing netcdf + + + + + + latitude map to be used for snow/ice modelling + + + + + + This is needed when using projected coordinates + + + + + + + ************************************************************** + TIME-RELATED CONSTANTS + ************************************************************** + + + + + Calendar convention + + + + + + Reference day and time + + + + + + timestep [seconds] + + + + + + 17280 5 times subrouting + 21600 6 hours + Sub time step used for kinematic and MCT wave channel routing [seconds] + Within the model,the smallest out of DtSecChannel and DtSec is used + + + + + + 01/01/YEAR_START 12:00 + Number of first time step in simulation + + + + + + 01/01/YEAR_END 06:00 + Number of last time step in simulation + + + + + + low value to limit testing time + + + + + + 1..9999 + Time steps at which to write model state maps (i.e. only + those maps that would be needed to define initial conditions + for succeeding model run) + + + + + + + + + + + ************************************************************** + MONTE CARLO, KALMAN FILTER + ************************************************************** + + + + + Number of sample to use in MonteCarlo simulations + + + + + + Number of cores of the computer to use in MonteCarlo simulations + This only works with Linux, if set to 1 no forking will be used + + + + + + + Time steps at which to write model state maps (i.e. only + those maps that would be needed to define initial conditions + for succeeding model run) + + + + + + + + + + ************************************************************** + CALIBRATION PARAMETERS + with .nc format: than working with smaller sub-areas is possible + ************************************************************** + + + + default: 10 + $(PathParams)/params_UpperZoneTimeConstant + Time constant for water in upper zone [days] + This is the average time a water 'particle' remains in the reservoir + if we had a stationary system (average inflow=average outflow) + + + + + + default: 100 + $(PathParams)/params_LowerZoneTimeConstant + Time constant for water in lower zone [days] + This is the average time a water 'particle' remains in the reservoir + if we had a stationary system (average inflow=average outflow) + + + + + + default: 0.5 + $(PathParams)/GwPercValue + Maximum rate of percolation going from the Upper to the Lower + response box [mm/day] + + + + + + default: 0.0 + $(PathParams)/GwLoss + Maximum percolation rate from the lower groundwater zone [mm/days]. GWLoss + it’s lost beyond the catchment boundaries or to deep groundwater systems. + A value of 0 (closed lower boundary) is recommended as a starting value. + + + + + + default: 10 + $(PathParams)/params_LZThreshold + threshold value [mm] of the water storage in the lower groundwater zone. + If the water storage in the lower groundwater zone decreases below LZThreshold, + the flow from the lower zone to the nearby rivers (base-flow) stops. + + + + + + default: 0.7 [-] + $(PathParams)/b_Xinanjiang + Power in Xinanjiang distribution function [-] + + + + + + default: 3.5 [-] + $(PathParams)/PowerPrefFlow + Power that controls increase of proportion of preferential + flow with increased soil moisture storage [-] + + + + + + default: 2.0 [-] + $(PathParams)/CalChanMan1 + Multiplier [-] applied to Channel Manning's n + + + + + + default: 4.0 [mm C-1 day-1] + $(PathParams)/SnowMeltCoef + SRM: 0.45 cm C-1 day-1 ( = 4.50 mm C-1 day-1), Kwadijk: 18 mm C-1 month-1 (= 0.59 mm C-1 day-1) + See also Martinec et al., 1998. + + + + + + default: 3.0 [-] + $(PathParams)/CalChanMan2 + Multiplier [-] applied to Channel Manning's n for second line of routing + + + + + + default: 3.0 [-] + $(PathParams)/CalChanMan3 + Multiplier [-] applied to Channel Manning's n for MCT routing + + + + + + default: 1.0 [-] + $(PathParams)/LakeMultiplier + Multiplier applied to the lake parameter A + + + + + + Fraction of the total reservoir storage above which the reservoirs enters + the flood control zone. + + + + + + Factor of the 100-year return inflow (`ReservoirFloodOutflow`) that defines the inflow + value that switches, when exceeded, the reservoir routine to flood control mode. + It can be a map (NetCDF), a table (TXT) or a float. Negative values will be replaced by + the default value of 0.3 + Units: - + Range: 0.1 - 0.5 + Default: 0.3 + + + + + + default: 5.0 [mm/day] (not included in calibration) + Critical amount of available water (expressed in [mm/day]!), above which 'Days Since Last Rain' parameter is + set to 1 + + + + + default: 2.0 + $(PathParams)/params_QSplitMult + Multiplier applied to average Q to split into a second line of routing + + + + + + default: 1.0 + $(PathParams)/params_ChanBottomWMult + Multiplier applied to ChanBottomWidth + + + + + + default: 1.0 + $(PathParams)/params_ChanDepthTMult + Multiplier [] applied to ChanDepthThreshold + + + + + + default: 1.0 + $(PathParams)/params_ChanSMult + Multiplier [] applied to ChanSdXdY + + + + + + + + ************************************************************** + FILE PATHS + ************************************************************** + + + + + RUNDIR + Output path (org=$(PathRoot)/out) + + + + + + INITDIR + Path of the initial value maps e.g. lzavin.map (org=$(PathRoot)/outPo) + + + + + + Static maps path + + + + + + Inflow path + + + + + + Calibration parameter path + + + + + + Tables path + + + + + + Maps instead of tables path + + + + + + Maps instead of tables for soil hydraulics path + + + + + + Maps for transient land use changes every 5 years + + + + + + Maps for land use fractions and related land use maps + + + + + + Water use maps path + + + + + + FORCINGSDIR + Meteo path + + + + + + Leaf Area Index maps path + + + + + + variable water fraction maps path + + + + + + + + ************************************************************** + INITIAL CONDITIONS + (maps or single values) + ************************************************************** + + + + + if init. condition are stored as netCDF with different time steps + this variable indicates which time step to use + Either as date e.g. 1/1/2010 or as number e.g. 5 + + + + + + Cold start: 0 + Initial overland flow storage [m3], direct runoff fraction + + + + + + Cold start: 0 + Initial overland flow storage [m3], other fraction + + + + + + Cold start: 0 + Initial overland flow storage [m3], forest fraction + + + + + + Cold start: 0 + initial snow depth in snow zone A [mm] + + + + + + Cold start: 0 + initial snow depth in snow zone B [mm] + + + + + + Cold start: 0 + initial snow depth in snow zone C [mm] + + + + + + Cold start: 0 + initial Frost Index value [degC/day] + + + + + + Cold start: 0 + cumulative interception [mm] + + + + + + Cold start: 0 + PRERUNDIR/uz.end.nc + water in upper store [mm] + + + + + + Cold start: 1 + days since last rainfall [days] + + + + + + + + ************************************************************** + The following variables can also be initialized in the model + internally. if you want this to happen set them to bogus value + of -9999 + ************************************************************** + + + + + PRERUNDIR/lz.end.nc + water in lower store [mm] + Cold start: -9999: use steady-state storage + + + + + + initial cross-sectional area of flow in channel[m2] + Cold start: -9999: use half bankfull + + + + + + PRERUNDIR/tha.end.nc + initial soil moisture content layer 1a (superficial soil layer) [mm3/mm3] + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thb.end.nc + initial soil moisture content layer 1b (upper soil layer) [mm3/mm3] + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thc.end.nc + initial soil moisture content layer 2 (lower soil layer) [mm3/mm3] + Cold start: -9999: use field capacity values + + + + + + initial channel cross-section area [m2] for 2nd routing channel + Cold start: -9999: use 0 + + + + + + initial lateral inflow for 1st line of routing [m2/s] + Cold start: -9999: use 0 + + + + + + Initial lake level [m] + Cold start: -9999 sets initial value to steady-state level + + + + + + Lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + Cold start: -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + Cold start: -9999 sets initial value + + + + + + Outflow discharge at the end of previous step (instantaneous) [m3/s] + Cold start: -9999 sets initial value to 0 + + + + + + Outflow average discharge on previous routing sub-step (average) [m3/s] + Cold start: -9999 sets initial value to 0 + + + + + + Courant number at previous step for MCT routing + Cold start: -9999 sets initial value to 1 + + + + + + Reynolds number at previous step for MCT routing + Cold start: -9999 sets initial value to 0 + + + + + + + + + ************************************************************** + INITIAL CONDITIONS FOREST + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + Cold start: 0 + + + + + + PRERUNDIR/uzf.end.nc + water in upper groundwater store [mm] + Cold start: 0 + + + + + + days since last rainfall + Cold start: 1 + + + + + + PRERUNDIR/thfa.end.nc + initial soil moisture content [mm3/mm3] layer 1a (superficial soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thfb.end.nc + initial soil moisture content [mm3/mm3] layer 1b (upper soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thfc.end.nc + initial soil moisture content [mm3/mm3] layer 2 (lower soil layer) + Cold start: -9999: use field capacity values + + + + + + + + + ************************************************************** + INITIAL CONDITIONS IRRIGATION + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + Cold start: 0 + + + + + + PRERUNDIR/uzi.end.nc + water in groundwater upper store [mm] + Cold start: 0 + + + + + + days since last rainfall + Cold start: 1 + + + + + + PRERUNDIR/thia.end.nc + initial soil moisture content [mm3/mm3] layer 1a (superficial soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thib.end.nc + initial soil moisture content [mm3/mm3] layer 1b (upper soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thic.end.nc + initial soil moisture content [mm3/mm3] layer 2 (lower soil layer) + Cold start: -9999: use field capacity values + + + + + + + + ************************************************************** + INITIAL CONDITIONS IMPERVIOUS AREAS + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + Cold start: 0 + + + + + + + + ************************************************************** + CUMULATIVE FLUXES REQUIRED WHEN COMPUTING THE PRE-RUN IN CHUNKS + ************************************************************** + + + + + Cumulative inflow to the lower groundwater zone + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + LZInflowCumEnd: required for the warm start of the pre-run + + + + + + Cumulative flux from second to third soil layer, other land cover fraction + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + cumSeepTopToSubBOtherEnd: required for the warm start of the pre-run + + + + + + Cumulative flux from second to third soil layer, forest land cover fraction + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + cumSeepTopToSubBForestEnd: required for the warm start of the pre-run + + + + + + Cumulative flux from second to third soil layer, irrigation land cover fraction + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + cumSeepTopToSubBIrrigationEnd: required for the warm start of the pre-run + + + + + + Cumulative discharge + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + CumQEnd: required for the warm start of the pre-run + + + + + + Cumulative number of days from the start of the prerun + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + TimeSinceStartPrerunChunkEnd: required for the warm start of the pre-run + + + + + + + + ************************************************************** + PREFIXES OF METEO AND VEGETATION RELATED VARIABLES + ************************************************************** + + + + + prefix precipitation maps + + + + + + prefix average temperature maps + + + + + + prefix E0 maps + + + + + + prefix ES0 maps + + + + + + prefix ET0 maps + + + + + + prefix LAI maps + + + + + + prefix LAI forest maps + + + + + + prefix LAI irrigation maps + + + + + + prefix domestic water use maps + + + + + + prefix livestock water use maps + + + + + + prefix energy water use maps + + + + + + prefix industry water use maps + + + + + + prefix variable water fraction + + + + + + + + ************************************************************** + PARAMETERS RELATED TO EVAPO(TRANSPI)RATION AND Interception + ************************************************************** + + Suggested parameterisation strategy: + + - leave all these parameters at their default values. + in some very special cases CalEvaporation may be set to some + value other than one + + + + + + Multiplier [-] applied to potential precipitation rates + + + + + + Multiplier [-] applied to potential evapo(transpi)ration rates + + + + + + Time constant for water in interception store [days] + + + + + + Average extinction coefficient for the diffuse radiation flux + varies with crop from 0.4 to 1.1 (Goudriaan (1977)) + + + + + + maximum depression storage for water on impervious surface + which is not immediatly causing surface runoff [mm] + + + + + + + + + + ************************************************************** + SNOW AND FROST RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - estimate SnowFactor from prior data (if available), otherwise use 1 + - use SnowMeltCoef as a calibration constant + - leave all other parameters at default + + + + + + Multiplier [-] applied to precipitation that falls as snow + + + + + + range [mm C-1 day-1] of the seasonal variation + SnowMeltCoef is the average value + + + + + + Average temperature [deg C] at which snow melts + + + + + + Average temperature [deg C] below which precipitation is snow + + + + + + Temperature lapse rate with altitude [C / m] + + + + + + Daily decay coefficient [day-1], (Handbook of Hydrology, p. 7.28) + + + + + + Snow depth reduction coefficient, [cm-1], (HH, p. 7.28) + + + + + + Snow water equivalent, (based on snow density of 450 kg/m3) (e.g. Tarboton and Luce, 1996) + + + + + + Degree Days Frost Threshold (stops infiltration, percolation and capillary rise) + Molnau and Bissel found a value 56-85 for NW USA. + + + + + + + + + + ************************************************************** + IRRIGATION AND WATER ABSTRACTION RELATED PARAMETERS + ************************************************************** + + + + + + default: 0.75 + Field application irrigation efficiency [-]: max 1, ~0.90 drip irrigation, ~0.75 sprinkling + + + + + + conveyance efficiency [-]: around 0.80 for average channel + + + + + + IrrigationType (value between 0 and 1) is used here to distinguish between additional adding water until fieldcapacity (value set to 1) or not (value set to 0) + + + + + + Factor [-] to irrigation water demand + More than the transpiration is added e.g to prevent salinisation + + + + + + Annual amount (m3) of treated wastewater reused for irrigation + + + + + + Number of days over which the annual amount of treated wastewater for irrigation is used + + + + + + Consumptive Use (1-Recycling ratio) for livestock water use (0-1) [-] + + + + + + Consumptive Use (1-Recycling ratio) for industrial water use (0-1) [-] + + + + + + # Consumptive Use (1-Recycling ratio) for energy water use (0-1) [-] + # Source: Torcellini et al. (2003) "Consumptive Use for US Power Production" + # map advised by Neil Edwards, Energy Industry + # the UK and small French rivers the consumptive use varies between 1:2 and 1:3, so 0.33-0.50 + # For plants along big rivers like Rhine and Danube the 0.025 is ok + EnergyConsumptiveUseFraction=0.025 + + + + + + Consumptive Use (1-Recycling ratio) for domestic water use (0-1) [-] + Source: EEA (2005) State of Environment + + + + + + Default : 0.2 + $(PathRoot)/leakage.map + Fraction of leakage of public water supply (0=no leakage, 1=100% leakage) + + + + + + The water that is lost from leakage (lost) (0-1) [-] + + + + + + Leakage reduction fraction (e.g. 50% = 0.5 as compared to current Leakage) (baseline=0, maximum=1) [-] + + + + + + Water savings fraction (e.g. 10% = 0.1 as compared to current Use (baseline=0, maximum=1) [-] + scenwsav.map + + + + + + Fraction of water re-used in industry (e.g. 50% = 0.5 = half of the water is re-used, used twice (baseline=0, maximum=1) [-] + scenruse.map + + + + + + Irrigation crop coefficient [-] + + + + + + Irrigation crop group number [-] + + + + + + Population [units] + + + + + + Population + + + + + + Land Use Mask + + + + + + Reported water use [cu m/s], depending on the availability of discharge + + + + + + Time series of upstream water use at gauging stations + + + + + + Number of sub-steps needed for water use + routine + + + + + + maximum number of loops for calculating the use of water + = distance water is taken for water consuption + + + + + + percentage of water which remains in the channel + e.g. 0.2 -> 20 percent of discharge is not taken out + + + + + + ? + + + + + + + + + ************************************************************** + GROUNDWATER RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - leave GwLossFraction at 0 unless prior information show groundwater loss + is important + - use UpperZoneTimeConstant, LowerZoneTimeConstant, + GwPercValue as calibration constants + - calibrate on GwLossFraction if necessary + + + + + length of the window used to smooth the LZ zone [number of cell length] + + + + + + map of aquifers (0/1), used to smoothen LZ near extraction areas + + + + + + + + + ************************************************************** + EVAPORATION FROM OPEN WATER + ************************************************************** + + + + + + Fraction of maximum extend of water + + + + + + Mask with Lakes from GLWD database + + + + + + + + + + ************************************************************** + TRANSMISSION LOSS PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use TransSub as calibration constant leave all other parameters at default values + + + + + Transmission loss function parameter + + + + + + PBchange + Transmission loss function parameter + + + + + + PBchange + downstream area taking into account for transmission loss + + + + + + upstream area + + + + + + + + + + ************************************************************** + ROUTING PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use CalChanMan as calibration constant to fine-tune timing of + channel routing, leave all other parameters at default values + + + + + + kinematic wave parameter beta [-]: 0.6 is for broad sheet flow + + + + + + Reference depth of overland flow [mm], used to compute + overland flow Alpha for kin. wave + + + + + + Percentage [-] used to compute the TotalCrossSectionAreaHalfBankFull in the initialisation of the + total cross-sectional area + default: 0.5 + + + + + + Minimum slope gradient [-] (for kin. wave: slope cannot be 0) + + + + + + Minimum channel gradient [-] (for kin. wave: slope cannot be 0) + + + + + + + + ************************************************************** + PARAMETERS RELATED TO NUMERICS + ************************************************************** + + Important: do not change, default value of 0.4 generally combines + sufficient numerical accuracy within a limited number of sub-steps + + + + + + Minimum value for Courant condition in soil moisture routine. Always less than or equal to 1. + Small values result in improved numerical accuracy, at the expense of increased + computing time (more sub-steps needed). If reported time series of soil moisture contain + large jumps, lowering CourantCrit should fix this + + + + + + + + ************************************************************** + VARIABLES RELATED TO OPTIONS + These all need to have some (real or bogus) value, + even for options that are not actually used! + ************************************************************** + + + + ************************************************************** + RESERVOIR OPTION + ************************************************************** + + + + + Sub time step used for reservoir simulation [s]. Within the model, + the smallest out of DtSecReservoirs and DtSec is used. + + + + + + Initial reservoir fill fraction [-] + Cold start: -9999 sets initial fill to normal storage limit + if you're not using the reservoir option, enter some bogus value + + + + + + + + ************************************************************** + LAKE OPTION + ************************************************************** + + + + + Cold start: -9999 + Estimate of average net inflow into lake (=inflow - evaporation) [cu m / s] + Used to calculated steady-state lake level in case LakeInitialLevelValue + is set to -9999 + + + + + + + + + + ************************************************************** + POLDER OPTION + ************************************************************** + + + + + Weir constant [-] (Do not change!) + + + + + + Initial water level in polder [m] + + + + + + + + + + ************************************************************** + DYNAMIC WAVE OPTION + ************************************************************** + + + + + Critical Courant number for dynamic wave + value between 0-1 (smaller values result in greater numerical accuracy, + but also increase computational time) + + + + + + Constant head [m] at most downstream pixel (relative to altitude + at most downstream pixel) + + + + + + + + + ************************************************************** + MUSKINGUM-CUNGE-TODINI OPTION + ************************************************************** + + + + + test_chanmct_all + test_chanmct_2 + chanmct_single + Boolean map with value 1 at channel pixels where MCT is + used, and 0 at all other pixels + + + + + + Maximum channel gradient for channels using MCT routing [-] (for MCT wave: slope cannot be 0) + Default: 0.001 + + + + + + + + + + ************************************************************** + INFLOW HYDROGRAPH (OPTIONAL) + ************************************************************** + + + + + OPTIONAL: nominal map with locations of (measured) + inflow hydrographs [cu m / s] + + + + + + location of calibration points + OPTIONAL: nominal map with locations of calibration points + + + + + + OPTIONAL: observed or simulated input hydrographs as + time series [cu m / s] + Note that identifiers in time series correspond to + InflowPoints map (also optional) + + + + + + + + ************************************************************** + PF REPORTING OPTION + ************************************************************** + + + + + Maximum capillary head [cm]. This value is used if Theta equals residual soil + moisture content (value of HeadMax is arbitrary). Only needed for pF computation, + otherwise doesn't influence model results at all) + + + + + PF MAPS + + + + + Reported pF soil layer 1a, other fraction + + + + + + Reported pF soil layer 1b, other fraction + + + + + + Reported pF soil layer 2, other fraction + + + + + + Reported pF soil layer 1a, forest fraction + + + + + + Reported pF soil layer 1b, forest fraction + + + + + + Reported pF layer 2, forest fraction + + + + + + Reported pF soil layer 1a, irrigation fraction + + + + + + Reported pF soil layer 1b, irrigation fraction + + + + + + Reported pF soil layer 2, irrigation fraction + + + + + + + + + + + + + + + + + + This is necessary when using projected coordinates (x,y) + + + + + + + + + + + Clone map + + + + + + netcdf template used to copy metadata information for writing netcdf + + + + + + latitude map to be used for snow/ice modelling + + + + + + + + ************************************************************** + TIMESTEP RELATED PARAMETERS + ************************************************************** + + + + + Calendar convention + + + + + + Calendar day is back! + Calendar day number of 1st day in model run + e.g. 1st of January: 1; 1st of June 151 (or 152 in leap year) + Needed to read out LAI tables correctly + + + + + + timestep [seconds] (60*60*24) + + + + + + Sub time step used for kinematic wave channel routing [seconds] + Within the model,the smallest out of DtSecChannel and DtSec is used + + + + + + Number of first time step in simulation + + + + + + Number of last time step in simulation + + + + + + Number of days used for internal spin-up (fluxes computations during prerun) + + + + + + + + ************************************************************** + PARAMETERS RELATED TO EVAPO(TRANSPI)RATION AND Interception + ************************************************************** + + Suggested parameterisation strategy: + + - leave all these parameters at their default values. + in some very special cases CalEvaporation may be set to some + value other than one + + + + + + Multiplier applied to potential precipitation rates [-] + + + + + + Multiplier applied to potential evapo(transpi)ration rates [-] + + + + + + Time constant for water in interception store [days] + + + + + + Average extinction coefficient [-] for the diffuse radiation flux + varies with crop from 0.4 to 1.1 (Goudriaan (1977)) + + + + + + Critical amount of available water (expressed in [mm/day]!), above which 'Days Since Last Rain' parameter is + set to 1 + + + + + + maximum depression storage for water on impervious surface + which is not immediatly causing surface runoff [mm] + + + + + + + + + + ************************************************************** + SNOW AND FROST RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - estimate SnowFactor from prior data (if available), otherwise use 1 + - use SnowMeltCoef as a calibration constant + - leave all other parameters at default + + + + + + Multiplier applied to precipitation that falls as snow + + + + + + Snowmelt coefficient [mm C-1 day-1)] + See also Martinec et al., 1998. + + + + + + range [mm C-1 day-1] of the seasonal variation + SnowMeltCoef is the average value + + + + + + Average temperature [deg C] at which snow melts + + + + + + Average temperature [deg C] below which precipitation is snow + + + + + + Temperature lapse rate with altitude [deg C / m] + + + + + + Daily decay coefficient [day-1], (Handbook of Hydrology, p. 7.28) + + + + + + Snow depth reduction coefficient, [cm-1], (HH, p. 7.28) + + + + + + Snow water equivalent, (based on snow density of 450 kg/m3) (e.g. Tarboton and Luce, 1996) + + + + + + Degree Days Frost Threshold (stops infiltration, percolation and capillary rise) + Molnau and Bissel found a value 56-85 for NW USA. + + + + + + + + + + ************************************************************** + INFILTRATION PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - use b_Xinanjiang and PowerPrefFlow as calibration constants + + + + + + Power in Xinanjiang distribution function [-] + + + + + + Power that controls increase of proportion of preferential + flow with increased soil moisture storage [-] + + + + + + + + + + ************************************************************** + GROUNDWATER RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - leave GwLossFraction at 0 unless prior information show groundwater loss + is important + - use all other parameters as calibration constants + + + + + + Time constant for water in upper zone [days] + + + + + + Time constant for water in lower zone [days] + This is the average time a water 'particle' remains in the reservoir + if we had a stationary system (average inflow=average outflow) + + + + + + Maximum rate of percolation going from the Upper to the Lower + response box [mm/day] + + + + + + Maximum percolation rate from the lower groundwater zone [mm/days]. GWLoss + it’s lost beyond the catchment boundaries or to deep groundwater systems. + A value of 0 (closed lower boundary) is recommended as a starting value. + + + + + + + + + + + ************************************************************** + EVAPORATION FROM OPEN WATER + ************************************************************** + + + + + + water use daily maps with a (in this case negative) volume of water [cu m/s] + + + + + + table with days for each water use maps + 1st column: range of days; 2nd column: suffix of wuse map + + + + + + Percentage of maximum extend of water + + + + + + Mask with Lakes from GLWD database + + + + + + maximum number of loops for calculating evaporation + = distance water is taken to satisfy the need of evaporation from open water + + + + + + Reported evaporation from open water [mm] + + + + + + Time series of upstream water evaporation from open water at gauging stations + + + + + + + + + + + + + ************************************************************** + TRANSMISSION LOSS PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use TransSub as calibration constant leave all other parameters at default values + + + + + + PBchange + Transmission loss function parameter + + + + + + PBchange + Transmission loss function parameter + + + + + + PBchange + downstream area taking into account for transmission loss + + + + + + upstream area + + + + + + + + ************************************************************** + ROUTING PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use CalChanMan as calibration constant to fine-tune timing of + channel routing, leave all other parameters at default values + + + + + + Multiplier applied to Channel Manning's n + + + + + + Multiplier applied to Channel Manning's n for second routing line + + + + + + Multiplier applied to Channel Manning's n for MCT routing + + + + + + Multiplier applied to average Q to split into a second line of routing + + + + + + Multiplier applied to ChanBottomWidth + + + + + + Multiplier applied to ChanDepthThreshold + + + + + + Multiplier applied to ChanSdXdY + + + + + + kinematic wave parameter: 0.6 is for broad sheet flow + + + + + + Reference depth of overland flow [mm], used to compute + overland flow Alpha for kin. wave + + + + + + Percentage [-] used to compute the TotalCrossSectionAreaHalfBankFull in the initialisation of the + total cross-sectional area + default: 0.5 + + + + + + Minimum slope gradient (for kin. wave: slope cannot be 0) + + + + + + Minimum channel gradient (for kin. wave: slope cannot be 0) + + + + + + + + ************************************************************** + PARAMETERS RELATED TO NUMERICS + ************************************************************** + + Important: do not change, default value of 0.4 generally combines + sufficient numerical accuracy within a limited number of sub-steps + + + + + + Minimum value for Courant condition in soil moisture routine. Always less than or equal to 1. + Small values result in improved numerical accuracy, at the expense of increased + computing time (more sub-steps needed). If reported time series of soil moisture contain + large jumps, lowering CourantCrit should fix this + + + + + + + + ************************************************************** + INITIAL CONDITIONS FOR THE WATER BALANCE MODEL + (can be either maps or single values) + ************************************************************** + + + + + PRERUNDIR/lzavin + Reported map of average percolation rate from upper to + lower groundwater zone (reported for end of simulation) [mm/day] + + + + + + PRERUNDIR/avgdis + CHANNEL split routing in two lines + Average discharge map [m3/s] + + + + + + Reported infiltration from the soil layer 2 to soil layer 3, other land cover fraction, average flux over the simulation period [mm] + + + + + + Reported infiltration from the soil layer 2 to soil layer 3, forest land cover fraction, average flux over the simulation period [mm] + + + + + + Reported infiltration from the soil layer 2 to soil layer 3, irrigated land cover fraction, average flux over the simulation period [mm] + + + + + + if init condition are stored as netCDF with different time steps + this variable indicates which time step to use + Either as date e.g. 1/1/2010 or as number e.g. 5 + + + + + + Initial overland flow storage [m3], direct runoff fraction + + + + + + Initial overland flow storage [m3], other fraction + + + + + + Initial overland flow storage [m3], forest fraction + + + + + + initial snow depth in snow zone A [mm] + + + + + + initial snow depth in snow zone B [mm] + + + + + + initial snow depth in snow zone C [mm] + + + + + + initial Frost Index value [degC/day] + + + + + + cumulative interception [mm] + + + + + + water in groundwater upper store [mm] + + + + + + days since last rainfall + + + + + + + + ************************************************************** + The following variables can also be initialized in the model + internally. if you want this to happen set them to bogus value + of -9999 + ************************************************************** + + + + + water in groundwater lower store [mm] + -9999: use steady-state storage + + + + + + initial cross-sectional area of flow in channel[m2] + -9999: use half bankfull + + + + + + initial soil moisture content [mm3/mm3] layer 1a (superficial layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 1b (upper layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 2 (lower layer) + -9999: use field capacity values + + + + + + initial channel cross-section area [m2] for 2nd routing channel + -9999: use 0 + + + + + + initial lateral inflow for 1st line of routing [m2/s] + -9999: use 0 + + + + + + Outflow discharge at the end of previous step (instantaneous) [m3/s] + -9999: use 0 + + + + + + Outflow average discharge on previous routing sub-step (average) [m3/s] + Cold start: -9999 sets initial value to 0 + + + + + + Courant number at previous step for MCT routing + Cold start: -9999 sets initial value to 1 + + + + + + Reynolds number at previous step for MCT routing + Cold start: -9999 sets initial value to 0 + + + + + + + + ************************************************************** + INITIAL CONDITIONS FOREST + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + + + + + + water in groundwater upper store [mm] + + + + + + days since last rainfall for forest fraction + + + + + + initial soil moisture content [mm3/mm3] layer 1a (superficial layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 1b (upper layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 2 (lower layer) + -9999: use field capacity values + + + + + + cumulative depression storage [mm] + + + + + + + + + ************************************************************** + INITIAL CONDITIONS IRRIGATION + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + + + + + + water in groundwater upper store [mm] + + + + + + days since last rainfall for irrigation + + + + + + initial soil moisture content [mm3/mm3] layer 1a (superficial layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 1b (upper layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 2 (lower layer) + -9999: use field capacity values + + + + + + + + ************************************************************** + CUMULATIVE FLUXES REQUIRED WHEN COMPUTING THE PRE-RUN IN CHUNKS + ************************************************************** + + + + Cumulative inflow to the lower groundwater zone + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + LZInflowCumEnd: required for the warm start of the pre-run + + + + + + Cumulative flow from second to third soil layer, other land cover fraction + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + cumSeepTopToSubBOtherEnd: required for the warm start of the pre-run + + + + + + Cumulative flow from second to third soil layer, forest land cover fraction + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + cumSeepTopToSubBForestEnd: required for the warm start of the pre-run + + + + + + Cumulative flow from second to third soil layer, irrigation land cover fraction + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + cumSeepTopToSubBIrrigationEnd: required for the warm start of the pre-run + + + + + + Cumulative discharge + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + CumQEnd: required for the warm start of the pre-run + + + + + + Cumulative number of days from the start of the prerun + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + NetTimeSinceStartPrerunChunkEnd: required for the warm start of the pre-run + + + + + + + + + + ************************************************************** + INPUT METEOROLOGICAL AND VEGETATION TIMESERIES AS MAPS + ************************************************************** + + + + + precipitation [mm/day] + + + + + + average daily temperature [C] + + + + + + daily reference evaporation (free water) [mm/day] + + + + + + daily reference evaporation (soil) [mm/day] + + + + + + daily reference evapotranspiration (crop) [mm/day] + + + + + + leaf area index [m2/m2] + + + + + + leaf area index [m2/m2] + + + + + + leaf area index [m2/m2] + + + + + + + + ************************************************************** + INPUT WATER USE MAPS AND PARAMETERS + ************************************************************** + + + + + Domestic water abstraction daily maps [mm] + + + + + + Livestock water abstraction daily maps [mm] + + + + + + Energy water abstraction daily maps [mm] + + + + + + Industry water abstraction daily maps [mm] + + + + + + Consumptive Use (1-Recycling ratio) for livestock water use (0-1) + + + + + + Consumptive Use (1-Recycling ratio) for industrial water use (0-1) + + + + + + # Consumptive Use (1-Recycling ratio) for energy water use (0-1) + # Source: Torcellini et al. (2003) "Consumptive Use for US Power Production" + # map advised by Neil Edwards, Energy Industry + # the UK and small French rivers the consumptive use varies between 1:2 and 1:3, so 0.33-0.50 + # For plants along big rivers like Rhine and Danube the 0.025 is ok + EnergyConsumptiveUseFraction=0.025 + + + + + + Consumptive Use (1-Recycling ratio) for domestic water use (0-1) + Source: EEA (2005) State of Environment + + + + + + Fraction of leakage of public water supply (0=no leakage, 1=100% leakage) + + + + + + The water that is lost from leakage (lost) (0-1) + + + + + + Leakage reduction fraction (e.g. 50% = 0.5 as compared to current Leakage) (baseline=0, maximum=1) + + + + + + Water savings fraction (e.g. 10% = 0.1 as compared to current Use (baseline=0, maximum=1) + scenwsav.map + + + + + + Fraction of water re-used in industry (e.g. 50% = 0.5 = half of the water is re-used, used twice (baseline=0, maximum=1 + scenruse.map + + + + + + + Field application irrigation efficiency max 1, ~0.90 drip irrigation, ~0.75 sprinkling + + + + + + conveyance efficiency, around 0.80 for average channel + + + + + + IrrigationType (value between 0 and 1) is used here to distinguish between additional adding water until fieldcapacity (value set to 1) or not (value set to 0) + + + + + + Factor to irrigation water demand + More than the transpiration is added e.g to prevent salinisation + + + + + + Annual amount (m3) of treated wastewater reused for irrigation + + + + + + Number of days over which the annual amount of treated wastewater for irrigation is used + + + + + + Irrigation crop coefficient + + + + + + Irrigation crop group number + + + + + + Population + + + + + + Population + + + + + + Land Use Mask + + + + + + Reported water use [cu m/s], depending on the availability of discharge + + + + + + Time series of upstream water use at gauging stations + + + + + + Number of sub-steps needed for water use + routine + + + + + + maximum number of loops for calculating the use of water + = distance water is taken for water consuption + + + + + + percentage of water which remains in the channel + e.g. 0.2 -> 20 percent of discharge is not taken out + + + + + + + + + + + + + + ************************************************************** + RICE IRRIGATION + ************************************************************** + + + + + + water amount in mm per day + 10 mm for 10 days (total 10cm water) + + + + + + FAO: percolation for heavy clay soils: PERC = 2 mm/day + + + + + + map with starting day of the year + + + + + + map with starting day of the year + + + + + + map with starting day of the year + + + + + + map with starting day of the year + + + + + + + + + ************************************************************** + REPORTED OUTPUT MAPS + ************************************************************** + + + + + Reported discharge [cu m/s] (average over the model timesteps) (AvgDis) + + + + + + Reported Topsoil moisture [%] + + + + + + Reported Topsoil moisture [%] + + + + + + Reported discharge [cu m/s] at the end of a timestep + + + + + + Reported discharge [cu m/s] but cut by a discharge mask map + + + + + + Reported water level [m] % False by default + + + + + + + STATE VARIABLES AT SELECTED TIME STEPS + ONLY FOR INITIALISATION OF SUCCEEDING RUNS + REPORTING TIME STEPS SET THROUGH "ReportSteps" OPTION + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported days since last rain + + + + + + Reported water depth + + + + + + Reported overland flow water volume [m3] for direct fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for other fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for forest fraction on catchment surface + + + + + + Reported chan cross-section area [m2] + + + + + + Reported snow cover in snow zone A [mm] + + + + + + Reported snow cover in snow zone B [mm] + + + + + + Reported snow cover in snow zone C [mm] + + + + + + Reported frost index [degC/day] + + + + + + Reported interception storage [mm] + + + + + + + Reported cross section area 2nd line of routing [m2] + + + + + + Reported channel side flow [m2/s] + + + + + + Reported istantaneous discharge at end of computation step [cu m/s] ChanQ + + + + + + Reported average discharge over last routing sub-step used to initialise lakes [cu m/s] ChanQAvgDt + + + + + + Courant number at previous step for MCT routing + + + + + + Reynolds number at previous step for MCT routing + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + cumulative interception [mm] + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lowerupper layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported transpiration maps, other fraction [mm] + + + + + + Reported transpiration maps, forest fraction [mm] + + + + + + Reported transpiration maps, irrigated fraction [mm] + + + + + + Reported transpiration maps, weighted sum over the fractions of each pixel [mm] + + + + + + + + + "END" MAPS, AKA REPORTED OUTPUT MAPS CALLED "END" + Same as above, but always at last time step + Support for these "end" maps will most likely be + discontinued some time soon + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported days since last rain + + + + + + Reported water depth [m] + + + + + + Reported overland flow water volume [m3] for direct fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for other fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for forest fraction on catchment surface + + + + + + Reported chan cross-section area [m2] + + + + + + Reported snow cover in snow zone A [mm] + + + + + + Reported snow cover in snow zone B [mm] + + + + + + Reported snow cover in snow zone C [mm] + + + + + + Reported frost index [degC/day] + + + + + + Reported interception storage [mm] + + + + + + Reported lake level [m] + + + + + + Reported lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Reported lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value + + + + + + Reported lake storage [m3] + + + + + + + Reported reservoir filling [-] + + + + + + Reported cross section area 2nd line of rounting [m2] + + + + + + Reported channel side flow [m2/s] + + + + + + Reported istantaneous discharge at end of computation step [cu m/s] ChanQ + + + + + + Reported average discharge over last routing sub-step used to initialise lakes [cu m/s] ChanQAvgDt + + + + + + Reported average discharge [cu m/s] (average over the model timesteps) (AvgDis) + + + + + + Courant number at previous step for MCT routing + + + + + + Reynolds number at previous step for MCT routing + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + cumulative interception [mm] + + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1c (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + + + INDIVIDUAL DRIVING METEOROLOGICAL VARIABLES (AT EVERY TIME STEP) + ONLY IF REPORTING OF EACH RESPECTIVE VARIABLE IS + SWITCHED ON (DEFAULT: ALL SWITCHED OFF) + Note reporting is done as a quantity per time step, not as + an intensity (as in meteo input!) + + + + + Precipitation [mm per time step] + + + + + + Average DAILY temperature [degrees C] + + + + + + Potential reference evapotranspiration [mm per time step] + + + + + + Potential evaporation from bare soil surface [mm per time step] + + + + + + Potential evaporation from open water surface [mm per time step] + + + + + + + + INDIVIDUAL STATE VARIABLES (AT EVERY TIME STEP) + ONLY IF REPORTING OF EACH RESPECTIVE VARIABLE IS + SWITCHED ON (DEFAULT: ALL SWITCHED OFF) + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported total water storage [mm] + + + + + + Reported days since last rain + + + + + + Reported water depth [m] + + + + + + Reported overland flow water volume [m3] for direct runoff fraction on catchment surfac + + + + + + Reported overland flow water volume [m3] for other fraction on catchment surfac + + + + + + Reported overland flow water volume [m3] for forest fraction on catchment surfac + + + + + + Reported channel cross-section area [m2] + + + + + + Reported snow cover [mm] + + + + + + Reported frost index [degC/day] + + + + + + Reported interception storage, other fraction [mm] + + + + + + + Reported days since last rain + + + + + + Reported interception storage, forest fraction [mm] + + + + + + Reported interception storage, irrigation fraction [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported interception (depression) storage, direct runoff (impervious) fraction [mm] + + + + + + + INDIVIDUAL RATE VARIABLES (AT EVERY TIME STEP) + ONLY IF REPORTING OF EACH RESPECTIVE VARIABLE IS + SWITCHED ON (DEFAULT: ALL SWITCHED OFF) + + + + + Reported rain (excluding snow)[mm] + + + + + + Reported snow (excluding rain)[mm] + + + + + + Reported snowmelt [mm] + + + + + + Reported interception [mm] + + + + + + Reported transpiration [mm] + + + + + + Reported soil evaporation [mm] + + + + + + Reported evaporation of intercepted water [mm] + + + + + + Reported actual evapotranspiration [mm] + + + + + + Reported leaf drainage [mm] + + + + + + Reported infiltration [mm] + + + + + + Reported preferential flow [mm] + + + + + + Reported percolation from soil layer 1a to soil layer 1b, other fraction [mm] + + + + + + Reported percolation from soil layer 1a to soil layer 1b, forest fraction [mm] + + + + + + Reported percolation from soil layer 1a to soil layer 1b, irrigation fraction [mm] + + + + + + Reported percolation from soil layer 1b to soil layer 2, other fraction [mm] + + + + + + Reported percolation from soil layer 1b to soil layer 2, forest fraction [mm] + + + + + + Reported percolation from soil layer 1b to soil layer 2, irrigation fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), other fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), forest fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), irrigation fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), weighted sum over the fraction of each pixel [mm] + + + + + + Reported available groundwater LZ+ GWLoss [mm] + + + + + + Reported surface runoff [mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported lower zone outflow [mm] + + + + + + Reported fast runoff = surface + UZ [mm] + + + + + + Reported GWloss [mm] + + + + + + Reported total runoff [mm] + + + + + + Reported total runoff that enters the channel: groundwater + surface runoff [mm] + + + + + + Reported Direct Runoff [mm] + + + + + + Reported FlowVelocityMSecMaps [m/s] + + + + + + Reported TravelDistance [m] + + + + + + Reported percolation from upper to lower groundwater zone [mm] + + + + + + + Reported evaporation of intercepted water [mm] + + + + + + Reported soil evaporation [mm] + + + + + + Reported leaf drainage Forest[mm] + + + + + + Reported interception forest [mm] + + + + + + Reported infiltration [mm] + + + + + + Reported transpiration forest [mm] + + + + + + Reported preferential flow [mm] + + + + + + Reported percolation from 1st to 2nd soil layer [mm] + + + + + + Reported seepage to groundwater[mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported percolation from upper to lower zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + + + + MISCELLANEOUS OUTPUT MAPS AND TIME SERIES + + + + + Time series of average percolation rate from upper to + lower groundwater zone (reported at sites) [mm/day] + + + + + + Time series of average percolation rate from upper to + lower groundwater zone (average for upstream area of each gauge) [mm/day] + + + + + + Reported number of days in simulation with soil moisture stress [days] + + + + + + Reported number of days in simulation with soil moisture stress for forest fraction [days] + + + + + + Reported soil transpiration reduction factor [-] for other landuse + values below 1 indicate soil moisture stress + + + + + + Reported soil transpiration reduction factor [-] + values below 1 indicate soil moisture stress + + + + + + + + ************************************************************** + REPORTED OUTPUT TIME SERIES + ************************************************************** + + + + + Reported average discharge over the model time step [cu m/s] + + + + + + Reported instantaneous discharge at the end of routing sub-step [cu m/s] + + + + + + Reported average discharge on the last routing sub-step [cu m/s] + + + + + + Reported water level [m] + + + + + + + OUTPUT AT SITES: STATE VARIABLES + + + + + Water depth on soil surface [mm] + + + + + + Depth of snow cover on soil surface [mm] + + + + + + Water stored as interception [mm] + + + + + + Soil moisture layer 1a [cu mm / cu mm] + + + + + + Soil moisture layer 1b [cu mm / cu mm] + + + + + + Soil moisture layer 2 [cu mm / cu mm] + + + + + + Soil moisture layer 1a [cu mm / cu mm] + + + + + + Soil moisture layer 1b [cu mm / cu mm] + + + + + + Soil moisture layer 2 [cu mm / cu mm] + + + + + + Storage in upper groundwater zone [mm] + + + + + + Storage in lower groundwater zone [mm] + + + + + + Days since last rain [days] + + + + + + Frost index [degC/day] + + + + + + Days since last rain [days] + + + + + + + + OUTPUT AT SITES: RATE VARIABLES + + + + + Rain (excluding snow) [mm] + + + + + + Snow (excluding rain) [mm] + + + + + + Reported snowmelt [mm] + + + + + + Reported interception [mm] + + + + + + Reported transpiration [mm] + + + + + + Reported soil evaporation [mm] + + + + + + Reported evaporation from interception storage [mm] + + + + + + Reported leaf drainage [mm] + + + + + + Reported infiltration [mm] + + + + + + Reported preferential flow [mm] + + + + + + Reported percolation from 1st to 2nd soil layer [mm] + + + + + + Reported seepage to groundwater[mm] + + + + + + Reported surface runoff [mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported lower zone outflow [mm] + + + + + + Reported total runoff [mm] + + + + + + Reported percolation from upper to lower zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + + + + + + + + + + + AVERAGE VALUES OF METEOROLOGICAL FORCING VARIABLES + UPSTREAM OF GAUGES + (only if repMeteoUpsGauges option is activated) + + + + + Precipitation [mm/time step] + + + + + + Average temperature [deg C] + + + + + + Reference evapotranspiration [mm/time step] + + + + + + Potential soil evaporation [mm/time step] + + + + + + Potential open water evaporation [mm/time step] + + + + + + ESActPixel+self.var.TaPixel+self.var.TaInterceptionAll+self.var.EvaAddM3*self.var.M3toMM + + + + + + + + AVERAGE VALUES OF MODEL STATE VARIABLES + UPSTREAM OF GAUGES + (only if repStateUpsGauges option is activated) + + + + + Water depth on soil surface [mm] + + + + + + Depth of snow cover on soil surface [mm] + + + + + + Water stored as interception [mm] + + + + + + Soil moisture upper layer [mm3/mm3] + + + + + + Soil moisture lower layer [mm3/mm3] + + + + + + + + + + Soil moisture lower layer [mm3/mm3] + + + + + + Storage in upper groundwater zone [mm] + + + + + + Storage in lower groundwater zone [mm] + + + + + + Days since last rain [days] + + + + + + Frost index [degC/day] + + + + + + Days since last rain [days] + + + + + + + + AVERAGE VALUES OF MODEL RATE VARIABLES + UPSTREAM OF GAUGES + (only if repRateUpsGauges option is activated) + + + + + Rain (excluding snow) [mm] + + + + + + Snow (excluding rain) [mm] + + + + + + Snow melt [mm] + + + + + + Interception [mm] + + + + + + Actual transpiration [mm] + + + + + + Actual evaporation [mm] + + + + + + Evaporation from interception storage [mm] + + + + + + Leaf drainage [mm] + + + + + + Infiltration [mm] + + + + + + Preferential flow [mm] + + + + + + Percolation upper to lower soil layer [mm] + + + + + + Seepage from lower soil layer to groundwater [mm] + + + + + + Surface runoff [mm] + + + + + + Outflow from upper groundwater zone (to channel) [mm] + + + + + + Outflow from lower groundwater zone (to channel) [mm] + + + + + + Total runoff [mm] + + + + + + Reported percolation from upper to lower groundwater zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + + + NUMERICS + + + + + Reported mass balance error at outlet [cu m] + + + + + + Reported mass balance error at outlet (as mm water slice) + + + + + + Reported mass balance error due to the split routing module, for each catchment [m3] + + + + + + Reported discharge error at the outlet as a consequence of the mass balance error within the split routing module, for each catchment [m3/s] + + + + + + Reported ratio between the mass balance error and the water volume storage, for each catchment [m3/m3] + + + + + + Average value of the sum of the fractions within a catchment: this value must be 1.0 in order to avoid mass balace errors! [-] + + + + + + Number of cells with Theta lower than + residual soil moisture content + (should ALWAYS be zero, if not something is + seriously wrong!!!) + TEST ONLY!! REMOVE OR HIDE IN FINAL VERSION!! + + + + + + Number of cells with Theta lower than + residual soil moisture content + (should ALWAYS be zero, if not something is + seriously wrong!!!) + TEST ONLY!! REMOVE OR HIDE IN FINAL VERSION!! + + + + + + Number of sub-steps needed for soil moisture + routine + + + + + + + + + ************************************************************** + BASE INPUT MAPS AND TABLES + ************************************************************** + + + + + ************************************************************** + TOPOGRAPHY MAPS + ************************************************************** + + + + + $(PathMaps)/ldd.map + local drain direction map (1-9) + + + + + + slope gradient [-] (0.50 -> tangent=0.5, angle=26.5 degrees) + + + + + + Elevation standard deviation [m], i.e. altitude difference elevation within pixel. + Used for sub-pixel modelling of snow accumulation + and melt + + + + + + outlets.map + Nominal map with gauge locations (i.e cells for which simulated discharge + is written to file(1,2,3 etc) + + + + + + map with monitoring sites (1,2,3 etc) + + + + + + optional map with pixel length [m], only needed in case map attributes + are not in [m] (e.g. lat / lon systems) + + + + + + optional map with pixel area [m2], only needed in case map attributes + are not in [m] (e.g. lat / lon systems) + + + + + + + + ************************************************************** + SOIL PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - use b_Xinanjiang and PowerPrefFlow as calibration constants + + + + + + Soil depth for 1st layer: 1a (superficial layer) + Minimum Soil Depth [mm] for superficial soil layer + For Europe it is 50 mm + For Africa it is 200 mm + + + + + + Soil depth for 2nd layer: 1b (upper layer) + Minimum Soil Depth [mm] for second soil layer + + + + + + Soil depth for 2nd layer: 2 (lower layer) + Minimum Soil Depth [mm] for second soil layer + + + + + + Soil depth for 1st layer: 1a + Minimum Soil Depth [mm] for upper soil layer + For Europe it is 50 mm + For Africa it is 200 mm + + + + + + Soil depth for 2nd layer: 1b + Minimum Soil Depth [mm] for lower soil layer + + + + + + Soil depth for 2nd layer: 2 + Minimum Soil Depth [mm] for lower soil layer 300 + + + + + + + + + ************************************************************** + LAND USE RELATED MAPS AND TABLES + ************************************************************** + + + + + $(PathMapsLanduse)/fracsealed + urban area (0-1) + + + + + + stack of Direct Runoff fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracforest + forest fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of forest fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracwater + forest fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of water fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracother + forest fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of other fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracirrigated + irrigated area fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of Irrigation fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracDrained.map + drained fraction from irrigated area (0-1) + + + + + + rice fraction of a pixel (0-1) + + + + + + stack of rice fraction maps (0-1) + + + + + + groundwater used fraction of a pixel (0-1) + + + + + + NonConventionalWaterUsed (0-1) + + + + + + lake and reservoir water used, fraction of a pixel (0-1) + + + + + + $(PathMaps)/eflow.map + EFlowThreshold is map with m3/s discharge, e.g. the 10th percentile discharge of the baseline run + + + + + + table with crop coefficient for each land use; values ranging from 0.75 to 1.25; + source: Supit, p.83 CFET + + + + + + table with crop group number; table 6.1 and 6.2 in WOFOST 6.0, Supit, 1994: p. 86 + + + + + + $(PathMapsTables)/manngs_2000_250m.map + table with Manning's roughness [m^(1/3) s^(-1)] for each CORINE landcover class + + + + + + table with crop coefficient for each land use; values ranging from 0.75 to 1.25; + source: Supit, p.83 CFET + + + + + + table with crop group number; table 6.1 and 6.2 in WOFOST 6.0, Supit, 1994: p. 86 + + + + + + $(PathMapsTables)/manngs_2000_250m.map + table with Manning's roughness [m^(1/3) s^(-1)] for each CORINE landcover class + + + + + + + + + + ************************************************************** + Variable Channel NoSubStepChannel + ************************************************************** + + + + + UpArea do be included in max. celerity + + + + + + variable Number of sub steps for the kinematic wave routing + + + + + ************************************************************** + CHANNEL MAPS + ************************************************************** + + + + + Boolean map with value 1 at channel pixels and 0 at + all other pixels + IMPORTANT: IF NON-CHANNEL PIXELS HAVE MISSING VALUES + THEN THIS MAY RESULT IN INCORRECT RESULTS + + + + + + Channel gradient (fraction, dy/dx) + + + + + + Channel Manning's n [m^(1/3) s^(-1)] + + + + + + Channel length [m] + + + + + + Channel bottom width [m] + + + + + + Channel side slope, expressed as gradient + !! expressed as dx/dy !!! (NOT dy/dx, which would perhaps be more logical) + + + + + + Floodplain Width [m] + + + + + + Bankfull channel depth [m] + + + + + + + + ************************************************************** + TABLES WITH TOPSOIL SOIL PHYSICAL PARAMETERS (HYPRES) + Each parameter is defined for upper (1a and 1b) and + lower (2) soil layers + ************************************************************** + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 1b (upper soil layer) + + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 2 (lower soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1b (upper soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 2 (lower soil layer) + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1a (superficial soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1b (upper soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 2 (lower soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1a (superficial soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1b (upper soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 2 (lower soil layer) + + + + + + + + ************************************************************** + TABLES WITH TOPSOIL SOIL PHYSICAL PARAMETERS (HYPRES) for Forest + Each parameter is defined for 1a and 1b + Normal parameter is taken for the lower soil layer + ************************************************************** + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1b (upper soil layer) + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) for soil layer 1a (superficial soil layer) + Lambda is acually 1-n [-] for soil layer 1b (upper soil layer) + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] for soil layer 1b (upper soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1a (superficial soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1b (upper soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1a (superficial soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1b (upper soil layer) + + + + + + + + + + + + ************************************************************** + RESERVOIRS (if used ) + Input maps + ************************************************************** + + + + + Sub time step used for reservoir simulation [s]. Within the model, + the smallest out of DtSecReservoirs and DtSec is used. + + + + + + Map with location of reservoirs (number) + + + + + + Initial reservoir storage (fraction) + + + + + + Input tables + + + + + Total reservoir storage capacity + Units: m³ + + + + + + Reservoir inflow associated with the 100-year return period. + It is modified by a calibration parameter (`ReservoirFloodOutflowFactor`) to + define the inflow above which the reservoir switches to flood control mode + Units: m³/s + + + + + + NReservoir average inflow used to define the normal reservoir release + Units: m³/s + + + + + + Minimum reservoir release: + Units: m³/s + + + + + Output time series + + + + + name of output TSS file with Reservoir Inflow + + + + + + name of output TSS file with Reservoir Outflow + + + + + + name of output TSS file with Reservoir Filling + + + + + + name of output TSS file with Reservoir storage [m3] + + + + + + + name of output map(s) with Reservoir Filling + + + + + + Fraction of the total reservoir storage above which the reservoirs enters + the flood control zone. + + + + + + Factor of the 100-year return inflow that defines a flood event, i.e., the + reservoir routine switches to flood control mode. + + + + + + + + ************************************************************** + LAKES (if used ) + Input maps + ************************************************************** + + + + + Map with location of lakes + + + + + + Initial lake level [m] + -9999 sets initial value to steady-state level + + + + + + Lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value + + + + + + Estimate of average net inflow into lake (=inflow - evaporation) [m3 / s] + Used to calculated steady-state lake level in case LakeInitialLevelValue + is set to -9999 + + + + + Input tables + + + + + Lake surface area [m2] + + + + + + Lake parameter A [m/s] + + + + + + Multiplier applied to the lake parameter A + + + + + Output time series + + + + + Output timeseries file with lake inflow [m3 /s] + + + + + + Output timeseries file with lake outflow [m3 /s] + + + + + + Output timeseries file with lake level [m] + + + + + + Output map(s) with lake level [m] + + + + + + Output map with lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Output map with lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value + + + + + + + + ************************************************************** + POLDERS(if used) + ************************************************************** + + + + + + Weir constant (fixed) [-] + + + + + + Map with polder locations + + + + + + Initial water level in polders [m] + + + + + + Polder maximum storage capacity [cu m] + + + + + + Area of polder [sq m] + + + + + + Width of polder outlet/inlet [m] + + + + + + Polder bottom level, measured from channel bottom [m] + + + + + + Time step at which polder opens in case of regulated polder (use bogus value of -9999 in table in case of unregulated polder) + + + + + + Time step at which water stored in polder is released again(use bogus value of -9999 in table in case of unregulated polder) + + + + + + name of output TSS file with polder flux [cu m / s]. Positive for flow from channel to polder, negative for polder to channel + + + + + + name of output TSS file with polder level [m] + + + + + + name of output map(s) with polder level + + + + + + + + + ************************************************************** + INFLOW HYDROGRAPH (if used) + ************************************************************** + + + + + OPTIONAL: nominal map with locations of (measured) + inflow hydrographs + + + + + + location of calibration points + OPTIONAL: nominal map with locations of calibration points + + + + + + Observed or simulated input hydrographs as + time series [m3 / s] + Note that identifiers in time series correspond to + InflowPoints map (also optional) + + + + + + + + + ************************************************************** + DYNAMIC WAVE(if used) + ************************************************************** + + + + + Critical Courant number for dynamic wave + value between 0-1 (smaller values result in greater numerical accuracy, + but also increase computational time) + + + + + + Constant head [m] at most downstream pixel (relative to altitude + at most downstream pixel) + + + + + + Boolean map with value 1 at channel pixels where dynamic wave is + used, and 0 at all other pixels + + + + + + Channel bottom level [m] + + + + + + Nominal map with channel cross section IDs + + + + + + Table with cross section parameters (H,A,P) + + + + + + + + ************************************************************** + MUSKINGUM-CUNGE-TODINI OPTION + ************************************************************** + + + + + Boolean map with value 1 at channel pixels where MCT is + used, and 0 at all other pixels + + + + + + Maximum channel gradient for channels using MCT routing [-] (for MCT wave: slope cannot be >0.001) + + + + + + + + + ************************************************************** + PF REPORTING (if used) + ************************************************************** + + + + PF PARAMETERS + + + + + Maximum capillary head [cm]. This value is used if Theta equals residual soil + moisture content (value of HeadMax is arbitrary). Only needed for pF computation, + otherwise doesn't influence model results at all) + + + + + PF MAPS + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + PF TIMESERIES, VALUES AT SITES + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + PF TIMESERIES, AVERAGE VALUES UPSTREAM OF GAUGES + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + + + + + + ************************************************************** + Ad'a addition + ************************************************************** + + + + + threshold value below which there is no outflow to the channel [mm] + + + + + + length of the window used to smooth the LZ zone [number of cells] + + + + + + map of aquifers (0/1), used to smoothen LZ near extraction areas + + + + + + + + ************************************************************** + Water demand output maps + ************************************************************** + + + + + day of the year when the yearly endcalculation is done e.g. 31/10/xxxx = 304 + + + + + + + TotalAbstractionFromGroundwater [mm] + + + + + + TotalAbstractionFromSurfaceWater [mm] + + + + + + TotalAbstractionFromSurfaceWater [mm] summed up for water regions + + + + + + Total Abstraction From SurfaceWater and Groundwater [mm] summed up for water regions, montly values + + + + + + TotalPaddyRiceIrrigationAbstraction [m3] + + + + + + Water Exploitation Index - Consumption; for water regions (this is the official EU WEI+): consumption / internal and external availability + + + + + + Water Exploitation Index - Abstraction; for water regions: abstraction / internal and external availability + + + + + + Water Exploitation Index - Demand; for water regions: demand / internal and external availability + + + + + + Water Exploitation Index - Consumption; for water regions + + + + + + Internal available water + + + + + + External available water + + + + + + Region Water Consumption + + + + + + Region Water Consumption + + + + + + Reservoir and Lake storage in m3 at end of month + + + + + + Reservoir and Lake abstraction in m3 + + + + + + Irrigation water shortage in m3 for month + + + + + + Surface water availability in m3 for potential irrigation for each day + + + + + + Monthly evapotranspiration deficit in mm + + + + + + Monthly evapotranspiration deficit in mm + + + + + + Monthly evapotranspiration deficit in mm + + + + + + Monthly Water Dependency Index (0-1) (De Roo 2015) + WDI = Upstream Inflow Actually Used / Total Water Demand + Values close to 1 give extreme dependency on upstream water + + + + + + Monthly Water Security Index (0-1) (De Roo 2015) + WSI = Upstream Inflow Actually Used / Upstream Inflow Available + Values close to 1 give extreme vulnerability to upstream water + + + + + + Monthly Water Sustainability Index (0-1) (De Roo 2015) + WTI = 1-SurfaceWaterDeficit / TotalWaterDemand + Values of 1 indicate complete sustainable conditions, no water deficit + Values less than 1 indicate that considerable deep groundwater resources or desalinated water is used + + + + + + Monthly Falkenmark 1 Index (tochanm3) + + + + + + Monthly Falkenmark 2 Index (tochanm3+reservoirlakeabstraction) + + + + + + Monthly Falkenmark 3 Index (tochanm3+reservoirlakeabstraction+externalinflow) + + + + + + + Abstraction from groundwater in m3 per timestep + + + + + + Abstraction from surface water in m3 per timestep + + + + + + Region abstraction from surface water in m3 per timestep + + + + + + Region Total Abstraction From Lakes and Reservoirs in m3, per timestep + + + + + + Lake Abstraction per timestep in m3 + + + + + + ReservoirAbstraction per timestep in M3 + + + + + + ReservoirStorage in M3 + + + + + + LakeStorage in M3 + + + + + + AreatotalIrrigationUseM3 + + + + + + FractionAbstractedFromChannels + + + + + + EFlowIndicator (1 on day with ChanQ smaller than EflowThreshold, 0 on normal days) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ************************************************************** + Peter's addition + ************************************************************** + + + + + + [mm] + + + + + + [mm] + + + + + + [mm] + + + + + + + + + + areamap MaskMap; + timer StepStart StepEnd 1; + ReportSteps=$(ReportSteps); + + + + + diff --git a/tests/test_mct_dyn_inflow_calib.py b/tests/test_mct_dyn_inflow_calib.py new file mode 100644 index 00000000..fbd8835b --- /dev/null +++ b/tests/test_mct_dyn_inflow_calib.py @@ -0,0 +1,137 @@ +from __future__ import absolute_import +import os +import datetime +import shutil +import pytest + +from lisfloodutilities.compare.nc import NetCDFComparator +from lisfloodutilities.compare.pcr import TSSComparator + +from lisflood.main import lisfloodexe +from lisflood.global_modules.settings import LisSettings + +from .test_utils import setoptions, mk_path_out + + +class TestInflow(): + + case_dir = os.path.join(os.path.dirname(__file__), 'data', 'LF_MCT_UseCase') + + def run(self, date_start, date_end, dtsec, type): + # generate inflow (inflow.tss) one pixel upstream of inflow point + out_path_ref = os.path.join(self.case_dir, 'reference_mct_dyn') + out_path_run = os.path.join(self.case_dir, 'reference_mct_dyn', 'inflow_'+type) + settings_file = os.path.join(self.case_dir, 'settings', 'mct_inflow_calib.xml') + settings = setoptions(settings_file, + opts_to_unset = ['inflow'], + vars_to_set={'StepStart': date_start, + 'StepEnd': date_end, + 'CalendarDayStart': date_start, + 'DtSec' : dtsec, + # 'DtSecChannel' : dtsec, # single routing step + 'BankFullPerc': '0.1', + 'MaskMap': '$(PathRoot)/maps/mask.nc', + 'Gauges': '4292500 2377500', # one cell upstream of inflow point (p2) + 'ChanqavgdtTS': out_path_run+'/inflow.tss', # use chanqavgdt as inflow + 'PathOut': out_path_run, + # 'ChannelsMCT': '$(PathRoot)/maps/chanmct_everywhere', + 'ChanGradMaxMCT': '0.00005', + 'CalChanMan3': '5.0'}) + mk_path_out(out_path_ref) + mk_path_out(out_path_run) + lisfloodexe(settings) + + # generate control run at inflow point + out_path_run = os.path.join(self.case_dir, 'reference_mct_dyn', 'inflow_'+type) + settings_file = os.path.join(self.case_dir, 'settings', 'mct_inflow_calib.xml') + settings = setoptions(settings_file, + opts_to_unset = ['inflow'], + # opts_to_set=['simulateCalibrationPoints'], + vars_to_set={'StepStart': date_start, + 'StepEnd': date_end, + 'CalendarDayStart': date_start, + 'DtSec' : dtsec, + # 'DtSecChannel': dtsec, # single routing step + 'BankFullPerc': '0.1', + 'MaskMap': '$(PathRoot)/maps/mask.nc', + # 'Gauges': '4322500 2447500 4447500 2422500', # inflow and outlet + # 'Gauges': '4297500 2372500', # inflow point (p5) + 'PathOut': out_path_run, + # 'ChannelsMCT': '$(PathRoot)/maps/chanmct_everywhere', + 'ChanGradMaxMCT': '0.00005', + 'CalChanMan3': '5.0', + 'CalibrationPoints': "$(PathRoot)/maps/p2.nc", + }) + # mk_path_out(out_path_run) + lisfloodexe(settings) + + # run with inflow from dynamic reference and generate outflow at inflow point + # out_path_ref = os.path.join(self.case_dir, 'reference_mct_dyn', 'inflow_'+type) + out_path_run = os.path.join(self.case_dir, self.run_type) + settings_file = os.path.join(self.case_dir, 'settings', 'mct_inflow_calib.xml') + settings = setoptions(settings_file, + opts_to_set=['inflow'], + vars_to_set={'StepStart': date_start, + 'StepEnd': date_end, + 'CalendarDayStart': date_start, + 'DtSec' : dtsec, + # 'DtSecChannel': dtsec, # single routing step + 'BankFullPerc': '0.1', + 'MaskMap': '$(PathRoot)/maps/interbasin_mask.nc', + 'InflowPoints': '$(PathRoot)/maps/inflow.nc', + 'QInTS': out_path_ref+'/inflow.tss', + # 'Gauges': '4322500 2447500 4447500 2422500', # inflow and outlet + # 'Gauges': '4297500 2372500', # inflow point (p5) + 'PathOut': out_path_run, + # 'ChannelsMCT': '$(PathRoot)/maps/chanmct_everywhere', + 'ChanGradMaxMCT': '0.00005', + 'CalChanMan3': '5.0'}) + mk_path_out(out_path_run) + lisfloodexe(settings) + + # set precision for the test and number of steps to skip at the beginning of the time series + atol = 2.0 + # atol = 5.0 # single routing step + rtol = 0.01 + init_steps_to_skip = 20 + # comparator = TSSComparator(atol,rtol,init_skip_steps = init_steps_to_skip) + + # test when DtSec = DtSecChannel + reference = os.path.join(out_path_ref, 'disWin.tss') + output_tss = os.path.join(out_path_run, 'disWin.tss') + # comparator.compare_files(reference, output_tss) + + # test when DtSec != DtSecChannel + reference = os.path.join(out_path_ref, 'chanqWin.tss') + output_tss = os.path.join(out_path_run, 'chanqWin.tss') + # comparator.compare_files(reference, output_tss) + + # test when DtSec != DtSecChannel + reference = os.path.join(out_path_ref, 'chanqavgdt.tss') + output_tss = os.path.join(out_path_run, 'chanqavgdt.tss') + # comparator.compare_files(reference, output_tss) + + # def teardown_method(self, type): + # print('Cleaning directories') + # + # ref_path = os.path.join(self.case_dir, 'reference_mct_dyn') + # if os.path.exists(ref_path) and os.path.isdir(ref_path): + # shutil.rmtree(ref_path, ignore_errors=True) + # + # out_path = os.path.join(self.case_dir, self.run_type) + # if os.path.exists(out_path) and os.path.isdir(out_path): + # shutil.rmtree(out_path, ignore_errors=True) + + +class TestInflowShort(TestInflow): + + run_type = 'short' + + # def test_mct_inflow_daily(self): + # self.run("02/01/2016 06:00", "30/01/2016 06:00", 86400,'daily') + def test_mct_inflow_6h(self): + self.run("01/03/2016 06:00", "30/04/2016 06:00", 21600,'6h') + + # # cleaning folders + # def cleaning(self,): + # self.teardown_method() From d76c11606347cb187a9561af46c97fc23c84f5cf Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Thu, 21 May 2026 08:38:59 +0000 Subject: [PATCH 28/35] Fixed output paths in the dynamic inflow test. --- tests/test_mct_dyn_inflow_calib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_mct_dyn_inflow_calib.py b/tests/test_mct_dyn_inflow_calib.py index fbd8835b..d3d04b9f 100644 --- a/tests/test_mct_dyn_inflow_calib.py +++ b/tests/test_mct_dyn_inflow_calib.py @@ -62,11 +62,11 @@ def run(self, date_start, date_end, dtsec, type): 'CalChanMan3': '5.0', 'CalibrationPoints': "$(PathRoot)/maps/p2.nc", }) - # mk_path_out(out_path_run) + lisfloodexe(settings) # run with inflow from dynamic reference and generate outflow at inflow point - # out_path_ref = os.path.join(self.case_dir, 'reference_mct_dyn', 'inflow_'+type) + out_path_ref = os.path.join(self.case_dir, 'reference_mct_dyn', 'inflow_'+type) out_path_run = os.path.join(self.case_dir, self.run_type) settings_file = os.path.join(self.case_dir, 'settings', 'mct_inflow_calib.xml') settings = setoptions(settings_file, From 1b68035fa0193f37cf62ced5d33ce2f679bed8e7 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Thu, 21 May 2026 08:57:44 +0000 Subject: [PATCH 29/35] Debugging test_mct_dyn_inflow_calib --- .../settings/mct_inflow_calib.xml | 10 ++--- tests/test_mct_dyn_inflow_calib.py | 38 ++++++++++--------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/tests/data/LF_MCT_UseCase/settings/mct_inflow_calib.xml b/tests/data/LF_MCT_UseCase/settings/mct_inflow_calib.xml index c78f7c3e..e047ed62 100644 --- a/tests/data/LF_MCT_UseCase/settings/mct_inflow_calib.xml +++ b/tests/data/LF_MCT_UseCase/settings/mct_inflow_calib.xml @@ -46,11 +46,11 @@ You can use builtin path variables in this template and reference to other paths - + - + # use inflow data @@ -292,7 +292,7 @@ You can use builtin path variables in this template and reference to other paths - + Reference day and time @@ -313,14 +313,14 @@ You can use builtin path variables in this template and reference to other paths - + 01/01/YEAR_START 12:00 Number of first time step in simulation - + 01/01/YEAR_END 06:00 Number of last time step in simulation diff --git a/tests/test_mct_dyn_inflow_calib.py b/tests/test_mct_dyn_inflow_calib.py index d3d04b9f..48fa43b4 100644 --- a/tests/test_mct_dyn_inflow_calib.py +++ b/tests/test_mct_dyn_inflow_calib.py @@ -27,16 +27,17 @@ def run(self, date_start, date_end, dtsec, type): vars_to_set={'StepStart': date_start, 'StepEnd': date_end, 'CalendarDayStart': date_start, - 'DtSec' : dtsec, + # 'DtSec' : dtsec, # 'DtSecChannel' : dtsec, # single routing step - 'BankFullPerc': '0.1', - 'MaskMap': '$(PathRoot)/maps/mask.nc', - 'Gauges': '4292500 2377500', # one cell upstream of inflow point (p2) + # 'BankFullPerc': '0.1', + # 'MaskMap': '$(PathRoot)/maps/mask.nc', + # 'Gauges': '4292500 2377500', # one cell upstream of inflow point (p2) 'ChanqavgdtTS': out_path_run+'/inflow.tss', # use chanqavgdt as inflow 'PathOut': out_path_run, # 'ChannelsMCT': '$(PathRoot)/maps/chanmct_everywhere', - 'ChanGradMaxMCT': '0.00005', - 'CalChanMan3': '5.0'}) + # 'ChanGradMaxMCT': '0.00005', + # 'CalChanMan3': '5.0', + }) mk_path_out(out_path_ref) mk_path_out(out_path_run) lisfloodexe(settings) @@ -50,20 +51,20 @@ def run(self, date_start, date_end, dtsec, type): vars_to_set={'StepStart': date_start, 'StepEnd': date_end, 'CalendarDayStart': date_start, - 'DtSec' : dtsec, + # 'DtSec' : dtsec, # 'DtSecChannel': dtsec, # single routing step - 'BankFullPerc': '0.1', - 'MaskMap': '$(PathRoot)/maps/mask.nc', + #'BankFullPerc': '0.1', + # 'MaskMap': '$(PathRoot)/maps/mask.nc', # 'Gauges': '4322500 2447500 4447500 2422500', # inflow and outlet # 'Gauges': '4297500 2372500', # inflow point (p5) 'PathOut': out_path_run, # 'ChannelsMCT': '$(PathRoot)/maps/chanmct_everywhere', - 'ChanGradMaxMCT': '0.00005', - 'CalChanMan3': '5.0', - 'CalibrationPoints': "$(PathRoot)/maps/p2.nc", + # 'ChanGradMaxMCT': '0.00005', + # 'CalChanMan3': '5.0', + # 'CalibrationPoints': "$(PathRoot)/maps/p2.nc", }) - lisfloodexe(settings) + # lisfloodexe(settings) # run with inflow from dynamic reference and generate outflow at inflow point out_path_ref = os.path.join(self.case_dir, 'reference_mct_dyn', 'inflow_'+type) @@ -74,9 +75,9 @@ def run(self, date_start, date_end, dtsec, type): vars_to_set={'StepStart': date_start, 'StepEnd': date_end, 'CalendarDayStart': date_start, - 'DtSec' : dtsec, + # 'DtSec' : dtsec, # 'DtSecChannel': dtsec, # single routing step - 'BankFullPerc': '0.1', + # 'BankFullPerc': '0.1', 'MaskMap': '$(PathRoot)/maps/interbasin_mask.nc', 'InflowPoints': '$(PathRoot)/maps/inflow.nc', 'QInTS': out_path_ref+'/inflow.tss', @@ -84,10 +85,11 @@ def run(self, date_start, date_end, dtsec, type): # 'Gauges': '4297500 2372500', # inflow point (p5) 'PathOut': out_path_run, # 'ChannelsMCT': '$(PathRoot)/maps/chanmct_everywhere', - 'ChanGradMaxMCT': '0.00005', - 'CalChanMan3': '5.0'}) + # 'ChanGradMaxMCT': '0.00005', + # 'CalChanMan3': '5.0', + }) mk_path_out(out_path_run) - lisfloodexe(settings) + # lisfloodexe(settings) # set precision for the test and number of steps to skip at the beginning of the time series atol = 2.0 From 224a93969c8909b27f9800e3a0c0a67d82419077 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Thu, 21 May 2026 13:21:04 +0000 Subject: [PATCH 30/35] Added short test for MCT inflow in flat channels (MCT pixels slope=0.00005) --- .../settings/mct_inflow_calib.xml | 4 +- tests/test_mct_dyn_inflow_calib.py | 95 ++++++++++--------- 2 files changed, 50 insertions(+), 49 deletions(-) diff --git a/tests/data/LF_MCT_UseCase/settings/mct_inflow_calib.xml b/tests/data/LF_MCT_UseCase/settings/mct_inflow_calib.xml index e047ed62..a0ac4ff4 100644 --- a/tests/data/LF_MCT_UseCase/settings/mct_inflow_calib.xml +++ b/tests/data/LF_MCT_UseCase/settings/mct_inflow_calib.xml @@ -46,11 +46,11 @@ You can use builtin path variables in this template and reference to other paths - + - + # use inflow data diff --git a/tests/test_mct_dyn_inflow_calib.py b/tests/test_mct_dyn_inflow_calib.py index 48fa43b4..6af0c96e 100644 --- a/tests/test_mct_dyn_inflow_calib.py +++ b/tests/test_mct_dyn_inflow_calib.py @@ -24,19 +24,21 @@ def run(self, date_start, date_end, dtsec, type): settings_file = os.path.join(self.case_dir, 'settings', 'mct_inflow_calib.xml') settings = setoptions(settings_file, opts_to_unset = ['inflow'], + opts_to_set=['simulateCalibrationPoints', 'MCTRoutingInterface'], vars_to_set={'StepStart': date_start, 'StepEnd': date_end, 'CalendarDayStart': date_start, - # 'DtSec' : dtsec, + 'DtSec' : dtsec, # 'DtSecChannel' : dtsec, # single routing step - # 'BankFullPerc': '0.1', - # 'MaskMap': '$(PathRoot)/maps/mask.nc', - # 'Gauges': '4292500 2377500', # one cell upstream of inflow point (p2) + 'BankFullPerc': '0.1', + 'MaskMap': '$(PathRoot)/maps/mask.nc', + 'Gauges': '4292500 2377500', # one cell upstream of inflow point (p2) 'ChanqavgdtTS': out_path_run+'/inflow.tss', # use chanqavgdt as inflow 'PathOut': out_path_run, - # 'ChannelsMCT': '$(PathRoot)/maps/chanmct_everywhere', - # 'ChanGradMaxMCT': '0.00005', - # 'CalChanMan3': '5.0', + 'ChannelsMCT': '$(PathRoot)/maps/chanmct_conf', + 'ChanGradMaxMCT': '0.00005', + 'CalChanMan3': '5.0', + 'CalibrationPoints': "$(PathRoot)/maps/p2.nc", }) mk_path_out(out_path_ref) mk_path_out(out_path_run) @@ -47,93 +49,92 @@ def run(self, date_start, date_end, dtsec, type): settings_file = os.path.join(self.case_dir, 'settings', 'mct_inflow_calib.xml') settings = setoptions(settings_file, opts_to_unset = ['inflow'], - # opts_to_set=['simulateCalibrationPoints'], + opts_to_set=['simulateCalibrationPoints', 'MCTRoutingInterface'], vars_to_set={'StepStart': date_start, 'StepEnd': date_end, 'CalendarDayStart': date_start, - # 'DtSec' : dtsec, + 'DtSec' : dtsec, # 'DtSecChannel': dtsec, # single routing step - #'BankFullPerc': '0.1', - # 'MaskMap': '$(PathRoot)/maps/mask.nc', + 'BankFullPerc': '0.1', + 'MaskMap': '$(PathRoot)/maps/mask.nc', # 'Gauges': '4322500 2447500 4447500 2422500', # inflow and outlet - # 'Gauges': '4297500 2372500', # inflow point (p5) + 'Gauges': '4297500 2372500', # inflow point (p5) 'PathOut': out_path_run, - # 'ChannelsMCT': '$(PathRoot)/maps/chanmct_everywhere', - # 'ChanGradMaxMCT': '0.00005', - # 'CalChanMan3': '5.0', - # 'CalibrationPoints': "$(PathRoot)/maps/p2.nc", + 'ChannelsMCT': '$(PathRoot)/maps/chanmct_conf', + 'ChanGradMaxMCT': '0.00005', + 'CalChanMan3': '5.0', + 'CalibrationPoints': "$(PathRoot)/maps/p2.nc", }) - # lisfloodexe(settings) + lisfloodexe(settings) # run with inflow from dynamic reference and generate outflow at inflow point out_path_ref = os.path.join(self.case_dir, 'reference_mct_dyn', 'inflow_'+type) out_path_run = os.path.join(self.case_dir, self.run_type) settings_file = os.path.join(self.case_dir, 'settings', 'mct_inflow_calib.xml') settings = setoptions(settings_file, - opts_to_set=['inflow'], + opts_to_set=['inflow','simulateCalibrationPoints', 'MCTRoutingInterface'], vars_to_set={'StepStart': date_start, 'StepEnd': date_end, 'CalendarDayStart': date_start, - # 'DtSec' : dtsec, + 'DtSec' : dtsec, # 'DtSecChannel': dtsec, # single routing step - # 'BankFullPerc': '0.1', + 'BankFullPerc': '0.1', 'MaskMap': '$(PathRoot)/maps/interbasin_mask.nc', 'InflowPoints': '$(PathRoot)/maps/inflow.nc', 'QInTS': out_path_ref+'/inflow.tss', # 'Gauges': '4322500 2447500 4447500 2422500', # inflow and outlet - # 'Gauges': '4297500 2372500', # inflow point (p5) + 'Gauges': '4297500 2372500', # inflow point (p5) 'PathOut': out_path_run, - # 'ChannelsMCT': '$(PathRoot)/maps/chanmct_everywhere', - # 'ChanGradMaxMCT': '0.00005', - # 'CalChanMan3': '5.0', + 'ChannelsMCT': '$(PathRoot)/maps/chanmct_conf', + 'ChanGradMaxMCT': '0.00005', + 'CalChanMan3': '5.0', }) mk_path_out(out_path_run) - # lisfloodexe(settings) + lisfloodexe(settings) # set precision for the test and number of steps to skip at the beginning of the time series atol = 2.0 - # atol = 5.0 # single routing step rtol = 0.01 - init_steps_to_skip = 20 - # comparator = TSSComparator(atol,rtol,init_skip_steps = init_steps_to_skip) + init_steps_to_skip = 5 + comparator = TSSComparator(atol,rtol,init_skip_steps = init_steps_to_skip) # test when DtSec = DtSecChannel reference = os.path.join(out_path_ref, 'disWin.tss') output_tss = os.path.join(out_path_run, 'disWin.tss') - # comparator.compare_files(reference, output_tss) + comparator.compare_files(reference, output_tss) # test when DtSec != DtSecChannel reference = os.path.join(out_path_ref, 'chanqWin.tss') output_tss = os.path.join(out_path_run, 'chanqWin.tss') - # comparator.compare_files(reference, output_tss) + comparator.compare_files(reference, output_tss) # test when DtSec != DtSecChannel reference = os.path.join(out_path_ref, 'chanqavgdt.tss') output_tss = os.path.join(out_path_run, 'chanqavgdt.tss') - # comparator.compare_files(reference, output_tss) + comparator.compare_files(reference, output_tss) + + def teardown_method(self, type): + print('Cleaning directories') + + ref_path = os.path.join(self.case_dir, 'reference_mct_dyn') + if os.path.exists(ref_path) and os.path.isdir(ref_path): + shutil.rmtree(ref_path, ignore_errors=True) - # def teardown_method(self, type): - # print('Cleaning directories') - # - # ref_path = os.path.join(self.case_dir, 'reference_mct_dyn') - # if os.path.exists(ref_path) and os.path.isdir(ref_path): - # shutil.rmtree(ref_path, ignore_errors=True) - # - # out_path = os.path.join(self.case_dir, self.run_type) - # if os.path.exists(out_path) and os.path.isdir(out_path): - # shutil.rmtree(out_path, ignore_errors=True) + out_path = os.path.join(self.case_dir, self.run_type) + if os.path.exists(out_path) and os.path.isdir(out_path): + shutil.rmtree(out_path, ignore_errors=True) class TestInflowShort(TestInflow): run_type = 'short' - # def test_mct_inflow_daily(self): - # self.run("02/01/2016 06:00", "30/01/2016 06:00", 86400,'daily') + def test_mct_inflow_daily(self): + self.run("02/01/2016 06:00", "30/01/2016 06:00", 86400,'daily') def test_mct_inflow_6h(self): - self.run("01/03/2016 06:00", "30/04/2016 06:00", 21600,'6h') + self.run("01/03/2016 06:00", "30/03/2016 06:00", 21600,'6h') - # # cleaning folders - # def cleaning(self,): - # self.teardown_method() + # cleaning folders + def cleaning(self,): + self.teardown_method() From a8a7a8caf597acd111f721d44731f61ba2a0166c Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Thu, 21 May 2026 14:56:39 +0000 Subject: [PATCH 31/35] Cosmetic change --- tests/test_mct_dyn_inflow_calib.py | 33 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/tests/test_mct_dyn_inflow_calib.py b/tests/test_mct_dyn_inflow_calib.py index 6af0c96e..fb045d09 100644 --- a/tests/test_mct_dyn_inflow_calib.py +++ b/tests/test_mct_dyn_inflow_calib.py @@ -38,7 +38,7 @@ def run(self, date_start, date_end, dtsec, type): 'ChannelsMCT': '$(PathRoot)/maps/chanmct_conf', 'ChanGradMaxMCT': '0.00005', 'CalChanMan3': '5.0', - 'CalibrationPoints': "$(PathRoot)/maps/p2.nc", + 'CalibrationPoints': "$(PathRoot)/maps/inflow.nc", }) mk_path_out(out_path_ref) mk_path_out(out_path_run) @@ -63,7 +63,7 @@ def run(self, date_start, date_end, dtsec, type): 'ChannelsMCT': '$(PathRoot)/maps/chanmct_conf', 'ChanGradMaxMCT': '0.00005', 'CalChanMan3': '5.0', - 'CalibrationPoints': "$(PathRoot)/maps/p2.nc", + # 'CalibrationPoints': "$(PathRoot)/maps/inflow.nc", }) lisfloodexe(settings) @@ -89,6 +89,7 @@ def run(self, date_start, date_end, dtsec, type): 'ChannelsMCT': '$(PathRoot)/maps/chanmct_conf', 'ChanGradMaxMCT': '0.00005', 'CalChanMan3': '5.0', + # 'CalibrationPoints': "$(PathRoot)/maps/inflow.nc", }) mk_path_out(out_path_run) lisfloodexe(settings) @@ -114,27 +115,27 @@ def run(self, date_start, date_end, dtsec, type): output_tss = os.path.join(out_path_run, 'chanqavgdt.tss') comparator.compare_files(reference, output_tss) - def teardown_method(self, type): - print('Cleaning directories') - - ref_path = os.path.join(self.case_dir, 'reference_mct_dyn') - if os.path.exists(ref_path) and os.path.isdir(ref_path): - shutil.rmtree(ref_path, ignore_errors=True) - - out_path = os.path.join(self.case_dir, self.run_type) - if os.path.exists(out_path) and os.path.isdir(out_path): - shutil.rmtree(out_path, ignore_errors=True) + # def teardown_method(self, type): + # print('Cleaning directories') + # + # ref_path = os.path.join(self.case_dir, 'reference_mct_dyn') + # if os.path.exists(ref_path) and os.path.isdir(ref_path): + # shutil.rmtree(ref_path, ignore_errors=True) + # + # out_path = os.path.join(self.case_dir, self.run_type) + # if os.path.exists(out_path) and os.path.isdir(out_path): + # shutil.rmtree(out_path, ignore_errors=True) class TestInflowShort(TestInflow): run_type = 'short' - def test_mct_inflow_daily(self): - self.run("02/01/2016 06:00", "30/01/2016 06:00", 86400,'daily') + # def test_mct_inflow_daily(self): + # self.run("02/01/2016 06:00", "30/01/2016 06:00", 86400,'daily') def test_mct_inflow_6h(self): self.run("01/03/2016 06:00", "30/03/2016 06:00", 21600,'6h') # cleaning folders - def cleaning(self,): - self.teardown_method() + # def cleaning(self,): + # self.teardown_method() From e415ea0fe6790720573d584ac7b38ecdd25db2c1 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Wed, 27 May 2026 14:02:21 +0000 Subject: [PATCH 32/35] Fixed dynamic initialization of MCT confluence and warm start --- src/lisflood/hydrological_modules/mctconfluence.py | 7 ++++++- src/lisflood/hydrological_modules/routing.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lisflood/hydrological_modules/mctconfluence.py b/src/lisflood/hydrological_modules/mctconfluence.py index bfc66ec8..8352b695 100755 --- a/src/lisflood/hydrological_modules/mctconfluence.py +++ b/src/lisflood/hydrological_modules/mctconfluence.py @@ -126,8 +126,13 @@ def dynamic_init(self): """ settings = LisSettings.instance() option = settings.options + maskinfo = MaskInfo.instance() if option['MCTRouting'] and option['MCTRoutingInterface']: - self.var.QInConfM3Old = np.where(self.var.MCTConfluenceSitesC > 0, self.var.ChanQAvgDt * self.var.DtSec, 0) + lateralflow = np.bincount(self.var.KinematicUpsOfMCTConfluence, weights=self.var.ChanQAvgDt)[self.var.MCTConfluenceIndex] #same as Qin + # contribution to the MCT pixel from upstream Kinematic pixels + self.var.QInConfM3Old = maskinfo.in_zero() + np.put(self.var.QInConfM3Old, self.var.MCTConfluenceIndex, lateralflow * self.var.DtSec) + pass def dynamic_inloop(self, NoRoutingExecuted: int): diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 9416a26f..1339b497 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -860,6 +860,7 @@ def dynamic(self, NoRoutingExecuted): # # MCT headwater pixels outflow volume per routing sub step [m3] # MCT CONFLUENCE + # This needs to be here because I need to grab the input to MCT pixels from outflow at the end of routing step of kinematic pixels if option['MCTRoutingInterface']: self.mctconfluence_module.dynamic_inloop(NoRoutingExecuted) # calculate sideflow from MCT confluence pixels From 5932549a1af8490fd965b6590a37a6d57c2e99e5 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Wed, 27 May 2026 15:02:17 +0000 Subject: [PATCH 33/35] Adding a test for warm start when using MCT Calibration points and MCT Confluence --- .../settings/mct_cold_interface.xml | 6154 +++++++++++++++++ .../settings/mct_warm_endmaps_interface.xml | 5992 ++++++++++++++++ .../settings/mct_warm_interface.xml | 5993 ++++++++++++++++ tests/test_mct_warmstart_calib.py | 250 + 4 files changed, 18389 insertions(+) create mode 100644 tests/data/LF_MCT_UseCase/settings/mct_cold_interface.xml create mode 100644 tests/data/LF_MCT_UseCase/settings/mct_warm_endmaps_interface.xml create mode 100644 tests/data/LF_MCT_UseCase/settings/mct_warm_interface.xml create mode 100644 tests/test_mct_warmstart_calib.py diff --git a/tests/data/LF_MCT_UseCase/settings/mct_cold_interface.xml b/tests/data/LF_MCT_UseCase/settings/mct_cold_interface.xml new file mode 100644 index 00000000..3b47e491 --- /dev/null +++ b/tests/data/LF_MCT_UseCase/settings/mct_cold_interface.xml @@ -0,0 +1,6154 @@ + + + + + + + #----------------------------------------------------------- + # modelling and reporting options + #----------------------------------------------------------- + + + + # options to turn hydrological modules on/off + + + + + + + + + + + + + + + + + + + + + + # use inflow data + + + # option to compute indicators + + + # option to initialize Lisflood + + + + # option to read/write NetCDF + + + + + # option to Report PaddyRiceDebug information in CSV file for debugging Paddy Rice Water Abstraction issue on dry Channels + + + #----------------------------------------------------------- + # report time series + #----------------------------------------------------------- + # report discharge TS + + + # report gauges and sites + # sites (pixel average) + + + # gauges (catchment average) + + + + + # report reservoirs and lakes + + + + # report mass balance + + + #----------------------------------------------------------- + # report maps + #----------------------------------------------------------- + # report state maps + + + # report end maps + + + # report output maps + # forcings + + + + + + + # dicharge + + + + + + # variables + + + + + + + + + + + + + + + + #Surface runoff + #Surface runoff + UZ [mm] + #Surface runoff + UZ [mm] + LZ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ************************************************************** + netCDF parameters + ************************************************************** + + + + !-- Optimization of netCDF I/O through chunking and caching. + + The option "NetCDFTimeChunks" may take the following values: + - "-1" : Load everything upfront + - "[positive integer number]" : Chunk size defined by user + - "auto" : Let xarray to decide + + + + + The option "MapsCaching" may take the following values: + - "True" : Cache maps during execution + - "False" : No caching + + + + ************************************************************** + PARALLELIZED KINEMATIC ROUTING + ************************************************************** + + + + + The option "OutputMapsChunks" may take the following values: + - "[positive integer number]" : Dump outputs to disk every X steps (default 1) + + + + + The option "OutputMapsDataType" sets the output data type and may take the following values: + - "float64" + - "float32" + + + + ************************************************************** + PARALLELISATION WITH NUMBA (USED IN ROUTING AND SOILLOOP) + ************************************************************** + + + + + !-- Parallelisation of using Numba runtime compiled library . + The option "numCPUs_parallelNumba" may take the following values: + - "0" : set to NUMBA_NUM_THREADS Environment Variable + (if NUMBA_NUM_THREADS is not set, will take the number of CPU cores determined by python's multiprocessing.cpu_count()) + - "1" : serial execution (not parallel) + - "2", "3", ... : manual setting of the number of parallel threads. + (if exceeding NUMBA_NUM_THREADS, the value is set to NUMBA_NUM_THREADS) --> + + + + ************************************************************** + AREA AND OUTLETS + ************************************************************** + + + + + MAPSDIR + Root directory (tables and parameters) + $(SettingsPath)/.. + + + + + + Clone map + col row cellsize xupleft yupleft + or pcraster maps or netcdf maps + + + + + 4307500 2377500 outlet + 4307500 2377500 4292500 2377500 4302500 2377500 4302500 2372500 4297500 2372500 4312500 2377500 4287500 2372500 4282500 2367500 + Nominal map with gauge locations (i.e cells for which simulated discharge + is written to file(1,2,3 etc) + lat lon (lat2 lon2 ...) + or pcraster maps or netcdf maps + + + + + + netcdf template used to copy metadata information for writing netcdf + + + + + + latitude map to be used for snow/ice modelling + + + + + + This is needed when using projected coordinates + + + + + + + ************************************************************** + TIME-RELATED CONSTANTS + ************************************************************** + + + + + Calendar convention + + + + + + Reference day and time + + + + + + timestep [seconds] + + + + + + 17280 5 times subrouting + 21600 6 hours + Sub time step used for kinematic and MCT wave channel routing [seconds] + Within the model,the smallest out of DtSecChannel and DtSec is used + + + + + + 01/01/YEAR_START 12:00 + Number of first time step in simulation + + + + + + 01/01/YEAR_END 06:00 + Number of last time step in simulation + + + + + + low value to limit testing time + + + + + + 1..9999 + Time steps at which to write model state maps (i.e. only + those maps that would be needed to define initial conditions + for succeeding model run) + + + + + + + + + + + ************************************************************** + MONTE CARLO, KALMAN FILTER + ************************************************************** + + + + + Number of sample to use in MonteCarlo simulations + + + + + + Number of cores of the computer to use in MonteCarlo simulations + This only works with Linux, if set to 1 no forking will be used + + + + + + + Time steps at which to write model state maps (i.e. only + those maps that would be needed to define initial conditions + for succeeding model run) + + + + + + + + + + ************************************************************** + CALIBRATION PARAMETERS + with .nc format: than working with smaller sub-areas is possible + ************************************************************** + + + + default: 10 + $(PathParams)/params_UpperZoneTimeConstant + Time constant for water in upper zone [days] + This is the average time a water 'particle' remains in the reservoir + if we had a stationary system (average inflow=average outflow) + + + + + + default: 100 + $(PathParams)/params_LowerZoneTimeConstant + Time constant for water in lower zone [days] + This is the average time a water 'particle' remains in the reservoir + if we had a stationary system (average inflow=average outflow) + + + + + + default: 0.5 + $(PathParams)/GwPercValue + Maximum rate of percolation going from the Upper to the Lower + response box [mm/day] + + + + + + default: 0.0 + $(PathParams)/GwLoss + Maximum percolation rate from the lower groundwater zone [mm/days]. GWLoss + it’s lost beyond the catchment boundaries or to deep groundwater systems. + A value of 0 (closed lower boundary) is recommended as a starting value. + + + + + + default: 10 + $(PathParams)/params_LZThreshold + threshold value [mm] of the water storage in the lower groundwater zone. + If the water storage in the lower groundwater zone decreases below LZThreshold, + the flow from the lower zone to the nearby rivers (base-flow) stops. + + + + + + default: 0.7 [-] + $(PathParams)/b_Xinanjiang + Power in Xinanjiang distribution function [-] + + + + + + default: 3.5 [-] + $(PathParams)/PowerPrefFlow + Power that controls increase of proportion of preferential + flow with increased soil moisture storage [-] + + + + + + default: 2.0 [-] + $(PathParams)/CalChanMan1 + Multiplier [-] applied to Channel Manning's n + + + + + + default: 4.0 [mm C-1 day-1] + $(PathParams)/SnowMeltCoef + SRM: 0.45 cm C-1 day-1 ( = 4.50 mm C-1 day-1), Kwadijk: 18 mm C-1 month-1 (= 0.59 mm C-1 day-1) + See also Martinec et al., 1998. + + + + + + default: 3.0 [-] + $(PathParams)/CalChanMan2 + Multiplier [-] applied to Channel Manning's n for second line of routing + + + + + + default: 3.0 [-] + $(PathParams)/CalChanMan3 + Multiplier [-] applied to Channel Manning's n for MCT routing + + + + + + default: 1.0 [-] + $(PathParams)/LakeMultiplier + Multiplier applied to the lake parameter A + + + + + + Fraction of the total reservoir storage above which the reservoirs enters + the flood control zone. + + + + + + Factor of the 100-year return inflow (`ReservoirFloodOutflow`) that defines the inflow + value that switches, when exceeded, the reservoir routine to flood control mode. + It can be a map (NetCDF), a table (TXT) or a float. Negative values will be replaced by + the default value of 0.3 + Units: - + Range: 0.1 - 0.5 + Default: 0.3 + + + + + + default: 5.0 [mm/day] (not included in calibration) + Critical amount of available water (expressed in [mm/day]!), above which 'Days Since Last Rain' parameter is + set to 1 + + + + + default: 2.0 + $(PathParams)/params_QSplitMult + Multiplier applied to average Q to split into a second line of routing + + + + + + default: 1.0 + $(PathParams)/params_ChanBottomWMult + Multiplier applied to ChanBottomWidth + + + + + + default: 1.0 + $(PathParams)/params_ChanDepthTMult + Multiplier [] applied to ChanDepthThreshold + + + + + + default: 1.0 + $(PathParams)/params_ChanSMult + Multiplier [] applied to ChanSdXdY + + + + + + + + ************************************************************** + FILE PATHS + ************************************************************** + + + + + RUNDIR + Output path (org=$(PathRoot)/out) + + + + + + INITDIR + Path of the initial value maps e.g. lzavin.map (org=$(PathRoot)/outPo) + + + + + + Static maps path + + + + + + Inflow path + + + + + + Calibration parameter path + + + + + + Tables path + + + + + + Maps instead of tables path + + + + + + Maps instead of tables for soil hydraulics path + + + + + + Maps for transient land use changes every 5 years + + + + + + Maps for land use fractions and related land use maps + + + + + + Water use maps path + + + + + + FORCINGSDIR + Meteo path + + + + + + Leaf Area Index maps path + + + + + + variable water fraction maps path + + + + + + + + ************************************************************** + INITIAL CONDITIONS + (maps or single values) + ************************************************************** + + + + + if init. condition are stored as netCDF with different time steps + this variable indicates which time step to use + Either as date e.g. 1/1/2010 or as number e.g. 5 + + + + + + Cold start: 0 + Initial overland flow storage [m3], direct runoff fraction + + + + + + Cold start: 0 + Initial overland flow storage [m3], other fraction + + + + + + Cold start: 0 + Initial overland flow storage [m3], forest fraction + + + + + + Cold start: 0 + initial snow depth in snow zone A [mm] + + + + + + Cold start: 0 + initial snow depth in snow zone B [mm] + + + + + + Cold start: 0 + initial snow depth in snow zone C [mm] + + + + + + Cold start: 0 + initial Frost Index value [degC/day] + + + + + + Cold start: 0 + cumulative interception [mm] + + + + + + Cold start: 0 + PRERUNDIR/uz.end.nc + water in upper store [mm] + + + + + + Cold start: 1 + days since last rainfall [days] + + + + + + + + ************************************************************** + The following variables can also be initialized in the model + internally. if you want this to happen set them to bogus value + of -9999 + ************************************************************** + + + + + PRERUNDIR/lz.end.nc + water in lower store [mm] + Cold start: -9999: use steady-state storage + + + + + + initial cross-sectional area of flow in channel[m2] + Cold start: -9999: use half bankfull + + + + + + PRERUNDIR/tha.end.nc + initial soil moisture content layer 1a (superficial soil layer) [mm3/mm3] + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thb.end.nc + initial soil moisture content layer 1b (upper soil layer) [mm3/mm3] + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thc.end.nc + initial soil moisture content layer 2 (lower soil layer) [mm3/mm3] + Cold start: -9999: use field capacity values + + + + + + initial channel cross-section area [m2] for 2nd routing channel + Cold start: -9999: use 0 + + + + + + initial lateral inflow for 1st line of routing [m2/s] + Cold start: -9999: use 0 + + + + + + Initial lake level [m] + Cold start: -9999 sets initial value to steady-state level + + + + + + Lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + Cold start: -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + Cold start: -9999 sets initial value + + + + + + Outflow discharge at the end of previous step (instantaneous) [m3/s] + Cold start: -9999 sets initial value to 0 + + + + + + Outflow average discharge on previous routing sub-step (average) [m3/s] + Cold start: -9999 sets initial value to 0 + + + + + + Courant number at previous step for MCT routing + Cold start: -9999 sets initial value to 1 + + + + + + Reynolds number at previous step for MCT routing + Cold start: -9999 sets initial value to 0 + + + + + + + + + ************************************************************** + INITIAL CONDITIONS FOREST + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + Cold start: 0 + + + + + + PRERUNDIR/uzf.end.nc + water in upper groundwater store [mm] + Cold start: 0 + + + + + + days since last rainfall + Cold start: 1 + + + + + + PRERUNDIR/thfa.end.nc + initial soil moisture content [mm3/mm3] layer 1a (superficial soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thfb.end.nc + initial soil moisture content [mm3/mm3] layer 1b (upper soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thfc.end.nc + initial soil moisture content [mm3/mm3] layer 2 (lower soil layer) + Cold start: -9999: use field capacity values + + + + + + + + + ************************************************************** + INITIAL CONDITIONS IRRIGATION + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + Cold start: 0 + + + + + + PRERUNDIR/uzi.end.nc + water in groundwater upper store [mm] + Cold start: 0 + + + + + + days since last rainfall + Cold start: 1 + + + + + + PRERUNDIR/thia.end.nc + initial soil moisture content [mm3/mm3] layer 1a (superficial soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thib.end.nc + initial soil moisture content [mm3/mm3] layer 1b (upper soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thic.end.nc + initial soil moisture content [mm3/mm3] layer 2 (lower soil layer) + Cold start: -9999: use field capacity values + + + + + + + + ************************************************************** + INITIAL CONDITIONS IMPERVIOUS AREAS + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + Cold start: 0 + + + + + + + + ************************************************************** + CUMULATIVE FLUXES REQUIRED WHEN COMPUTING THE PRE-RUN IN CHUNKS + ************************************************************** + + + + + Cumulative inflow to the lower groundwater zone + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + LZInflowCumEnd: required for the warm start of the pre-run + + + + + + Cumulative flux from second to third soil layer, other land cover fraction + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + cumSeepTopToSubBOtherEnd: required for the warm start of the pre-run + + + + + + Cumulative flux from second to third soil layer, forest land cover fraction + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + cumSeepTopToSubBForestEnd: required for the warm start of the pre-run + + + + + + Cumulative flux from second to third soil layer, irrigation land cover fraction + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + cumSeepTopToSubBIrrigationEnd: required for the warm start of the pre-run + + + + + + Cumulative discharge + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + CumQEnd: required for the warm start of the pre-run + + + + + + Cumulative number of days from the start of the prerun + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + TimeSinceStartPrerunChunkEnd: required for the warm start of the pre-run + + + + + + + ************************************************************** + PREFIXES OF METEO AND VEGETATION RELATED VARIABLES + ************************************************************** + + + + + prefix precipitation maps + + + + + + prefix average temperature maps + + + + + + prefix E0 maps + + + + + + prefix ES0 maps + + + + + + prefix ET0 maps + + + + + + prefix LAI maps + + + + + + prefix LAI forest maps + + + + + + prefix LAI irrigation maps + + + + + + prefix domestic water use maps + + + + + + prefix livestock water use maps + + + + + + prefix energy water use maps + + + + + + prefix industry water use maps + + + + + + prefix variable water fraction + + + + + + + + ************************************************************** + PARAMETERS RELATED TO EVAPO(TRANSPI)RATION AND Interception + ************************************************************** + + Suggested parameterisation strategy: + + - leave all these parameters at their default values. + in some very special cases CalEvaporation may be set to some + value other than one + + + + + + Multiplier [-] applied to potential precipitation rates + + + + + + Multiplier [-] applied to potential evapo(transpi)ration rates + + + + + + Time constant for water in interception store [days] + + + + + + Average extinction coefficient for the diffuse radiation flux + varies with crop from 0.4 to 1.1 (Goudriaan (1977)) + + + + + + maximum depression storage for water on impervious surface + which is not immediatly causing surface runoff [mm] + + + + + + + + + + ************************************************************** + SNOW AND FROST RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - estimate SnowFactor from prior data (if available), otherwise use 1 + - use SnowMeltCoef as a calibration constant + - leave all other parameters at default + + + + + + Multiplier [-] applied to precipitation that falls as snow + + + + + + range [mm C-1 day-1] of the seasonal variation + SnowMeltCoef is the average value + + + + + + Average temperature [deg C] at which snow melts + + + + + + Average temperature [deg C] below which precipitation is snow + + + + + + Temperature lapse rate with altitude [C / m] + + + + + + Daily decay coefficient [day-1], (Handbook of Hydrology, p. 7.28) + + + + + + Snow depth reduction coefficient, [cm-1], (HH, p. 7.28) + + + + + + Snow water equivalent, (based on snow density of 450 kg/m3) (e.g. Tarboton and Luce, 1996) + + + + + + Degree Days Frost Threshold (stops infiltration, percolation and capillary rise) + Molnau and Bissel found a value 56-85 for NW USA. + + + + + + + + + + ************************************************************** + IRRIGATION AND WATER ABSTRACTION RELATED PARAMETERS + ************************************************************** + + + + + + default: 0.75 + Field application irrigation efficiency [-]: max 1, ~0.90 drip irrigation, ~0.75 sprinkling + + + + + + conveyance efficiency [-]: around 0.80 for average channel + + + + + + IrrigationType (value between 0 and 1) is used here to distinguish between additional adding water until fieldcapacity (value set to 1) or not (value set to 0) + + + + + + Factor [-] to irrigation water demand + More than the transpiration is added e.g to prevent salinisation + + + + + + Annual amount (m3) of treated wastewater reused for irrigation + + + + + + Number of days over which the annual amount of treated wastewater for irrigation is used + + + + + + Consumptive Use (1-Recycling ratio) for livestock water use (0-1) [-] + + + + + + Consumptive Use (1-Recycling ratio) for industrial water use (0-1) [-] + + + + + + # Consumptive Use (1-Recycling ratio) for energy water use (0-1) [-] + # Source: Torcellini et al. (2003) "Consumptive Use for US Power Production" + # map advised by Neil Edwards, Energy Industry + # the UK and small French rivers the consumptive use varies between 1:2 and 1:3, so 0.33-0.50 + # For plants along big rivers like Rhine and Danube the 0.025 is ok + EnergyConsumptiveUseFraction=0.025 + + + + + + Consumptive Use (1-Recycling ratio) for domestic water use (0-1) [-] + Source: EEA (2005) State of Environment + + + + + + Default : 0.2 + $(PathRoot)/leakage.map + Fraction of leakage of public water supply (0=no leakage, 1=100% leakage) + + + + + + The water that is lost from leakage (lost) (0-1) [-] + + + + + + Leakage reduction fraction (e.g. 50% = 0.5 as compared to current Leakage) (baseline=0, maximum=1) [-] + + + + + + Water savings fraction (e.g. 10% = 0.1 as compared to current Use (baseline=0, maximum=1) [-] + scenwsav.map + + + + + + Fraction of water re-used in industry (e.g. 50% = 0.5 = half of the water is re-used, used twice (baseline=0, maximum=1) [-] + scenruse.map + + + + + + Irrigation crop coefficient [-] + + + + + + Irrigation crop group number [-] + + + + + + Population [units] + + + + + + Population + + + + + + Land Use Mask + + + + + + Reported water use [cu m/s], depending on the availability of discharge + + + + + + Time series of upstream water use at gauging stations + + + + + + Number of sub-steps needed for water use + routine + + + + + + maximum number of loops for calculating the use of water + = distance water is taken for water consuption + + + + + + percentage of water which remains in the channel + e.g. 0.2 -> 20 percent of discharge is not taken out + + + + + + ? + + + + + + + + + ************************************************************** + GROUNDWATER RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - leave GwLossFraction at 0 unless prior information show groundwater loss + is important + - use UpperZoneTimeConstant, LowerZoneTimeConstant, + GwPercValue as calibration constants + - calibrate on GwLossFraction if necessary + + + + + length of the window used to smooth the LZ zone [number of cell length] + + + + + + map of aquifers (0/1), used to smoothen LZ near extraction areas + + + + + + + + + + ************************************************************** + EVAPORATION FROM OPEN WATER + ************************************************************** + + + + + + Fraction of maximum extend of water + + + + + + Mask with Lakes from GLWD database + + + + + + + + + + + + ************************************************************** + TRANSMISSION LOSS PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use TransSub as calibration constant leave all other parameters at default values + + + + + Transmission loss function parameter + + + + + + PBchange + Transmission loss function parameter + + + + + + PBchange + downstream area taking into account for transmission loss + + + + + + upstream area + + + + + + + + + + ************************************************************** + ROUTING PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use CalChanMan as calibration constant to fine-tune timing of + channel routing, leave all other parameters at default values + + + + + + kinematic wave parameter beta [-]: 0.6 is for broad sheet flow + + + + + + Reference depth of overland flow [mm], used to compute + overland flow Alpha for kin. wave + + + + + + Percentage [-] used to compute the TotalCrossSectionAreaHalfBankFull in the initialisation of the + total cross-sectional area + default: 0.5 + + + + + + Minimum slope gradient [-] (for kin. wave: slope cannot be 0) + + + + + + Minimum channel gradient [-] (for kin. wave: slope cannot be 0) + + + + + + + + ************************************************************** + PARAMETERS RELATED TO NUMERICS + ************************************************************** + + Important: do not change, default value of 0.4 generally combines + sufficient numerical accuracy within a limited number of sub-steps + + + + + + Minimum value for Courant condition in soil moisture routine. Always less than or equal to 1. + Small values result in improved numerical accuracy, at the expense of increased + computing time (more sub-steps needed). If reported time series of soil moisture contain + large jumps, lowering CourantCrit should fix this + + + + + + + + ************************************************************** + VARIABLES RELATED TO OPTIONS + These all need to have some (real or bogus) value, + even for options that are not actually used! + ************************************************************** + + + + ************************************************************** + RESERVOIR OPTION + ************************************************************** + + + + + Sub time step used for reservoir simulation [s]. Within the model, + the smallest out of DtSecReservoirs and DtSec is used. + + + + + + Initial reservoir fill fraction [-] + Cold start: -9999 sets initial fill to normal storage limit + if you're not using the reservoir option, enter some bogus value + + + + + + + + ************************************************************** + LAKE OPTION + ************************************************************** + + + + + Cold start: -9999 + Estimate of average net inflow into lake (=inflow - evaporation) [cu m / s] + Used to calculated steady-state lake level in case LakeInitialLevelValue + is set to -9999 + + + + + + + + + + ************************************************************** + POLDER OPTION + ************************************************************** + + + + + Weir constant [-] (Do not change!) + + + + + + Initial water level in polder [m] + + + + + + + + + + ************************************************************** + DYNAMIC WAVE OPTION + ************************************************************** + + + + + Critical Courant number for dynamic wave + value between 0-1 (smaller values result in greater numerical accuracy, + but also increase computational time) + + + + + + Constant head [m] at most downstream pixel (relative to altitude + at most downstream pixel) + + + + + + + + + ************************************************************** + MUSKINGUM-CUNGE-TODINI OPTION + ************************************************************** + + + + + test_chanmct_all + test_chanmct_2 + chanmct_single + Boolean map with value 1 at channel pixels where MCT is + used, and 0 at all other pixels + + + + + + Maximum channel gradient for channels using MCT routing [-] (for MCT wave: slope cannot be 0) + Default: 0.001 + + + + + + + + + + ************************************************************** + INFLOW HYDROGRAPH (OPTIONAL) + ************************************************************** + + + + + OPTIONAL: nominal map with locations of (measured) + inflow hydrographs [cu m / s] + + + + + + location of calibration points + OPTIONAL: nominal map with locations of calibration points + + + + + + OPTIONAL: observed or simulated input hydrographs as + time series [cu m / s] + Note that identifiers in time series correspond to + InflowPoints map (also optional) + + + + + + + + ************************************************************** + PF REPORTING OPTION + ************************************************************** + + + + + Maximum capillary head [cm]. This value is used if Theta equals residual soil + moisture content (value of HeadMax is arbitrary). Only needed for pF computation, + otherwise doesn't influence model results at all) + + + + + PF MAPS + + + + + Reported pF soil layer 1a, other fraction + + + + + + Reported pF soil layer 1b, other fraction + + + + + + Reported pF soil layer 2, other fraction + + + + + + Reported pF soil layer 1a, forest fraction + + + + + + Reported pF soil layer 1b, forest fraction + + + + + + Reported pF layer 2, forest fraction + + + + + + Reported pF soil layer 1a, irrigation fraction + + + + + + Reported pF soil layer 1b, irrigation fraction + + + + + + Reported pF soil layer 2, irrigation fraction + + + + + + + + + + + + + + + + + This is necessary when using projected coordinates (x,y) + + + + + + + + + + + Clone map + + + + + + netcdf template used to copy metadata information for writing netcdf + + + + + + latitude map to be used for snow/ice modelling + + + + + + + + ************************************************************** + TIMESTEP RELATED PARAMETERS + ************************************************************** + + + + + Calendar convention + + + + + + Calendar day is back! + Calendar day number of 1st day in model run + e.g. 1st of January: 1; 1st of June 151 (or 152 in leap year) + Needed to read out LAI tables correctly + + + + + + timestep [seconds] (60*60*24) + + + + + + Sub time step used for kinematic wave channel routing [seconds] + Within the model,the smallest out of DtSecChannel and DtSec is used + + + + + + Number of first time step in simulation + + + + + + Number of last time step in simulation + + + + + + Number of days used for internal spin-up (fluxes computations during prerun) + + + + + + + + ************************************************************** + PARAMETERS RELATED TO EVAPO(TRANSPI)RATION AND Interception + ************************************************************** + + Suggested parameterisation strategy: + + - leave all these parameters at their default values. + in some very special cases CalEvaporation may be set to some + value other than one + + + + + + Multiplier applied to potential precipitation rates [-] + + + + + + Multiplier applied to potential evapo(transpi)ration rates [-] + + + + + + Time constant for water in interception store [days] + + + + + + Average extinction coefficient [-] for the diffuse radiation flux + varies with crop from 0.4 to 1.1 (Goudriaan (1977)) + + + + + + Critical amount of available water (expressed in [mm/day]!), above which 'Days Since Last Rain' parameter is + set to 1 + + + + + + maximum depression storage for water on impervious surface + which is not immediatly causing surface runoff [mm] + + + + + + + + + + ************************************************************** + SNOW AND FROST RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - estimate SnowFactor from prior data (if available), otherwise use 1 + - use SnowMeltCoef as a calibration constant + - leave all other parameters at default + + + + + + Multiplier applied to precipitation that falls as snow + + + + + + Snowmelt coefficient [mm C-1 day-1)] + See also Martinec et al., 1998. + + + + + + range [mm C-1 day-1] of the seasonal variation + SnowMeltCoef is the average value + + + + + + Average temperature [deg C] at which snow melts + + + + + + Average temperature [deg C] below which precipitation is snow + + + + + + Temperature lapse rate with altitude [deg C / m] + + + + + + Daily decay coefficient [day-1], (Handbook of Hydrology, p. 7.28) + + + + + + Snow depth reduction coefficient, [cm-1], (HH, p. 7.28) + + + + + + Snow water equivalent, (based on snow density of 450 kg/m3) (e.g. Tarboton and Luce, 1996) + + + + + + Degree Days Frost Threshold (stops infiltration, percolation and capillary rise) + Molnau and Bissel found a value 56-85 for NW USA. + + + + + + + + + + ************************************************************** + INFILTRATION PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - use b_Xinanjiang and PowerPrefFlow as calibration constants + + + + + + Power in Xinanjiang distribution function [-] + + + + + + Power that controls increase of proportion of preferential + flow with increased soil moisture storage [-] + + + + + + + + + + ************************************************************** + GROUNDWATER RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - leave GwLossFraction at 0 unless prior information show groundwater loss + is important + - use all other parameters as calibration constants + + + + + + Time constant for water in upper zone [days] + + + + + + Time constant for water in lower zone [days] + This is the average time a water 'particle' remains in the reservoir + if we had a stationary system (average inflow=average outflow) + + + + + + Maximum rate of percolation going from the Upper to the Lower + response box [mm/day] + + + + + + Maximum percolation rate from the lower groundwater zone [mm/days]. GWLoss + it’s lost beyond the catchment boundaries or to deep groundwater systems. + A value of 0 (closed lower boundary) is recommended as a starting value. + + + + + + + + + + + ************************************************************** + EVAPORATION FROM OPEN WATER + ************************************************************** + + + + + + water use daily maps with a (in this case negative) volume of water [cu m/s] + + + + + + table with days for each water use maps + 1st column: range of days; 2nd column: suffix of wuse map + + + + + + Percentage of maximum extend of water + + + + + + Mask with Lakes from GLWD database + + + + + + maximum number of loops for calculating evaporation + = distance water is taken to satisfy the need of evaporation from open water + + + + + + Reported evaporation from open water [mm] + + + + + + Time series of upstream water evaporation from open water at gauging stations + + + + + + + + ************************************************************** + TRANSMISSION LOSS PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use TransSub as calibration constant leave all other parameters at default values + + + + + + PBchange + Transmission loss function parameter + + + + + + PBchange + Transmission loss function parameter + + + + + + PBchange + downstream area taking into account for transmission loss + + + + + + upstream area + + + + + + + + ************************************************************** + ROUTING PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use CalChanMan as calibration constant to fine-tune timing of + channel routing, leave all other parameters at default values + + + + + + Multiplier applied to Channel Manning's n + + + + + + Multiplier applied to Channel Manning's n for second routing line + + + + + + Multiplier applied to Channel Manning's n for MCT routing + + + + + + Multiplier applied to average Q to split into a second line of routing + + + + + + Multiplier applied to ChanBottomWidth + + + + + + Multiplier applied to ChanDepthThreshold + + + + + + Multiplier applied to ChanSdXdY + + + + + + kinematic wave parameter: 0.6 is for broad sheet flow + + + + + + Reference depth of overland flow [mm], used to compute + overland flow Alpha for kin. wave + + + + + + Percentage [-] used to compute the TotalCrossSectionAreaHalfBankFull in the initialisation of the + total cross-sectional area + default: 0.5 + + + + + + Minimum slope gradient (for kin. wave: slope cannot be 0) + + + + + + Minimum channel gradient (for kin. wave: slope cannot be 0) + + + + + + + + ************************************************************** + PARAMETERS RELATED TO NUMERICS + ************************************************************** + + Important: do not change, default value of 0.4 generally combines + sufficient numerical accuracy within a limited number of sub-steps + + + + + + Minimum value for Courant condition in soil moisture routine. Always less than or equal to 1. + Small values result in improved numerical accuracy, at the expense of increased + computing time (more sub-steps needed). If reported time series of soil moisture contain + large jumps, lowering CourantCrit should fix this + + + + + + + + ************************************************************** + INITIAL CONDITIONS FOR THE WATER BALANCE MODEL + (can be either maps or single values) + ************************************************************** + + + + + PRERUNDIR/lzavin + Reported map of average percolation rate from upper to + lower groundwater zone (reported for end of simulation) [mm/day] + + + + + + PRERUNDIR/avgdis + CHANNEL split routing in two lines + Average discharge map [m3/s] + + + + + + Reported infiltration from the soil layer 2 to soil layer 3, other land cover fraction, average flux over the simulation period [mm] + + + + + + Reported infiltration from the soil layer 2 to soil layer 3, forest land cover fraction, average flux over the simulation period [mm] + + + + + + Reported infiltration from the soil layer 2 to soil layer 3, irrigated land cover fraction, average flux over the simulation period [mm] + + + + + + if init condition are stored as netCDF with different time steps + this variable indicates which time step to use + Either as date e.g. 1/1/2010 or as number e.g. 5 + + + + + + Initial overland flow storage [m3], direct runoff fraction + + + + + + Initial overland flow storage [m3], other fraction + + + + + + Initial overland flow storage [m3], forest fraction + + + + + + initial snow depth in snow zone A [mm] + + + + + + initial snow depth in snow zone B [mm] + + + + + + initial snow depth in snow zone C [mm] + + + + + + initial Frost Index value [degC/day] + + + + + + cumulative interception [mm] + + + + + + water in groundwater upper store [mm] + + + + + + days since last rainfall + + + + + + + + ************************************************************** + The following variables can also be initialized in the model + internally. if you want this to happen set them to bogus value + of -9999 + ************************************************************** + + + + + water in groundwater lower store [mm] + -9999: use steady-state storage + + + + + + initial cross-sectional area of flow in channel[m2] + -9999: use half bankfull + + + + + + initial soil moisture content [mm3/mm3] layer 1a (superficial layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 1b (upper layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 2 (lower layer) + -9999: use field capacity values + + + + + + initial channel cross-section area [m2] for 2nd routing channel + -9999: use 0 + + + + + + initial lateral inflow for 1st line of routing [m2/s] + -9999: use 0 + + + + + + Outflow discharge at the end of previous step (instantaneous) [m3/s] + -9999: use 0 + + + + + + Outflow average discharge on previous routing sub-step (average) [m3/s] + Cold start: -9999 sets initial value to 0 + + + + + + Courant number at previous step for MCT routing + Cold start: -9999 sets initial value to 1 + + + + + + Reynolds number at previous step for MCT routing + Cold start: -9999 sets initial value to 0 + + + + + + + + ************************************************************** + INITIAL CONDITIONS FOREST + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + + + + + + water in groundwater upper store [mm] + + + + + + days since last rainfall for forest fraction + + + + + + initial soil moisture content [mm3/mm3] layer 1a (superficial layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 1b (upper layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 2 (lower layer) + -9999: use field capacity values + + + + + + cumulative depression storage [mm] + + + + + + + + + ************************************************************** + INITIAL CONDITIONS IRRIGATION + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + + + + + + water in groundwater upper store [mm] + + + + + + days since last rainfall for irrigation + + + + + + initial soil moisture content [mm3/mm3] layer 1a (superficial layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 1b (upper layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 2 (lower layer) + -9999: use field capacity values + + + + + + + ************************************************************** + CUMULATIVE FLUXES REQUIRED WHEN COMPUTING THE PRE-RUN IN CHUNKS + ************************************************************** + + + + Cumulative inflow to the lower groundwater zone + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + LZInflowCumEnd: required for the warm start of the pre-run + + + + + + Cumulative flow from second to third soil layer, other land cover fraction + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + cumSeepTopToSubBOtherEnd: required for the warm start of the pre-run + + + + + + Cumulative flow from second to third soil layer, forest land cover fraction + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + cumSeepTopToSubBForestEnd: required for the warm start of the pre-run + + + + + + Cumulative flow from second to third soil layer, irrigation land cover fraction + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + cumSeepTopToSubBIrrigationEnd: required for the warm start of the pre-run + + + + + + Cumulative discharge + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + CumQEnd: required for the warm start of the pre-run + + + + + + Cumulative number of days from the start of the prerun + 0: this is appropriate for the cold start of the pre-run, the cold start of the run, the warm start of the run + NetTimeSinceStartPrerunChunkEnd: required for the warm start of the pre-run + + + + + + + + ************************************************************** + INPUT METEOROLOGICAL AND VEGETATION TIMESERIES AS MAPS + ************************************************************** + + + + + precipitation [mm/day] + + + + + + average daily temperature [C] + + + + + + daily reference evaporation (free water) [mm/day] + + + + + + daily reference evaporation (soil) [mm/day] + + + + + + daily reference evapotranspiration (crop) [mm/day] + + + + + + leaf area index [m2/m2] + + + + + + leaf area index [m2/m2] + + + + + + leaf area index [m2/m2] + + + + + + + + ************************************************************** + INPUT WATER USE MAPS AND PARAMETERS + ************************************************************** + + + + + Domestic water abstraction daily maps [mm] + + + + + + Livestock water abstraction daily maps [mm] + + + + + + Energy water abstraction daily maps [mm] + + + + + + Industry water abstraction daily maps [mm] + + + + + + Consumptive Use (1-Recycling ratio) for livestock water use (0-1) + + + + + + Consumptive Use (1-Recycling ratio) for industrial water use (0-1) + + + + + + # Consumptive Use (1-Recycling ratio) for energy water use (0-1) + # Source: Torcellini et al. (2003) "Consumptive Use for US Power Production" + # map advised by Neil Edwards, Energy Industry + # the UK and small French rivers the consumptive use varies between 1:2 and 1:3, so 0.33-0.50 + # For plants along big rivers like Rhine and Danube the 0.025 is ok + EnergyConsumptiveUseFraction=0.025 + + + + + + Consumptive Use (1-Recycling ratio) for domestic water use (0-1) + Source: EEA (2005) State of Environment + + + + + + Fraction of leakage of public water supply (0=no leakage, 1=100% leakage) + + + + + + The water that is lost from leakage (lost) (0-1) + + + + + + Leakage reduction fraction (e.g. 50% = 0.5 as compared to current Leakage) (baseline=0, maximum=1) + + + + + + Water savings fraction (e.g. 10% = 0.1 as compared to current Use (baseline=0, maximum=1) + scenwsav.map + + + + + + Fraction of water re-used in industry (e.g. 50% = 0.5 = half of the water is re-used, used twice (baseline=0, maximum=1 + scenruse.map + + + + + + + Field application irrigation efficiency max 1, ~0.90 drip irrigation, ~0.75 sprinkling + + + + + + conveyance efficiency, around 0.80 for average channel + + + + + + IrrigationType (value between 0 and 1) is used here to distinguish between additional adding water until fieldcapacity (value set to 1) or not (value set to 0) + + + + + + Factor to irrigation water demand + More than the transpiration is added e.g to prevent salinisation + + + + + + Annual amount (m3) of treated wastewater reused for irrigation + + + + + + Number of days over which the annual amount of treated wastewater for irrigation is used + + + + + + Irrigation crop coefficient + + + + + + Irrigation crop group number + + + + + + Population + + + + + + Population + + + + + + Land Use Mask + + + + + + Reported water use [cu m/s], depending on the availability of discharge + + + + + + Time series of upstream water use at gauging stations + + + + + + Number of sub-steps needed for water use + routine + + + + + + maximum number of loops for calculating the use of water + = distance water is taken for water consuption + + + + + + percentage of water which remains in the channel + e.g. 0.2 -> 20 percent of discharge is not taken out + + + + + + + + + + + + + ************************************************************** + RICE IRRIGATION + ************************************************************** + + + + + + water amount in mm per day + 10 mm for 10 days (total 10cm water) + + + + + + FAO: percolation for heavy clay soils: PERC = 2 mm/day + + + + + + map with starting day of the year + + + + + + map with starting day of the year + + + + + + map with starting day of the year + + + + + + map with starting day of the year + + + + + + + + ************************************************************** + REPORTED OUTPUT MAPS + ************************************************************** + + + + + Reported discharge [cu m/s] (average over the model timesteps) (AvgDis) + + + + + + Reported Topsoil moisture [%] + + + + + + Reported Topsoil moisture [%] + + + + + + Reported discharge [cu m/s] at the end of a timestep + + + + + + Reported discharge [cu m/s] but cut by a discharge mask map + + + + + + Reported water level [m] % False by default + + + + + + + + STATE VARIABLES AT SELECTED TIME STEPS + ONLY FOR INITIALISATION OF SUCCEEDING RUNS + REPORTING TIME STEPS SET THROUGH "ReportSteps" OPTION + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported days since last rain + + + + + + Reported water depth + + + + + + Reported overland flow water volume [m3] for direct fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for other fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for forest fraction on catchment surface + + + + + + Reported chan cross-section area [m2] + + + + + + Reported snow cover in snow zone A [mm] + + + + + + Reported snow cover in snow zone B [mm] + + + + + + Reported snow cover in snow zone C [mm] + + + + + + Reported frost index [degC/day] + + + + + + Reported interception storage [mm] + + + + + + + Reported cross section area 2nd line of routing [m2] + + + + + + Reported channel side flow [m2/s] + + + + + + Reported istantaneous discharge at end of computation step [cu m/s] ChanQ + + + + + + Reported average discharge over last routing sub-step used to initialise lakes [cu m/s] ChanQAvgDt + + + + + + Courant number at previous step for MCT routing + + + + + + Reynolds number at previous step for MCT routing + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + cumulative interception [mm] + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lowerupper layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported transpiration maps, other fraction [mm] + + + + + + Reported transpiration maps, forest fraction [mm] + + + + + + Reported transpiration maps, irrigated fraction [mm] + + + + + + Reported transpiration maps, weighted sum over the fractions of each pixel [mm] + + + + + + + + "END" MAPS, AKA REPORTED OUTPUT MAPS CALLED "END" + Same as above, but always at last time step + Support for these "end" maps will most likely be + discontinued some time soon + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported days since last rain + + + + + + Reported water depth [m] + + + + + + Reported overland flow water volume [m3] for direct fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for other fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for forest fraction on catchment surface + + + + + + Reported chan cross-section area [m2] + + + + + + Reported snow cover in snow zone A [mm] + + + + + + Reported snow cover in snow zone B [mm] + + + + + + Reported snow cover in snow zone C [mm] + + + + + + Reported frost index [degC/day] + + + + + + Reported interception storage [mm] + + + + + + Reported lake level [m] + + + + + + Reported lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Reported lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value + + + + + + Reported lake storage [m3] + + + + + + + Reported reservoir filling [-] + + + + + + Reported cross section area 2nd line of rounting [m2] + + + + + + Reported channel side flow [m2/s] + + + + + + Reported istantaneous discharge at end of computation step [cu m/s] ChanQ + + + + + + Reported average discharge over last routing sub-step used to initialise lakes [cu m/s] ChanQAvgDt + + + + + + Reported average discharge [cu m/s] (average over the model timesteps) (AvgDis) + + + + + + Courant number at previous step for MCT routing + + + + + + Reynolds number at previous step for MCT routing + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + cumulative interception [mm] + + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1c (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + + + INDIVIDUAL DRIVING METEOROLOGICAL VARIABLES (AT EVERY TIME STEP) + ONLY IF REPORTING OF EACH RESPECTIVE VARIABLE IS + SWITCHED ON (DEFAULT: ALL SWITCHED OFF) + Note reporting is done as a quantity per time step, not as + an intensity (as in meteo input!) + + + + + Precipitation [mm per time step] + + + + + + Average DAILY temperature [degrees C] + + + + + + Potential reference evapotranspiration [mm per time step] + + + + + + Potential evaporation from bare soil surface [mm per time step] + + + + + + Potential evaporation from open water surface [mm per time step] + + + + + + + + INDIVIDUAL STATE VARIABLES (AT EVERY TIME STEP) + ONLY IF REPORTING OF EACH RESPECTIVE VARIABLE IS + SWITCHED ON (DEFAULT: ALL SWITCHED OFF) + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported total water storage [mm] + + + + + + Reported days since last rain + + + + + + Reported water depth [m] + + + + + + Reported overland flow water volume [m3] for direct runoff fraction on catchment surfac + + + + + + Reported overland flow water volume [m3] for other fraction on catchment surfac + + + + + + Reported overland flow water volume [m3] for forest fraction on catchment surfac + + + + + + Reported channel cross-section area [m2] + + + + + + Reported snow cover [mm] + + + + + + Reported frost index [degC/day] + + + + + + Reported interception storage, other fraction [mm] + + + + + + + Reported days since last rain + + + + + + Reported interception storage, forest fraction [mm] + + + + + + Reported interception storage, irrigation fraction [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported interception (depression) storage, direct runoff (impervious) fraction [mm] + + + + + + + + INDIVIDUAL RATE VARIABLES (AT EVERY TIME STEP) + ONLY IF REPORTING OF EACH RESPECTIVE VARIABLE IS + SWITCHED ON (DEFAULT: ALL SWITCHED OFF) + + + + + Reported rain (excluding snow)[mm] + + + + + + Reported snow (excluding rain)[mm] + + + + + + Reported snowmelt [mm] + + + + + + Reported interception [mm] + + + + + + Reported transpiration [mm] + + + + + + Reported soil evaporation [mm] + + + + + + Reported evaporation of intercepted water [mm] + + + + + + Reported actual evapotranspiration [mm] + + + + + + Reported leaf drainage [mm] + + + + + + Reported infiltration [mm] + + + + + + Reported preferential flow [mm] + + + + + + Reported percolation from soil layer 1a to soil layer 1b, other fraction [mm] + + + + + + Reported percolation from soil layer 1a to soil layer 1b, forest fraction [mm] + + + + + + Reported percolation from soil layer 1a to soil layer 1b, irrigation fraction [mm] + + + + + + Reported percolation from soil layer 1b to soil layer 2, other fraction [mm] + + + + + + Reported percolation from soil layer 1b to soil layer 2, forest fraction [mm] + + + + + + Reported percolation from soil layer 1b to soil layer 2, irrigation fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), other fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), forest fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), irrigation fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), weighted sum over the fraction of each pixel [mm] + + + + + + Reported available groundwater LZ+ GWLoss [mm] + + + + + + Reported surface runoff [mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported lower zone outflow [mm] + + + + + + Reported fast runoff = surface + UZ [mm] + + + + + + Reported GWloss [mm] + + + + + + Reported total runoff [mm] + + + + + + Reported total runoff that enters the channel: groundwater + surface runoff [mm] + + + + + + Reported Direct Runoff [mm] + + + + + + Reported FlowVelocityMSecMaps [m/s] + + + + + + Reported TravelDistance [m] + + + + + + Reported percolation from upper to lower groundwater zone [mm] + + + + + + + Reported evaporation of intercepted water [mm] + + + + + + Reported soil evaporation [mm] + + + + + + Reported leaf drainage Forest[mm] + + + + + + Reported interception forest [mm] + + + + + + Reported infiltration [mm] + + + + + + Reported transpiration forest [mm] + + + + + + Reported preferential flow [mm] + + + + + + Reported percolation from 1st to 2nd soil layer [mm] + + + + + + Reported seepage to groundwater[mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported percolation from upper to lower zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + + + MISCELLANEOUS OUTPUT MAPS AND TIME SERIES + + + + + Time series of average percolation rate from upper to + lower groundwater zone (reported at sites) [mm/day] + + + + + + Time series of average percolation rate from upper to + lower groundwater zone (average for upstream area of each gauge) [mm/day] + + + + + + Reported number of days in simulation with soil moisture stress [days] + + + + + + Reported number of days in simulation with soil moisture stress for forest fraction [days] + + + + + + Reported soil transpiration reduction factor [-] for other landuse + values below 1 indicate soil moisture stress + + + + + + Reported soil transpiration reduction factor [-] + values below 1 indicate soil moisture stress + + + + + + + + ************************************************************** + REPORTED OUTPUT TIME SERIES + ************************************************************** + + + + + Reported average discharge over the model time step [cu m/s] + + + + + + Reported instantaneous discharge at the end of routing sub-step [cu m/s] + + + + + + Reported average discharge on the last routing sub-step [cu m/s] + + + + + + Reported water level [m] + + + + + + + OUTPUT AT SITES: STATE VARIABLES + + + + + Water depth on soil surface [mm] + + + + + + Depth of snow cover on soil surface [mm] + + + + + + Water stored as interception [mm] + + + + + + Soil moisture layer 1a [cu mm / cu mm] + + + + + + Soil moisture layer 1b [cu mm / cu mm] + + + + + + Soil moisture layer 2 [cu mm / cu mm] + + + + + + Soil moisture layer 1a [cu mm / cu mm] + + + + + + Soil moisture layer 1b [cu mm / cu mm] + + + + + + Soil moisture layer 2 [cu mm / cu mm] + + + + + + Storage in upper groundwater zone [mm] + + + + + + Storage in lower groundwater zone [mm] + + + + + + Days since last rain [days] + + + + + + Frost index [degC/day] + + + + + + Days since last rain [days] + + + + + + + + OUTPUT AT SITES: RATE VARIABLES + + + + + Rain (excluding snow) [mm] + + + + + + Snow (excluding rain) [mm] + + + + + + Reported snowmelt [mm] + + + + + + Reported interception [mm] + + + + + + Reported transpiration [mm] + + + + + + Reported soil evaporation [mm] + + + + + + Reported evaporation from interception storage [mm] + + + + + + Reported leaf drainage [mm] + + + + + + Reported infiltration [mm] + + + + + + Reported preferential flow [mm] + + + + + + Reported percolation from 1st to 2nd soil layer [mm] + + + + + + Reported seepage to groundwater[mm] + + + + + + Reported surface runoff [mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported lower zone outflow [mm] + + + + + + Reported total runoff [mm] + + + + + + Reported percolation from upper to lower zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + + + + + + + + + + + AVERAGE VALUES OF METEOROLOGICAL FORCING VARIABLES + UPSTREAM OF GAUGES + (only if repMeteoUpsGauges option is activated) + + + + + Precipitation [mm/time step] + + + + + + Average temperature [deg C] + + + + + + Reference evapotranspiration [mm/time step] + + + + + + Potential soil evaporation [mm/time step] + + + + + + Potential open water evaporation [mm/time step] + + + + + + ESActPixel+self.var.TaPixel+self.var.TaInterceptionAll+self.var.EvaAddM3*self.var.M3toMM + + + + + + + + AVERAGE VALUES OF MODEL STATE VARIABLES + UPSTREAM OF GAUGES + (only if repStateUpsGauges option is activated) + + + + + Water depth on soil surface [mm] + + + + + + Depth of snow cover on soil surface [mm] + + + + + + Water stored as interception [mm] + + + + + + Soil moisture upper layer [mm3/mm3] + + + + + + Soil moisture lower layer [mm3/mm3] + + + + + + + + + + Soil moisture lower layer [mm3/mm3] + + + + + + Storage in upper groundwater zone [mm] + + + + + + Storage in lower groundwater zone [mm] + + + + + + Days since last rain [days] + + + + + + Frost index [degC/day] + + + + + + Days since last rain [days] + + + + + + + + AVERAGE VALUES OF MODEL RATE VARIABLES + UPSTREAM OF GAUGES + (only if repRateUpsGauges option is activated) + + + + + Rain (excluding snow) [mm] + + + + + + Snow (excluding rain) [mm] + + + + + + Snow melt [mm] + + + + + + Interception [mm] + + + + + + Actual transpiration [mm] + + + + + + Actual evaporation [mm] + + + + + + Evaporation from interception storage [mm] + + + + + + Leaf drainage [mm] + + + + + + Infiltration [mm] + + + + + + Preferential flow [mm] + + + + + + Percolation upper to lower soil layer [mm] + + + + + + Seepage from lower soil layer to groundwater [mm] + + + + + + Surface runoff [mm] + + + + + + Outflow from upper groundwater zone (to channel) [mm] + + + + + + Outflow from lower groundwater zone (to channel) [mm] + + + + + + Total runoff [mm] + + + + + + Reported percolation from upper to lower groundwater zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + + + NUMERICS + + + + + Reported mass balance error at outlet [cu m] + + + + + + Reported mass balance error at outlet (as mm water slice) + + + + + + Reported mass balance error due to the split routing module, for each catchment [m3] + + + + + + Reported discharge error at the outlet as a consequence of the mass balance error within the split routing module, for each catchment [m3/s] + + + + + + Reported ratio between the mass balance error and the water volume storage, for each catchment [m3/m3] + + + + + + Average value of the sum of the fractions within a catchment: this value must be 1.0 in order to avoid mass balace errors! [-] + + + + + + Number of cells with Theta lower than + residual soil moisture content + (should ALWAYS be zero, if not something is + seriously wrong!!!) + TEST ONLY!! REMOVE OR HIDE IN FINAL VERSION!! + + + + + + Number of cells with Theta lower than + residual soil moisture content + (should ALWAYS be zero, if not something is + seriously wrong!!!) + TEST ONLY!! REMOVE OR HIDE IN FINAL VERSION!! + + + + + + Number of sub-steps needed for soil moisture + routine + + + + + + + + ************************************************************** + BASE INPUT MAPS AND TABLES + ************************************************************** + + + + + ************************************************************** + TOPOGRAPHY MAPS + ************************************************************** + + + + + $(PathMaps)/ldd.map + local drain direction map (1-9) + + + + + + slope gradient [-] (0.50 -> tangent=0.5, angle=26.5 degrees) + + + + + + Elevation standard deviation [m], i.e. altitude difference elevation within pixel. + Used for sub-pixel modelling of snow accumulation + and melt + + + + + + outlets.map + Nominal map with gauge locations (i.e cells for which simulated discharge + is written to file(1,2,3 etc) + + + + + + map with monitoring sites (1,2,3 etc) + + + + + + optional map with pixel length [m], only needed in case map attributes + are not in [m] (e.g. lat / lon systems) + + + + + + optional map with pixel area [m2], only needed in case map attributes + are not in [m] (e.g. lat / lon systems) + + + + + + + + ************************************************************** + SOIL PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - use b_Xinanjiang and PowerPrefFlow as calibration constants + + + + + + Soil depth for 1st layer: 1a (superficial layer) + Minimum Soil Depth [mm] for superficial soil layer + For Europe it is 50 mm + For Africa it is 200 mm + + + + + + Soil depth for 2nd layer: 1b (upper layer) + Minimum Soil Depth [mm] for second soil layer + + + + + + Soil depth for 2nd layer: 2 (lower layer) + Minimum Soil Depth [mm] for second soil layer + + + + + + Soil depth for 1st layer: 1a + Minimum Soil Depth [mm] for upper soil layer + For Europe it is 50 mm + For Africa it is 200 mm + + + + + + Soil depth for 2nd layer: 1b + Minimum Soil Depth [mm] for lower soil layer + + + + + + Soil depth for 2nd layer: 2 + Minimum Soil Depth [mm] for lower soil layer 300 + + + + + + + + + ************************************************************** + LAND USE RELATED MAPS AND TABLES + ************************************************************** + + + + + $(PathMapsLanduse)/fracsealed + urban area (0-1) + + + + + + stack of Direct Runoff fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracforest + forest fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of forest fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracwater + forest fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of water fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracother + forest fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of other fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracirrigated + irrigated area fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of Irrigation fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracDrained.map + drained fraction from irrigated area (0-1) + + + + + + rice fraction of a pixel (0-1) + + + + + + stack of rice fraction maps (0-1) + + + + + + groundwater used fraction of a pixel (0-1) + + + + + + NonConventionalWaterUsed (0-1) + + + + + + lake and reservoir water used, fraction of a pixel (0-1) + + + + + + $(PathMaps)/eflow.map + EFlowThreshold is map with m3/s discharge, e.g. the 10th percentile discharge of the baseline run + + + + + + table with crop coefficient for each land use; values ranging from 0.75 to 1.25; + source: Supit, p.83 CFET + + + + + + table with crop group number; table 6.1 and 6.2 in WOFOST 6.0, Supit, 1994: p. 86 + + + + + + $(PathMapsTables)/manngs_2000_250m.map + table with Manning's roughness [m^(1/3) s^(-1)] for each CORINE landcover class + + + + + + table with crop coefficient for each land use; values ranging from 0.75 to 1.25; + source: Supit, p.83 CFET + + + + + + table with crop group number; table 6.1 and 6.2 in WOFOST 6.0, Supit, 1994: p. 86 + + + + + + $(PathMapsTables)/manngs_2000_250m.map + table with Manning's roughness [m^(1/3) s^(-1)] for each CORINE landcover class + + + + + + + + + + ************************************************************** + Variable Channel NoSubStepChannel + ************************************************************** + + + + + UpArea do be included in max. celerity + + + + + + variable Number of sub steps for the kinematic wave routing + + + + + ************************************************************** + CHANNEL MAPS + ************************************************************** + + + + + Boolean map with value 1 at channel pixels and 0 at + all other pixels + IMPORTANT: IF NON-CHANNEL PIXELS HAVE MISSING VALUES + THEN THIS MAY RESULT IN INCORRECT RESULTS + + + + + + Channel gradient (fraction, dy/dx) + + + + + + Channel Manning's n [m^(1/3) s^(-1)] + + + + + + Channel length [m] + + + + + + Channel bottom width [m] + + + + + + Channel side slope, expressed as gradient + !! expressed as dx/dy !!! (NOT dy/dx, which would perhaps be more logical) + + + + + + Floodplain Width [m] + + + + + + Bankfull channel depth [m] + + + + + + + + ************************************************************** + TABLES WITH TOPSOIL SOIL PHYSICAL PARAMETERS (HYPRES) + Each parameter is defined for upper (1a and 1b) and + lower (2) soil layers + ************************************************************** + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 1b (upper soil layer) + + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 2 (lower soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1b (upper soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 2 (lower soil layer) + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1a (superficial soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1b (upper soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 2 (lower soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1a (superficial soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1b (upper soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 2 (lower soil layer) + + + + + + + + ************************************************************** + TABLES WITH TOPSOIL SOIL PHYSICAL PARAMETERS (HYPRES) for Forest + Each parameter is defined for 1a and 1b + Normal parameter is taken for the lower soil layer + ************************************************************** + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1b (upper soil layer) + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) for soil layer 1a (superficial soil layer) + Lambda is acually 1-n [-] for soil layer 1b (upper soil layer) + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] for soil layer 1b (upper soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1a (superficial soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1b (upper soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1a (superficial soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1b (upper soil layer) + + + + + + + + + + + + ************************************************************** + RESERVOIRS (if used ) + Input maps + ************************************************************** + + + + + Sub time step used for reservoir simulation [s]. Within the model, + the smallest out of DtSecReservoirs and DtSec is used. + + + + + + Map with location of reservoirs (number) + + + + + + Initial reservoir storage (fraction) + + + + + + Input tables + + + + + Total reservoir storage capacity + Units: m³ + + + + + + Reservoir inflow associated with the 100-year return period. + It is modified by a calibration parameter (`ReservoirFloodOutflowFactor`) to + define the inflow above which the reservoir switches to flood control mode + Units: m³/s + + + + + + NReservoir average inflow used to define the normal reservoir release + Units: m³/s + + + + + + Minimum reservoir release: + Units: m³/s + + + + + Output time series + + + + + name of output TSS file with Reservoir Inflow + + + + + + name of output TSS file with Reservoir Outflow + + + + + + name of output TSS file with Reservoir Filling + + + + + + name of output TSS file with Reservoir storage [m3] + + + + + + + name of output map(s) with Reservoir Filling + + + + + + Fraction of the total reservoir storage above which the reservoirs enters + the flood control zone. + + + + + + Factor of the 100-year return inflow that defines a flood event, i.e., the + reservoir routine switches to flood control mode. + + + + + + + + ************************************************************** + LAKES (if used ) + Input maps + ************************************************************** + + + + + Map with location of lakes + + + + + + Initial lake level [m] + -9999 sets initial value to steady-state level + + + + + + Lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value + + + + + + Estimate of average net inflow into lake (=inflow - evaporation) [m3 / s] + Used to calculated steady-state lake level in case LakeInitialLevelValue + is set to -9999 + + + + + Input tables + + + + + Lake surface area [m2] + + + + + + Lake parameter A [m/s] + + + + + + Multiplier applied to the lake parameter A + + + + + Output time series + + + + + Output timeseries file with lake inflow [m3 /s] + + + + + + Output timeseries file with lake outflow [m3 /s] + + + + + + Output timeseries file with lake level [m] + + + + + + Output map(s) with lake level [m] + + + + + + Output map with lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Output map with lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value + + + + + + + + ************************************************************** + POLDERS(if used) + ************************************************************** + + + + + + Weir constant (fixed) [-] + + + + + + Map with polder locations + + + + + + Initial water level in polders [m] + + + + + + Polder maximum storage capacity [cu m] + + + + + + Area of polder [sq m] + + + + + + Width of polder outlet/inlet [m] + + + + + + Polder bottom level, measured from channel bottom [m] + + + + + + Time step at which polder opens in case of regulated polder (use bogus value of -9999 in table in case of unregulated polder) + + + + + + Time step at which water stored in polder is released again(use bogus value of -9999 in table in case of unregulated polder) + + + + + + name of output TSS file with polder flux [cu m / s]. Positive for flow from channel to polder, negative for polder to channel + + + + + + name of output TSS file with polder level [m] + + + + + + name of output map(s) with polder level + + + + + + + + + ************************************************************** + INFLOW HYDROGRAPH (if used) + ************************************************************** + + + + + OPTIONAL: nominal map with locations of (measured) + inflow hydrographs + + + + + + location of calibration points + OPTIONAL: nominal map with locations of calibration points + + + + + + Observed or simulated input hydrographs as + time series [m3 / s] + Note that identifiers in time series correspond to + InflowPoints map (also optional) + + + + + + + + + ************************************************************** + DYNAMIC WAVE(if used) + ************************************************************** + + + + + Critical Courant number for dynamic wave + value between 0-1 (smaller values result in greater numerical accuracy, + but also increase computational time) + + + + + + Constant head [m] at most downstream pixel (relative to altitude + at most downstream pixel) + + + + + + Boolean map with value 1 at channel pixels where dynamic wave is + used, and 0 at all other pixels + + + + + + Channel bottom level [m] + + + + + + Nominal map with channel cross section IDs + + + + + + Table with cross section parameters (H,A,P) + + + + + + + + ************************************************************** + MUSKINGUM-CUNGE-TODINI OPTION + ************************************************************** + + + + + Boolean map with value 1 at channel pixels where MCT is + used, and 0 at all other pixels + + + + + + Maximum channel gradient for channels using MCT routing [-] (for MCT wave: slope cannot be >0.001) + + + + + + + + + ************************************************************** + PF REPORTING (if used) + ************************************************************** + + + + PF PARAMETERS + + + + + Maximum capillary head [cm]. This value is used if Theta equals residual soil + moisture content (value of HeadMax is arbitrary). Only needed for pF computation, + otherwise doesn't influence model results at all) + + + + + PF MAPS + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + PF TIMESERIES, VALUES AT SITES + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + PF TIMESERIES, AVERAGE VALUES UPSTREAM OF GAUGES + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + + + + + + ************************************************************** + Ad'a addition + ************************************************************** + + + + + threshold value below which there is no outflow to the channel [mm] + + + + + + length of the window used to smooth the LZ zone [number of cells] + + + + + + map of aquifers (0/1), used to smoothen LZ near extraction areas + + + + + + + + ************************************************************** + Water demand output maps + ************************************************************** + + + + + day of the year when the yearly endcalculation is done e.g. 31/10/xxxx = 304 + + + + + + + TotalAbstractionFromGroundwater [mm] + + + + + + TotalAbstractionFromSurfaceWater [mm] + + + + + + TotalAbstractionFromSurfaceWater [mm] summed up for water regions + + + + + + Total Abstraction From SurfaceWater and Groundwater [mm] summed up for water regions, montly values + + + + + + TotalPaddyRiceIrrigationAbstraction [m3] + + + + + + Water Exploitation Index - Consumption; for water regions (this is the official EU WEI+): consumption / internal and external availability + + + + + + Water Exploitation Index - Abstraction; for water regions: abstraction / internal and external availability + + + + + + Water Exploitation Index - Demand; for water regions: demand / internal and external availability + + + + + + Water Exploitation Index - Consumption; for water regions + + + + + + + Internal available water + + + + + + External available water + + + + + + Region Water Consumption + + + + + + Region Water Consumption + + + + + + Reservoir and Lake storage in m3 at end of month + + + + + + Reservoir and Lake abstraction in m3 + + + + + + Irrigation water shortage in m3 for month + + + + + + Surface water availability in m3 for potential irrigation for each day + + + + + + Monthly evapotranspiration deficit in mm + + + + + + Monthly evapotranspiration deficit in mm + + + + + + Monthly evapotranspiration deficit in mm + + + + + + Monthly Water Dependency Index (0-1) (De Roo 2015) + WDI = Upstream Inflow Actually Used / Total Water Demand + Values close to 1 give extreme dependency on upstream water + + + + + + Monthly Water Security Index (0-1) (De Roo 2015) + WSI = Upstream Inflow Actually Used / Upstream Inflow Available + Values close to 1 give extreme vulnerability to upstream water + + + + + + Monthly Water Sustainability Index (0-1) (De Roo 2015) + WTI = 1-SurfaceWaterDeficit / TotalWaterDemand + Values of 1 indicate complete sustainable conditions, no water deficit + Values less than 1 indicate that considerable deep groundwater resources or desalinated water is used + + + + + + Monthly Falkenmark 1 Index (tochanm3) + + + + + + Monthly Falkenmark 2 Index (tochanm3+reservoirlakeabstraction) + + + + + + Monthly Falkenmark 3 Index (tochanm3+reservoirlakeabstraction+externalinflow) + + + + + + + Abstraction from groundwater in m3 per timestep + + + + + + Abstraction from surface water in m3 per timestep + + + + + + Region abstraction from surface water in m3 per timestep + + + + + + Region Total Abstraction From Lakes and Reservoirs in m3, per timestep + + + + + + Lake Abstraction per timestep in m3 + + + + + + ReservoirAbstraction per timestep in M3 + + + + + + ReservoirStorage in M3 + + + + + + LakeStorage in M3 + + + + + + AreatotalIrrigationUseM3 + + + + + + FractionAbstractedFromChannels + + + + + + EFlowIndicator (1 on day with ChanQ smaller than EflowThreshold, 0 on normal days) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ************************************************************** + Peter's addition + ************************************************************** + + + + + + [mm] + + + + + + [mm] + + + + + + [mm] + + + + + + + + + + areamap MaskMap; + timer StepStart StepEnd 1; + ReportSteps=$(ReportSteps); + + + + + diff --git a/tests/data/LF_MCT_UseCase/settings/mct_warm_endmaps_interface.xml b/tests/data/LF_MCT_UseCase/settings/mct_warm_endmaps_interface.xml new file mode 100644 index 00000000..d6921e63 --- /dev/null +++ b/tests/data/LF_MCT_UseCase/settings/mct_warm_endmaps_interface.xml @@ -0,0 +1,5992 @@ + + + + + + + #----------------------------------------------------------- + # modelling and reporting options + #----------------------------------------------------------- + + + + # options to turn hydrological modules on/off + + + + + + + + + + + + + + + + + + + + + + + # use inflow data + + + # option to compute indicators + + + # option to initialize Lisflood + + + + # option to read/write NetCDF + + + + + + + #----------------------------------------------------------- + # report time series + #----------------------------------------------------------- + # report discharge TS + + + # report gauges and sites + # sites (pixel average) + + + # gauges (catchment average) + + + + + # report reservoirs and lakes + + + + # report mass balance + + + #----------------------------------------------------------- + # report maps + #----------------------------------------------------------- + # report state maps + + + # report end maps + + + # report output maps + # forcings + + + + + + + # dicharge + + + + + + # variables + + + + + + + + + + + + + + + + #Surface runoff + #Surface runoff + UZ [mm] + #Surface runoff + UZ [mm] + LZ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ************************************************************** + netCDF parameters + ************************************************************** + + + + + !-- Optimization of netCDF I/O through chunking and caching. + + The option "NetCDFTimeChunks" may take the following values: + - "-1" : Load everything upfront + - "[positive integer number]" : Chunk size defined by user + - "auto" : Let xarray to decide + + + + + The option "MapsCaching" may take the following values: + - "True" : Cache maps during execution + - "False" : No caching + + + + ************************************************************** + PARALLELIZED KINEMATIC ROUTING + ************************************************************** + + + + + The option "OutputMapsChunks" may take the following values: + - "[positive integer number]" : Dump outputs to disk every X steps (default 1) + + + + + The option "OutputMapsDataType" sets the output data type and may take the following values: + - "float64" + - "float32" + + + + ************************************************************** + PARALLELISATION WITH NUMBA (USED IN ROUTING AND SOILLOOP) + ************************************************************** + + + + + !-- Parallelisation of using Numba runtime compiled library . + The option "numCPUs_parallelNumba" may take the following values: + - "0" : set to NUMBA_NUM_THREADS Environment Variable + (if NUMBA_NUM_THREADS is not set, will take the number of CPU cores determined by python's multiprocessing.cpu_count()) + - "1" : serial execution (not parallel) + - "2", "3", ... : manual setting of the number of parallel threads. + (if exceeding NUMBA_NUM_THREADS, the value is set to NUMBA_NUM_THREADS) --> + + + + + ************************************************************** + AREA AND OUTLETS + ************************************************************** + + + + + MAPSDIR + Root directory (tables and parameters) + $(SettingsPath)/.. + + + + + + Clone map + col row cellsize xupleft yupleft + or pcraster maps or netcdf maps + + + + + + 4307500 2377500 outlet + 4307500 2377500 4292500 2377500 4302500 2377500 4302500 2372500 4297500 2372500 4312500 2377500 4287500 2372500 4282500 2367500 + Nominal map with gauge locations (i.e cells for which simulated discharge + is written to file(1,2,3 etc) + lat lon (lat2 lon2 ...) + or pcraster maps or netcdf maps + + + + + + netcdf template used to copy metadata information for writing netcdf + + + + + + latitude map to be used for snow/ice modelling + + + + + + This is needed when using projected coordinates + + + + + ************************************************************** + TIME-RELATED CONSTANTS + ************************************************************** + + + + + Calendar convention + + + + + + Reference day and time + + + + + + timestep [seconds] + + + + + + 17280 5 times subrouting + 21600 6 hours + Sub time step used for kinematic and MCT wave channel routing [seconds] + Within the model,the smallest out of DtSecChannel and DtSec is used + + + + + + 01/01/YEAR_START 12:00 + Number of first time step in simulation + + + + + + 01/01/YEAR_END 06:00 + Number of last time step in simulation + + + + + + low value to limit testing time + + + + + + 1..9999 + Time steps at which to write model state maps (i.e. only + those maps that would be needed to define initial conditions + for succeeding model run) + + + + + + + + ************************************************************** + MONTE CARLO, KALMAN FILTER + ************************************************************** + + + + + Number of sample to use in MonteCarlo simulations + + + + + + Number of cores of the computer to use in MonteCarlo simulations + This only works with Linux, if set to 1 no forking will be used + + + + + + Time steps at which to write model state maps (i.e. only + those maps that would be needed to define initial conditions + for succeeding model run) + + + + + + + + ************************************************************** + CALIBRATION PARAMETERS + with .nc format: than working with smaller sub-areas is possible + ************************************************************** + + + + default: 10 + $(PathParams)/params_UpperZoneTimeConstant + Time constant for water in upper zone [days] + This is the average time a water 'particle' remains in the reservoir + if we had a stationary system (average inflow=average outflow) + + + + + + default: 100 + $(PathParams)/params_LowerZoneTimeConstant + Time constant for water in lower zone [days] + This is the average time a water 'particle' remains in the reservoir + if we had a stationary system (average inflow=average outflow) + + + + + + default: 0.5 + $(PathParams)/GwPercValue + Maximum rate of percolation going from the Upper to the Lower + response box [mm/day] + + + + + + default: 0.0 + $(PathParams)/GwLoss + Maximum percolation rate from the lower groundwater zone [mm/days]. GWLoss + it’s lost beyond the catchment boundaries or to deep groundwater systems. + A value of 0 (closed lower boundary) is recommended as a starting value. + + + + + + default: 10 + $(PathParams)/params_LZThreshold + threshold value [mm] of the water storage in the lower groundwater zone. + If the water storage in the lower groundwater zone decreases below LZThreshold, + the flow from the lower zone to the nearby rivers (base-flow) stops. + + + + + + default: 0.7 [-] + $(PathParams)/b_Xinanjiang + Power in Xinanjiang distribution function [-] + + + + + + default: 3.5 [-] + $(PathParams)/PowerPrefFlow + Power that controls increase of proportion of preferential + flow with increased soil moisture storage [-] + + + + + + default: 2.0 [-] + $(PathParams)/CalChanMan1 + Multiplier [-] applied to Channel Manning's n + + + + + + default: 4.0 [mm C-1 day-1] + $(PathParams)/SnowMeltCoef + SRM: 0.45 cm C-1 day-1 ( = 4.50 mm C-1 day-1), Kwadijk: 18 mm C-1 month-1 (= 0.59 mm C-1 day-1) + See also Martinec et al., 1998. + + + + + + default: 3.0 [-] + $(PathParams)/CalChanMan2 + Multiplier [-] applied to Channel Manning's n for second line of routing + + + + + + default: 3.0 [-] + $(PathParams)/CalChanMan3 + Multiplier [-] applied to Channel Manning's n for MCT routing + + + + + + default: 1.0 [-] + $(PathParams)/LakeMultiplier + Multiplier applied to the lake parameter A + + + + + + Fraction of the total reservoir storage above which the reservoirs enters + the flood control zone. + + + + + + Factor of the 100-year return inflow (`ReservoirFloodOutflow`) that defines the inflow + value that switches, when exceeded, the reservoir routine to flood control mode. + It can be a map (NetCDF), a table (TXT) or a float. Negative values will be replaced by + the default value of 0.3 + Units: - + Range: 0.1 - 0.5 + Default: 0.3 + + + + + + default: 5.0 [mm/day] (not included in calibration) + Critical amount of available water (expressed in [mm/day]!), above which 'Days Since Last Rain' parameter is + set to 1 + + + + + default: 2.0 + $(PathParams)/params_QSplitMult + Multiplier applied to average Q to split into a second line of routing + + + + + + default: 1.0 + $(PathParams)/params_ChanBottomWMult + Multiplier applied to ChanBottomWidth + + + + + + default: 1.0 + $(PathParams)/params_ChanDepthTMult + Multiplier [] applied to ChanDepthThreshold + + + + + + default: 1.0 + $(PathParams)/params_ChanSMult + Multiplier [] applied to ChanSdXdY + + + + + + + ************************************************************** + FILE PATHS + ************************************************************** + + + + + RUNDIR + Output path (org=$(PathRoot)/out) + + + + + + INITDIR + Path of the initial value maps e.g. lzavin.map (org=$(PathRoot)/outPo) + + + + + + Static maps path + + + + + + Inflow path + + + + + + Calibration parameter path + + + + + + Tables path + + + + + + Maps instead of tables path + + + + + + Maps instead of tables for soil hydraulics path + + + + + + Maps for transient land use changes every 5 years + + + + + + Maps for land use fractions and related land use maps + + + + + + Water use maps path + + + + + + FORCINGSDIR + Meteo path + + + + + + Leaf Area Index maps path + + + + + + variable water fraction maps path + + + + + + + + ************************************************************** + INITIAL CONDITIONS + (maps or single values) + ************************************************************** + + + + + if init. condition are stored as netCDF with different time steps + this variable indicates which time step to use + Either as date e.g. 1/1/2010 or as number e.g. 5 + + + + + + Cold start: 0 + Initial overland flow storage [m3], direct runoff fraction + + + + + + Cold start: 0 + Initial overland flow storage [m3], other fraction + + + + + + Cold start: 0 + Initial overland flow storage [m3], forest fraction + + + + + + Cold start: 0 + initial snow depth in snow zone A [mm] + + + + + + Cold start: 0 + initial snow depth in snow zone B [mm] + + + + + + Cold start: 0 + initial snow depth in snow zone C [mm] + + + + + + Cold start: 0 + initial Frost Index value [degC/day] + + + + + + Cold start: 0 + cumulative interception [mm] + + + + + + Cold start: 0 + PRERUNDIR/uz.end.nc + water in upper store [mm] + + + + + + Cold start: 1 + days since last rainfall [days] + + + + + + + + ************************************************************** + The following variables can also be initialized in the model + internally. if you want this to happen set them to bogus value + of -9999 + ************************************************************** + + + + + PRERUNDIR/lz.end.nc + water in lower store [mm] + Cold start: -9999: use steady-state storage + + + + + + initial cross-sectional area of flow in channel[m2] + Cold start: -9999: use half bankfull + + + + + + PRERUNDIR/tha.end.nc + initial soil moisture content layer 1a (superficial soil layer) [mm3/mm3] + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thb.end.nc + initial soil moisture content layer 1b (upper soil layer) [mm3/mm3] + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thc.end.nc + initial soil moisture content layer 2 (lower soil layer) [mm3/mm3] + Cold start: -9999: use field capacity values + + + + + + initial channel cross-section area [m2] for 2nd routing channel + Cold start: -9999: use 0 + + + + + + initial lateral inflow for 1st line of routing [m2/s] + Cold start: -9999: use 0 + + + + + + Initial lake level [m] + Cold start: -9999 sets initial value to steady-state level + + + + + + Lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + Cold start: -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + Cold start: -9999 sets initial value + + + + + + Outflow discharge at the end of previous step (instantaneous) [m3/s] + Cold start: -9999 sets initial value to 0 + + + + + + Outflow average discharge on previous routing sub-step (average) [m3/s] + Cold start: -9999 sets initial value to 0 + + + + + + Courant number at previous step for MCT routing + Cold start: -9999 sets initial value to 1 + + + + + + Reynolds number at previous step for MCT routing + Cold start: -9999 sets initial value to 0 + + + + + + + ************************************************************** + INITIAL CONDITIONS FOREST + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + Cold start: 0 + + + + + + PRERUNDIR/uzf.end.nc + water in upper groundwater store [mm] + Cold start: 0 + + + + + + days since last rainfall + Cold start: 1 + + + + + + PRERUNDIR/thfa.end.nc + initial soil moisture content [mm3/mm3] layer 1a (superficial soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thfb.end.nc + initial soil moisture content [mm3/mm3] layer 1b (upper soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thfc.end.nc + initial soil moisture content [mm3/mm3] layer 2 (lower soil layer) + Cold start: -9999: use field capacity values + + + + + + + + + ************************************************************** + INITIAL CONDITIONS IRRIGATION + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + Cold start: 0 + + + + + + PRERUNDIR/uzi.end.nc + water in groundwater upper store [mm] + Cold start: 0 + + + + + + days since last rainfall + Cold start: 1 + + + + + + PRERUNDIR/thia.end.nc + initial soil moisture content [mm3/mm3] layer 1a (superficial soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thib.end.nc + initial soil moisture content [mm3/mm3] layer 1b (upper soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thic.end.nc + initial soil moisture content [mm3/mm3] layer 2 (lower soil layer) + Cold start: -9999: use field capacity values + + + + + + + + ************************************************************** + INITIAL CONDITIONS IMPERVIOUS AREAS + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + Cold start: 0 + + + + + + + + ************************************************************** + PREFIXES OF METEO AND VEGETATION RELATED VARIABLES + ************************************************************** + + + + + prefix precipitation maps + + + + + + prefix average temperature maps + + + + + + prefix E0 maps + + + + + + prefix ES0 maps + + + + + + prefix ET0 maps + + + + + + prefix LAI maps + + + + + + prefix LAI forest maps + + + + + + prefix LAI irrigation maps + + + + + + prefix domestic water use maps + + + + + + prefix livestock water use maps + + + + + + prefix energy water use maps + + + + + + prefix industry water use maps + + + + + + prefix variable water fraction + + + + + + + + ************************************************************** + PARAMETERS RELATED TO EVAPO(TRANSPI)RATION AND Interception + ************************************************************** + + Suggested parameterisation strategy: + + - leave all these parameters at their default values. + in some very special cases CalEvaporation may be set to some + value other than one + + + + + + Multiplier [-] applied to potential precipitation rates + + + + + + Multiplier [-] applied to potential evapo(transpi)ration rates + + + + + + Time constant for water in interception store [days] + + + + + + Average extinction coefficient for the diffuse radiation flux + varies with crop from 0.4 to 1.1 (Goudriaan (1977)) + + + + + + maximum depression storage for water on impervious surface + which is not immediatly causing surface runoff [mm] + + + + + + + + ************************************************************** + SNOW AND FROST RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - estimate SnowFactor from prior data (if available), otherwise use 1 + - use SnowMeltCoef as a calibration constant + - leave all other parameters at default + + + + + + Multiplier [-] applied to precipitation that falls as snow + + + + + + range [mm C-1 day-1] of the seasonal variation + SnowMeltCoef is the average value + + + + + + Average temperature [deg C] at which snow melts + + + + + + Average temperature [deg C] below which precipitation is snow + + + + + + Temperature lapse rate with altitude [C / m] + + + + + + Daily decay coefficient [day-1], (Handbook of Hydrology, p. 7.28) + + + + + + Snow depth reduction coefficient, [cm-1], (HH, p. 7.28) + + + + + + Snow water equivalent, (based on snow density of 450 kg/m3) (e.g. Tarboton and Luce, 1996) + + + + + + Degree Days Frost Threshold (stops infiltration, percolation and capillary rise) + Molnau and Bissel found a value 56-85 for NW USA. + + + + + + + + ************************************************************** + IRRIGATION AND WATER ABSTRACTION RELATED PARAMETERS + ************************************************************** + + + + + default: 0.75 + Field application irrigation efficiency [-]: max 1, ~0.90 drip irrigation, ~0.75 sprinkling + + + + + + conveyance efficiency [-]: around 0.80 for average channel + + + + + + IrrigationType (value between 0 and 1) is used here to distinguish between additional adding water until fieldcapacity (value set to 1) or not (value set to 0) + + + + + + Factor [-] to irrigation water demand + More than the transpiration is added e.g to prevent salinisation + + + + + + Annual amount (m3) of treated wastewater reused for irrigation + + + + + + Number of days over which the annual amount of treated wastewater for irrigation is used + + + + + + Consumptive Use (1-Recycling ratio) for livestock water use (0-1) [-] + + + + + + Consumptive Use (1-Recycling ratio) for industrial water use (0-1) [-] + + + + + + # Consumptive Use (1-Recycling ratio) for energy water use (0-1) [-] + # Source: Torcellini et al. (2003) "Consumptive Use for US Power Production" + # map advised by Neil Edwards, Energy Industry + # the UK and small French rivers the consumptive use varies between 1:2 and 1:3, so 0.33-0.50 + # For plants along big rivers like Rhine and Danube the 0.025 is ok + EnergyConsumptiveUseFraction=0.025 + + + + + + Consumptive Use (1-Recycling ratio) for domestic water use (0-1) [-] + Source: EEA (2005) State of Environment + + + + + + Default : 0.2 + $(PathRoot)/leakage.map + Fraction of leakage of public water supply (0=no leakage, 1=100% leakage) + + + + + + The water that is lost from leakage (lost) (0-1) [-] + + + + + + Leakage reduction fraction (e.g. 50% = 0.5 as compared to current Leakage) (baseline=0, maximum=1) [-] + + + + + + Water savings fraction (e.g. 10% = 0.1 as compared to current Use (baseline=0, maximum=1) [-] + scenwsav.map + + + + + + Fraction of water re-used in industry (e.g. 50% = 0.5 = half of the water is re-used, used twice (baseline=0, maximum=1) [-] + scenruse.map + + + + + + + Irrigation crop coefficient [-] + + + + + + Irrigation crop group number [-] + + + + + + Population [units] + + + + + + Population + + + + + + Land Use Mask + + + + + + Reported water use [cu m/s], depending on the availability of discharge + + + + + + Time series of upstream water use at gauging stations + + + + + + Number of sub-steps needed for water use + routine + + + + + + maximum number of loops for calculating the use of water + = distance water is taken for water consuption + + + + + + percentage of water which remains in the channel + e.g. 0.2 -> 20 percent of discharge is not taken out + + + + + + ? + + + + + + + + + ************************************************************** + GROUNDWATER RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - leave GwLossFraction at 0 unless prior information show groundwater loss + is important + - use UpperZoneTimeConstant, LowerZoneTimeConstant, + GwPercValue as calibration constants + - calibrate on GwLossFraction if necessary + + + + + length of the window used to smooth the LZ zone [number of cell length] + + + + + + map of aquifers (0/1), used to smoothen LZ near extraction areas + + + + + + + + ************************************************************** + EVAPORATION FROM OPEN WATER + ************************************************************** + + + + + Fraction of maximum extend of water + + + + + + Mask with Lakes from GLWD database + + + + + + + + ************************************************************** + TRANSMISSION LOSS PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use TransSub as calibration constant leave all other parameters at default values + + + + + Transmission loss function parameter + + + + + + PBchange + Transmission loss function parameter + + + + + + PBchange + downstream area taking into account for transmission loss + + + + + + upstream area + + + + + + + + + ************************************************************** + ROUTING PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use CalChanMan as calibration constant to fine-tune timing of + channel routing, leave all other parameters at default values + + + + + kinematic wave parameter beta [-]: 0.6 is for broad sheet flow + + + + + + Reference depth of overland flow [mm], used to compute + overland flow Alpha for kin. wave + + + + + + Percentage [-] used to compute the TotalCrossSectionAreaHalfBankFull in the initialisation of the + total cross-sectional area + default: 0.5 + + + + + + Minimum slope gradient [-] (for kin. wave: slope cannot be 0) + + + + + + Minimum channel gradient [-] (for kin. wave: slope cannot be 0) + + + + + + + + ************************************************************** + PARAMETERS RELATED TO NUMERICS + ************************************************************** + + Important: do not change, default value of 0.4 generally combines + sufficient numerical accuracy within a limited number of sub-steps + + + + + + Minimum value for Courant condition in soil moisture routine. Always less than or equal to 1. + Small values result in improved numerical accuracy, at the expense of increased + computing time (more sub-steps needed). If reported time series of soil moisture contain + large jumps, lowering CourantCrit should fix this + + + + + + + + ************************************************************** + VARIABLES RELATED TO OPTIONS + These all need to have some (real or bogus) value, + even for options that are not actually used! + ************************************************************** + + + + ************************************************************** + RESERVOIR OPTION + ************************************************************** + + + + + Sub time step used for reservoir simulation [s]. Within the model, + the smallest out of DtSecReservoirs and DtSec is used. + + + + + + Initial reservoir fill fraction [-] + Cold start: -9999 sets initial fill to normal storage limit + if you're not using the reservoir option, enter some bogus value + + + + + + + + ************************************************************** + LAKE OPTION + ************************************************************** + + + + + Cold start: -9999 + Estimate of average net inflow into lake (=inflow - evaporation) [cu m / s] + Used to calculated steady-state lake level in case LakeInitialLevelValue + is set to -9999 + + + + + + + + ************************************************************** + POLDER OPTION + ************************************************************** + + + + + Weir constant [-] (Do not change!) + + + + + + Initial water level in polder [m] + + + + + + + + ************************************************************** + DYNAMIC WAVE OPTION + ************************************************************** + + + + + Critical Courant number for dynamic wave + value between 0-1 (smaller values result in greater numerical accuracy, + but also increase computational time) + + + + + + Constant head [m] at most downstream pixel (relative to altitude + at most downstream pixel) + + + + + + + + ************************************************************** + MUSKINGUM-CUNGE-TODINI OPTION + ************************************************************** + + + + + test_chanmct_all + test_chanmct_2 + chanmct_single + Boolean map with value 1 at channel pixels where MCT is + used, and 0 at all other pixels + + + + + + Maximum channel gradient for channels using MCT routing [-] (for MCT wave: slope cannot be 0) + Default: 0.001 + + + + + + + + ************************************************************** + INFLOW HYDROGRAPH (OPTIONAL) + ************************************************************** + + + + + OPTIONAL: nominal map with locations of (measured) + inflow hydrographs [cu m / s] + + + + + + location of calibration points + OPTIONAL: nominal map with locations of calibration points + + + + + + OPTIONAL: observed or simulated input hydrographs as + time series [cu m / s] + Note that identifiers in time series correspond to + InflowPoints map (also optional) + + + + + + + + ************************************************************** + PF REPORTING OPTION + ************************************************************** + + + + + Maximum capillary head [cm]. This value is used if Theta equals residual soil + moisture content (value of HeadMax is arbitrary). Only needed for pF computation, + otherwise doesn't influence model results at all) + + + + + PF MAPS + + + + + Reported pF soil layer 1a, other fraction + + + + + + Reported pF soil layer 1b, other fraction + + + + + + Reported pF soil layer 2, other fraction + + + + + + Reported pF soil layer 1a, forest fraction + + + + + + Reported pF soil layer 1b, forest fraction + + + + + + Reported pF layer 2, forest fraction + + + + + + Reported pF soil layer 1a, irrigation fraction + + + + + + Reported pF soil layer 1b, irrigation fraction + + + + + + Reported pF soil layer 2, irrigation fraction + + + + + + + + + + + + + + + + + This is necessary when using projected coordinates (x,y) + + + + + + + + + + + Clone map + + + + + + netcdf template used to copy metadata information for writing netcdf + + + + + + latitude map to be used for snow/ice modelling + + + + + + + + ************************************************************** + TIMESTEP RELATED PARAMETERS + ************************************************************** + + + + + Calendar convention + + + + + + Calendar day is back! + Calendar day number of 1st day in model run + e.g. 1st of January: 1; 1st of June 151 (or 152 in leap year) + Needed to read out LAI tables correctly + + + + + + timestep [seconds] (60*60*24) + + + + + + Sub time step used for kinematic wave channel routing [seconds] + Within the model,the smallest out of DtSecChannel and DtSec is used + + + + + + Number of first time step in simulation + + + + + + Number of last time step in simulation + + + + + + Number of days used for internal spin-up (fluxes computations during prerun) + + + + + + + + ************************************************************** + PARAMETERS RELATED TO EVAPO(TRANSPI)RATION AND Interception + ************************************************************** + + Suggested parameterisation strategy: + + - leave all these parameters at their default values. + in some very special cases CalEvaporation may be set to some + value other than one + + + + + + Multiplier applied to potential precipitation rates [-] + + + + + + Multiplier applied to potential evapo(transpi)ration rates [-] + + + + + + Time constant for water in interception store [days] + + + + + + Average extinction coefficient [-] for the diffuse radiation flux + varies with crop from 0.4 to 1.1 (Goudriaan (1977)) + + + + + + Critical amount of available water (expressed in [mm/day]!), above which 'Days Since Last Rain' parameter is + set to 1 + + + + + + maximum depression storage for water on impervious surface + which is not immediatly causing surface runoff [mm] + + + + + + + + ************************************************************** + SNOW AND FROST RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - estimate SnowFactor from prior data (if available), otherwise use 1 + - use SnowMeltCoef as a calibration constant + - leave all other parameters at default + + + + + + Multiplier applied to precipitation that falls as snow + + + + + + Snowmelt coefficient [mm C-1 day-1)] + See also Martinec et al., 1998. + + + + + + range [mm C-1 day-1] of the seasonal variation + SnowMeltCoef is the average value + + + + + + Average temperature [deg C] at which snow melts + + + + + + Average temperature [deg C] below which precipitation is snow + + + + + + Temperature lapse rate with altitude [deg C / m] + + + + + + Daily decay coefficient [day-1], (Handbook of Hydrology, p. 7.28) + + + + + + Snow depth reduction coefficient, [cm-1], (HH, p. 7.28) + + + + + + Snow water equivalent, (based on snow density of 450 kg/m3) (e.g. Tarboton and Luce, 1996) + + + + + + Degree Days Frost Threshold (stops infiltration, percolation and capillary rise) + Molnau and Bissel found a value 56-85 for NW USA. + + + + + + + + ************************************************************** + INFILTRATION PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - use b_Xinanjiang and PowerPrefFlow as calibration constants + + + + + + Power in Xinanjiang distribution function [-] + + + + + + Power that controls increase of proportion of preferential + flow with increased soil moisture storage [-] + + + + + + + + ************************************************************** + GROUNDWATER RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - leave GwLossFraction at 0 unless prior information show groundwater loss + is important + - use all other parameters as calibration constants + + + + + + Time constant for water in upper zone [days] + + + + + + Time constant for water in lower zone [days] + This is the average time a water 'particle' remains in the reservoir + if we had a stationary system (average inflow=average outflow) + + + + + + Maximum rate of percolation going from the Upper to the Lower + response box [mm/day] + + + + + + Maximum percolation rate from the lower groundwater zone [mm/days]. GWLoss + it’s lost beyond the catchment boundaries or to deep groundwater systems. + A value of 0 (closed lower boundary) is recommended as a starting value. + + + + + + + + ************************************************************** + EVAPORATION FROM OPEN WATER + ************************************************************** + + + + + water use daily maps with a (in this case negative) volume of water [cu m/s] + + + + + + table with days for each water use maps + 1st column: range of days; 2nd column: suffix of wuse map + + + + + + Percentage of maximum extend of water + + + + + + Mask with Lakes from GLWD database + + + + + + maximum number of loops for calculating evaporation + = distance water is taken to satisfy the need of evaporation from open water + + + + + + Reported evaporation from open water [mm] + + + + + + Time series of upstream water evaporation from open water at gauging stations + + + + + + + + ************************************************************** + TRANSMISSION LOSS PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use TransSub as calibration constant leave all other parameters at default values + + + + + + PBchange + Transmission loss function parameter + + + + + + PBchange + Transmission loss function parameter + + + + + + PBchange + downstream area taking into account for transmission loss + + + + + + upstream area + + + + + + + + ************************************************************** + ROUTING PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use CalChanMan as calibration constant to fine-tune timing of + channel routing, leave all other parameters at default values + + + + + + Multiplier applied to Channel Manning's n + + + + + + Multiplier applied to Channel Manning's n for second routing line + + + + + + Multiplier applied to Channel Manning's n for MCT routing + + + + + + Multiplier applied to average Q to split into a second line of routing + + + + + + Multiplier applied to ChanBottomWidth + + + + + + Multiplier applied to ChanDepthThreshold + + + + + + Multiplier applied to ChanSdXdY + + + + + + kinematic wave parameter: 0.6 is for broad sheet flow + + + + + + Reference depth of overland flow [mm], used to compute + overland flow Alpha for kin. wave + + + + + + Percentage [-] used to compute the TotalCrossSectionAreaHalfBankFull in the initialisation of the + total cross-sectional area + default: 0.5 + + + + + + Minimum slope gradient (for kin. wave: slope cannot be 0) + + + + + + Minimum channel gradient (for kin. wave: slope cannot be 0) + + + + + + + + ************************************************************** + PARAMETERS RELATED TO NUMERICS + ************************************************************** + + Important: do not change, default value of 0.4 generally combines + sufficient numerical accuracy within a limited number of sub-steps + + + + + + Minimum value for Courant condition in soil moisture routine. Always less than or equal to 1. + Small values result in improved numerical accuracy, at the expense of increased + computing time (more sub-steps needed). If reported time series of soil moisture contain + large jumps, lowering CourantCrit should fix this + + + + + + + + ************************************************************** + INITIAL CONDITIONS FOR THE WATER BALANCE MODEL + (can be either maps or single values) + ************************************************************** + + + + + PRERUNDIR/lzavin + Reported map of average percolation rate from upper to + lower groundwater zone (reported for end of simulation) [mm/day] + + + + + + PRERUNDIR/avgdis + CHANNEL split routing in two lines + Average discharge map [m3/s] + + + + + + Reported infiltration from the soil layer 2 to soil layer 3, other land cover fraction, average flux over the simulation period [mm] + + + + + + Reported infiltration from the soil layer 2 to soil layer 3, forest land cover fraction, average flux over the simulation period [mm] + + + + + + Reported infiltration from the soil layer 2 to soil layer 3, irrigated land cover fraction, average flux over the simulation period [mm] + + + + + + if init condition are stored as netCDF with different time steps + this variable indicates which time step to use + Either as date e.g. 1/1/2010 or as number e.g. 5 + + + + + + Initial overland flow storage [m3], direct runoff fraction + + + + + + Initial overland flow storage [m3], other fraction + + + + + + Initial overland flow storage [m3], forest fraction + + + + + + initial snow depth in snow zone A [mm] + + + + + + initial snow depth in snow zone B [mm] + + + + + + initial snow depth in snow zone C [mm] + + + + + + initial Frost Index value [degC/day] + + + + + + cumulative interception [mm] + + + + + + water in groundwater upper store [mm] + + + + + + days since last rainfall + + + + + + + + ************************************************************** + The following variables can also be initialized in the model + internally. if you want this to happen set them to bogus value + of -9999 + ************************************************************** + + + + + water in groundwater lower store [mm] + -9999: use steady-state storage + + + + + + initial cross-sectional area of flow in channel[m2] + -9999: use half bankfull + + + + + + initial soil moisture content [mm3/mm3] layer 1a (superficial layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 1b (upper layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 2 (lower layer) + -9999: use field capacity values + + + + + + initial channel cross-section area [m2] for 2nd routing channel + -9999: use 0 + + + + + + initial lateral inflow for 1st line of routing [m2/s] + -9999: use 0 + + + + + + Outflow discharge at the end of previous step (instantaneous) [m3/s] + -9999: use 0 + + + + + + Outflow average discharge on previous routing sub-step (average) [m3/s] + Cold start: -9999 sets initial value to 0 + + + + + + Courant number at previous step for MCT routing + Cold start: -9999 sets initial value to 1 + + + + + + Reynolds number at previous step for MCT routing + Cold start: -9999 sets initial value to 0 + + + + + + + + ************************************************************** + INITIAL CONDITIONS FOREST + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + + + + + + water in groundwater upper store [mm] + + + + + + days since last rainfall for forest fraction + + + + + + initial soil moisture content [mm3/mm3] layer 1a (superficial layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 1b (upper layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 2 (lower layer) + -9999: use field capacity values + + + + + + cumulative depression storage [mm] + + + + + + + + ************************************************************** + INITIAL CONDITIONS IRRIGATION + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + + + + + + water in groundwater upper store [mm] + + + + + + days since last rainfall for irrigation + + + + + + initial soil moisture content [mm3/mm3] layer 1a (superficial layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 1b (upper layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 2 (lower layer) + -9999: use field capacity values + + + + + + + + ************************************************************** + INPUT METEOROLOGICAL AND VEGETATION TIMESERIES AS MAPS + ************************************************************** + + + + + precipitation [mm/day] + + + + + + average daily temperature [C] + + + + + + daily reference evaporation (free water) [mm/day] + + + + + + daily reference evaporation (soil) [mm/day] + + + + + + daily reference evapotranspiration (crop) [mm/day] + + + + + + leaf area index [m2/m2] + + + + + + leaf area index [m2/m2] + + + + + + leaf area index [m2/m2] + + + + + + + + ************************************************************** + INPUT WATER USE MAPS AND PARAMETERS + ************************************************************** + + + + + Domestic water abstraction daily maps [mm] + + + + + + Livestock water abstraction daily maps [mm] + + + + + + Energy water abstraction daily maps [mm] + + + + + + Industry water abstraction daily maps [mm] + + + + + + Consumptive Use (1-Recycling ratio) for livestock water use (0-1) + + + + + + Consumptive Use (1-Recycling ratio) for industrial water use (0-1) + + + + + + # Consumptive Use (1-Recycling ratio) for energy water use (0-1) + # Source: Torcellini et al. (2003) "Consumptive Use for US Power Production" + # map advised by Neil Edwards, Energy Industry + # the UK and small French rivers the consumptive use varies between 1:2 and 1:3, so 0.33-0.50 + # For plants along big rivers like Rhine and Danube the 0.025 is ok + EnergyConsumptiveUseFraction=0.025 + + + + + + Consumptive Use (1-Recycling ratio) for domestic water use (0-1) + Source: EEA (2005) State of Environment + + + + + + Fraction of leakage of public water supply (0=no leakage, 1=100% leakage) + + + + + + The water that is lost from leakage (lost) (0-1) + + + + + + Leakage reduction fraction (e.g. 50% = 0.5 as compared to current Leakage) (baseline=0, maximum=1) + + + + + + Water savings fraction (e.g. 10% = 0.1 as compared to current Use (baseline=0, maximum=1) + scenwsav.map + + + + + + Fraction of water re-used in industry (e.g. 50% = 0.5 = half of the water is re-used, used twice (baseline=0, maximum=1 + scenruse.map + + + + + + + Field application irrigation efficiency max 1, ~0.90 drip irrigation, ~0.75 sprinkling + + + + + + conveyance efficiency, around 0.80 for average channel + + + + + + IrrigationType (value between 0 and 1) is used here to distinguish between additional adding water until fieldcapacity (value set to 1) or not (value set to 0) + + + + + + Factor to irrigation water demand + More than the transpiration is added e.g to prevent salinisation + + + + + + Annual amount (m3) of treated wastewater reused for irrigation + + + + + + Number of days over which the annual amount of treated wastewater for irrigation is used + + + + + + Irrigation crop coefficient + + + + + + Irrigation crop group number + + + + + + Population + + + + + + Population + + + + + + Land Use Mask + + + + + + Reported water use [cu m/s], depending on the availability of discharge + + + + + + Time series of upstream water use at gauging stations + + + + + + Number of sub-steps needed for water use + routine + + + + + + maximum number of loops for calculating the use of water + = distance water is taken for water consuption + + + + + + percentage of water which remains in the channel + e.g. 0.2 -> 20 percent of discharge is not taken out + + + + + + + + + + + + + ************************************************************** + RICE IRRIGATION + ************************************************************** + + + + + water amount in mm per day + 10 mm for 10 days (total 10cm water) + + + + + + FAO: percolation for heavy clay soils: PERC = 2 mm/day + + + + + + map with starting day of the year + + + + + + map with starting day of the year + + + + + + map with starting day of the year + + + + + + map with starting day of the year + + + + + + + + ************************************************************** + REPORTED OUTPUT MAPS + ************************************************************** + + + + + Reported discharge [cu m/s] (average over the model timesteps) (AvgDis) + + + + + + Reported Topsoil moisture [%] + + + + + + Reported Topsoil moisture [%] + + + + + + Reported discharge [cu m/s] at the end of a timestep + + + + + + Reported discharge [cu m/s] but cut by a discharge mask map + + + + + + Reported water level [m] % False by default + + + + + + + + STATE VARIABLES AT SELECTED TIME STEPS + ONLY FOR INITIALISATION OF SUCCEEDING RUNS + REPORTING TIME STEPS SET THROUGH "ReportSteps" OPTION + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported days since last rain + + + + + + Reported water depth + + + + + + Reported overland flow water volume [m3] for direct fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for other fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for forest fraction on catchment surface + + + + + + Reported chan cross-section area [m2] + + + + + + Reported snow cover in snow zone A [mm] + + + + + + Reported snow cover in snow zone B [mm] + + + + + + Reported snow cover in snow zone C [mm] + + + + + + Reported frost index [degC/day] + + + + + + Reported interception storage [mm] + + + + + + + Reported cross section area 2nd line of routing [m2] + + + + + + Reported channel side flow [m2/s] + + + + + + Reported istantaneous discharge at end of computation step [cu m/s] ChanQ + + + + + + Reported average discharge over last routing sub-step used to initialise lakes [cu m/s] ChanQAvgDt + + + + + + Courant number at previous step for MCT routing + + + + + + Reynolds number at previous step for MCT routing + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + cumulative interception [mm] + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lowerupper layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported transpiration maps, other fraction [mm] + + + + + + Reported transpiration maps, forest fraction [mm] + + + + + + Reported transpiration maps, irrigated fraction [mm] + + + + + + Reported transpiration maps, weighted sum over the fractions of each pixel [mm] + + + + + + + + "END" MAPS, AKA REPORTED OUTPUT MAPS CALLED "END" + Same as above, but always at last time step + Support for these "end" maps will most likely be + discontinued some time soon + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported days since last rain + + + + + + Reported water depth [m] + + + + + + Reported overland flow water volume [m3] for direct fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for other fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for forest fraction on catchment surface + + + + + + Reported chan cross-section area [m2] + + + + + + Reported snow cover in snow zone A [mm] + + + + + + Reported snow cover in snow zone B [mm] + + + + + + Reported snow cover in snow zone C [mm] + + + + + + Reported frost index [degC/day] + + + + + + Reported interception storage [mm] + + + + + + Reported lake level [m] + + + + + + Reported lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Reported lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value + + + + + + Reported lake storage [m3] + + + + + + + Reported reservoir filling [-] + + + + + + Reported cross section area 2nd line of rounting [m2] + + + + + + Reported channel side flow [m2/s] + + + + + + Reported istantaneous discharge at end of computation step [cu m/s] ChanQ + + + + + + Reported average discharge over last routing sub-step used to initialise lakes [cu m/s] ChanQAvgDt + + + + + + Reported average discharge [cu m/s] (average over the model timesteps) (AvgDis) + + + + + + Courant number at previous step for MCT routing + + + + + + Reynolds number at previous step for MCT routing + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + cumulative interception [mm] + + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1c (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + + + INDIVIDUAL DRIVING METEOROLOGICAL VARIABLES (AT EVERY TIME STEP) + ONLY IF REPORTING OF EACH RESPECTIVE VARIABLE IS + SWITCHED ON (DEFAULT: ALL SWITCHED OFF) + Note reporting is done as a quantity per time step, not as + an intensity (as in meteo input!) + + + + + Precipitation [mm per time step] + + + + + + Average DAILY temperature [degrees C] + + + + + + Potential reference evapotranspiration [mm per time step] + + + + + + Potential evaporation from bare soil surface [mm per time step] + + + + + + Potential evaporation from open water surface [mm per time step] + + + + + + + + INDIVIDUAL STATE VARIABLES (AT EVERY TIME STEP) + ONLY IF REPORTING OF EACH RESPECTIVE VARIABLE IS + SWITCHED ON (DEFAULT: ALL SWITCHED OFF) + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported total water storage [mm] + + + + + + Reported days since last rain + + + + + + Reported water depth [m] + + + + + + Reported overland flow water volume [m3] for direct runoff fraction on catchment surfac + + + + + + Reported overland flow water volume [m3] for other fraction on catchment surfac + + + + + + Reported overland flow water volume [m3] for forest fraction on catchment surfac + + + + + + Reported channel cross-section area [m2] + + + + + + Reported snow cover [mm] + + + + + + Reported frost index [degC/day] + + + + + + Reported interception storage, other fraction [mm] + + + + + + + Reported days since last rain + + + + + + Reported interception storage, forest fraction [mm] + + + + + + Reported interception storage, irrigation fraction [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported interception (depression) storage, direct runoff (impervious) fraction [mm] + + + + + + + + INDIVIDUAL RATE VARIABLES (AT EVERY TIME STEP) + ONLY IF REPORTING OF EACH RESPECTIVE VARIABLE IS + SWITCHED ON (DEFAULT: ALL SWITCHED OFF) + + + + + Reported rain (excluding snow)[mm] + + + + + + Reported snow (excluding rain)[mm] + + + + + + Reported snowmelt [mm] + + + + + + Reported interception [mm] + + + + + + Reported transpiration [mm] + + + + + + Reported soil evaporation [mm] + + + + + + Reported evaporation of intercepted water [mm] + + + + + + Reported actual evapotranspiration [mm] + + + + + + Reported leaf drainage [mm] + + + + + + Reported infiltration [mm] + + + + + + Reported preferential flow [mm] + + + + + + Reported percolation from soil layer 1a to soil layer 1b, other fraction [mm] + + + + + + Reported percolation from soil layer 1a to soil layer 1b, forest fraction [mm] + + + + + + Reported percolation from soil layer 1a to soil layer 1b, irrigation fraction [mm] + + + + + + Reported percolation from soil layer 1b to soil layer 2, other fraction [mm] + + + + + + Reported percolation from soil layer 1b to soil layer 2, forest fraction [mm] + + + + + + Reported percolation from soil layer 1b to soil layer 2, irrigation fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), other fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), forest fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), irrigation fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), weighted sum over the fraction of each pixel [mm] + + + + + + Reported available groundwater LZ+ GWLoss [mm] + + + + + + Reported surface runoff [mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported lower zone outflow [mm] + + + + + + Reported fast runoff = surface + UZ [mm] + + + + + + Reported GWloss [mm] + + + + + + Reported total runoff [mm] + + + + + + Reported total runoff that enters the channel: groundwater + surface runoff [mm] + + + + + + Reported Direct Runoff [mm] + + + + + + Reported FlowVelocityMSecMaps [m/s] + + + + + + Reported TravelDistance [m] + + + + + + Reported percolation from upper to lower groundwater zone [mm] + + + + + + + Reported evaporation of intercepted water [mm] + + + + + + Reported soil evaporation [mm] + + + + + + Reported leaf drainage Forest[mm] + + + + + + Reported interception forest [mm] + + + + + + Reported infiltration [mm] + + + + + + Reported transpiration forest [mm] + + + + + + Reported preferential flow [mm] + + + + + + Reported percolation from 1st to 2nd soil layer [mm] + + + + + + Reported seepage to groundwater[mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported percolation from upper to lower zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + + + MISCELLANEOUS OUTPUT MAPS AND TIME SERIES + + + + + Time series of average percolation rate from upper to + lower groundwater zone (reported at sites) [mm/day] + + + + + + Time series of average percolation rate from upper to + lower groundwater zone (average for upstream area of each gauge) [mm/day] + + + + + + Reported number of days in simulation with soil moisture stress [days] + + + + + + Reported number of days in simulation with soil moisture stress for forest fraction [days] + + + + + + Reported soil transpiration reduction factor [-] for other landuse + values below 1 indicate soil moisture stress + + + + + + Reported soil transpiration reduction factor [-] + values below 1 indicate soil moisture stress + + + + + + + + ************************************************************** + REPORTED OUTPUT TIME SERIES + ************************************************************** + + + + + Reported average discharge over the model time step [cu m/s] + + + + + + Reported instantaneous discharge at the end of routing sub-step [cu m/s] + + + + + + Reported average discharge on the last routing sub-step [cu m/s] + + + + + + Reported water level [m] + + + + + + + OUTPUT AT SITES: STATE VARIABLES + + + + + Water depth on soil surface [mm] + + + + + + Depth of snow cover on soil surface [mm] + + + + + + Water stored as interception [mm] + + + + + + Soil moisture layer 1a [cu mm / cu mm] + + + + + + Soil moisture layer 1b [cu mm / cu mm] + + + + + + Soil moisture layer 2 [cu mm / cu mm] + + + + + + Soil moisture layer 1a [cu mm / cu mm] + + + + + + Soil moisture layer 1b [cu mm / cu mm] + + + + + + Soil moisture layer 2 [cu mm / cu mm] + + + + + + Storage in upper groundwater zone [mm] + + + + + + Storage in lower groundwater zone [mm] + + + + + + Days since last rain [days] + + + + + + Frost index [degC/day] + + + + + + Days since last rain [days] + + + + + + + + OUTPUT AT SITES: RATE VARIABLES + + + + + Rain (excluding snow) [mm] + + + + + + Snow (excluding rain) [mm] + + + + + + Reported snowmelt [mm] + + + + + + Reported interception [mm] + + + + + + Reported transpiration [mm] + + + + + + Reported soil evaporation [mm] + + + + + + Reported evaporation from interception storage [mm] + + + + + + Reported leaf drainage [mm] + + + + + + Reported infiltration [mm] + + + + + + Reported preferential flow [mm] + + + + + + Reported percolation from 1st to 2nd soil layer [mm] + + + + + + Reported seepage to groundwater[mm] + + + + + + Reported surface runoff [mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported lower zone outflow [mm] + + + + + + Reported total runoff [mm] + + + + + + Reported percolation from upper to lower zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + + + + + + + + + + + + AVERAGE VALUES OF METEOROLOGICAL FORCING VARIABLES + UPSTREAM OF GAUGES + (only if repMeteoUpsGauges option is activated) + + + + + Precipitation [mm/time step] + + + + + + Average temperature [deg C] + + + + + + Reference evapotranspiration [mm/time step] + + + + + + Potential soil evaporation [mm/time step] + + + + + + Potential open water evaporation [mm/time step] + + + + + + ESActPixel+self.var.TaPixel+self.var.TaInterceptionAll+self.var.EvaAddM3*self.var.M3toMM + + + + + + + + AVERAGE VALUES OF MODEL STATE VARIABLES + UPSTREAM OF GAUGES + (only if repStateUpsGauges option is activated) + + + + + Water depth on soil surface [mm] + + + + + + Depth of snow cover on soil surface [mm] + + + + + + Water stored as interception [mm] + + + + + + Soil moisture upper layer [mm3/mm3] + + + + + + Soil moisture lower layer [mm3/mm3] + + + + + + + + + + Soil moisture lower layer [mm3/mm3] + + + + + + Storage in upper groundwater zone [mm] + + + + + + Storage in lower groundwater zone [mm] + + + + + + Days since last rain [days] + + + + + + Frost index [degC/day] + + + + + + Days since last rain [days] + + + + + + + + AVERAGE VALUES OF MODEL RATE VARIABLES + UPSTREAM OF GAUGES + (only if repRateUpsGauges option is activated) + + + + + Rain (excluding snow) [mm] + + + + + + Snow (excluding rain) [mm] + + + + + + Snow melt [mm] + + + + + + Interception [mm] + + + + + + Actual transpiration [mm] + + + + + + Actual evaporation [mm] + + + + + + Evaporation from interception storage [mm] + + + + + + Leaf drainage [mm] + + + + + + Infiltration [mm] + + + + + + Preferential flow [mm] + + + + + + Percolation upper to lower soil layer [mm] + + + + + + Seepage from lower soil layer to groundwater [mm] + + + + + + Surface runoff [mm] + + + + + + Outflow from upper groundwater zone (to channel) [mm] + + + + + + Outflow from lower groundwater zone (to channel) [mm] + + + + + + Total runoff [mm] + + + + + + Reported percolation from upper to lower groundwater zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + + + NUMERICS + + + + + Reported mass balance error at outlet [cu m] + + + + + + Reported mass balance error at outlet (as mm water slice) + + + + + + Reported mass balance error due to the split routing module, for each catchment [m3] + + + + + + Reported discharge error at the outlet as a consequence of the mass balance error within the split routing module, for each catchment [m3/s] + + + + + + Reported ratio between the mass balance error and the water volume storage, for each catchment [m3/m3] + + + + + + Average value of the sum of the fractions within a catchment: this value must be 1.0 in order to avoid mass balace errors! [-] + + + + + + Number of cells with Theta lower than + residual soil moisture content + (should ALWAYS be zero, if not something is + seriously wrong!!!) + TEST ONLY!! REMOVE OR HIDE IN FINAL VERSION!! + + + + + + Number of cells with Theta lower than + residual soil moisture content + (should ALWAYS be zero, if not something is + seriously wrong!!!) + TEST ONLY!! REMOVE OR HIDE IN FINAL VERSION!! + + + + + + Number of sub-steps needed for soil moisture + routine + + + + + + + + ************************************************************** + BASE INPUT MAPS AND TABLES + ************************************************************** + + + + + ************************************************************** + TOPOGRAPHY MAPS + ************************************************************** + + + + + $(PathMaps)/ldd.map + local drain direction map (1-9) + + + + + + slope gradient [-] (0.50 -> tangent=0.5, angle=26.5 degrees) + + + + + + Elevation standard deviation [m], i.e. altitude difference elevation within pixel. + Used for sub-pixel modelling of snow accumulation + and melt + + + + + + outlets.map + Nominal map with gauge locations (i.e cells for which simulated discharge + is written to file(1,2,3 etc) + + + + + + map with monitoring sites (1,2,3 etc) + + + + + + optional map with pixel length [m], only needed in case map attributes + are not in [m] (e.g. lat / lon systems) + + + + + + optional map with pixel area [m2], only needed in case map attributes + are not in [m] (e.g. lat / lon systems) + + + + + + + + ************************************************************** + SOIL PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - use b_Xinanjiang and PowerPrefFlow as calibration constants + + + + + + Soil depth for 1st layer: 1a (superficial layer) + Minimum Soil Depth [mm] for superficial soil layer + For Europe it is 50 mm + For Africa it is 200 mm + + + + + + Soil depth for 2nd layer: 1b (upper layer) + Minimum Soil Depth [mm] for second soil layer + + + + + + Soil depth for 2nd layer: 2 (lower layer) + Minimum Soil Depth [mm] for second soil layer + + + + + + Soil depth for 1st layer: 1a + Minimum Soil Depth [mm] for upper soil layer + For Europe it is 50 mm + For Africa it is 200 mm + + + + + + Soil depth for 2nd layer: 1b + Minimum Soil Depth [mm] for lower soil layer + + + + + + Soil depth for 2nd layer: 2 + Minimum Soil Depth [mm] for lower soil layer 300 + + + + + + + + ************************************************************** + LAND USE RELATED MAPS AND TABLES + ************************************************************** + + + + + $(PathMapsLanduse)/fracsealed + urban area (0-1) + + + + + + stack of Direct Runoff fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracforest + forest fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of forest fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracwater + forest fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of water fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracother + forest fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of other fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracirrigated + irrigated area fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of Irrigation fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracDrained.map + drained fraction from irrigated area (0-1) + + + + + + rice fraction of a pixel (0-1) + + + + + + stack of rice fraction maps (0-1) + + + + + + groundwater used fraction of a pixel (0-1) + + + + + + NonConventionalWaterUsed (0-1) + + + + + + lake and reservoir water used, fraction of a pixel (0-1) + + + + + + $(PathMaps)/eflow.map + EFlowThreshold is map with m3/s discharge, e.g. the 10th percentile discharge of the baseline run + + + + + + table with crop coefficient for each land use; values ranging from 0.75 to 1.25; + source: Supit, p.83 CFET + + + + + + table with crop group number; table 6.1 and 6.2 in WOFOST 6.0, Supit, 1994: p. 86 + + + + + + $(PathMapsTables)/manngs_2000_250m.map + table with Manning's roughness [m^(1/3) s^(-1)] for each CORINE landcover class + + + + + + table with crop coefficient for each land use; values ranging from 0.75 to 1.25; + source: Supit, p.83 CFET + + + + + + table with crop group number; table 6.1 and 6.2 in WOFOST 6.0, Supit, 1994: p. 86 + + + + + + $(PathMapsTables)/manngs_2000_250m.map + table with Manning's roughness [m^(1/3) s^(-1)] for each CORINE landcover class + + + + + + + + ************************************************************** + Variable Channel NoSubStepChannel + ************************************************************** + + + + + UpArea do be included in max. celerity + + + + + + variable Number of sub steps for the kinematic wave routing + + + + + ************************************************************** + CHANNEL MAPS + ************************************************************** + + + + + Boolean map with value 1 at channel pixels and 0 at + all other pixels + IMPORTANT: IF NON-CHANNEL PIXELS HAVE MISSING VALUES + THEN THIS MAY RESULT IN INCORRECT RESULTS + + + + + + Channel gradient (fraction, dy/dx) + + + + + + Channel Manning's n [m^(1/3) s^(-1)] + + + + + + Channel length [m] + + + + + + Channel bottom width [m] + + + + + + Channel side slope, expressed as gradient + !! expressed as dx/dy !!! (NOT dy/dx, which would perhaps be more logical) + + + + + + Floodplain Width [m] + + + + + + Bankfull channel depth [m] + + + + + + + + ************************************************************** + TABLES WITH TOPSOIL SOIL PHYSICAL PARAMETERS (HYPRES) + Each parameter is defined for upper (1a and 1b) and + lower (2) soil layers + ************************************************************** + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 1b (upper soil layer) + + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 2 (lower soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1b (upper soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 2 (lower soil layer) + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1a (superficial soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1b (upper soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 2 (lower soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1a (superficial soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1b (upper soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 2 (lower soil layer) + + + + + + + + ************************************************************** + TABLES WITH TOPSOIL SOIL PHYSICAL PARAMETERS (HYPRES) for Forest + Each parameter is defined for 1a and 1b + Normal parameter is taken for the lower soil layer + ************************************************************** + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1b (upper soil layer) + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) for soil layer 1a (superficial soil layer) + Lambda is acually 1-n [-] for soil layer 1b (upper soil layer) + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] for soil layer 1b (upper soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1a (superficial soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1b (upper soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1a (superficial soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1b (upper soil layer) + + + + + + + + ************************************************************** + RESERVOIRS (if used ) + Input maps + ************************************************************** + + + + + Sub time step used for reservoir simulation [s]. Within the model, + the smallest out of DtSecReservoirs and DtSec is used. + + + + + + Map with location of reservoirs (number) + + + + + + Initial reservoir storage (fraction) + + + + + + Input tables + + + + + Total reservoir storage capacity + Units: m³ + + + + + + Reservoir inflow associated with the 100-year return period. + It is modified by a calibration parameter (`ReservoirFloodOutflowFactor`) to + define the inflow above which the reservoir switches to flood control mode + Units: m³/s + + + + + + NReservoir average inflow used to define the normal reservoir release + Units: m³/s + + + + + + Minimum reservoir release: + Units: m³/s + + + + + Output time series + + + + + name of output TSS file with Reservoir Inflow + + + + + + name of output TSS file with Reservoir Outflow + + + + + + name of output TSS file with Reservoir Filling + + + + + + name of output TSS file with Reservoir storage [m3] + + + + + + + name of output map(s) with Reservoir Filling + + + + + + Fraction of the total reservoir storage above which the reservoirs enters + the flood control zone. + + + + + + Factor of the 100-year return inflow that defines a flood event, i.e., the + reservoir routine switches to flood control mode. + + + + + + + + ************************************************************** + LAKES (if used ) + Input maps + ************************************************************** + + + + + Map with location of lakes + + + + + + Initial lake level [m] + -9999 sets initial value to steady-state level + + + + + + Lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value + + + + + + Estimate of average net inflow into lake (=inflow - evaporation) [m3 / s] + Used to calculated steady-state lake level in case LakeInitialLevelValue + is set to -9999 + + + + + Input tables + + + + + Lake surface area [m2] + + + + + + Lake parameter A [m/s] + + + + + + Multiplier applied to the lake parameter A + + + + + Output time series + + + + + Output timeseries file with lake inflow [m3 /s] + + + + + + Output timeseries file with lake outflow [m3 /s] + + + + + + Output timeseries file with lake level [m] + + + + + + Output map(s) with lake level [m] + + + + + + Output map with lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Output map with lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value + + + + + + + + ************************************************************** + POLDERS(if used) + ************************************************************** + + + + + + Weir constant (fixed) [-] + + + + + + Map with polder locations + + + + + + Initial water level in polders [m] + + + + + + Polder maximum storage capacity [cu m] + + + + + + Area of polder [sq m] + + + + + + Width of polder outlet/inlet [m] + + + + + + Polder bottom level, measured from channel bottom [m] + + + + + + Time step at which polder opens in case of regulated polder (use bogus value of -9999 in table in case of unregulated polder) + + + + + + Time step at which water stored in polder is released again(use bogus value of -9999 in table in case of unregulated polder) + + + + + + name of output TSS file with polder flux [cu m / s]. Positive for flow from channel to polder, negative for polder to channel + + + + + + name of output TSS file with polder level [m] + + + + + + name of output map(s) with polder level + + + + + + + + ************************************************************** + INFLOW HYDROGRAPH (if used) + ************************************************************** + + + + + OPTIONAL: nominal map with locations of (measured) + inflow hydrographs + + + + + + location of calibration points + OPTIONAL: nominal map with locations of calibration points + + + + + + Observed or simulated input hydrographs as + time series [m3 / s] + Note that identifiers in time series correspond to + InflowPoints map (also optional) + + + + + + + + ************************************************************** + DYNAMIC WAVE(if used) + ************************************************************** + + + + + Critical Courant number for dynamic wave + value between 0-1 (smaller values result in greater numerical accuracy, + but also increase computational time) + + + + + + Constant head [m] at most downstream pixel (relative to altitude + at most downstream pixel) + + + + + + Boolean map with value 1 at channel pixels where dynamic wave is + used, and 0 at all other pixels + + + + + + Channel bottom level [m] + + + + + + Nominal map with channel cross section IDs + + + + + + Table with cross section parameters (H,A,P) + + + + + + + + ************************************************************** + MUSKINGUM-CUNGE-TODINI OPTION + ************************************************************** + + + + + Boolean map with value 1 at channel pixels where MCT is + used, and 0 at all other pixels + + + + + + Maximum channel gradient for channels using MCT routing [-] (for MCT wave: slope cannot be >0.001) + + + + + + + + ************************************************************** + PF REPORTING (if used) + ************************************************************** + + + + PF PARAMETERS + + + + + Maximum capillary head [cm]. This value is used if Theta equals residual soil + moisture content (value of HeadMax is arbitrary). Only needed for pF computation, + otherwise doesn't influence model results at all) + + + + + PF MAPS + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + PF TIMESERIES, VALUES AT SITES + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + PF TIMESERIES, AVERAGE VALUES UPSTREAM OF GAUGES + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + + + ************************************************************** + Ad'a addition + ************************************************************** + + + + + threshold value below which there is no outflow to the channel [mm] + + + + + + length of the window used to smooth the LZ zone [number of cells] + + + + + + map of aquifers (0/1), used to smoothen LZ near extraction areas + + + + + + + + ************************************************************** + Water demand output maps + ************************************************************** + + + + + day of the year when the yearly endcalculation is done e.g. 31/10/xxxx = 304 + + + + + + + TotalAbstractionFromGroundwater [mm] + + + + + + TotalAbstractionFromSurfaceWater [mm] + + + + + + TotalAbstractionFromSurfaceWater [mm] summed up for water regions + + + + + + Total Abstraction From SurfaceWater and Groundwater [mm] summed up for water regions, montly values + + + + + + TotalPaddyRiceIrrigationAbstraction [m3] + + + + + + Water Exploitation Index - Consumption; for water regions (this is the official EU WEI+): consumption / internal and external availability + + + + + + Water Exploitation Index - Abstraction; for water regions: abstraction / internal and external availability + + + + + + Water Exploitation Index - Demand; for water regions: demand / internal and external availability + + + + + + Water Exploitation Index - Consumption; for water regions + + + + + + Internal available water + + + + + + External available water + + + + + + Region Water Consumption + + + + + + Region Water Consumption + + + + + + Reservoir and Lake storage in m3 at end of month + + + + + + Reservoir and Lake abstraction in m3 + + + + + + Irrigation water shortage in m3 for month + + + + + + Surface water availability in m3 for potential irrigation for each day + + + + + + Monthly evapotranspiration deficit in mm + + + + + + Monthly evapotranspiration deficit in mm + + + + + + Monthly evapotranspiration deficit in mm + + + + + + Monthly Water Dependency Index (0-1) (De Roo 2015) + WDI = Upstream Inflow Actually Used / Total Water Demand + Values close to 1 give extreme dependency on upstream water + + + + + + Monthly Water Security Index (0-1) (De Roo 2015) + WSI = Upstream Inflow Actually Used / Upstream Inflow Available + Values close to 1 give extreme vulnerability to upstream water + + + + + + Monthly Water Sustainability Index (0-1) (De Roo 2015) + WTI = 1-SurfaceWaterDeficit / TotalWaterDemand + Values of 1 indicate complete sustainable conditions, no water deficit + Values less than 1 indicate that considerable deep groundwater resources or desalinated water is used + + + + + + Monthly Falkenmark 1 Index (tochanm3) + + + + + + Monthly Falkenmark 2 Index (tochanm3+reservoirlakeabstraction) + + + + + + Monthly Falkenmark 3 Index (tochanm3+reservoirlakeabstraction+externalinflow) + + + + + + + Abstraction from groundwater in m3 per timestep + + + + + + Abstraction from surface water in m3 per timestep + + + + + + Region abstraction from surface water in m3 per timestep + + + + + + Region Total Abstraction From Lakes and Reservoirs in m3, per timestep + + + + + + Lake Abstraction per timestep in m3 + + + + + + ReservoirAbstraction per timestep in M3 + + + + + + ReservoirStorage in M3 + + + + + + LakeStorage in M3 + + + + + + AreatotalIrrigationUseM3 + + + + + + FractionAbstractedFromChannels + + + + + + EFlowIndicator (1 on day with ChanQ smaller than EflowThreshold, 0 on normal days) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ************************************************************** + Peter's addition + ************************************************************** + + + + + + [mm] + + + + + + [mm] + + + + + + [mm] + + + + + + + + + + areamap MaskMap; + timer StepStart StepEnd 1; + ReportSteps=$(ReportSteps); + + + + + diff --git a/tests/data/LF_MCT_UseCase/settings/mct_warm_interface.xml b/tests/data/LF_MCT_UseCase/settings/mct_warm_interface.xml new file mode 100644 index 00000000..ac54343a --- /dev/null +++ b/tests/data/LF_MCT_UseCase/settings/mct_warm_interface.xml @@ -0,0 +1,5993 @@ + + + + + + + #----------------------------------------------------------- + # modelling and reporting options + #----------------------------------------------------------- + + + + # options to turn hydrological modules on/off + + + + + + + + + + + + + + + + + + + + + + + + # use inflow data + + + # option to compute indicators + + + # option to initialize Lisflood + + + + # option to read/write NetCDF + + + + + + + #----------------------------------------------------------- + # report time series + #----------------------------------------------------------- + # report discharge TS + + + # report gauges and sites + # sites (pixel average) + + + # gauges (catchment average) + + + + + # report reservoirs and lakes + + + + # report mass balance + + + #----------------------------------------------------------- + # report maps + #----------------------------------------------------------- + # report state maps + + + # report end maps + + + # report output maps + # forcings + + + + + + + # dicharge + + + + + + # variables + + + + + + + + + + + + + + + + #Surface runoff + #Surface runoff + UZ [mm] + #Surface runoff + UZ [mm] + LZ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ************************************************************** + netCDF parameters + ************************************************************** + + + + + !-- Optimization of netCDF I/O through chunking and caching. + + The option "NetCDFTimeChunks" may take the following values: + - "-1" : Load everything upfront + - "[positive integer number]" : Chunk size defined by user + - "auto" : Let xarray to decide + + + + + The option "MapsCaching" may take the following values: + - "True" : Cache maps during execution + - "False" : No caching + + + + ************************************************************** + PARALLELIZED KINEMATIC ROUTING + ************************************************************** + + + + + The option "OutputMapsChunks" may take the following values: + - "[positive integer number]" : Dump outputs to disk every X steps (default 1) + + + + + The option "OutputMapsDataType" sets the output data type and may take the following values: + - "float64" + - "float32" + + + + ************************************************************** + PARALLELISATION WITH NUMBA (USED IN ROUTING AND SOILLOOP) + ************************************************************** + + + + + !-- Parallelisation of using Numba runtime compiled library . + The option "numCPUs_parallelNumba" may take the following values: + - "0" : set to NUMBA_NUM_THREADS Environment Variable + (if NUMBA_NUM_THREADS is not set, will take the number of CPU cores determined by python's multiprocessing.cpu_count()) + - "1" : serial execution (not parallel) + - "2", "3", ... : manual setting of the number of parallel threads. + (if exceeding NUMBA_NUM_THREADS, the value is set to NUMBA_NUM_THREADS) --> + + + + + ************************************************************** + AREA AND OUTLETS + ************************************************************** + + + + + MAPSDIR + Root directory (tables and parameters) + $(SettingsPath)/.. + + + + + + Clone map + col row cellsize xupleft yupleft + or pcraster maps or netcdf maps + + + + + + 4307500 2377500 outlet + 4307500 2377500 4292500 2377500 4302500 2377500 4302500 2372500 4297500 2372500 4312500 2377500 4287500 2372500 4282500 2367500 + Nominal map with gauge locations (i.e cells for which simulated discharge + is written to file(1,2,3 etc) + lat lon (lat2 lon2 ...) + or pcraster maps or netcdf maps + + + + + + netcdf template used to copy metadata information for writing netcdf + + + + + + latitude map to be used for snow/ice modelling + + + + + + This is needed when using projected coordinates + + + + + ************************************************************** + TIME-RELATED CONSTANTS + ************************************************************** + + + + + Calendar convention + + + + + + Reference day and time + + + + + + timestep [seconds] + + + + + + 17280 5 times subrouting + 21600 6 hours + Sub time step used for kinematic and MCT wave channel routing [seconds] + Within the model,the smallest out of DtSecChannel and DtSec is used + + + + + + 01/01/YEAR_START 12:00 + Number of first time step in simulation + + + + + + 01/01/YEAR_END 06:00 + Number of last time step in simulation + + + + + + low value to limit testing time + + + + + + 1..9999 + Time steps at which to write model state maps (i.e. only + those maps that would be needed to define initial conditions + for succeeding model run) + + + + + + + + ************************************************************** + MONTE CARLO, KALMAN FILTER + ************************************************************** + + + + + Number of sample to use in MonteCarlo simulations + + + + + + Number of cores of the computer to use in MonteCarlo simulations + This only works with Linux, if set to 1 no forking will be used + + + + + + Time steps at which to write model state maps (i.e. only + those maps that would be needed to define initial conditions + for succeeding model run) + + + + + + + + ************************************************************** + CALIBRATION PARAMETERS + with .nc format: than working with smaller sub-areas is possible + ************************************************************** + + + + default: 10 + $(PathParams)/params_UpperZoneTimeConstant + Time constant for water in upper zone [days] + This is the average time a water 'particle' remains in the reservoir + if we had a stationary system (average inflow=average outflow) + + + + + + default: 100 + $(PathParams)/params_LowerZoneTimeConstant + Time constant for water in lower zone [days] + This is the average time a water 'particle' remains in the reservoir + if we had a stationary system (average inflow=average outflow) + + + + + + default: 0.5 + $(PathParams)/GwPercValue + Maximum rate of percolation going from the Upper to the Lower + response box [mm/day] + + + + + + default: 0.0 + $(PathParams)/GwLoss + Maximum percolation rate from the lower groundwater zone [mm/days]. GWLoss + it’s lost beyond the catchment boundaries or to deep groundwater systems. + A value of 0 (closed lower boundary) is recommended as a starting value. + + + + + + default: 10 + $(PathParams)/params_LZThreshold + threshold value [mm] of the water storage in the lower groundwater zone. + If the water storage in the lower groundwater zone decreases below LZThreshold, + the flow from the lower zone to the nearby rivers (base-flow) stops. + + + + + + default: 0.7 [-] + $(PathParams)/b_Xinanjiang + Power in Xinanjiang distribution function [-] + + + + + + default: 3.5 [-] + $(PathParams)/PowerPrefFlow + Power that controls increase of proportion of preferential + flow with increased soil moisture storage [-] + + + + + + default: 2.0 [-] + $(PathParams)/CalChanMan1 + Multiplier [-] applied to Channel Manning's n + + + + + + default: 4.0 [mm C-1 day-1] + $(PathParams)/SnowMeltCoef + SRM: 0.45 cm C-1 day-1 ( = 4.50 mm C-1 day-1), Kwadijk: 18 mm C-1 month-1 (= 0.59 mm C-1 day-1) + See also Martinec et al., 1998. + + + + + + default: 3.0 [-] + $(PathParams)/CalChanMan2 + Multiplier [-] applied to Channel Manning's n for second line of routing + + + + + + default: 3.0 [-] + $(PathParams)/CalChanMan3 + Multiplier [-] applied to Channel Manning's n for MCT routing + + + + + + default: 1.0 [-] + $(PathParams)/LakeMultiplier + Multiplier applied to the lake parameter A + + + + + + Fraction of the total reservoir storage above which the reservoirs enters + the flood control zone. + + + + + + Factor of the 100-year return inflow (`ReservoirFloodOutflow`) that defines the inflow + value that switches, when exceeded, the reservoir routine to flood control mode. + It can be a map (NetCDF), a table (TXT) or a float. Negative values will be replaced by + the default value of 0.3 + Units: - + Range: 0.1 - 0.5 + Default: 0.3 + + + + + + default: 5.0 [mm/day] (not included in calibration) + Critical amount of available water (expressed in [mm/day]!), above which 'Days Since Last Rain' parameter is + set to 1 + + + + + default: 2.0 + $(PathParams)/params_QSplitMult + Multiplier applied to average Q to split into a second line of routing + + + + + + default: 1.0 + $(PathParams)/params_ChanBottomWMult + Multiplier applied to ChanBottomWidth + + + + + + default: 1.0 + $(PathParams)/params_ChanDepthTMult + Multiplier [] applied to ChanDepthThreshold + + + + + + default: 1.0 + $(PathParams)/params_ChanSMult + Multiplier [] applied to ChanSdXdY + + + + + + + ************************************************************** + FILE PATHS + ************************************************************** + + + + + RUNDIR + Output path (org=$(PathRoot)/out) + + + + + + INITDIR + Path of the initial value maps e.g. lzavin.map (org=$(PathRoot)/outPo) + + + + + + Static maps path + + + + + + Inflow path + + + + + + Calibration parameter path + + + + + + Tables path + + + + + + Maps instead of tables path + + + + + + Maps instead of tables for soil hydraulics path + + + + + + Maps for transient land use changes every 5 years + + + + + + Maps for land use fractions and related land use maps + + + + + + Water use maps path + + + + + + FORCINGSDIR + Meteo path + + + + + + Leaf Area Index maps path + + + + + + variable water fraction maps path + + + + + + + + ************************************************************** + INITIAL CONDITIONS + (maps or single values) + ************************************************************** + + + + + if init. condition are stored as netCDF with different time steps + this variable indicates which time step to use + Either as date e.g. 1/1/2010 or as number e.g. 5 + + + + + + Cold start: 0 + Initial overland flow storage [m3], direct runoff fraction + + + + + + Cold start: 0 + Initial overland flow storage [m3], other fraction + + + + + + Cold start: 0 + Initial overland flow storage [m3], forest fraction + + + + + + Cold start: 0 + initial snow depth in snow zone A [mm] + + + + + + Cold start: 0 + initial snow depth in snow zone B [mm] + + + + + + Cold start: 0 + initial snow depth in snow zone C [mm] + + + + + + Cold start: 0 + initial Frost Index value [degC/day] + + + + + + Cold start: 0 + cumulative interception [mm] + + + + + + Cold start: 0 + PRERUNDIR/uz.end.nc + water in upper store [mm] + + + + + + Cold start: 1 + days since last rainfall [days] + + + + + + + + ************************************************************** + The following variables can also be initialized in the model + internally. if you want this to happen set them to bogus value + of -9999 + ************************************************************** + + + + + PRERUNDIR/lz.end.nc + water in lower store [mm] + Cold start: -9999: use steady-state storage + + + + + + initial cross-sectional area of flow in channel[m2] + Cold start: -9999: use half bankfull + + + + + + PRERUNDIR/tha.end.nc + initial soil moisture content layer 1a (superficial soil layer) [mm3/mm3] + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thb.end.nc + initial soil moisture content layer 1b (upper soil layer) [mm3/mm3] + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thc.end.nc + initial soil moisture content layer 2 (lower soil layer) [mm3/mm3] + Cold start: -9999: use field capacity values + + + + + + initial channel cross-section area [m2] for 2nd routing channel + Cold start: -9999: use 0 + + + + + + initial lateral inflow for 1st line of routing [m2/s] + Cold start: -9999: use 0 + + + + + + Initial lake level [m] + Cold start: -9999 sets initial value to steady-state level + + + + + + Lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + Cold start: -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + Cold start: -9999 sets initial value + + + + + + Outflow discharge at the end of previous step (instantaneous) [m3/s] + Cold start: -9999 sets initial value to 0 + + + + + + Outflow average discharge on previous routing sub-step (average) [m3/s] + Cold start: -9999 sets initial value to 0 + + + + + + Courant number at previous step for MCT routing + Cold start: -9999 sets initial value to 1 + + + + + + Reynolds number at previous step for MCT routing + Cold start: -9999 sets initial value to 0 + + + + + + + ************************************************************** + INITIAL CONDITIONS FOREST + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + Cold start: 0 + + + + + + PRERUNDIR/uzf.end.nc + water in upper groundwater store [mm] + Cold start: 0 + + + + + + days since last rainfall + Cold start: 1 + + + + + + PRERUNDIR/thfa.end.nc + initial soil moisture content [mm3/mm3] layer 1a (superficial soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thfb.end.nc + initial soil moisture content [mm3/mm3] layer 1b (upper soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thfc.end.nc + initial soil moisture content [mm3/mm3] layer 2 (lower soil layer) + Cold start: -9999: use field capacity values + + + + + + + + + ************************************************************** + INITIAL CONDITIONS IRRIGATION + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + Cold start: 0 + + + + + + PRERUNDIR/uzi.end.nc + water in groundwater upper store [mm] + Cold start: 0 + + + + + + days since last rainfall + Cold start: 1 + + + + + + PRERUNDIR/thia.end.nc + initial soil moisture content [mm3/mm3] layer 1a (superficial soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thib.end.nc + initial soil moisture content [mm3/mm3] layer 1b (upper soil layer) + Cold start: -9999: use field capacity values + + + + + + PRERUNDIR/thic.end.nc + initial soil moisture content [mm3/mm3] layer 2 (lower soil layer) + Cold start: -9999: use field capacity values + + + + + + + + ************************************************************** + INITIAL CONDITIONS IMPERVIOUS AREAS + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + Cold start: 0 + + + + + + + + ************************************************************** + PREFIXES OF METEO AND VEGETATION RELATED VARIABLES + ************************************************************** + + + + + prefix precipitation maps + + + + + + prefix average temperature maps + + + + + + prefix E0 maps + + + + + + prefix ES0 maps + + + + + + prefix ET0 maps + + + + + + prefix LAI maps + + + + + + prefix LAI forest maps + + + + + + prefix LAI irrigation maps + + + + + + prefix domestic water use maps + + + + + + prefix livestock water use maps + + + + + + prefix energy water use maps + + + + + + prefix industry water use maps + + + + + + prefix variable water fraction + + + + + + + + ************************************************************** + PARAMETERS RELATED TO EVAPO(TRANSPI)RATION AND Interception + ************************************************************** + + Suggested parameterisation strategy: + + - leave all these parameters at their default values. + in some very special cases CalEvaporation may be set to some + value other than one + + + + + + Multiplier [-] applied to potential precipitation rates + + + + + + Multiplier [-] applied to potential evapo(transpi)ration rates + + + + + + Time constant for water in interception store [days] + + + + + + Average extinction coefficient for the diffuse radiation flux + varies with crop from 0.4 to 1.1 (Goudriaan (1977)) + + + + + + maximum depression storage for water on impervious surface + which is not immediatly causing surface runoff [mm] + + + + + + + + ************************************************************** + SNOW AND FROST RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - estimate SnowFactor from prior data (if available), otherwise use 1 + - use SnowMeltCoef as a calibration constant + - leave all other parameters at default + + + + + + Multiplier [-] applied to precipitation that falls as snow + + + + + + range [mm C-1 day-1] of the seasonal variation + SnowMeltCoef is the average value + + + + + + Average temperature [deg C] at which snow melts + + + + + + Average temperature [deg C] below which precipitation is snow + + + + + + Temperature lapse rate with altitude [C / m] + + + + + + Daily decay coefficient [day-1], (Handbook of Hydrology, p. 7.28) + + + + + + Snow depth reduction coefficient, [cm-1], (HH, p. 7.28) + + + + + + Snow water equivalent, (based on snow density of 450 kg/m3) (e.g. Tarboton and Luce, 1996) + + + + + + Degree Days Frost Threshold (stops infiltration, percolation and capillary rise) + Molnau and Bissel found a value 56-85 for NW USA. + + + + + + + + ************************************************************** + IRRIGATION AND WATER ABSTRACTION RELATED PARAMETERS + ************************************************************** + + + + + default: 0.75 + Field application irrigation efficiency [-]: max 1, ~0.90 drip irrigation, ~0.75 sprinkling + + + + + + conveyance efficiency [-]: around 0.80 for average channel + + + + + + IrrigationType (value between 0 and 1) is used here to distinguish between additional adding water until fieldcapacity (value set to 1) or not (value set to 0) + + + + + + Factor [-] to irrigation water demand + More than the transpiration is added e.g to prevent salinisation + + + + + + Annual amount (m3) of treated wastewater reused for irrigation + + + + + + Number of days over which the annual amount of treated wastewater for irrigation is used + + + + + + Consumptive Use (1-Recycling ratio) for livestock water use (0-1) [-] + + + + + + Consumptive Use (1-Recycling ratio) for industrial water use (0-1) [-] + + + + + + # Consumptive Use (1-Recycling ratio) for energy water use (0-1) [-] + # Source: Torcellini et al. (2003) "Consumptive Use for US Power Production" + # map advised by Neil Edwards, Energy Industry + # the UK and small French rivers the consumptive use varies between 1:2 and 1:3, so 0.33-0.50 + # For plants along big rivers like Rhine and Danube the 0.025 is ok + EnergyConsumptiveUseFraction=0.025 + + + + + + Consumptive Use (1-Recycling ratio) for domestic water use (0-1) [-] + Source: EEA (2005) State of Environment + + + + + + Default : 0.2 + $(PathRoot)/leakage.map + Fraction of leakage of public water supply (0=no leakage, 1=100% leakage) + + + + + + The water that is lost from leakage (lost) (0-1) [-] + + + + + + Leakage reduction fraction (e.g. 50% = 0.5 as compared to current Leakage) (baseline=0, maximum=1) [-] + + + + + + Water savings fraction (e.g. 10% = 0.1 as compared to current Use (baseline=0, maximum=1) [-] + scenwsav.map + + + + + + Fraction of water re-used in industry (e.g. 50% = 0.5 = half of the water is re-used, used twice (baseline=0, maximum=1) [-] + scenruse.map + + + + + + + Irrigation crop coefficient [-] + + + + + + Irrigation crop group number [-] + + + + + + Population [units] + + + + + + Population + + + + + + Land Use Mask + + + + + + Reported water use [cu m/s], depending on the availability of discharge + + + + + + Time series of upstream water use at gauging stations + + + + + + Number of sub-steps needed for water use + routine + + + + + + maximum number of loops for calculating the use of water + = distance water is taken for water consuption + + + + + + percentage of water which remains in the channel + e.g. 0.2 -> 20 percent of discharge is not taken out + + + + + + ? + + + + + + + + + ************************************************************** + GROUNDWATER RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - leave GwLossFraction at 0 unless prior information show groundwater loss + is important + - use UpperZoneTimeConstant, LowerZoneTimeConstant, + GwPercValue as calibration constants + - calibrate on GwLossFraction if necessary + + + + + length of the window used to smooth the LZ zone [number of cell length] + + + + + + map of aquifers (0/1), used to smoothen LZ near extraction areas + + + + + + + + ************************************************************** + EVAPORATION FROM OPEN WATER + ************************************************************** + + + + + Fraction of maximum extend of water + + + + + + Mask with Lakes from GLWD database + + + + + + + + ************************************************************** + TRANSMISSION LOSS PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use TransSub as calibration constant leave all other parameters at default values + + + + + Transmission loss function parameter + + + + + + PBchange + Transmission loss function parameter + + + + + + PBchange + downstream area taking into account for transmission loss + + + + + + upstream area + + + + + + + + + ************************************************************** + ROUTING PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use CalChanMan as calibration constant to fine-tune timing of + channel routing, leave all other parameters at default values + + + + + kinematic wave parameter beta [-]: 0.6 is for broad sheet flow + + + + + + Reference depth of overland flow [mm], used to compute + overland flow Alpha for kin. wave + + + + + + Percentage [-] used to compute the TotalCrossSectionAreaHalfBankFull in the initialisation of the + total cross-sectional area + default: 0.5 + + + + + + Minimum slope gradient [-] (for kin. wave: slope cannot be 0) + + + + + + Minimum channel gradient [-] (for kin. wave: slope cannot be 0) + + + + + + + + ************************************************************** + PARAMETERS RELATED TO NUMERICS + ************************************************************** + + Important: do not change, default value of 0.4 generally combines + sufficient numerical accuracy within a limited number of sub-steps + + + + + + Minimum value for Courant condition in soil moisture routine. Always less than or equal to 1. + Small values result in improved numerical accuracy, at the expense of increased + computing time (more sub-steps needed). If reported time series of soil moisture contain + large jumps, lowering CourantCrit should fix this + + + + + + + + ************************************************************** + VARIABLES RELATED TO OPTIONS + These all need to have some (real or bogus) value, + even for options that are not actually used! + ************************************************************** + + + + ************************************************************** + RESERVOIR OPTION + ************************************************************** + + + + + Sub time step used for reservoir simulation [s]. Within the model, + the smallest out of DtSecReservoirs and DtSec is used. + + + + + + Initial reservoir fill fraction [-] + Cold start: -9999 sets initial fill to normal storage limit + if you're not using the reservoir option, enter some bogus value + + + + + + + + ************************************************************** + LAKE OPTION + ************************************************************** + + + + + Cold start: -9999 + Estimate of average net inflow into lake (=inflow - evaporation) [cu m / s] + Used to calculated steady-state lake level in case LakeInitialLevelValue + is set to -9999 + + + + + + + + ************************************************************** + POLDER OPTION + ************************************************************** + + + + + Weir constant [-] (Do not change!) + + + + + + Initial water level in polder [m] + + + + + + + + ************************************************************** + DYNAMIC WAVE OPTION + ************************************************************** + + + + + Critical Courant number for dynamic wave + value between 0-1 (smaller values result in greater numerical accuracy, + but also increase computational time) + + + + + + Constant head [m] at most downstream pixel (relative to altitude + at most downstream pixel) + + + + + + + + ************************************************************** + MUSKINGUM-CUNGE-TODINI OPTION + ************************************************************** + + + + + test_chanmct_all + test_chanmct_2 + chanmct_single + Boolean map with value 1 at channel pixels where MCT is + used, and 0 at all other pixels + + + + + + Maximum channel gradient for channels using MCT routing [-] (for MCT wave: slope cannot be 0) + Default: 0.001 + + + + + + + + ************************************************************** + INFLOW HYDROGRAPH (OPTIONAL) + ************************************************************** + + + + + OPTIONAL: nominal map with locations of (measured) + inflow hydrographs [cu m / s] + + + + + + location of calibration points + OPTIONAL: nominal map with locations of calibration points + + + + + + OPTIONAL: observed or simulated input hydrographs as + time series [cu m / s] + Note that identifiers in time series correspond to + InflowPoints map (also optional) + + + + + + + + ************************************************************** + PF REPORTING OPTION + ************************************************************** + + + + + Maximum capillary head [cm]. This value is used if Theta equals residual soil + moisture content (value of HeadMax is arbitrary). Only needed for pF computation, + otherwise doesn't influence model results at all) + + + + + PF MAPS + + + + + Reported pF soil layer 1a, other fraction + + + + + + Reported pF soil layer 1b, other fraction + + + + + + Reported pF soil layer 2, other fraction + + + + + + Reported pF soil layer 1a, forest fraction + + + + + + Reported pF soil layer 1b, forest fraction + + + + + + Reported pF layer 2, forest fraction + + + + + + Reported pF soil layer 1a, irrigation fraction + + + + + + Reported pF soil layer 1b, irrigation fraction + + + + + + Reported pF soil layer 2, irrigation fraction + + + + + + + + + + + + + + + + + This is necessary when using projected coordinates (x,y) + + + + + + + + + + + Clone map + + + + + + netcdf template used to copy metadata information for writing netcdf + + + + + + latitude map to be used for snow/ice modelling + + + + + + + + ************************************************************** + TIMESTEP RELATED PARAMETERS + ************************************************************** + + + + + Calendar convention + + + + + + Calendar day is back! + Calendar day number of 1st day in model run + e.g. 1st of January: 1; 1st of June 151 (or 152 in leap year) + Needed to read out LAI tables correctly + + + + + + timestep [seconds] (60*60*24) + + + + + + Sub time step used for kinematic wave channel routing [seconds] + Within the model,the smallest out of DtSecChannel and DtSec is used + + + + + + Number of first time step in simulation + + + + + + Number of last time step in simulation + + + + + + Number of days used for internal spin-up (fluxes computations during prerun) + + + + + + + + ************************************************************** + PARAMETERS RELATED TO EVAPO(TRANSPI)RATION AND Interception + ************************************************************** + + Suggested parameterisation strategy: + + - leave all these parameters at their default values. + in some very special cases CalEvaporation may be set to some + value other than one + + + + + + Multiplier applied to potential precipitation rates [-] + + + + + + Multiplier applied to potential evapo(transpi)ration rates [-] + + + + + + Time constant for water in interception store [days] + + + + + + Average extinction coefficient [-] for the diffuse radiation flux + varies with crop from 0.4 to 1.1 (Goudriaan (1977)) + + + + + + Critical amount of available water (expressed in [mm/day]!), above which 'Days Since Last Rain' parameter is + set to 1 + + + + + + maximum depression storage for water on impervious surface + which is not immediatly causing surface runoff [mm] + + + + + + + + ************************************************************** + SNOW AND FROST RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - estimate SnowFactor from prior data (if available), otherwise use 1 + - use SnowMeltCoef as a calibration constant + - leave all other parameters at default + + + + + + Multiplier applied to precipitation that falls as snow + + + + + + Snowmelt coefficient [mm C-1 day-1)] + See also Martinec et al., 1998. + + + + + + range [mm C-1 day-1] of the seasonal variation + SnowMeltCoef is the average value + + + + + + Average temperature [deg C] at which snow melts + + + + + + Average temperature [deg C] below which precipitation is snow + + + + + + Temperature lapse rate with altitude [deg C / m] + + + + + + Daily decay coefficient [day-1], (Handbook of Hydrology, p. 7.28) + + + + + + Snow depth reduction coefficient, [cm-1], (HH, p. 7.28) + + + + + + Snow water equivalent, (based on snow density of 450 kg/m3) (e.g. Tarboton and Luce, 1996) + + + + + + Degree Days Frost Threshold (stops infiltration, percolation and capillary rise) + Molnau and Bissel found a value 56-85 for NW USA. + + + + + + + + ************************************************************** + INFILTRATION PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - use b_Xinanjiang and PowerPrefFlow as calibration constants + + + + + + Power in Xinanjiang distribution function [-] + + + + + + Power that controls increase of proportion of preferential + flow with increased soil moisture storage [-] + + + + + + + + ************************************************************** + GROUNDWATER RELATED PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - leave GwLossFraction at 0 unless prior information show groundwater loss + is important + - use all other parameters as calibration constants + + + + + + Time constant for water in upper zone [days] + + + + + + Time constant for water in lower zone [days] + This is the average time a water 'particle' remains in the reservoir + if we had a stationary system (average inflow=average outflow) + + + + + + Maximum rate of percolation going from the Upper to the Lower + response box [mm/day] + + + + + + Maximum percolation rate from the lower groundwater zone [mm/days]. GWLoss + it’s lost beyond the catchment boundaries or to deep groundwater systems. + A value of 0 (closed lower boundary) is recommended as a starting value. + + + + + + + + ************************************************************** + EVAPORATION FROM OPEN WATER + ************************************************************** + + + + + water use daily maps with a (in this case negative) volume of water [cu m/s] + + + + + + table with days for each water use maps + 1st column: range of days; 2nd column: suffix of wuse map + + + + + + Percentage of maximum extend of water + + + + + + Mask with Lakes from GLWD database + + + + + + maximum number of loops for calculating evaporation + = distance water is taken to satisfy the need of evaporation from open water + + + + + + Reported evaporation from open water [mm] + + + + + + Time series of upstream water evaporation from open water at gauging stations + + + + + + + + ************************************************************** + TRANSMISSION LOSS PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use TransSub as calibration constant leave all other parameters at default values + + + + + + PBchange + Transmission loss function parameter + + + + + + PBchange + Transmission loss function parameter + + + + + + PBchange + downstream area taking into account for transmission loss + + + + + + upstream area + + + + + + + + ************************************************************** + ROUTING PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - Use CalChanMan as calibration constant to fine-tune timing of + channel routing, leave all other parameters at default values + + + + + + Multiplier applied to Channel Manning's n + + + + + + Multiplier applied to Channel Manning's n for second routing line + + + + + + Multiplier applied to Channel Manning's n for MCT routing + + + + + + Multiplier applied to average Q to split into a second line of routing + + + + + + Multiplier applied to ChanBottomWidth + + + + + + Multiplier applied to ChanDepthThreshold + + + + + + Multiplier applied to ChanSdXdY + + + + + + kinematic wave parameter: 0.6 is for broad sheet flow + + + + + + Reference depth of overland flow [mm], used to compute + overland flow Alpha for kin. wave + + + + + + Percentage [-] used to compute the TotalCrossSectionAreaHalfBankFull in the initialisation of the + total cross-sectional area + default: 0.5 + + + + + + Minimum slope gradient (for kin. wave: slope cannot be 0) + + + + + + Minimum channel gradient (for kin. wave: slope cannot be 0) + + + + + + + + ************************************************************** + PARAMETERS RELATED TO NUMERICS + ************************************************************** + + Important: do not change, default value of 0.4 generally combines + sufficient numerical accuracy within a limited number of sub-steps + + + + + + Minimum value for Courant condition in soil moisture routine. Always less than or equal to 1. + Small values result in improved numerical accuracy, at the expense of increased + computing time (more sub-steps needed). If reported time series of soil moisture contain + large jumps, lowering CourantCrit should fix this + + + + + + + + ************************************************************** + INITIAL CONDITIONS FOR THE WATER BALANCE MODEL + (can be either maps or single values) + ************************************************************** + + + + + PRERUNDIR/lzavin + Reported map of average percolation rate from upper to + lower groundwater zone (reported for end of simulation) [mm/day] + + + + + + PRERUNDIR/avgdis + CHANNEL split routing in two lines + Average discharge map [m3/s] + + + + + + Reported infiltration from the soil layer 2 to soil layer 3, other land cover fraction, average flux over the simulation period [mm] + + + + + + Reported infiltration from the soil layer 2 to soil layer 3, forest land cover fraction, average flux over the simulation period [mm] + + + + + + Reported infiltration from the soil layer 2 to soil layer 3, irrigated land cover fraction, average flux over the simulation period [mm] + + + + + + if init condition are stored as netCDF with different time steps + this variable indicates which time step to use + Either as date e.g. 1/1/2010 or as number e.g. 5 + + + + + + Initial overland flow storage [m3], direct runoff fraction + + + + + + Initial overland flow storage [m3], other fraction + + + + + + Initial overland flow storage [m3], forest fraction + + + + + + initial snow depth in snow zone A [mm] + + + + + + initial snow depth in snow zone B [mm] + + + + + + initial snow depth in snow zone C [mm] + + + + + + initial Frost Index value [degC/day] + + + + + + cumulative interception [mm] + + + + + + water in groundwater upper store [mm] + + + + + + days since last rainfall + + + + + + + + ************************************************************** + The following variables can also be initialized in the model + internally. if you want this to happen set them to bogus value + of -9999 + ************************************************************** + + + + + water in groundwater lower store [mm] + -9999: use steady-state storage + + + + + + initial cross-sectional area of flow in channel[m2] + -9999: use half bankfull + + + + + + initial soil moisture content [mm3/mm3] layer 1a (superficial layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 1b (upper layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 2 (lower layer) + -9999: use field capacity values + + + + + + initial channel cross-section area [m2] for 2nd routing channel + -9999: use 0 + + + + + + initial lateral inflow for 1st line of routing [m2/s] + -9999: use 0 + + + + + + Outflow discharge at the end of previous step (instantaneous) [m3/s] + -9999: use 0 + + + + + + Outflow average discharge on previous routing sub-step (average) [m3/s] + Cold start: -9999 sets initial value to 0 + + + + + + Courant number at previous step for MCT routing + Cold start: -9999 sets initial value to 1 + + + + + + Reynolds number at previous step for MCT routing + Cold start: -9999 sets initial value to 0 + + + + + + + + ************************************************************** + INITIAL CONDITIONS FOREST + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + + + + + + water in groundwater upper store [mm] + + + + + + days since last rainfall for forest fraction + + + + + + initial soil moisture content [mm3/mm3] layer 1a (superficial layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 1b (upper layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 2 (lower layer) + -9999: use field capacity values + + + + + + cumulative depression storage [mm] + + + + + + + + ************************************************************** + INITIAL CONDITIONS IRRIGATION + (maps or single values) + ************************************************************** + + + + + cumulative interception [mm] + + + + + + water in groundwater upper store [mm] + + + + + + days since last rainfall for irrigation + + + + + + initial soil moisture content [mm3/mm3] layer 1a (superficial layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 1b (upper layer) + -9999: use field capacity values + + + + + + initial soil moisture content [mm3/mm3] layer 2 (lower layer) + -9999: use field capacity values + + + + + + + + ************************************************************** + INPUT METEOROLOGICAL AND VEGETATION TIMESERIES AS MAPS + ************************************************************** + + + + + precipitation [mm/day] + + + + + + average daily temperature [C] + + + + + + daily reference evaporation (free water) [mm/day] + + + + + + daily reference evaporation (soil) [mm/day] + + + + + + daily reference evapotranspiration (crop) [mm/day] + + + + + + leaf area index [m2/m2] + + + + + + leaf area index [m2/m2] + + + + + + leaf area index [m2/m2] + + + + + + + + ************************************************************** + INPUT WATER USE MAPS AND PARAMETERS + ************************************************************** + + + + + Domestic water abstraction daily maps [mm] + + + + + + Livestock water abstraction daily maps [mm] + + + + + + Energy water abstraction daily maps [mm] + + + + + + Industry water abstraction daily maps [mm] + + + + + + Consumptive Use (1-Recycling ratio) for livestock water use (0-1) + + + + + + Consumptive Use (1-Recycling ratio) for industrial water use (0-1) + + + + + + # Consumptive Use (1-Recycling ratio) for energy water use (0-1) + # Source: Torcellini et al. (2003) "Consumptive Use for US Power Production" + # map advised by Neil Edwards, Energy Industry + # the UK and small French rivers the consumptive use varies between 1:2 and 1:3, so 0.33-0.50 + # For plants along big rivers like Rhine and Danube the 0.025 is ok + EnergyConsumptiveUseFraction=0.025 + + + + + + Consumptive Use (1-Recycling ratio) for domestic water use (0-1) + Source: EEA (2005) State of Environment + + + + + + Fraction of leakage of public water supply (0=no leakage, 1=100% leakage) + + + + + + The water that is lost from leakage (lost) (0-1) + + + + + + Leakage reduction fraction (e.g. 50% = 0.5 as compared to current Leakage) (baseline=0, maximum=1) + + + + + + Water savings fraction (e.g. 10% = 0.1 as compared to current Use (baseline=0, maximum=1) + scenwsav.map + + + + + + Fraction of water re-used in industry (e.g. 50% = 0.5 = half of the water is re-used, used twice (baseline=0, maximum=1 + scenruse.map + + + + + + + Field application irrigation efficiency max 1, ~0.90 drip irrigation, ~0.75 sprinkling + + + + + + conveyance efficiency, around 0.80 for average channel + + + + + + IrrigationType (value between 0 and 1) is used here to distinguish between additional adding water until fieldcapacity (value set to 1) or not (value set to 0) + + + + + + Factor to irrigation water demand + More than the transpiration is added e.g to prevent salinisation + + + + + + Annual amount (m3) of treated wastewater reused for irrigation + + + + + + Number of days over which the annual amount of treated wastewater for irrigation is used + + + + + + Irrigation crop coefficient + + + + + + Irrigation crop group number + + + + + + Population + + + + + + Population + + + + + + Land Use Mask + + + + + + Reported water use [cu m/s], depending on the availability of discharge + + + + + + Time series of upstream water use at gauging stations + + + + + + Number of sub-steps needed for water use + routine + + + + + + maximum number of loops for calculating the use of water + = distance water is taken for water consuption + + + + + + percentage of water which remains in the channel + e.g. 0.2 -> 20 percent of discharge is not taken out + + + + + + + + + + + + + ************************************************************** + RICE IRRIGATION + ************************************************************** + + + + + water amount in mm per day + 10 mm for 10 days (total 10cm water) + + + + + + FAO: percolation for heavy clay soils: PERC = 2 mm/day + + + + + + map with starting day of the year + + + + + + map with starting day of the year + + + + + + map with starting day of the year + + + + + + map with starting day of the year + + + + + + + + ************************************************************** + REPORTED OUTPUT MAPS + ************************************************************** + + + + + Reported discharge [cu m/s] (average over the model timesteps) (AvgDis) + + + + + + Reported Topsoil moisture [%] + + + + + + Reported Topsoil moisture [%] + + + + + + Reported discharge [cu m/s] at the end of a timestep + + + + + + Reported discharge [cu m/s] but cut by a discharge mask map + + + + + + Reported water level [m] % False by default + + + + + + + + STATE VARIABLES AT SELECTED TIME STEPS + ONLY FOR INITIALISATION OF SUCCEEDING RUNS + REPORTING TIME STEPS SET THROUGH "ReportSteps" OPTION + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported days since last rain + + + + + + Reported water depth + + + + + + Reported overland flow water volume [m3] for direct fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for other fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for forest fraction on catchment surface + + + + + + Reported chan cross-section area [m2] + + + + + + Reported snow cover in snow zone A [mm] + + + + + + Reported snow cover in snow zone B [mm] + + + + + + Reported snow cover in snow zone C [mm] + + + + + + Reported frost index [degC/day] + + + + + + Reported interception storage [mm] + + + + + + + Reported cross section area 2nd line of routing [m2] + + + + + + Reported channel side flow [m2/s] + + + + + + Reported istantaneous discharge at end of computation step [cu m/s] ChanQ + + + + + + Reported average discharge over last routing sub-step used to initialise lakes [cu m/s] ChanQAvgDt + + + + + + Courant number at previous step for MCT routing + + + + + + Reynolds number at previous step for MCT routing + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + cumulative interception [mm] + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lowerupper layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported transpiration maps, other fraction [mm] + + + + + + Reported transpiration maps, forest fraction [mm] + + + + + + Reported transpiration maps, irrigated fraction [mm] + + + + + + Reported transpiration maps, weighted sum over the fractions of each pixel [mm] + + + + + + + + "END" MAPS, AKA REPORTED OUTPUT MAPS CALLED "END" + Same as above, but always at last time step + Support for these "end" maps will most likely be + discontinued some time soon + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported days since last rain + + + + + + Reported water depth [m] + + + + + + Reported overland flow water volume [m3] for direct fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for other fraction on catchment surface + + + + + + Reported overland flow water volume [m3] for forest fraction on catchment surface + + + + + + Reported chan cross-section area [m2] + + + + + + Reported snow cover in snow zone A [mm] + + + + + + Reported snow cover in snow zone B [mm] + + + + + + Reported snow cover in snow zone C [mm] + + + + + + Reported frost index [degC/day] + + + + + + Reported interception storage [mm] + + + + + + Reported lake level [m] + + + + + + Reported lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Reported lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value + + + + + + Reported lake storage [m3] + + + + + + + Reported reservoir filling [-] + + + + + + Reported cross section area 2nd line of rounting [m2] + + + + + + Reported channel side flow [m2/s] + + + + + + Reported istantaneous discharge at end of computation step [cu m/s] ChanQ + + + + + + Reported average discharge over last routing sub-step used to initialise lakes [cu m/s] ChanQAvgDt + + + + + + Reported average discharge [cu m/s] (average over the model timesteps) (AvgDis) + + + + + + Courant number at previous step for MCT routing + + + + + + Reynolds number at previous step for MCT routing + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + cumulative interception [mm] + + + + + + + Reported days since last rain + + + + + + Reported interception storage [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1c (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + + + INDIVIDUAL DRIVING METEOROLOGICAL VARIABLES (AT EVERY TIME STEP) + ONLY IF REPORTING OF EACH RESPECTIVE VARIABLE IS + SWITCHED ON (DEFAULT: ALL SWITCHED OFF) + Note reporting is done as a quantity per time step, not as + an intensity (as in meteo input!) + + + + + Precipitation [mm per time step] + + + + + + Average DAILY temperature [degrees C] + + + + + + Potential reference evapotranspiration [mm per time step] + + + + + + Potential evaporation from bare soil surface [mm per time step] + + + + + + Potential evaporation from open water surface [mm per time step] + + + + + + + + INDIVIDUAL STATE VARIABLES (AT EVERY TIME STEP) + ONLY IF REPORTING OF EACH RESPECTIVE VARIABLE IS + SWITCHED ON (DEFAULT: ALL SWITCHED OFF) + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported storage in lower response box [mm] + + + + + + Reported total water storage [mm] + + + + + + Reported days since last rain + + + + + + Reported water depth [m] + + + + + + Reported overland flow water volume [m3] for direct runoff fraction on catchment surfac + + + + + + Reported overland flow water volume [m3] for other fraction on catchment surfac + + + + + + Reported overland flow water volume [m3] for forest fraction on catchment surfac + + + + + + Reported channel cross-section area [m2] + + + + + + Reported snow cover [mm] + + + + + + Reported frost index [degC/day] + + + + + + Reported interception storage, other fraction [mm] + + + + + + + Reported days since last rain + + + + + + Reported interception storage, forest fraction [mm] + + + + + + Reported interception storage, irrigation fraction [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a (superficial layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b (upper layer) [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 (lower layer) [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + Reported interception (depression) storage, direct runoff (impervious) fraction [mm] + + + + + + + + INDIVIDUAL RATE VARIABLES (AT EVERY TIME STEP) + ONLY IF REPORTING OF EACH RESPECTIVE VARIABLE IS + SWITCHED ON (DEFAULT: ALL SWITCHED OFF) + + + + + Reported rain (excluding snow)[mm] + + + + + + Reported snow (excluding rain)[mm] + + + + + + Reported snowmelt [mm] + + + + + + Reported interception [mm] + + + + + + Reported transpiration [mm] + + + + + + Reported soil evaporation [mm] + + + + + + Reported evaporation of intercepted water [mm] + + + + + + Reported actual evapotranspiration [mm] + + + + + + Reported leaf drainage [mm] + + + + + + Reported infiltration [mm] + + + + + + Reported preferential flow [mm] + + + + + + Reported percolation from soil layer 1a to soil layer 1b, other fraction [mm] + + + + + + Reported percolation from soil layer 1a to soil layer 1b, forest fraction [mm] + + + + + + Reported percolation from soil layer 1a to soil layer 1b, irrigation fraction [mm] + + + + + + Reported percolation from soil layer 1b to soil layer 2, other fraction [mm] + + + + + + Reported percolation from soil layer 1b to soil layer 2, forest fraction [mm] + + + + + + Reported percolation from soil layer 1b to soil layer 2, irrigation fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), other fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), forest fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), irrigation fraction [mm] + + + + + + Reported seepage to groundwater(from soil layer 2 to groundwater), weighted sum over the fraction of each pixel [mm] + + + + + + Reported available groundwater LZ+ GWLoss [mm] + + + + + + Reported surface runoff [mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported lower zone outflow [mm] + + + + + + Reported fast runoff = surface + UZ [mm] + + + + + + Reported GWloss [mm] + + + + + + Reported total runoff [mm] + + + + + + Reported total runoff that enters the channel: groundwater + surface runoff [mm] + + + + + + Reported Direct Runoff [mm] + + + + + + Reported FlowVelocityMSecMaps [m/s] + + + + + + Reported TravelDistance [m] + + + + + + Reported percolation from upper to lower groundwater zone [mm] + + + + + + + Reported evaporation of intercepted water [mm] + + + + + + Reported soil evaporation [mm] + + + + + + Reported leaf drainage Forest[mm] + + + + + + Reported interception forest [mm] + + + + + + Reported infiltration [mm] + + + + + + Reported transpiration forest [mm] + + + + + + Reported preferential flow [mm] + + + + + + Reported percolation from 1st to 2nd soil layer [mm] + + + + + + Reported seepage to groundwater[mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported percolation from upper to lower zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + Reported volumetric soil moisture content for + soil layer 1a [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 1b [V/V] [mm3/mm3] + + + + + + Reported volumetric soil moisture content for both + soil layer 2 [V/V] [mm3/mm3] + + + + + + Reported storage in upper response box [mm] + + + + + + + + MISCELLANEOUS OUTPUT MAPS AND TIME SERIES + + + + + Time series of average percolation rate from upper to + lower groundwater zone (reported at sites) [mm/day] + + + + + + Time series of average percolation rate from upper to + lower groundwater zone (average for upstream area of each gauge) [mm/day] + + + + + + Reported number of days in simulation with soil moisture stress [days] + + + + + + Reported number of days in simulation with soil moisture stress for forest fraction [days] + + + + + + Reported soil transpiration reduction factor [-] for other landuse + values below 1 indicate soil moisture stress + + + + + + Reported soil transpiration reduction factor [-] + values below 1 indicate soil moisture stress + + + + + + + + ************************************************************** + REPORTED OUTPUT TIME SERIES + ************************************************************** + + + + + Reported average discharge over the model time step [cu m/s] + + + + + + Reported instantaneous discharge at the end of routing sub-step [cu m/s] + + + + + + Reported average discharge on the last routing sub-step [cu m/s] + + + + + + Reported water level [m] + + + + + + + OUTPUT AT SITES: STATE VARIABLES + + + + + Water depth on soil surface [mm] + + + + + + Depth of snow cover on soil surface [mm] + + + + + + Water stored as interception [mm] + + + + + + Soil moisture layer 1a [cu mm / cu mm] + + + + + + Soil moisture layer 1b [cu mm / cu mm] + + + + + + Soil moisture layer 2 [cu mm / cu mm] + + + + + + Soil moisture layer 1a [cu mm / cu mm] + + + + + + Soil moisture layer 1b [cu mm / cu mm] + + + + + + Soil moisture layer 2 [cu mm / cu mm] + + + + + + Storage in upper groundwater zone [mm] + + + + + + Storage in lower groundwater zone [mm] + + + + + + Days since last rain [days] + + + + + + Frost index [degC/day] + + + + + + Days since last rain [days] + + + + + + + + OUTPUT AT SITES: RATE VARIABLES + + + + + Rain (excluding snow) [mm] + + + + + + Snow (excluding rain) [mm] + + + + + + Reported snowmelt [mm] + + + + + + Reported interception [mm] + + + + + + Reported transpiration [mm] + + + + + + Reported soil evaporation [mm] + + + + + + Reported evaporation from interception storage [mm] + + + + + + Reported leaf drainage [mm] + + + + + + Reported infiltration [mm] + + + + + + Reported preferential flow [mm] + + + + + + Reported percolation from 1st to 2nd soil layer [mm] + + + + + + Reported seepage to groundwater[mm] + + + + + + Reported surface runoff [mm] + + + + + + Reported upper zone outflow [mm] + + + + + + Reported lower zone outflow [mm] + + + + + + Reported total runoff [mm] + + + + + + Reported percolation from upper to lower zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + + + + + + + + + + + + AVERAGE VALUES OF METEOROLOGICAL FORCING VARIABLES + UPSTREAM OF GAUGES + (only if repMeteoUpsGauges option is activated) + + + + + Precipitation [mm/time step] + + + + + + Average temperature [deg C] + + + + + + Reference evapotranspiration [mm/time step] + + + + + + Potential soil evaporation [mm/time step] + + + + + + Potential open water evaporation [mm/time step] + + + + + + ESActPixel+self.var.TaPixel+self.var.TaInterceptionAll+self.var.EvaAddM3*self.var.M3toMM + + + + + + + + AVERAGE VALUES OF MODEL STATE VARIABLES + UPSTREAM OF GAUGES + (only if repStateUpsGauges option is activated) + + + + + Water depth on soil surface [mm] + + + + + + Depth of snow cover on soil surface [mm] + + + + + + Water stored as interception [mm] + + + + + + Soil moisture upper layer [mm3/mm3] + + + + + + Soil moisture lower layer [mm3/mm3] + + + + + + + + + + Soil moisture lower layer [mm3/mm3] + + + + + + Storage in upper groundwater zone [mm] + + + + + + Storage in lower groundwater zone [mm] + + + + + + Days since last rain [days] + + + + + + Frost index [degC/day] + + + + + + Days since last rain [days] + + + + + + + + AVERAGE VALUES OF MODEL RATE VARIABLES + UPSTREAM OF GAUGES + (only if repRateUpsGauges option is activated) + + + + + Rain (excluding snow) [mm] + + + + + + Snow (excluding rain) [mm] + + + + + + Snow melt [mm] + + + + + + Interception [mm] + + + + + + Actual transpiration [mm] + + + + + + Actual evaporation [mm] + + + + + + Evaporation from interception storage [mm] + + + + + + Leaf drainage [mm] + + + + + + Infiltration [mm] + + + + + + Preferential flow [mm] + + + + + + Percolation upper to lower soil layer [mm] + + + + + + Seepage from lower soil layer to groundwater [mm] + + + + + + Surface runoff [mm] + + + + + + Outflow from upper groundwater zone (to channel) [mm] + + + + + + Outflow from lower groundwater zone (to channel) [mm] + + + + + + Total runoff [mm] + + + + + + Reported percolation from upper to lower groundwater zone [mm] + + + + + + Reported loss from lower zone [mm] + + + + + + + + NUMERICS + + + + + Reported mass balance error at outlet [cu m] + + + + + + Reported mass balance error at outlet (as mm water slice) + + + + + + Reported mass balance error due to the split routing module, for each catchment [m3] + + + + + + Reported discharge error at the outlet as a consequence of the mass balance error within the split routing module, for each catchment [m3/s] + + + + + + Reported ratio between the mass balance error and the water volume storage, for each catchment [m3/m3] + + + + + + Average value of the sum of the fractions within a catchment: this value must be 1.0 in order to avoid mass balace errors! [-] + + + + + + Number of cells with Theta lower than + residual soil moisture content + (should ALWAYS be zero, if not something is + seriously wrong!!!) + TEST ONLY!! REMOVE OR HIDE IN FINAL VERSION!! + + + + + + Number of cells with Theta lower than + residual soil moisture content + (should ALWAYS be zero, if not something is + seriously wrong!!!) + TEST ONLY!! REMOVE OR HIDE IN FINAL VERSION!! + + + + + + Number of sub-steps needed for soil moisture + routine + + + + + + + + ************************************************************** + BASE INPUT MAPS AND TABLES + ************************************************************** + + + + + ************************************************************** + TOPOGRAPHY MAPS + ************************************************************** + + + + + $(PathMaps)/ldd.map + local drain direction map (1-9) + + + + + + slope gradient [-] (0.50 -> tangent=0.5, angle=26.5 degrees) + + + + + + Elevation standard deviation [m], i.e. altitude difference elevation within pixel. + Used for sub-pixel modelling of snow accumulation + and melt + + + + + + outlets.map + Nominal map with gauge locations (i.e cells for which simulated discharge + is written to file(1,2,3 etc) + + + + + + map with monitoring sites (1,2,3 etc) + + + + + + optional map with pixel length [m], only needed in case map attributes + are not in [m] (e.g. lat / lon systems) + + + + + + optional map with pixel area [m2], only needed in case map attributes + are not in [m] (e.g. lat / lon systems) + + + + + + + + ************************************************************** + SOIL PARAMETERS + ************************************************************** + + Suggested parameterisation strategy: + + - use b_Xinanjiang and PowerPrefFlow as calibration constants + + + + + + Soil depth for 1st layer: 1a (superficial layer) + Minimum Soil Depth [mm] for superficial soil layer + For Europe it is 50 mm + For Africa it is 200 mm + + + + + + Soil depth for 2nd layer: 1b (upper layer) + Minimum Soil Depth [mm] for second soil layer + + + + + + Soil depth for 2nd layer: 2 (lower layer) + Minimum Soil Depth [mm] for second soil layer + + + + + + Soil depth for 1st layer: 1a + Minimum Soil Depth [mm] for upper soil layer + For Europe it is 50 mm + For Africa it is 200 mm + + + + + + Soil depth for 2nd layer: 1b + Minimum Soil Depth [mm] for lower soil layer + + + + + + Soil depth for 2nd layer: 2 + Minimum Soil Depth [mm] for lower soil layer 300 + + + + + + + + ************************************************************** + LAND USE RELATED MAPS AND TABLES + ************************************************************** + + + + + $(PathMapsLanduse)/fracsealed + urban area (0-1) + + + + + + stack of Direct Runoff fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracforest + forest fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of forest fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracwater + forest fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of water fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracother + forest fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of other fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracirrigated + irrigated area fraction of a pixel (0-1) + + + + + + $(PathMapsLandUseChange)/ + stack of Irrigation fraction maps (0-1) + + + + + + $(PathMapsLanduse)/fracDrained.map + drained fraction from irrigated area (0-1) + + + + + + rice fraction of a pixel (0-1) + + + + + + stack of rice fraction maps (0-1) + + + + + + groundwater used fraction of a pixel (0-1) + + + + + + NonConventionalWaterUsed (0-1) + + + + + + lake and reservoir water used, fraction of a pixel (0-1) + + + + + + $(PathMaps)/eflow.map + EFlowThreshold is map with m3/s discharge, e.g. the 10th percentile discharge of the baseline run + + + + + + table with crop coefficient for each land use; values ranging from 0.75 to 1.25; + source: Supit, p.83 CFET + + + + + + table with crop group number; table 6.1 and 6.2 in WOFOST 6.0, Supit, 1994: p. 86 + + + + + + $(PathMapsTables)/manngs_2000_250m.map + table with Manning's roughness [m^(1/3) s^(-1)] for each CORINE landcover class + + + + + + table with crop coefficient for each land use; values ranging from 0.75 to 1.25; + source: Supit, p.83 CFET + + + + + + table with crop group number; table 6.1 and 6.2 in WOFOST 6.0, Supit, 1994: p. 86 + + + + + + $(PathMapsTables)/manngs_2000_250m.map + table with Manning's roughness [m^(1/3) s^(-1)] for each CORINE landcover class + + + + + + + + ************************************************************** + Variable Channel NoSubStepChannel + ************************************************************** + + + + + UpArea do be included in max. celerity + + + + + + variable Number of sub steps for the kinematic wave routing + + + + + ************************************************************** + CHANNEL MAPS + ************************************************************** + + + + + Boolean map with value 1 at channel pixels and 0 at + all other pixels + IMPORTANT: IF NON-CHANNEL PIXELS HAVE MISSING VALUES + THEN THIS MAY RESULT IN INCORRECT RESULTS + + + + + + Channel gradient (fraction, dy/dx) + + + + + + Channel Manning's n [m^(1/3) s^(-1)] + + + + + + Channel length [m] + + + + + + Channel bottom width [m] + + + + + + Channel side slope, expressed as gradient + !! expressed as dx/dy !!! (NOT dy/dx, which would perhaps be more logical) + + + + + + Floodplain Width [m] + + + + + + Bankfull channel depth [m] + + + + + + + + ************************************************************** + TABLES WITH TOPSOIL SOIL PHYSICAL PARAMETERS (HYPRES) + Each parameter is defined for upper (1a and 1b) and + lower (2) soil layers + ************************************************************** + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 1b (upper soil layer) + + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 2 (lower soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1b (upper soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 2 (lower soil layer) + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1a (superficial soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1b (upper soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 2 (lower soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1a (superficial soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1b (upper soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 2 (lower soil layer) + + + + + + + + ************************************************************** + TABLES WITH TOPSOIL SOIL PHYSICAL PARAMETERS (HYPRES) for Forest + Each parameter is defined for 1a and 1b + Normal parameter is taken for the lower soil layer + ************************************************************** + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Soil moisture content at saturation [V/V] [mm3/mm3] + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1a (superficial soil layer) + + + + + + Residual soil moisture content [V/V] [mm3/mm3] for soil layer 1b (upper soil layer) + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) for soil layer 1a (superficial soil layer) + Lambda is acually 1-n [-] for soil layer 1b (upper soil layer) + + + + + + Pore-size index (Van Genuchten m and n are calculated from this) + Lambda is acually 1-n [-] for soil layer 1b (upper soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1a (superficial soil layer) + + + + + + Van Genuchten parameter Alpha [1/cm] for soil layer 1b (upper soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1a (superficial soil layer) + + + + + + Saturated conductivity [mm/day] for soil layer 1b (upper soil layer) + + + + + + + + ************************************************************** + RESERVOIRS (if used ) + Input maps + ************************************************************** + + + + + Sub time step used for reservoir simulation [s]. Within the model, + the smallest out of DtSecReservoirs and DtSec is used. + + + + + + Map with location of reservoirs (number) + + + + + + Initial reservoir storage (fraction) + + + + + + Input tables + + + + + Total reservoir storage capacity + Units: m³ + + + + + + Reservoir inflow associated with the 100-year return period. + It is modified by a calibration parameter (`ReservoirFloodOutflowFactor`) to + define the inflow above which the reservoir switches to flood control mode + Units: m³/s + + + + + + NReservoir average inflow used to define the normal reservoir release + Units: m³/s + + + + + + Minimum reservoir release: + Units: m³/s + + + + + Output time series + + + + + name of output TSS file with Reservoir Inflow + + + + + + name of output TSS file with Reservoir Outflow + + + + + + name of output TSS file with Reservoir Filling + + + + + + name of output TSS file with Reservoir storage [m3] + + + + + + + name of output map(s) with Reservoir Filling + + + + + + Fraction of the total reservoir storage above which the reservoirs enters + the flood control zone. + + + + + + Factor of the 100-year return inflow that defines a flood event, i.e., the + reservoir routine switches to flood control mode. + + + + + + + + ************************************************************** + LAKES (if used ) + Input maps + ************************************************************** + + + + + Map with location of lakes + + + + + + Initial lake level [m] + -9999 sets initial value to steady-state level + + + + + + Lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value + + + + + + Estimate of average net inflow into lake (=inflow - evaporation) [m3 / s] + Used to calculated steady-state lake level in case LakeInitialLevelValue + is set to -9999 + + + + + Input tables + + + + + Lake surface area [m2] + + + + + + Lake parameter A [m/s] + + + + + + Multiplier applied to the lake parameter A + + + + + Output time series + + + + + Output timeseries file with lake inflow [m3 /s] + + + + + + Output timeseries file with lake outflow [m3 /s] + + + + + + Output timeseries file with lake level [m] + + + + + + Output map(s) with lake level [m] + + + + + + Output map with lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value equal to PrevDischarge (ChanQ(t)) + + + + + + Output map with lake outflow at previous routing sub-step (ChanQ(t-1)) [m3/s] + -9999 sets initial value + + + + + + + + ************************************************************** + POLDERS(if used) + ************************************************************** + + + + + + Weir constant (fixed) [-] + + + + + + Map with polder locations + + + + + + Initial water level in polders [m] + + + + + + Polder maximum storage capacity [cu m] + + + + + + Area of polder [sq m] + + + + + + Width of polder outlet/inlet [m] + + + + + + Polder bottom level, measured from channel bottom [m] + + + + + + Time step at which polder opens in case of regulated polder (use bogus value of -9999 in table in case of unregulated polder) + + + + + + Time step at which water stored in polder is released again(use bogus value of -9999 in table in case of unregulated polder) + + + + + + name of output TSS file with polder flux [cu m / s]. Positive for flow from channel to polder, negative for polder to channel + + + + + + name of output TSS file with polder level [m] + + + + + + name of output map(s) with polder level + + + + + + + + ************************************************************** + INFLOW HYDROGRAPH (if used) + ************************************************************** + + + + + OPTIONAL: nominal map with locations of (measured) + inflow hydrographs + + + + + + location of calibration points + OPTIONAL: nominal map with locations of calibration points + + + + + + Observed or simulated input hydrographs as + time series [m3 / s] + Note that identifiers in time series correspond to + InflowPoints map (also optional) + + + + + + + + ************************************************************** + DYNAMIC WAVE(if used) + ************************************************************** + + + + + Critical Courant number for dynamic wave + value between 0-1 (smaller values result in greater numerical accuracy, + but also increase computational time) + + + + + + Constant head [m] at most downstream pixel (relative to altitude + at most downstream pixel) + + + + + + Boolean map with value 1 at channel pixels where dynamic wave is + used, and 0 at all other pixels + + + + + + Channel bottom level [m] + + + + + + Nominal map with channel cross section IDs + + + + + + Table with cross section parameters (H,A,P) + + + + + + + + ************************************************************** + MUSKINGUM-CUNGE-TODINI OPTION + ************************************************************** + + + + + Boolean map with value 1 at channel pixels where MCT is + used, and 0 at all other pixels + + + + + + Maximum channel gradient for channels using MCT routing [-] (for MCT wave: slope cannot be >0.001) + + + + + + + + ************************************************************** + PF REPORTING (if used) + ************************************************************** + + + + PF PARAMETERS + + + + + Maximum capillary head [cm]. This value is used if Theta equals residual soil + moisture content (value of HeadMax is arbitrary). Only needed for pF computation, + otherwise doesn't influence model results at all) + + + + + PF MAPS + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + PF TIMESERIES, VALUES AT SITES + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + PF TIMESERIES, AVERAGE VALUES UPSTREAM OF GAUGES + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + Reported pF upper soil layer [-] + + + + + + Reported pF lower soil layer [-] + + + + + + + + ************************************************************** + Ad'a addition + ************************************************************** + + + + + threshold value below which there is no outflow to the channel [mm] + + + + + + length of the window used to smooth the LZ zone [number of cells] + + + + + + map of aquifers (0/1), used to smoothen LZ near extraction areas + + + + + + + + ************************************************************** + Water demand output maps + ************************************************************** + + + + + day of the year when the yearly endcalculation is done e.g. 31/10/xxxx = 304 + + + + + + + TotalAbstractionFromGroundwater [mm] + + + + + + TotalAbstractionFromSurfaceWater [mm] + + + + + + TotalAbstractionFromSurfaceWater [mm] summed up for water regions + + + + + + Total Abstraction From SurfaceWater and Groundwater [mm] summed up for water regions, montly values + + + + + + TotalPaddyRiceIrrigationAbstraction [m3] + + + + + + Water Exploitation Index - Consumption; for water regions (this is the official EU WEI+): consumption / internal and external availability + + + + + + Water Exploitation Index - Abstraction; for water regions: abstraction / internal and external availability + + + + + + Water Exploitation Index - Demand; for water regions: demand / internal and external availability + + + + + + Water Exploitation Index - Consumption; for water regions + + + + + + Internal available water + + + + + + External available water + + + + + + Region Water Consumption + + + + + + Region Water Consumption + + + + + + Reservoir and Lake storage in m3 at end of month + + + + + + Reservoir and Lake abstraction in m3 + + + + + + Irrigation water shortage in m3 for month + + + + + + Surface water availability in m3 for potential irrigation for each day + + + + + + Monthly evapotranspiration deficit in mm + + + + + + Monthly evapotranspiration deficit in mm + + + + + + Monthly evapotranspiration deficit in mm + + + + + + Monthly Water Dependency Index (0-1) (De Roo 2015) + WDI = Upstream Inflow Actually Used / Total Water Demand + Values close to 1 give extreme dependency on upstream water + + + + + + Monthly Water Security Index (0-1) (De Roo 2015) + WSI = Upstream Inflow Actually Used / Upstream Inflow Available + Values close to 1 give extreme vulnerability to upstream water + + + + + + Monthly Water Sustainability Index (0-1) (De Roo 2015) + WTI = 1-SurfaceWaterDeficit / TotalWaterDemand + Values of 1 indicate complete sustainable conditions, no water deficit + Values less than 1 indicate that considerable deep groundwater resources or desalinated water is used + + + + + + Monthly Falkenmark 1 Index (tochanm3) + + + + + + Monthly Falkenmark 2 Index (tochanm3+reservoirlakeabstraction) + + + + + + Monthly Falkenmark 3 Index (tochanm3+reservoirlakeabstraction+externalinflow) + + + + + + + Abstraction from groundwater in m3 per timestep + + + + + + Abstraction from surface water in m3 per timestep + + + + + + Region abstraction from surface water in m3 per timestep + + + + + + Region Total Abstraction From Lakes and Reservoirs in m3, per timestep + + + + + + Lake Abstraction per timestep in m3 + + + + + + ReservoirAbstraction per timestep in M3 + + + + + + ReservoirStorage in M3 + + + + + + LakeStorage in M3 + + + + + + AreatotalIrrigationUseM3 + + + + + + FractionAbstractedFromChannels + + + + + + EFlowIndicator (1 on day with ChanQ smaller than EflowThreshold, 0 on normal days) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ************************************************************** + Peter's addition + ************************************************************** + + + + + + [mm] + + + + + + [mm] + + + + + + [mm] + + + + + + + + + + areamap MaskMap; + timer StepStart StepEnd 1; + ReportSteps=$(ReportSteps); + + + + + diff --git a/tests/test_mct_warmstart_calib.py b/tests/test_mct_warmstart_calib.py new file mode 100644 index 00000000..eed3faba --- /dev/null +++ b/tests/test_mct_warmstart_calib.py @@ -0,0 +1,250 @@ +""" + +Copyright 2019-2020 European Union + +Licensed under the EUPL, Version 1.2 or as soon they will be approved by the European Commission subsequent versions of the EUPL (the "Licence"); + +You may not use this work except in compliance with the Licence. +You may obtain a copy of the Licence at: + +https://joinup.ec.europa.eu/sites/default/files/inline-files/EUPL%20v1_2%20EN(1).txt + +Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the Licence for the specific language governing permissions and limitations under the Licence. + +""" + +from __future__ import absolute_import +import os +import shutil +from datetime import datetime, timedelta +import glob + +import pytest + +from lisfloodutilities.compare.nc import NetCDFComparator +from lisfloodutilities.compare.pcr import TSSComparator + +from lisflood.main import lisfloodexe + +from .test_utils import setoptions, mk_path_out + + +class TestWarmStart(): + + case_dir = os.path.join(os.path.dirname(__file__), 'data', 'LF_MCT_UseCase') + + settings_files = { + 'cold': os.path.join(case_dir, 'settings', 'mct_cold_interface.xml'), + 'warm': os.path.join(case_dir, 'settings', 'mct_warm_interface.xml'), + 'warm_endmaps': os.path.join(case_dir, 'settings', 'mct_warm_endmaps_interface.xml') + } + + def test_mct_only_warmstart_daily_using_end_maps(self): + calendar_day_start = '02/01/1990 06:00' + step_start = '02/01/2016 06:00' + step_end = '31/03/2016 06:00' + dt_sec = 86400 + dt_sec_channel = 86400 + report_steps = '9496..9861' + self.run_warmstart_by_dtsec('mct_endmaps', dt_sec, dt_sec_channel, step_end, step_start, calendar_day_start, report_steps=report_steps) + + def test_mct_only_warmstart_daily(self): + calendar_day_start = '02/01/1990 06:00' + step_start = '02/01/2016 06:00' + step_end = '31/03/2016 06:00' + dt_sec = 86400 + dt_sec_channel = 86400 + report_steps = '9496..9861' + self.run_warmstart_by_dtsec('mct', dt_sec, dt_sec_channel, step_end, step_start, calendar_day_start, report_steps=report_steps) + + def test_mct_and_reservoirs_warmstart_daily(self): + calendar_day_start = '02/01/1990 06:00' + step_start = '02/01/2016 06:00' + step_end = '31/03/2016 06:00' + dt_sec = 86400 + dt_sec_channel = 86400 + report_steps = '9496..9861' + self.run_warmstart_by_dtsec('mct_reservoirs', dt_sec, dt_sec_channel, step_end, step_start, calendar_day_start, report_steps=report_steps) + + def test_mct_and_lakes_warmstart_daily(self): + calendar_day_start = '02/01/1990 06:00' + step_start = '02/01/2016 06:00' + step_end = '31/03/2016 06:00' + dt_sec = 86400 + dt_sec_channel = 3600 + report_steps = '9496..9861' + self.run_warmstart_by_dtsec('mct_lakes', dt_sec, dt_sec_channel, step_end, step_start, calendar_day_start, report_steps=report_steps) + + def test_mct_only_warmstart_6h(self): + calendar_day_start = '02/01/1990 06:00' + step_start = '01/03/2016 06:00' + step_end = '31/05/2016 06:00' + dt_sec = 21600 + dt_sec_channel = 3600 + report_steps = '38220..38830' + self.run_warmstart_by_dtsec('mct', dt_sec, dt_sec_channel, step_end, step_start, calendar_day_start, report_steps=report_steps) + + def test_mct_and_reservoirs_warmstart_6h(self): + calendar_day_start = '02/01/1990 06:00' + step_start = '01/03/2016 06:00' + step_end = '31/05/2016 06:00' + dt_sec = 21600 + dt_sec_channel = 3600 + report_steps = '38220..38830' + self.run_warmstart_by_dtsec('mct_reservoirs', dt_sec, dt_sec_channel, step_end, step_start, calendar_day_start, report_steps=report_steps) + + def test_mct_and_lakes_warmstart_6h(self): + calendar_day_start = '02/01/1990 06:00' + step_start = '01/03/2016 06:00' + step_end = '31/05/2016 06:00' + dt_sec = 21600 + dt_sec_channel = 3600 + report_steps = '38220..38830' + self.run_warmstart_by_dtsec('mct_lakes', dt_sec, dt_sec_channel, step_end, step_start, calendar_day_start, report_steps=report_steps) + + def run_warmstart_by_dtsec(self, mct_case, dt_sec, dt_sec_channel, step_end, step_start, calendar_day_start, report_steps='1..9999'): + + mk_path_out(os.path.join(self.case_dir, 'out')) + + check_every = 13 # steps + + self.path_out_reference = os.path.join(self.case_dir, 'out', 'longrun_reference{}'.format(dt_sec)) + + if mct_case == 'mct': + opts_to_set = ['repStateMaps','TransLoss','MCTRoutingInterface','simulateCalibrationPoints'] + opts_to_unset = ['repMBTs', 'simulateReservoirs', 'simulateLakes'] + warm_settings_file = 'warm' + if mct_case == 'mct_endmaps': + opts_to_set = ['repEndMaps','TransLoss','simulateCalibrationPoints','MCTRoutingInterface'] + opts_to_unset = ['repMBTs', 'simulateReservoirs', 'simulateLakes'] + warm_settings_file = 'warm_endmaps' + check_every = 0 # check only at the end + elif mct_case == 'mct_reservoirs': + opts_to_set = ['repStateMaps', 'simulateReservoirs','TransLoss','simulateCalibrationPoints','MCTRoutingInterface'] + opts_to_unset = ['repEndMaps','repMBTs', 'simulateLakes'] + warm_settings_file = 'warm' + elif mct_case == 'mct_lakes': + opts_to_set = ['repStateMaps', 'simulateLakes','openwaterevapo','TransLoss','simulateCalibrationPoints','MCTRoutingInterface'] + opts_to_unset = ['repEndMaps','repMBTs', 'simulateReservoirs'] + warm_settings_file = 'warm' + + settings_longrun = setoptions(self.settings_files['cold'], + opts_to_set=opts_to_set, + opts_to_unset=opts_to_unset, + vars_to_set={'StepStart': step_start, + 'StepEnd': step_end, + 'CalendarDayStart': calendar_day_start, + 'PathOut': self.path_out_reference, + 'ReportSteps': report_steps, + 'DtSec': dt_sec, + 'DtSecChannel': dt_sec_channel, + 'ChannelsMCT' : '$(PathRoot)/maps/chanmct_conf', + 'ChanGradMaxMCT': '0.00005', + 'CalChanMan3': '5.0', + 'CalibrationPoints': "$(PathRoot)/maps/inflow.nc", + 'TransSub': 0.3}) + # ** execute + mk_path_out(self.path_out_reference) + lisfloodexe(settings_longrun) + + + # warm run (1. Cold start) + run_number = 1 + cold_start_step_end = step_start + + self.path_out = os.path.join(self.case_dir, 'out', 'run{}_{}'.format(dt_sec, run_number)) + + settings_coldstart = setoptions(self.settings_files['cold'], + opts_to_set=opts_to_set, + opts_to_unset=opts_to_unset, + vars_to_set={'StepStart': step_start, + 'StepEnd': cold_start_step_end, + 'CalendarDayStart': calendar_day_start, + 'PathOut': self.path_out, + 'ReportSteps': report_steps, + 'DtSec': dt_sec, + 'DtSecChannel': dt_sec_channel, + 'ChannelsMCT': '$(PathRoot)/maps/chanmct_conf', + 'ChanGradMaxMCT': '0.00005', + 'CalChanMan3': '5.0', + 'CalibrationPoints': "$(PathRoot)/maps/inflow.nc", + 'TransSub': 0.3}) + # ** execute + mk_path_out(self.path_out) + lisfloodexe(settings_coldstart) + + # warm run (2. single step warm start/stop with initial conditions from previous run) + prev_settings = settings_coldstart + warm_step_start = prev_settings.step_end_dt + timedelta(seconds=dt_sec) + warm_step_end = warm_step_start + timestep_init = prev_settings.step_end_dt.strftime('%d/%m/%Y %H:%M') + + # run only 5*13 steps to speed up computation + # checking 5 steps every 'check_every' steps + # need to run 5*check_every steps in total + if check_every > 0: + step_limit = warm_step_start + 5*check_every*timedelta(seconds=dt_sec) + else: + step_limit = settings_longrun.step_end_dt + print('running until {}'.format(step_limit)) + + nc_comparator = NetCDFComparator(settings_longrun.maskpath) + tss_comparator = TSSComparator(array_equal=True) + settings_warmstart = None + while warm_step_start <= step_limit: + run_number += 1 + path_init = prev_settings.output_dir + self.path_out = (os.path.join(self.case_dir, 'out', 'run{}_{}'.format(dt_sec, run_number))) + + settings_warmstart = setoptions(self.settings_files[warm_settings_file], + opts_to_set=opts_to_set, + opts_to_unset=opts_to_unset, + vars_to_set={'StepStart': warm_step_start.strftime('%d/%m/%Y %H:%M'), + 'StepEnd': warm_step_end.strftime('%d/%m/%Y %H:%M'), + 'CalendarDayStart': calendar_day_start, + 'PathOut': self.path_out, + 'PathInit': path_init, + 'timestepInit': timestep_init, + 'ReportSteps': report_steps, + 'DtSec': dt_sec, + 'DtSecChannel': dt_sec_channel, + 'ChannelsMCT': '$(PathRoot)/maps/chanmct_conf', + 'ChanGradMaxMCT': '0.00005', + 'CalChanMan3': '5.0', + 'CalibrationPoints': "$(PathRoot)/maps/inflow.nc", + 'TransSub': 0.3}) + # ** execute + mk_path_out(self.path_out) + lisfloodexe(settings_warmstart) + + # checking values at current timestep (using datetime) + if (check_every > 0) and not (run_number % check_every): + # ****** compare ******* + # compare every 13 timesteps to speed up test + timestep_dt = settings_warmstart.step_end_dt # NetCDFComparator takes datetime.datetime as timestep + timestep = settings_warmstart.step_end_int + nc_comparator.compare_dirs(self.path_out, self.path_out_reference, timestep=timestep_dt) + tss_comparator.compare_dirs(self.path_out, self.path_out_reference, timestep=timestep) + + # setup for next warm start/stop + prev_settings = settings_warmstart + warm_step_start = prev_settings.step_end_dt + timedelta(seconds=dt_sec) + warm_step_end = warm_step_start + timestep_init = prev_settings.step_end_dt.strftime('%d/%m/%Y %H:%M') + + # check at the end of the whole period on the last path_out when check_every is zero + if check_every == 0: + timestep_dt = settings_warmstart.step_end_dt # NetCDFComparator takes datetime.datetime as timestep + timestep = settings_warmstart.step_end_int + nc_comparator.compare_dirs(self.path_out, self.path_out_reference, timestep=timestep_dt) + tss_comparator.compare_dirs(self.path_out, self.path_out_reference, timestep=timestep) + + + def teardown_method(self): + print('Cleaning directories') + folders_list = glob.glob(os.path.join(os.path.dirname(__file__), self.case_dir, 'out/run*')) + \ + glob.glob(os.path.join(os.path.dirname(__file__), self.case_dir, 'out/longrun_reference*')) + for folder in folders_list: + shutil.rmtree(folder) \ No newline at end of file From 03f0ab51346b93f8bc7dbe721716c0d648af9577 Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Wed, 27 May 2026 17:33:29 +0000 Subject: [PATCH 34/35] Renamed the test --- tests/test_mct_warmstart_calib.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_mct_warmstart_calib.py b/tests/test_mct_warmstart_calib.py index eed3faba..35bee7a9 100644 --- a/tests/test_mct_warmstart_calib.py +++ b/tests/test_mct_warmstart_calib.py @@ -31,7 +31,7 @@ from .test_utils import setoptions, mk_path_out -class TestWarmStart(): +class TestWarmStartMCTcalib(): case_dir = os.path.join(os.path.dirname(__file__), 'data', 'LF_MCT_UseCase') @@ -41,7 +41,7 @@ class TestWarmStart(): 'warm_endmaps': os.path.join(case_dir, 'settings', 'mct_warm_endmaps_interface.xml') } - def test_mct_only_warmstart_daily_using_end_maps(self): + def test_mctcal_only_warmstart_daily_using_end_maps(self): calendar_day_start = '02/01/1990 06:00' step_start = '02/01/2016 06:00' step_end = '31/03/2016 06:00' @@ -50,7 +50,7 @@ def test_mct_only_warmstart_daily_using_end_maps(self): report_steps = '9496..9861' self.run_warmstart_by_dtsec('mct_endmaps', dt_sec, dt_sec_channel, step_end, step_start, calendar_day_start, report_steps=report_steps) - def test_mct_only_warmstart_daily(self): + def test_mctcal_only_warmstart_daily(self): calendar_day_start = '02/01/1990 06:00' step_start = '02/01/2016 06:00' step_end = '31/03/2016 06:00' @@ -59,7 +59,7 @@ def test_mct_only_warmstart_daily(self): report_steps = '9496..9861' self.run_warmstart_by_dtsec('mct', dt_sec, dt_sec_channel, step_end, step_start, calendar_day_start, report_steps=report_steps) - def test_mct_and_reservoirs_warmstart_daily(self): + def test_mctcal_and_reservoirs_warmstart_daily(self): calendar_day_start = '02/01/1990 06:00' step_start = '02/01/2016 06:00' step_end = '31/03/2016 06:00' @@ -68,7 +68,7 @@ def test_mct_and_reservoirs_warmstart_daily(self): report_steps = '9496..9861' self.run_warmstart_by_dtsec('mct_reservoirs', dt_sec, dt_sec_channel, step_end, step_start, calendar_day_start, report_steps=report_steps) - def test_mct_and_lakes_warmstart_daily(self): + def test_mctcal_and_lakes_warmstart_daily(self): calendar_day_start = '02/01/1990 06:00' step_start = '02/01/2016 06:00' step_end = '31/03/2016 06:00' @@ -77,7 +77,7 @@ def test_mct_and_lakes_warmstart_daily(self): report_steps = '9496..9861' self.run_warmstart_by_dtsec('mct_lakes', dt_sec, dt_sec_channel, step_end, step_start, calendar_day_start, report_steps=report_steps) - def test_mct_only_warmstart_6h(self): + def test_mctcal_only_warmstart_6h(self): calendar_day_start = '02/01/1990 06:00' step_start = '01/03/2016 06:00' step_end = '31/05/2016 06:00' @@ -86,7 +86,7 @@ def test_mct_only_warmstart_6h(self): report_steps = '38220..38830' self.run_warmstart_by_dtsec('mct', dt_sec, dt_sec_channel, step_end, step_start, calendar_day_start, report_steps=report_steps) - def test_mct_and_reservoirs_warmstart_6h(self): + def test_mctcal_and_reservoirs_warmstart_6h(self): calendar_day_start = '02/01/1990 06:00' step_start = '01/03/2016 06:00' step_end = '31/05/2016 06:00' @@ -95,7 +95,7 @@ def test_mct_and_reservoirs_warmstart_6h(self): report_steps = '38220..38830' self.run_warmstart_by_dtsec('mct_reservoirs', dt_sec, dt_sec_channel, step_end, step_start, calendar_day_start, report_steps=report_steps) - def test_mct_and_lakes_warmstart_6h(self): + def test_mctcal_and_lakes_warmstart_6h(self): calendar_day_start = '02/01/1990 06:00' step_start = '01/03/2016 06:00' step_end = '31/05/2016 06:00' From 3d66c61e188212d504a0802f2e6b33d652f1628c Mon Sep 17 00:00:00 2001 From: Cinzia Mazzetti Date: Wed, 3 Jun 2026 13:12:50 +0000 Subject: [PATCH 35/35] Cleaning up --- src/lisflood/Lisflood_dynamic.py | 1 - src/lisflood/Lisflood_initial.py | 14 +- src/lisflood/global_modules/add1.py | 16 +- src/lisflood/global_modules/checkers.py | 2 +- src/lisflood/global_modules/netcdf.py | 10 +- src/lisflood/global_modules/settings.py | 8 +- src/lisflood/global_modules/stateVar.py | 2 +- src/lisflood/hydrological_modules/mct.py | 44 ++-- .../hydrological_modules/mctconfluence.py | 27 +-- .../hydrological_modules/mctheadwater.py | 189 ------------------ src/lisflood/hydrological_modules/routing.py | 24 +-- src/lisflood/hydrological_modules/soil.py | 2 +- .../hydrological_modules/surface_routing.py | 8 +- .../hydrological_modules/waterabstraction.py | 4 +- .../hydrological_modules/waterbalance.py | 1 - src/lisflood/main.py | 2 +- .../mct_cold_for_results_generation.xml | 40 ++-- 17 files changed, 87 insertions(+), 307 deletions(-) delete mode 100755 src/lisflood/hydrological_modules/mctheadwater.py diff --git a/src/lisflood/Lisflood_dynamic.py b/src/lisflood/Lisflood_dynamic.py index 022475ce..f12c64fb 100644 --- a/src/lisflood/Lisflood_dynamic.py +++ b/src/lisflood/Lisflood_dynamic.py @@ -239,7 +239,6 @@ def splitlanduse(array1, array2=None, array3=None): #self.DischargeM3Out += np.where(self.AtLastPointC ,self.ChanQ * self.DtSec,0) self.DischargeM3Out += np.where(self.AtLastPointC, self.ChanQAvg * self.DtSec, 0) # Cumulative outflow out of map - # cmcheck - we should use ChanQAvg here not ChanQ # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Calculate water level diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py index 314b3171..e77b418b 100644 --- a/src/lisflood/Lisflood_initial.py +++ b/src/lisflood/Lisflood_initial.py @@ -49,7 +49,6 @@ from .hydrological_modules.surface_routing import surface_routing from .hydrological_modules.reservoir import Reservoir from .hydrological_modules.lakes import lakes -from .hydrological_modules.mctheadwater import mctheadwater from .hydrological_modules.mctconfluence import mctconfluence from .hydrological_modules.polder import polder from .hydrological_modules.waterabstraction import waterabstraction @@ -140,7 +139,6 @@ def __init__(self): self.surface_routing_module = surface_routing(self) self.reservoir_module = Reservoir(self) # get_reservoir(option['reservoirHanazaki']) self.lakes_module = lakes(self) - # self.mctheadwater_module = mctheadwater(self) self.mctconfluence_module = mctconfluence(self) self.polder_module = polder(self) self.waterabstraction_module = waterabstraction(self) @@ -219,8 +217,6 @@ def __init__(self): # Structures such as reservoirs and lakes are modelled by interrupting the channel flow paths # At this point LddKinematic and LddChan have pits upstream of (structures) reservoirs and lakes - # self.mctheadwater_module.initial() - # # initialising MCT headwater pixels and adding pixels upstream of MCT headwater to the LDD if option.get('MCTRoutingInterface'): self.mctconfluence_module.initial() # initialising MCT confluence points and adding MCT confluence sinks to the LDD @@ -233,23 +229,15 @@ def __init__(self): self.surface_routing_module.initialSecond() - # MCT confluence must be in the LddKinematic when I get here + # MCT confluence must be in the LddKinematic at this point self.routing_module.initialKinematicWave() if option.get('MCTRouting'): self.routing_module.initialMCT() # initialising Muskingum-Cunge-Todini routing for channel if option.get('MCTRoutingInterface'): - # self.mctheadwater_module.dynamic_init() self.mctconfluence_module.dynamic_init() - # self.routing_module.initialKinematicWave() - # this cannot be here because I need river_router in the MCT initialization - - - - - self.evapowater_module.initial() self.riceirrigation_module.initial() self.waterabstraction_module.initial() diff --git a/src/lisflood/global_modules/add1.py b/src/lisflood/global_modules/add1.py index 76237671..97245f13 100755 --- a/src/lisflood/global_modules/add1.py +++ b/src/lisflood/global_modules/add1.py @@ -183,7 +183,7 @@ def loadsetclone(name): # settings x is first # setclone row col cellsize xupleft yupleft try: - setclone(int(coord[1]), int(coord[0]), float(coord[2]), float(coord[3]), float(coord[4])) # CM: pcraster + setclone(int(coord[1]), int(coord[0]), float(coord[2]), float(coord[3]), float(coord[4])) # pcraster except: rem = "["+str(coord[0])+" "+ str(coord[1])+" "+ str(coord[2])+" "+ str(coord[3])+" "+str(coord[4])+"]" msg = "Maskmap: " + rem + \ @@ -357,7 +357,7 @@ def loadmap_base(name, pcr=False, lddflag=False, timestampflag='exact', averagey :param name: name of key in Settings.xml input file containing path and name of the map file (as string) :param pcr: flag for output maps in pcraster format - :param lddflag: flag for local drain direction map (CM??) + :param lddflag: flag for local drain direction map :param timestampflag: look for exact time stamp in netcdf file ('exact') or for the closest (left) time stamp available ('closest') :param averageyearflag: if True, use "average year" netcdf file over the entire model simulation period :param force_load_with_nans: if True, loads the map without checking for nan values inside area Map. @@ -709,11 +709,11 @@ def readnetcdf(name, time, timestampflag='exact', averageyearflag=False): t_steps = nf1.variables['time'][:] # get values for timesteps ([ 0., 24., 48., 72., 96.]) t_unit = nf1.variables['time'].units # get unit (u'hours since 2015-01-01 06:00:00') t_cal = get_calendar_type(nf1) - # CM: get year from time unit in case average year is used + # get year from time unit in case average year is used if averageyearflag: - # CM: get date of the first step in netCDF file containing average year values + # get date of the first step in netCDF file containing average year values first_date = num2date(t_steps[0], t_unit, t_cal) - # CM: get year of the first step in netCDF file containing average year values + # get year of the first step in netCDF file containing average year values t_ref_year = first_date.year settings = LisSettings.instance() binding = settings.binding @@ -733,7 +733,7 @@ def readnetcdf(name, time, timestampflag='exact', averageyearflag=False): try: currentDate = currentDate.replace(year=t_ref_year) except: - # CM: if simulation year is leap and average year is not, switch 29/2 with 28/2 + # if simulation year is leap and average year is not, switch 29/2 with 28/2 currentDate = currentDate.replace(day=28) currentDate = currentDate.replace(year=t_ref_year) @@ -747,9 +747,9 @@ def readnetcdf(name, time, timestampflag='exact', averageyearflag=False): msg = "Date " + str(currentDate) + " not stored in " + filename raise LisfloodError(msg) elif (timestampflag == 'closest'): - # CM: get the closest value + # get the closest value current_ncdf_step_new = takeClosest(t_steps, current_ncdf_step) - # CM: set current_ncdf_step to the closest available time step in netCDF file + # set current_ncdf_step to the closest available time step in netCDF file current_ncdf_step = current_ncdf_step_new # get index of timestep in netCDF file corresponding to current simulation date diff --git a/src/lisflood/global_modules/checkers.py b/src/lisflood/global_modules/checkers.py index 4e88038c..058e667b 100755 --- a/src/lisflood/global_modules/checkers.py +++ b/src/lisflood/global_modules/checkers.py @@ -26,7 +26,7 @@ from ..hydrological_modules import (surface_routing, evapowater, snow, routing, leafarea, inflow, waterlevel, waterbalance, wateruse, waterabstraction, lakes, riceirrigation, indicatorcalc, landusechange, frost, groundwater, miscInitial, soilloop, soil, - reservoir, transmission, mctheadwater, mctconfluence) + reservoir, transmission, mctconfluence) class ModulesInputs: diff --git a/src/lisflood/global_modules/netcdf.py b/src/lisflood/global_modules/netcdf.py index bb7d7cdb..6e25fe24 100644 --- a/src/lisflood/global_modules/netcdf.py +++ b/src/lisflood/global_modules/netcdf.py @@ -530,8 +530,8 @@ def write_netcdf_header(settings, # time coordinates and associated values if frequency is not None: # output file with "time" dimension n_steps = len(rep_steps) - #Get initial and final dates for data to be stored in nerCDF file - # CM: Create time stamps for each step stored in netCDF file + # Get initial and final dates for data to be stored in nerCDF file + # Create time stamps for each step stored in netCDF file all_dates = np.array([start_date + datetime.timedelta(days=(int(d)-1)*DtDay) for d in rep_steps]) all_steps = np.array(rep_steps) if frequency == "all": @@ -556,16 +556,16 @@ def write_netcdf_header(settings, time = nf1.createVariable('time', float, ('time')) time.standard_name = 'time' time.calendar = binding["calendar_type"] - # CM: select the time unit according to model time step + # select the time unit according to model time step DtDay_in_sec = DtDay * 86400 if DtDay_in_sec >= 86400: # Daily model time steps or larger time.units = 'days since %s' % start_date.strftime("%Y-%m-%d %H:%M:%S.0") elif DtDay_in_sec >= 3600 and DtDay_in_sec < 86400: - # CM: hours to days model time steps + # hours to days model time steps time.units = 'hours since %s' % start_date.strftime("%Y-%m-%d %H:%M:%S.0") elif DtDay_in_sec >= 60 and DtDay_in_sec <3600: - # CM: minutes to hours model time step + # minutes to hours model time step time.units = 'minutes since %s' % start_date.strftime("%Y-%m-%d %H:%M:%S.0") nf1.variables["time"][:] = date2num(time_stamps, time.units, time.calendar) diff --git a/src/lisflood/global_modules/settings.py b/src/lisflood/global_modules/settings.py index d60a93bd..9cfd2df0 100755 --- a/src/lisflood/global_modules/settings.py +++ b/src/lisflood/global_modules/settings.py @@ -507,7 +507,7 @@ def _out_dir(user_settings): else: pathout = pathout.replace(pathout[a1:a2 + 1], s2) - # CM: output folder + # output folder return pathout @staticmethod @@ -790,13 +790,13 @@ def inttodate(int_in, ref_date, binding=None): settings = LisSettings.instance() binding = settings.binding - # CM: get model time step as float form 'DtSec' in Settings.xml file + # get model time step as float form 'DtSec' in Settings.xml file DtSec = float(binding['DtSec']) - # CM: compute fraction of day corresponding to model time step as float + # compute fraction of day corresponding to model time step as float DtDay = DtSec / 86400. # Time step, expressed as fraction of day (same as self.var.DtSec and self.var.DtDay) - # CM: compute date corresponding to intIn steps from reference date refDate + # compute date corresponding to intIn steps from reference date refDate stepDate = ref_date + datetime.timedelta(days=(int_in * DtDay)) return stepDate diff --git a/src/lisflood/global_modules/stateVar.py b/src/lisflood/global_modules/stateVar.py index ce17e659..704c6955 100755 --- a/src/lisflood/global_modules/stateVar.py +++ b/src/lisflood/global_modules/stateVar.py @@ -20,7 +20,7 @@ from .add1 import * -# CM: new-style class in Python 2.x +# new-style class in Python 2.x class stateVar(object): """ diff --git a/src/lisflood/hydrological_modules/mct.py b/src/lisflood/hydrological_modules/mct.py index 9678734e..c45cd38f 100644 --- a/src/lisflood/hydrological_modules/mct.py +++ b/src/lisflood/hydrological_modules/mct.py @@ -153,8 +153,6 @@ def mct_routing( ChanM3, # V11 channel storage volume at t+dt (instant) """ - - num_orders = mct_order_start_stop.shape[0] # loop on orders @@ -182,7 +180,7 @@ def mct_routing( ups_pix = upstream_pixels[ups_ix] # upstream pixel id ##################################################################################################### - # This is necessary for EFAS6/GloFAs5 calibration + # Check if there is a calibration point within the contributing pixels if np.any(CalibPointsIds == ups_pix): # this upstream pixel is a calibration point - add to sideflow ql += ChanQAvgDt[ups_pix] @@ -192,7 +190,6 @@ def mct_routing( q00 += ChanQ_0[ups_pix] # Inflow (x) to the pixel at previous step t (instant) q0m += ChanQAvgDt[ups_pix] # Average inflow (x) to the pixel at previous step t (average) q01 += ChanQ[ups_pix] # Inflow (x) at current step t+dt (instant) - ##################################################################################################### # get outflow from the pixel at previous step t @@ -264,8 +261,8 @@ def MCTRouting_single( # check for negative and zero discharge values # zero outflow is not allowed - if q11 < 0: # cmcheck <=0 #tpk - q11 = 0 #tpk + if q11 < 0: + q11 = 0 # calc reference discharge at time t # qm0 = (I(t)+O(t))/2 @@ -276,14 +273,14 @@ def MCTRouting_single( # reference I discharge at x=0 qmx0 = (q00 + q01) / 2.0 - if qmx0 <= eps : # cmcheck ==0 #tpk - qmx0 = eps #tpk + if qmx0 <= eps : + qmx0 = eps hmx0 = hoq(qmx0, s0, Balv, ANalv, Nalv) # reference O discharge at x=1 qmx1 = (q10 + q11) / 2.0 - if qmx1 <= eps: # cmcheck ==0 #tpk - qmx1 = eps #tpk + if qmx1 <= eps: + qmx1 = eps hmx1 = hoq(qmx1, s0, Balv, ANalv, Nalv) # Calc riverbed slope correction factor @@ -295,14 +292,13 @@ def MCTRouting_single( # Calc reference discharge time t+dt # Q(t+dt)=(I(t+dt)+O'(t+dt))/2 qm1 = (q01 + q11) / 2.0 - # cm - if qm1 <= eps : # cmcheck ==0 #tpk - qm1 = eps #tpk - # cm + if qm1 <= eps : + qm1 = eps + hm1 = hoq(qm1, s0, Balv, ANalv, Nalv) dummy, Ax1, Bx1, Px1, ck1 = qoh(hm1, s0, Balv, ANalv, Nalv) - if ck1 <= eps: #tpk - ck1 = eps #tpk + if ck1 <= eps: + ck1 = eps # Calc correcting factor Beta at time t+dt Beta1 = ck1 / (qm1 / Ax1) @@ -318,19 +314,18 @@ def MCTRouting_single( c3 = (1 - Cm0 + Dm0) / den * (Cm1 / Cm0) c4 = (2 * Cm1) / den - # cmcheck # Calc outflow q11 at time t+1 # Mass balance equation without lateral flow # q11 = c1 * q01 + c2 * q00 + c3 * q10 # Mass balance equation that takes into consideration the lateral flow q11 = c1 * q01 + c2 * q00 + c3 * q10 + c4 * ql - if q11 < 0: # cmcheck <=0 #tpk - q11 = 0 #tpk + if q11 < 0: + q11 = 0 #### end of for loop - # # cmcheck + # debug # calc_t = xpix / ck1 # if calc_t < dt: # print('xpix/ck1 < dt') @@ -348,17 +343,16 @@ def MCTRouting_single( V11 = (1 - Dm1) * dt / (2 * Cm1) * q01 + (1 + Dm1) * dt / (2 * Cm1) * q11 # V11 = k1 * (x1 * q01 + (1. - x1) * q11) # MUST be the same as above! - if V11 < 0 : #tpk - V11 = 0 #tpk + if V11 < 0 : + V11 = 0 - ### calc integration on the control volume (pixel) + # calc integration on the control volume (pixel) # calc average discharge outflow q1m for MCT channels during routing sub step dt # Calculate average outflow using water balance for MCT channel grid cell over sub-routing step q1mm = q0mm + ql + (V00 - V11) / dt - # cmcheck # q1m cannot be smaller than eps or it will cause instability - if q1mm < 0: # cmcheck <=0 + if q1mm < 0: q1mm = 0 ###if ql < 0: ql = 0 # prevent water abstraction or open water evaporation from drying out the channel and keep extracting water diff --git a/src/lisflood/hydrological_modules/mctconfluence.py b/src/lisflood/hydrological_modules/mctconfluence.py index 8352b695..0d413a7e 100755 --- a/src/lisflood/hydrological_modules/mctconfluence.py +++ b/src/lisflood/hydrological_modules/mctconfluence.py @@ -29,11 +29,9 @@ class mctconfluence(HydroModule): """ - Adds contribution from Kinematic cells to MCT cells as a lateral flow when MCT routing is enabled. - This is for MCT cells that have upstream contributions from both kinematic and MCT cells. - - This module handles the initialization and dynamic simulation of Kinematic to MCT cells confluence. - It injects side discharge to the downstream grid cell as lateral flow. + This module handles the initialization and dynamic simulation of the interface between Kinematic and MCT cells. + If MCT routing is enabled, when a Kinematic pixel flows into an MCT pixel, this module injects Kinematic channel + discharge to the MCT downstream grid cell as lateral flow. Attributes: ----------- @@ -44,7 +42,7 @@ class mctconfluence(HydroModule): initial(): Sets up the initial conditions and parameters for the simulation, including confluence locations. dynamic_inloop(NoRoutingExecuted: int): Performs dynamic calculations within the routing - loop to simulate the kinematic to MCT confluence. + loop to simulate the kinematic to MCT interface. """ module_name = 'MCTConfluence' @@ -87,7 +85,7 @@ def initial(self): # Mask of LddKinematic with only kinematic cells and no structures # Sinks are added at the last Kin pixel before confluence with MCT pixels - maskKinematic = (compressArray(LddKinematic) == 5) #& (self.var.IsUpsOfStructureKinematicC != 1) + maskKinematic = (compressArray(LddKinematic) == 5) # find location of KIN pixels (only) in LddKin that are upstream of the confluence with an MCT pixel maskKinematic[compressArray(self.var.AtLastPoint) == 1] = False @@ -98,7 +96,7 @@ def initial(self): self.var.LddChan = ifthenelse(maskKinematicPcr, 5, self.var.LddChan) self.var.LddKinematic = ifthenelse(maskKinematicPcr, 5, self.var.LddKinematic) # Adding sinks to Ldd at the last KIN pixels upstream of the confluence with an MCT pixel to LddChan and LddKinematic - # This similar to what is done in structures + # This is similar to what is done in structures # At this point LddChan and LddKinematic have sinks upstteam of structures and of a Kin-MCT confluence and outlets self.var.KinematicUpsOfMCTConfluence = np.where(maskKinematic, down, 0) @@ -117,7 +115,6 @@ def initial(self): self.var.MCTConfluenceSitesC = mctconfluence self.var.MCTConfluenceSitesCC = np.compress(mctconfluence > 0, mctconfluence) self.var.MCTConfluenceIndex = np.nonzero(mctconfluence)[0] - pass def dynamic_init(self): @@ -128,16 +125,15 @@ def dynamic_init(self): option = settings.options maskinfo = MaskInfo.instance() if option['MCTRouting'] and option['MCTRoutingInterface']: - lateralflow = np.bincount(self.var.KinematicUpsOfMCTConfluence, weights=self.var.ChanQAvgDt)[self.var.MCTConfluenceIndex] #same as Qin + lateralflow = np.bincount(self.var.KinematicUpsOfMCTConfluence, weights=self.var.ChanQAvgDt)[self.var.MCTConfluenceIndex] # contribution to the MCT pixel from upstream Kinematic pixels self.var.QInConfM3Old = maskinfo.in_zero() np.put(self.var.QInConfM3Old, self.var.MCTConfluenceIndex, lateralflow * self.var.DtSec) - pass def dynamic_inloop(self, NoRoutingExecuted: int): """ - Performs the dynamic simulation of MCT confluence within the routing loop. This method + Performs the dynamic simulation of Kin-MCT confluence within the routing loop. This method injects upstream discharge to the downstream grid cell as lateral inflow. Parameters: @@ -151,13 +147,8 @@ def dynamic_inloop(self, NoRoutingExecuted: int): option = settings.options maskinfo = MaskInfo.instance() - # self.var.QConfADDEDM3 = maskinfo.in_zero() - if option['MCTRouting'] and option['MCTRoutingInterface'] and not option['InitLisflood']: - InvDtSecDay = 1 / float(86400) - # InvDtSecDay=self.var.InvDtSec - lateralflow = np.bincount(self.var.KinematicUpsOfMCTConfluence, weights=self.var.ChanQAvgDt)[self.var.MCTConfluenceIndex] #same as Qin # contribution to the MCT pixel from upstream Kinematic pixels @@ -173,8 +164,6 @@ def dynamic_inloop(self, NoRoutingExecuted: int): self.var.QInConfM3Old = self.var.QInConfM3.copy() # save the lateral flow for next step - # self.var.QConfADDEDM3 += self.var.QConfM3Dt - diff --git a/src/lisflood/hydrological_modules/mctheadwater.py b/src/lisflood/hydrological_modules/mctheadwater.py deleted file mode 100755 index c6309048..00000000 --- a/src/lisflood/hydrological_modules/mctheadwater.py +++ /dev/null @@ -1,189 +0,0 @@ -""" - -Copyright 2019 European Union - -Licensed under the EUPL, Version 1.2 or as soon they will be approved by the European Commission -subsequent versions of the EUPL (the "Licence"); - -You may not use this work except in compliance with the Licence. -You may obtain a copy of the Licence at: - -https://joinup.ec.europa.eu/sites/default/files/inline-files/EUPL%20v1_2%20EN(1).txt - -Unless required by applicable law or agreed to in writing, -software distributed under the Licence is distributed on an "AS IS" basis, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the Licence for the specific language governing permissions and limitations under the Licence. - -""" - -from __future__ import print_function, absolute_import - -from pcraster import scalar, upstream -from pcraster import Scalar, numpy2pcr, pcr2numpy -from pcraster import downstream, boolean, cover, lddrepair, ifthenelse -from nine import range -import numpy as np -from ..global_modules.settings import LisSettings, MaskInfo -from ..global_modules.add1 import loadmap, compressArray, decompress, makenumpy -from ..global_modules.errors import LisfloodWarning -from . import HydroModule - - -class mctheadwater(HydroModule): - """ - Adds contribution from Kinematic cells to MCT cells as a lateral flow when MCT routing is enabled. - This is for MCT cells that have upstream contributions from both kinematic cells only. - - This module handles the initialization and dynamic simulation of MCT headwater cells. - It injects upstream discharge from kinematic cells to the downstream MCT grid cell as lateral flow. - - Attributes: - ----------- - var (object): An object containing all the variables used within the mctheadwater module. - - Methods: - -------- - initial(): Sets up the initial conditions and parameters for the simulation, - including headwater locations. - dynamic_inloop(NoRoutingExecuted: int): Performs dynamic calculations within the routing - loop to simulate the kinematic to MCT confluence. - """ - - module_name = 'MCTHeadwater' - - def __init__(self, mctheadwater_variable): - self.var = mctheadwater_variable - - def __init__(self, mctheadwater_variable): - """ - Initializes the MCT headwater module with a given variable object. - - Parameters: - ----------- - mctheadwater_variable: object - An object containing the variables needed for the MCT headwater simulation. - """ - - self.var = mctheadwater_variable - - def initial(self): - """ - Initiates the MCT headwater module by loading the necessary data and maps. - """ - - settings = LisSettings.instance() - option = settings.options - binding = settings.binding - maskinfo = MaskInfo.instance() - if option['MCTRouting']: - - UpStreamPcr = upstream(self.var.LddChan, scalar(self.var.IsChannelPcr)) - UpStream = pcr2numpy(UpStreamPcr, 0) - # identify all channel pixels that do not have any contributing pixel from upstream (head pixels) - - UpStreamMCTPcr = upstream(self.var.LddChan, scalar(self.var.IsChannelMCTPcr)) - UpStreamMCT = pcr2numpy(UpStreamMCTPcr, 0) - # identify all MCT pixels that do not have any contributing pixel from upstream (MCT head pixels) - - mctheadwater = (self.var.mctmask & (UpStreamMCT == 0) & (UpStream != 0)).astype(int) - # identify pixels in the MCT network that are head MCT pixels and are not general head pixels - - mctheadwaterPcr = numpy2pcr(Scalar, mctheadwater, 0) - - mctheadwater = compressArray(mctheadwaterPcr) - mctheadwater[np.isnan(mctheadwater)] = 0.0 - # flatten and add mask - - # mctheadwater[compressArray(self.var.AtLastPoint) == 1] = 0 - # # remove outlets points if any - - self.var.MCTHeadwaterSitesC = mctheadwater - self.var.MCTHeadwaterSitesCC = np.compress(mctheadwater > 0, mctheadwater) - self.var.MCTHeadwaterIndex = np.nonzero(mctheadwater)[0] - - # # Add MCT headwater locations to structures map - # # (used to modify LddKinematic and to calculate LddStructuresKinematic) - # self.var.IsStructureKinematic = np.where(self.var.MCTHeadwaterSitesC > 0, np.bool8(1), self.var.IsStructureKinematic) - # # Add reservoir locations to structures map (used to modify LddKinematic - # # and to calculate LddStructuresKinematic) - # self.var.IsStructureChan = np.where(self.var.MCTHeadwaterSitesC > 0, np.bool8(1), self.var.IsStructureChan) - # # Add reservoir locations to structures map (used to modify LddChan - # # and to calculate LddStructuresChan) - - # at this point, Ldd already have pits upstream of reservoirs and lakes - IsUpsOfMCTHeadwaterKinematic = downstream( #pcr map - self.var.LddKinematic, - cover(boolean(decompress(self.var.MCTHeadwaterSitesC)), boolean(0)) - ) - # Find location of pixels immediately upstream of an MCT Headwater pixel on the LddKinematic - - IsUpsOfMCTHeadwaterChan = downstream( #pcr map - self.var.LddChan, - cover(boolean(decompress(self.var.MCTHeadwaterSitesC)), boolean(0)) - ) - # Find location of pixels immediately upstream of a structure on the LddChan - - self.var.LddKinematic = lddrepair(ifthenelse(IsUpsOfMCTHeadwaterKinematic, 5, self.var.LddKinematic)) #pcr map - # Update LddKinematic by adding a pit in the pixel immediately upstream of a MCT headwater pixel - self.var.LddChan = lddrepair(ifthenelse(IsUpsOfMCTHeadwaterChan, 5, self.var.LddChan)) #pcr map - # Update LddChan by adding a pit in the pixel immediately upstream of a MCT headwater pixel - - - def dynamic_init(self): - """ Initialization of the dynamic part of the MCT headwater module - init mct headwater before sub step routing - """ - settings = LisSettings.instance() - option = settings.options - if option['MCTRouting']: - self.var.QInHeadM3Old = np.where(self.var.MCTHeadwaterSitesC > 0, self.var.ChanQAvgDt * self.var.DtSec, 0) # self.var.QInM3Old - - - def dynamic_inloop(self, NoRoutingExecuted: int): - """ - Performs the dynamic simulation of MCT headwater within the routing loop. This method - injects upstream discharge to the downstream grid cell as lateral inflow. - - Parameters: - ----------- - NoRoutingExecuted: integer - The number of routing sub-steps that have been executed. This parameter is used to manage - the accumulation of inflow and outflow over the routing steps. - """ - - settings = LisSettings.instance() - option = settings.options - maskinfo = MaskInfo.instance() - - # self.var.QHeadADDEDM3 = maskinfo.in_zero() - - if option['MCTRouting'] and not option['InitLisflood']: - - InvDtSecDay = 1 / float(86400) - # InvDtSecDay=self.var.InvDtSec - - inflow = np.bincount(self.var.downstruct, weights=self.var.ChanQAvgDt)[self.var.MCTHeadwaterIndex] #same as Qin - # contribution to the MCT pixel from upstream Kinematic pixels - - # ######## - # debug - # inflow = self.var.ChanQAvgDt[7] # this is just to make it the same as the inflow run REMOVE - # ######## - - self.var.QInHeadM3 = maskinfo.in_zero() - np.put(self.var.QInHeadM3, self.var.MCTHeadwaterIndex, inflow * self.var.DtSec) - self.var.QDeltaHeadM3 = (self.var.QInHeadM3 - self.var.QInHeadM3Old) * self.var.InvNoRoutSteps - # difference between old and new headwater flow per sub step - # in order to calculate the amount of headwater flow in the routing loop - - self.var.QHeadM3Dt = (self.var.QInHeadM3Old + (NoRoutingExecuted + 1) * self.var.QDeltaHeadM3) * self.var.InvNoRoutSteps - # output to the MCT headwater cells - - self.var.QInHeadM3Old = self.var.QInHeadM3.copy() - # save the upstream flow for next step - - # self.var.QHeadADDEDM3 += self.var.QHeadM3Dt - - - diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py index 1339b497..797163b1 100644 --- a/src/lisflood/hydrological_modules/routing.py +++ b/src/lisflood/hydrological_modules/routing.py @@ -30,7 +30,6 @@ from .transmission import transmission from .kinematic_wave_parallel import kinematicWave, kwpt from .mct import MCTWave -from .mctheadwater import mctheadwater from .mctconfluence import mctconfluence from ..global_modules.settings import LisSettings, MaskInfo @@ -64,7 +63,6 @@ def __init__(self, routing_variable): self.polder_module = polder(self.var) self.inflow_module = inflow(self.var) self.transmission_module = transmission(self.var) - # self.mctheadwater_module = mctheadwater(self.var) self.mctconfluence_module = mctconfluence(self.var) # -------------------------------------------------------------------------- @@ -180,14 +178,14 @@ def initial(self): self.var.LddKinematic = self.var.LddChan self.var.LddKinematicNp = compressArray(self.var.LddKinematic) # np - # At this point, LddChan and LddKinematic do not have sinks at reservoirs/lakes or MCT headwater and MCT confluences + # At this point, LddChan and LddKinematic do not have sinks at reservoirs/lakes or MCT confluences # LddMCT does not exist yet # ************************************************************ # ***** MCT DRAINAGE NETWORK GEOMETRY - LDD ***************** # ************************************************************ - # This is done here to be able to add MCT headwater pixels to structures + # This is done here to be able to add MCT confluence pixels to structures if option['MCTRouting']: self.var.IsChannelMCTPcr = boolean(loadmap('ChannelsMCT', pcr=True)) # pcr @@ -283,19 +281,20 @@ def initial(self): ChanDepthThreshold * (self.var.ChanUpperWidth + self.var.ChanBottomWidth) # Area (sq m) of bank full discharge cross-section [m2] (trapezoid area equation) - # cmcheck - TotalCrossSectionAreaHalfBankFull is not 1/2 TotalCrossSectionAreaBankFull it's trapezoid # ChanUpperWidthHalfBankFull = self.var.ChanBottomWidth + 2 * self.var.ChanSdXdY * 0.5 * ChanDepthThreshold # TotalCrossSectionAreaHalfBankFull = 0.5 * \ # 0.5 * ChanDepthThreshold * (ChanUpperWidthHalfBankFull + self.var.ChanBottomWidth) # Cross-sectional area at half bankfull [m2] + # TotalCrossSectionAreaHalfBankFull is not 1/2 TotalCrossSectionAreaBankFull it's trapezoid # This can be used to initialise channel flow (see below) BankFullPerc = loadmap('BankFullPerc') TotalCrossSectionAreaHalfBankFull = BankFullPerc * self.var.TotalCrossSectionAreaBankFull # set BankFullPerc to 0.5 for half bankfull - # # Channel volume initialization for MCT cells + # Channel volume initialization for MCT cells # TotalCrossSectionAreaHalfBankFull = np.where(self.var.IsChannelKinematic, TotalCrossSectionAreaHalfBankFull, 0.01 * self.var.TotalCrossSectionAreaBankFull) - # # set initial volume in MCT cells to 1% of bankfull + # set initial volume in MCT cells to 1% of bankfull + # not used now but it could be used in the future TotalCrossSectionAreaInitValue = loadmap('TotalCrossSectionAreaInitValue') self.var.TotalCrossSectionArea = np.where(TotalCrossSectionAreaInitValue == -9999, TotalCrossSectionAreaHalfBankFull, TotalCrossSectionAreaInitValue) @@ -473,7 +472,6 @@ def initial(self): # Cumulative inflow volume from inflow hydrographs [m3] self.var.sumDis = maskinfo.in_zero() self.var.sumIn = maskinfo.in_zero() - # cmcheck - non so se sostituita da self.var.sumInWB self.var.sumInWB = maskinfo.in_zero() def initialSecond(self): @@ -497,7 +495,6 @@ def initialSecond(self): # Manning's roughtness coefficient n for second line of routing AlpTermChan2 = (ChanMan2 / (np.sqrt(self.var.ChanGrad))) ** self.var.Beta self.var.ChannelAlpha2 = (AlpTermChan2 * (self.var.ChanWettedPerimeterAlpha ** self.var.AlpPow)).astype(float) - #cmcheck -> using channel wetted perimeter of half bankfull ChanWettedPerimeterAlpha ? self.var.InvChannelAlpha2 = 1 / self.var.ChannelAlpha2 # calculating second Alpha for second (virtual) channel @@ -831,7 +828,6 @@ def dynamic(self, NoRoutingExecuted): # Total channel storage [m3] = Volume in main channel (ChanM3Kin) + volume above bankfull in second line (Chan2M3Kin - Chan2M3Start) # Total channel storage V at the end of computation step t+dt for full section (instant) - # cmcheck ChanQAvgDt = np.maximum(self.var.ChanQKinAvgDt + self.var.Chan2QKinAvgDt - self.var.QLimit, 0) # (real) total outflow (at x+dx) at time t+dt end of step for the full cross-section (instant) # Main channel routing and above bankfull routing from second line of routing @@ -853,14 +849,8 @@ def dynamic(self, NoRoutingExecuted): self.var.ChanM3 = ChanM3 self.var.ChanQAvgDt = ChanQAvgDt # -> used to calc q0m - # # MCT HEADWATER - # self.mctheadwater_module.dynamic_inloop(NoRoutingExecuted) - # # calculate sideflow from MCT headwater pixels - # SideflowChanM3 += self.var.QHeadM3Dt - # # MCT headwater pixels outflow volume per routing sub step [m3] - # MCT CONFLUENCE - # This needs to be here because I need to grab the input to MCT pixels from outflow at the end of routing step of kinematic pixels + # This needs to be here because we need to grab the input to MCT pixels from the outflow at the end of routing step of kinematic pixels if option['MCTRoutingInterface']: self.mctconfluence_module.dynamic_inloop(NoRoutingExecuted) # calculate sideflow from MCT confluence pixels diff --git a/src/lisflood/hydrological_modules/soil.py b/src/lisflood/hydrological_modules/soil.py index e3233d74..79115160 100644 --- a/src/lisflood/hydrological_modules/soil.py +++ b/src/lisflood/hydrological_modules/soil.py @@ -422,7 +422,7 @@ def splitlanduse(array1, array2=None, array3=None): # ***** INITIAL VALUES # ************************************************************ # Inputs in waterbalance model and/or initial assumption - # CMmod + # DSLRInit = defsoil('DSLRInitValue', 'DSLRForestInitValue','DSLRIrrigationInitValue') diff --git a/src/lisflood/hydrological_modules/surface_routing.py b/src/lisflood/hydrological_modules/surface_routing.py index c736bee2..a0145121 100644 --- a/src/lisflood/hydrological_modules/surface_routing.py +++ b/src/lisflood/hydrological_modules/surface_routing.py @@ -45,7 +45,7 @@ def initial(self): """ initial part of the surface_routing module """ maskinfo = MaskInfo.instance() - # CM mod + OFM3OtherInit = loadmap('OFOtherInitValue') OFM3ForestInit = loadmap('OFForestInitValue') OFM3DirectInit = loadmap('OFDirectInitValue') @@ -56,7 +56,6 @@ def initial(self): # self.var.WaterDepth = self.var.WaterDepthInit.copy() # initial overland flow water depth [mm] # for initial water in CHANNEL see CHANNEL GEOMETRY section below! - ## end CM mod self.var.OFM3Other = makenumpy(OFM3OtherInit) self.var.OFM3Forest = makenumpy(OFM3ForestInit) @@ -94,8 +93,6 @@ def initial(self): self.var.OFQOther = ((self.var.OFM3Other * self.var.InvPixelLength * self.var.InvOFAlpha.values[self.var.dim_runoff[1].index('Other')])**(self.var.InvBeta)).astype(float) self.var.OFQForest = ((self.var.OFM3Forest * self.var.InvPixelLength * self.var.InvOFAlpha.values[self.var.dim_runoff[1].index('Forest')])**(self.var.InvBeta)).astype(float) - # cmcheck - # do I need to initialise from self.var.OFQDirect? # Initial average overland discharge [m3 s-1] self.var.OFQDirectAvg = maskinfo.in_zero() self.var.OFQOtherAvg = maskinfo.in_zero() @@ -206,13 +203,10 @@ def dynamic(self): self.var.M3all = self.var.OFM3Direct + self.var.OFM3Other + self.var.OFM3Forest # Total overland flow storage [m3] - # cmcheck - # this should be calculated using the average flow self.var.OFToChanM3 = np.where(self.var.IsChannel, self.var.QallAvg * self.var.DtSec, 0) # self.var.OFToChanM3 = np.where(self.var.IsChannel, self.var.Qall * self.var.DtSec, 0) # Overland flow in channel pixels (in [m3])is added to channel - self.var.WaterDepth = self.var.M3all * self.var.M3toMM # Update water depth [mm] diff --git a/src/lisflood/hydrological_modules/waterabstraction.py b/src/lisflood/hydrological_modules/waterabstraction.py index 4676b400..0449a4a8 100644 --- a/src/lisflood/hydrological_modules/waterabstraction.py +++ b/src/lisflood/hydrological_modules/waterabstraction.py @@ -135,7 +135,7 @@ def initial(self): else: if option['useWaterDemandAveYear']: raise LisfloodError("TransientWaterDemandChange option must be turned on to use average year water demand (useWaterDemandAveYear)") - # CM: using information on water demand from NetCDF files, only loaded once in init, not in dynamic + # using information on water demand from NetCDF files, only loaded once in init, not in dynamic self.var.DomesticDemandMM = loadmap('DomesticDemandMaps', timestampflag='closest') * self.var.DtDay self.var.IndustrialDemandMM = loadmap('IndustrialDemandMaps', timestampflag='closest') * self.var.DtDay self.var.LivestockDemandMM = loadmap('LivestockDemandMaps', timestampflag='closest') * self.var.DtDay @@ -681,7 +681,7 @@ def dynamic(self): # ************************************************************ # 19. update state variables *** # ************************************************************ - # CM Update state variables for changes to W1a[2] and W1b[2] + # Update state variables for changes to W1a[2] and W1b[2] veg = "Irrigated_prescribed" iveg,ilanduse,_ = self.var.get_landuse_and_indexes_from_vegetation_GLOBAL(veg) diff --git a/src/lisflood/hydrological_modules/waterbalance.py b/src/lisflood/hydrological_modules/waterbalance.py index 006e5d40..f77b43f8 100755 --- a/src/lisflood/hydrological_modules/waterbalance.py +++ b/src/lisflood/hydrological_modules/waterbalance.py @@ -101,7 +101,6 @@ def initial(self): # DisStructure = np.where(self.var.IsUpsOfStructureReservoir, self.var.ChanQAvgDt * self.var.DtRouting, 0) - # CM if option['simulateLakes']: # DisStructure += np.where(compressArray(self.var.IsUpsOfStructureLake), 0.5 * self.var.ChanQ * self.var.DtRouting, 0) DisStructure += np.where(compressArray(self.var.IsUpsOfStructureLake), 0.5 * self.var.ChanQAvgDt * self.var.DtRouting, 0) #np diff --git a/src/lisflood/main.py b/src/lisflood/main.py index 13b274e1..903657f3 100755 --- a/src/lisflood/main.py +++ b/src/lisflood/main.py @@ -144,7 +144,7 @@ def lisfloodexe(lissettings=None): except: print(calendar(binding["timestepInit"], binding['calendar_type'])) - # CM: print start step and end step for reporting model state maps + # print start step and end step for reporting model state maps print("Start Rep Step - End Rep Step: ", report_steps['rep'][0], " - ", report_steps['rep'][-1]) print("Start Rep Date - End Rep Date: ", inttodate(calendar(report_steps['rep'][0] - 1, binding['calendar_type']), calendar(binding['CalendarDayStart'], binding['calendar_type'])), diff --git a/tests/data/LF_ETRS89_UseCase/settings/mct_cold_for_results_generation.xml b/tests/data/LF_ETRS89_UseCase/settings/mct_cold_for_results_generation.xml index 0ef0ddbe..0ee70ecb 100644 --- a/tests/data/LF_ETRS89_UseCase/settings/mct_cold_for_results_generation.xml +++ b/tests/data/LF_ETRS89_UseCase/settings/mct_cold_for_results_generation.xml @@ -44,11 +44,13 @@ You can use builtin path variables in this template and reference to other paths - - + + + - + + # use inflow data @@ -88,7 +90,7 @@ You can use builtin path variables in this template and reference to other paths # report mass balance - + #----------------------------------------------------------- # report maps @@ -287,19 +289,19 @@ You can use builtin path variables in this template and reference to other paths - + Reference day and time - + timestep [seconds] - + 17280 5 times subrouting 21600 6 hours @@ -308,14 +310,14 @@ You can use builtin path variables in this template and reference to other paths - + 01/01/YEAR_START 12:00 Number of first time step in simulation - + 01/01/YEAR_END 06:00 Number of last time step in simulation @@ -469,7 +471,7 @@ You can use builtin path variables in this template and reference to other paths - + default: 3.0 [-] $(PathParams)/CalChanMan3 @@ -1476,7 +1478,7 @@ You can use builtin path variables in this template and reference to other paths - + Percentage [-] used to compute the TotalCrossSectionAreaHalfBankFull in the initialisation of the total cross-sectional area @@ -1629,7 +1631,7 @@ You can use builtin path variables in this template and reference to other paths - + Maximum channel gradient for channels using MCT routing [-] (for MCT wave: slope cannot be 0) Default: 0.001 @@ -1652,6 +1654,13 @@ You can use builtin path variables in this template and reference to other paths + + + location of calibration points + OPTIONAL: nominal map with locations of calibration points + + + OPTIONAL: observed or simulated input hydrographs as @@ -5418,6 +5427,13 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT + + + location of calibration points + OPTIONAL: nominal map with locations of calibration points + + + Observed or simulated input hydrographs as