diff --git a/.gitignore b/.gitignore
index 5c9e8b0b..dbbdebf8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,8 +28,9 @@ lisflood_model.egg-info
.vscode/
*.ipynb
.ipynb_checkpoints/
+tws_integration_master_diff.md
implementation_guide_scale_offset_packing.md
lisflood_optimization_report.md
lisflood_optimization_report_v2.md
# version file auto-generated by setuptools_scm (do not track)
-src/lisflood/_version.py
\ No newline at end of file
+src/lisflood/_version.py
diff --git a/docs/4_Static-Maps_reservoirs-lakes/index.md b/docs/4_Static-Maps_reservoirs-lakes/index.md
index 483d8df6..ce38feeb 100644
--- a/docs/4_Static-Maps_reservoirs-lakes/index.md
+++ b/docs/4_Static-Maps_reservoirs-lakes/index.md
@@ -4,6 +4,8 @@ Lakes and reservoirs can be defined as a significant volume of water, which occu
The modelling of lakes and reservoirs requires three maps and a set of txt files.
+For the generation of total water storage output (option `repTWSMaps`), two additional maps are needed to distribute the storage mass over the extent of the lakes/reservoirs (see [Lake and reservoir extent maps](#lake-and-reservoir-extent-maps) below).
+
## Lake mask map
@@ -20,7 +22,7 @@ The lake mask map represents the area covered by lakes and reservoirs, it is use
| :---| :--- | :--- | :--- |
|Global Lakes and Wetlands Database (GLWD):
Large Lake Polygons (Level 1) |[GLWD leve1](https://www.worldwildlife.org/publications/global-lakes-and-wetlands-database-large-lake-polygons-level-1)|2004|Global, 1:1 to 1:3 million resolution|
|Global Lakes and Wetlands Database (GLWD):
Small Lake Polygons (Level 2) |[GLWD leve1](https://www.worldwildlife.org/publications/global-lakes-and-wetlands-database-large-lake-polygons-level-2)|2004|Global, 1:1 to 1:3 million resolution|
-|Fraction of inland water| It can be prepared by using
the methodology explained [here](../4_Static-Maps_land-use#land-use)|NA|Global|
+|Fraction of inland water| It can be prepared by using
the methodology explained [here](../4_Static-Maps_land-use#land-use/index.md)|NA|Global|
### Methodology
@@ -146,4 +148,32 @@ Finally, lake average inflow can be retrieved from observed time series (where a
Lake maps and tables of the European 1arcmin domain and global 3arcmin domain are based on information from [HydroLAKES](https://www.hydrosheds.org/products/hydrolakes): waterbodies classified in HydroLakes as natural lake were considered for inclusion into the lakes dataset.
Lakes included in the European 1arcmin domain had a minimum volume of 10 hm3, a minimum lake surface area of 5 km2, a minimum upstream catchment area of 50 km2.
Lakes included in the global 3arcmin domain had a minimum volume of 100 hm3, a minimum lake surface area of 50 km2, a minimum upstream catchment area of 250 km2.
-Lake outlet width was generally measured with GIS tools; lake average inflow was computed using OS LISFLOOD CEMS EFAS and CEMS GloFAS discharge reanalysis (GloFASv4 reanalysis for GloFASv5 tables; EFASv5 naturalized flow for EFASv6 tables).
\ No newline at end of file
+Lake outlet width was generally measured with GIS tools; lake average inflow was computed using OS LISFLOOD CEMS EFAS and CEMS GloFAS discharge reanalysis (GloFASv4 reanalysis for GloFASv5 tables; EFASv5 naturalized flow for EFASv6 tables).
+
+
+## Lake and reservoir extent maps
+
+The lake and reservoir modules output lake/reservoir levels at the outlet locations (output files `lakeh.nc` for locations in `lakes.nc` and `res.nc`). For the generation of total water storage maps (option `repTWSMaps`), these levels have to be converted to mass changes and spatially distributed over the extent of the lakes/reservoirs. For this, two additional maps are needed that contain the lake/reservoir ID for each pixel belonging to the area covered by the respective lake/reservoir.
+
+### General map information
+
+| Map/table name | File name; type | Units; range | Description |
+| :--- | :--- | :--- | :--- |
+| Lake extent | lake_extent.nc;
Type: Float32 | Units: -;
Range: integer ID number to identify each lake | Lake ID (ID of outflow location) for each pixel belonging to the surface extent of the lake |
+| Reservoir extent | res_extent.nc;
Type: Float32 | Units: -;
Range: integer ID number to identify each reservoir | Reservoir ID (ID of outflow location) for each pixel belonging to the surface extent of the reservoir |
+
+### Methodology
+
+The creation of the lake extent map requires:
+
+1. Lake outflow location with unique lake identifier (e.g., `lakes.nc`)
+2. External local or global dataset containing the vectorized polygons of the lake outlines (e.g., in shapefile format), such as [HydroLAKES](https://www.hydrosheds.org/products/hydrolakes), as well as the surface area of the lake
+3. Table relating the unique lake identifier of OS LISFLOOD to the lake identifier in the external data set
+
+The creation of a raster file fulfilling the criteria for a consistent lake extent map (e.g., lakes with an area smaller than the grid cell size must not be neglected; lakes assigned to only one grid cell must not be overwritten by other lakes) is not straight forward, thus a standard rasterize command is not appropriate. A dedicated script should loop over each lake defined in the outlet location file and perform the following actions:
+
+- If the total lake area is too small in comparison to the grid cell area (e.g., smaller than 5% of the cell area), the outlet location pixel is set as the lake extent.
+- Otherwise, the corresponding polygon from the shapefile is intersected with the grid cells and each grid cell containing a fraction of the lake extent is checked. If the lake covers a sufficiently large fraction (e.g., more than 7%) of the grid cell, it is assigned the lake ID, else it is neglected.
+- If no intersection fraction is large enough (e.g., if the lake is very thin but long), the outlet location pixel is set as the lake extent.
+
+The creation of the reservoir extent map can be done analogously to the lake extent map using the same methodology.
diff --git a/docs/5_annex_output-files/index.md b/docs/5_annex_output-files/index.md
index 415b8acb..cbe65dfb 100644
--- a/docs/5_annex_output-files/index.md
+++ b/docs/5_annex_output-files/index.md
@@ -148,7 +148,9 @@ To speed up the pre-run and to prevent that results are taken from the pre-run,
| storage in lower groundwater zone | repLZMaps | $mm$ | LZMaps | lz |
| number of days since last rain | repDSLRMaps | $days$ | DSLRMaps
DSLRForestMaps | dslr
dslF |
| frost index | repFrostIndexMaps | $\frac{°C}{days}$ | FrostIndexMaps | frost |
-| Total Water Storage | repTotalWaterStorageMaps | $mm$ | TotalWaterStorageMaps | tws |
+| Total Water Storage | repTWSMaps | $m$ | TWSMaps | TotalWS |
+| Individual Water Storage Compartments | repStorageMaps | $m$ | LakeSMaps
RiverSMaps
SoilSMaps
GWSMaps
SnowSMaps
CumSMaps | Lakestor
Riverstor
Soilstor
GWstor
Snowstor
Cumstor |
+| Flow Momentum | repFlowMomMaps | $\frac{kgm}{s}$ | FlowMomMaps | FlowMomentum |
| **RATE VARIABLES** | | | | |
| rain (excluding snow) | repRainMaps | $\frac{mm}{timestep}$ | RainMaps | rain |
| snow | repSnowMaps | $\frac{mm}{timestep}$ | SnowMaps | snow |
@@ -181,8 +183,9 @@ The users should be aware that some state maps are generated only if the relevan
**Note**
-Some cumulative storages and volumes are computed internally by LISFLOOD. Some relevant example is described below:
-- Total Water Storage is the total water volume stored in channels, lakes, reservoirs, snow cover, sealed surfaces depressions, surface runoff, canopy interception, upper and lower groundwater zones.
+Some cumulative storages and volumes are computed internally by LISFLOOD. Some relevant examples are described below:
+- Total Water Storage is the total water mass (expressed in equivalent water height) stored in channels, lakes, reservoirs, all soil layers, snow cover, sealed surfaces depressions, surface runoff, canopy interception, uppper and lower groundwater zones. Using the option "repStorageMaps" outputs the individual storage compartments (Rivers, Lakes/Reservoirs, Soil, Groundwater, Snow, Interception storage) which add up to TWS ("repTWSMaps"). For the computation of mass stored in lakes and reservoirs (i.e. "simulateLakes" and/or "simulateReservoirs" is set to 1), the initial LISFLOOD output of lake levels centered at the outlet location are distributed over the actual extents of the lakes/reservoirs, which requires two additional input maps when using the options "repTWSMaps" and "repStorageMaps" (see [Reservoirs and lakes](../4_Static-Maps_reservoirs-lakes/)).
+- Flow Momentum is the product of flow velocity and river mass, which is needed for special applications, e.g. the computation of Earth rotation excitation functions.
- Surface runoff is the sum of direct runoff (from sealed and water fractions) and runoff generated by the pervious land cover fractions (forest, irrigation, other).
- Total runoff is the sum of surface runoff and sub-surface runoff. Sub-surface runoff is the outflow from upper and lower groundwater zones.
diff --git a/src/lisflood/Lisflood_dynamic.py b/src/lisflood/Lisflood_dynamic.py
index abf8d1cc..cf33894b 100644
--- a/src/lisflood/Lisflood_dynamic.py
+++ b/src/lisflood/Lisflood_dynamic.py
@@ -248,6 +248,10 @@ def splitlanduse(array1, array2=None, array3=None):
# Calculate water level
self.waterlevel_module.dynamic()
+ # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ # Calculate water storage
+ self.waterstorage_module.dynamic()
+
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# ************************************************************
diff --git a/src/lisflood/Lisflood_initial.py b/src/lisflood/Lisflood_initial.py
index 7a6a864e..3876fdb7 100644
--- a/src/lisflood/Lisflood_initial.py
+++ b/src/lisflood/Lisflood_initial.py
@@ -59,6 +59,7 @@
from .hydrological_modules.opensealed import opensealed
from .hydrological_modules.waterbalance import waterbalance
from .hydrological_modules.waterlevel import waterlevel
+from .hydrological_modules.waterstorage import waterstorage
from .hydrological_modules.structures import structures
from .global_modules.output import outputTssMap
@@ -150,6 +151,7 @@ def __init__(self):
self.opensealed_module = opensealed(self)
self.waterbalance_module = waterbalance(self)
self.waterlevel_module = waterlevel(self)
+ self.waterstorage_module = waterstorage(self)
self.structures_module = structures(self)
self.prescribed_vegetation = self.epic_settings.prescribed_vegetation
@@ -208,6 +210,7 @@ def __init__(self):
self.reservoir_module.initial()
self.lakes_module.initial()
self.polder_module.initial()
+ self.waterstorage_module.initial()
self.transmission_module.initial()
diff --git a/src/lisflood/global_modules/default_options.py b/src/lisflood/global_modules/default_options.py
index 4b531167..1ee24f3f 100644
--- a/src/lisflood/global_modules/default_options.py
+++ b/src/lisflood/global_modules/default_options.py
@@ -54,7 +54,6 @@
'repLZOutflowMaps': False,
'repLeafDrainageMaps': False,
'repMBTs': False,
- 'repTotalWaterStorageMaps': False,
'repMeteoUpsGauges': False,
'repOverlandFlowMaps': False,
'repPFMaps': False,
@@ -91,6 +90,9 @@
'repWaterLevelMaps': False,
'repWaterLevelTs': False,
'repEtactBudykoTs': False,
+ 'repTWSMaps': False,
+ 'repStorageMaps': False,
+ 'repFlowMomMaps': False,
'reportedmaps': {'AreaTotalAbstractionFromSurfaceWaterM3': ReportedMap(
name='AreaTotalAbstractionFromSurfaceWaterM3',
output_var='areatotal_withdrawal_SW_actual_M3', unit='m3', end=[],
@@ -317,7 +319,11 @@
unit='m3',
end=['InitLisflood'],
steps=[], all=[], restrictoption=[],
- monthly=False, yearly=False),
+ monthly=False, yearly=False),
+ 'CumSMaps': ReportedMap(name='CumSMaps', output_var='cumstor',
+ unit='m', end=[], steps=['repStorageMaps'],
+ all=[], restrictoption=['nonInit'],
+ monthly=False, yearly=False),
'DSLREnd': ReportedMap(name='DSLREnd', output_var='DSLR[0]', unit='-',
end=['repEndMaps'], steps=[], all=[],
restrictoption=[], monthly=False, yearly=False),
@@ -460,6 +466,10 @@
unit='-', end=[], steps=['repStateMaps'],
all=[], restrictoption=['nonInit'],
monthly=False, yearly=False),
+ 'FlowMomMaps': ReportedMap(name='FlowMomMaps', output_var='FlowMomentum',
+ unit='kgm/s', end=[], steps=['repFlowMomMaps'],
+ all=[], restrictoption=['nonInit'],
+ monthly=False, yearly=False),
'GwLossMaps': ReportedMap(name='GwLossMaps', output_var='GwLossPixel',
unit='mm', end=[], steps=[], all=['repGwLossMaps','repE2O2'],
restrictoption=['nonInit'], monthly=False,
@@ -481,13 +491,16 @@
end=[], steps=[],
all=['repGwPercUZLZMaps'],
restrictoption=['nonInit'], monthly=False,
- yearly=False, scale_factor=4.6e-05, add_offset=1.5),
-
+ yearly=False, scale_factor=4.6e-05, add_offset=1.5),
'GwPercUZLZMaps': ReportedMap(name='GwPercUZLZMaps',
output_var='GwPercUZLZPixel', unit='mm', end=[],
steps=[], all=['repGwPercUZLZMaps','repE2O2'],
restrictoption=['nonInit'], monthly=False,
yearly=False, scale_factor=4.6e-05, add_offset=1.5),
+ 'GWSMaps': ReportedMap(name='GWSMaps', output_var='gwstor',
+ unit='m', end=[], steps=['repStorageMaps'],
+ all=[], restrictoption=['nonInit'],
+ monthly=False, yearly=False),
'InfiltrationForestMaps': ReportedMap(name='InfiltrationForestMaps',
output_var='Infiltration[1]', unit='mm',
end=[], steps=[],
@@ -583,6 +596,10 @@
all=[],
restrictoption=['nonInit', 'simulateLakes'],
monthly=False, yearly=False),
+ 'LakeSMaps': ReportedMap(name='LakeSMaps', output_var='lakestor',
+ unit='m', end=[], steps=['repStorageMaps'],
+ all=[], restrictoption=['nonInit'],
+ monthly=False, yearly=False),
'LakeStorageM3': ReportedMap(name='LakeStorageM3', output_var='LakeStorageM3',
unit='m3', end=[], steps=['repTotalAbs'],
all=[], restrictoption=['nonInit', 'wateruse',
@@ -885,6 +902,11 @@
restrictoption=['nonInit', 'wateruse',
'simulateReservoirs'],
monthly=False, yearly=False),
+ 'RiverSMaps': ReportedMap(name='RiverSMaps', output_var='riverstor',
+ unit='m', end=[], steps=['repStorageMaps'],
+ all=[], restrictoption=['nonInit'],
+ monthly=False, yearly=False),
+
'SMStressForestMap': ReportedMap(name='SMStressForestMap',
output_var='SoilMoistureStressDays[1]',
unit='days', end=[], steps=[],
@@ -973,6 +995,14 @@
unit='mm', end=[], steps=[], all=['repSnowMeltMaps'],
restrictoption=['nonInit'], monthly=False,
yearly=False, scale_factor=0.0039, add_offset=125.),
+ 'SnowSMaps': ReportedMap(name='SnowSMaps', output_var='snowstor',
+ unit='m', end=[], steps=['repStorageMaps'],
+ all=[], restrictoption=['nonInit'],
+ monthly=False, yearly=False),
+ 'SoilSMaps': ReportedMap(name='SoilSMaps', output_var='soilstor',
+ unit='m', end=[], steps=['repStorageMaps'],
+ all=[], restrictoption=['nonInit'],
+ monthly=False, yearly=False),
'SurfaceRunoffMaps': ReportedMap(name='SurfaceRunoffMaps',
output_var='SurfaceRunoff', unit='mm',
end=[], steps=[],
@@ -1169,11 +1199,19 @@
unit='mm', end=[], steps=[],
all=['repTotalRunoffMaps'],
restrictoption=['nonInit'], monthly=False,
- yearly=False, scale_factor=0.0054, add_offset=175.),
+ yearly=False, scale_factor=0.0054, add_offset=175.),
'TransLossMaps': ReportedMap(name='TransLossMaps', output_var='TransLossM3*self.var.M3toMM',
unit='mm', end=[], steps=[], all=['repGwLossMaps','repE2O2'],
restrictoption=['nonInit','TransLoss'], monthly=False,
- yearly=False, scale_factor=0.0092, add_offset=300.),
+ yearly=False),
+ 'TWSMaps': ReportedMap(name='TWSMaps', output_var='twsstor',
+ unit='m', end=[], steps=['repTWSMaps'],
+ all=[], restrictoption=['nonInit'],
+ monthly=False, yearly=False),
+ 'TransLossMaps': ReportedMap(name='TransLossMaps', output_var='TransLossM3*self.var.M3toMM',
+ unit='mm', end=[], steps=[], all=['repGwLossMaps','repE2O2'],
+ restrictoption=['nonInit','TransLoss'], monthly=False,
+ yearly=False, scale_factor=0.0092, add_offset=300.),
'UpstreamInflowUsedM3': ReportedMap(name='UpstreamInflowUsedM3',
output_var='UpstreamInflowUsedM3',
unit='M3', end=[], steps=['repWaterUse'],
@@ -1275,13 +1313,7 @@
'WaterDepthState': ReportedMap(name='WaterDepthState', output_var='WaterDepth',
unit='m', end=[], steps=[],
all=[], restrictoption=['nonInit'],
- monthly=False, yearly=False, scale_factor=0.0039, add_offset=125.),
- 'TotalWaterStorageMaps': ReportedMap(name='TotalWaterStorageMaps',
- output_var='TotalWaterStorageMM',
- unit='mm', end=[], steps=[],
- all=['repTotalWaterStorageMaps'],
- restrictoption=['nonInit'],
- monthly=False, yearly=False, scale_factor=5.4e+02, add_offset=17497500.0),
+ monthly=False, yearly=False, scale_factor=0.0039, add_offset=125.),
'WaterSecurityIndex': ReportedMap(name='WaterSecurityIndex',
output_var='WaterSecurityIndex', unit='-',
end=[], steps=['repWIndex'], all=[],
@@ -1614,10 +1646,14 @@
'TransLossQAvgTS' : TimeSeries(name='TransLossQAvgTS', output_var='TransLossQAvg',
where='Gauges', repoption=['repRateUpsGauges'],
restrictoption=['nonInit', 'TransLoss'],
- operation=[''])},
+ operation=['']),
+ 'TWSAvUpsTS': TimeSeries(name='TWSAvUpsTS', output_var='twsstor',
+ where='Gauges', repoption=['repStateUpsGauges'],
+ restrictoption=['nonInit', 'repTWS'],
+ operation=['total'])},
'useWaterDemandAveYear': False,
'varfractionwater': False,
'wateruse': False,
'wateruseRegion': False,
'writeNetcdf': False,
- 'writeNetcdfStack': False}
+ 'writeNetcdfStack': False}
\ No newline at end of file
diff --git a/src/lisflood/global_modules/settings.py b/src/lisflood/global_modules/settings.py
index 8285407f..a0731173 100755
--- a/src/lisflood/global_modules/settings.py
+++ b/src/lisflood/global_modules/settings.py
@@ -616,6 +616,10 @@ def _options(settingsfile_dom):
# overwrite defaults
options.update(option_setting)
options['nonInit'] = not options['InitLisflood']
+ # Total Water Storage output is only meaningful when at least one
+ # storage/TWS map output is requested. Derived flag lets restrictoption
+ # (pure AND) express "repTWSMaps OR repStorageMaps".
+ options['repTWS'] = options['repTWSMaps'] or options['repStorageMaps']
return options
def _filter_steps(self, user_settings):
diff --git a/src/lisflood/hydrological_modules/routing.py b/src/lisflood/hydrological_modules/routing.py
index 9288d59c..90ecfe7d 100644
--- a/src/lisflood/hydrological_modules/routing.py
+++ b/src/lisflood/hydrological_modules/routing.py
@@ -1044,6 +1044,11 @@ def dynamic(self, NoRoutingExecuted):
# if flow is slow, Traveltime=DtSec then TravelDistance=PixelLength
# maximum set to 30km/day for 5km cell, is at DtSec/Traveltime=6, is at Traveltime pixel indices
+ self.var.lake_extent_areas = {} # dict: lake_id -> total grid area [m2]
+ if option['simulateLakes']:
+ self.var.LakeDistribution = loadmap('LakeExtent')
+ lake_ids = np.unique(self.var.LakeDistribution[~np.isnan(self.var.LakeDistribution)]).astype(int)
+ number_of_lakeIDs = len(lake_ids[lake_ids != 0])
+ if (number_of_lakeIDs == 0):
+ warnings.warn(LisfloodWarning('LakeExtent map contains no lake IDs. Please check consistency between LakeExtent map and model domain.'))
+ if self.var.LakeSitesCC.size != number_of_lakeIDs:
+ warnings.warn(LisfloodWarning('Number of lake IDs in map LakeExtent ('+str(number_of_lakeIDs)+') not equal to number of lake sites defined in map LakeSites ('+str(self.var.LakeSitesCC.size)+').'))
+ lake_extent = self.var.LakeDistribution
+ valid_lake_ids = set(self.var.LakeSitesCC.astype(int)) # IDs that have outlets in domain
+ for n in np.unique(lake_extent[~np.isnan(lake_extent)]).astype(int):
+ if n != 0 and n in valid_lake_ids:
+ mask = np.nonzero(lake_extent == n)
+ self.var.lake_extent_masks[n] = mask
+ self.var.lake_extent_areas[n] = np.nansum(self.var.PixelArea[mask])
+ elif n != 0:
+ warnings.warn(LisfloodWarning(
+ f'Lake ID {n} found in LakeExtent map but has no outlet in the domain. Skipping.'))
+
+ # Precompute reservoir extent masks and areas (static)
+ self.var.reservoir_extent_masks = {}
+ self.var.reservoir_extent_areas = {}
+ if option['simulateReservoirs']:
+ self.var.ReservoirDistribution = loadmap('ReservoirExtent')
+ res_ids = np.unique(self.var.ReservoirDistribution[~np.isnan(self.var.ReservoirDistribution)]).astype(int)
+ number_of_reservoirIDs = len(res_ids[res_ids != 0])
+ if (number_of_reservoirIDs == 0):
+ warnings.warn(LisfloodWarning('ReservoirExtent map contains no reservoir IDs. Please check consistency between ReservoirExtent map and model domain.'))
+ if self.var.ReservoirSitesCC.size != number_of_reservoirIDs:
+ warnings.warn(LisfloodWarning('Number of reservoir IDs in map ReservoirExtent ('+str(number_of_reservoirIDs)+') not equal to number of reservoir sites defined in map ReservoirSites ('+str(self.var.ReservoirSitesCC.size)+').'))
+ reservoir_extent = self.var.ReservoirDistribution
+ valid_res_ids = set(self.var.ReservoirSitesCC.astype(int))
+ for n in np.unique(reservoir_extent[~np.isnan(reservoir_extent)]).astype(int):
+ if n != 0 and n in valid_res_ids:
+ mask = np.nonzero(reservoir_extent == n)
+ self.var.reservoir_extent_masks[n] = mask
+ self.var.reservoir_extent_areas[n] = np.nansum(self.var.PixelArea[mask])
+ elif n != 0:
+ warnings.warn(LisfloodWarning(
+ f'Reservoir ID {n} found in ReservoirExtent map but has no outlet in the domain. Skipping.'))
+
+# --------------------------------------------------------------------------
+# --------------------------------------------------------------------------
+
+ def dynamic(self):
+ """ dynamic part of the water storage module
+ """
+ settings = LisSettings.instance()
+ option = settings.options
+ maskinfo = MaskInfo.instance()
+
+
+ if (not(option['InitLisflood'])) and (option['repStorageMaps'] or option['repTWSMaps']):
+
+ # ************************************************************
+ # ***** WATER STORAGE
+ # ************************************************************
+
+ # river water storage [m3]
+ tws_riverM3 = self.var.TotalCrossSectionArea * self.var.ChanLength
+
+ # [m3] -> [m]
+ tws_riverM = tws_riverM3 / self.var.PixelArea
+
+ # overlandflow water storage [m3]
+ tws_oflowM3 = self.var.OFM3Direct + self.var.OFM3Forest + self.var.OFM3Other
+
+ # [m3] -> [m]
+ tws_oflowM = tws_oflowM3 / self.var.PixelArea
+
+ # lake water storage [m3]
+ tws_lakeM3 = np.zeros(tws_riverM3.shape, dtype=np.float32)
+ # lake water storage [m]
+ tws_lakeM = np.zeros(tws_riverM.shape, dtype=np.float32)
+
+ if option['simulateLakes']:
+ LakeArea = maskinfo.in_zero()
+ np.put(LakeArea, self.var.LakeIndex, self.var.LakeAreaCC)
+ tws_lakeM3 = self.var.LakeLevel * LakeArea
+
+ # [m3] -> [m] distribute lake/river/oflow over lake areas
+ for n, lake_mask in self.var.lake_extent_masks.items():
+ grid_area_lake = self.var.lake_extent_areas[n]
+ tws_lakeM[lake_mask] = tws_lakeM3[self.var.LakeSitesC2==n] / grid_area_lake
+ tws_riverM[lake_mask] = np.nansum(tws_riverM3[lake_mask]) / grid_area_lake
+ tws_oflowM[lake_mask] = np.nansum(tws_oflowM3[lake_mask]) / grid_area_lake
+
+ # reservoir water storage [m3]
+ tws_reservoirM3 = np.zeros(tws_riverM3.shape, dtype=np.float32)
+ # reservoir water storage [m]
+ tws_reservoirM = np.zeros(tws_riverM.shape, dtype=np.float32)
+
+ if option['simulateReservoirs']:
+ TotalReservoirStorage = maskinfo.in_zero()
+ np.put(TotalReservoirStorage, self.var.ReservoirIndex, self.var.TotalReservoirStorageM3CC)
+ tws_reservoirM3 = self.var.ReservoirFill * TotalReservoirStorage
+
+ # [m3] -> [m] distribute reservoir/river/oflow over reservoir areas
+ for n, reservoir_mask in self.var.reservoir_extent_masks.items():
+ grid_area_reservoir = self.var.reservoir_extent_areas[n]
+ tws_reservoirM[reservoir_mask] = tws_reservoirM3[self.var.ReservoirSitesC==n] / grid_area_reservoir
+ tws_riverM[reservoir_mask] = np.nansum(tws_riverM3[reservoir_mask]) / grid_area_reservoir
+ tws_oflowM[reservoir_mask] = np.nansum(tws_oflowM3[reservoir_mask]) / grid_area_reservoir
+
+ # soil water storage [mm] -> [m]
+ tws_soil1M = ((self.var.Theta1a[0] * self.var.SoilDepth1a[0]) * self.var.OtherFraction +
+ (self.var.Theta1a[1] * self.var.SoilDepth1a[1]) * self.var.ForestFraction +
+ (self.var.Theta1a[2] * self.var.SoilDepth1a[2]) * self.var.IrrigationFraction
+ ) / 1000
+
+ tws_soil2M = ((self.var.Theta1b[0] * self.var.SoilDepth1b[0]) * self.var.OtherFraction +
+ (self.var.Theta1b[1] * self.var.SoilDepth1b[1]) * self.var.ForestFraction +
+ (self.var.Theta1b[2] * self.var.SoilDepth1b[2]) * self.var.IrrigationFraction
+ ) / 1000
+
+ tws_soil3M = ((self.var.Theta2[0] * self.var.SoilDepth2[0]) * self.var.OtherFraction +
+ (self.var.Theta2[1] * self.var.SoilDepth2[1]) * self.var.ForestFraction +
+ (self.var.Theta2[2] * self.var.SoilDepth2[2]) * self.var.IrrigationFraction
+ ) / 1000
+
+ tws_soilM = tws_soil1M + tws_soil2M + tws_soil3M
+
+ # groundwater storage [mm] -> [m], (uz,uzf,uzi,lz,fracforest,fracirrigated,fracother)
+ tws_groundwaterM = ( self.var.UZ[0] * self.var.OtherFraction +
+ self.var.UZ[1] * self.var.ForestFraction +
+ self.var.UZ[2] * self.var.IrrigationFraction +
+ self.var.LZ
+ ) / 1000
+
+ # snow storage [m]
+ tws_snowM = self.var.SnowCover / 1000
+
+ # cumulative interception storage [mm] and cumulative depression storage [mm] -> [m]
+ tws_cumM = ( self.var.CumInterception[0] * self.var.OtherFraction +
+ self.var.CumInterception[1] * self.var.ForestFraction +
+ self.var.CumInterception[2] * self.var.IrrigationFraction +
+ self.var.CumInterSealed * self.var.DirectRunoffFraction
+ ) / 1000
+
+ # total water storage maps
+ self.var.riverstor = tws_riverM + tws_oflowM
+ self.var.lakestor = tws_lakeM + tws_reservoirM
+ self.var.soilstor = tws_soilM
+ self.var.gwstor = tws_groundwaterM
+ self.var.snowstor = tws_snowM
+ self.var.cumstor = tws_cumM
+ self.var.twsstor = tws_riverM + tws_oflowM + tws_lakeM + tws_reservoirM + tws_soilM + tws_groundwaterM + tws_snowM + tws_cumM
\ No newline at end of file
diff --git a/src/lisfloodSettings_reference.xml b/src/lisfloodSettings_reference.xml
index 0746f45e..7f60899b 100644
--- a/src/lisfloodSettings_reference.xml
+++ b/src/lisfloodSettings_reference.xml
@@ -165,7 +165,10 @@ You can use builtin path variables in this template and reference to other paths
-
+
+
+
+
@@ -1700,7 +1703,27 @@ You can use builtin path variables in this template and reference to other paths
+
+
+ **************************************************************
+ TWS OPTION
+ **************************************************************
+
+
+
+
+ Map containing the lake ID for each pixel of its extent
+
+
+
+
+
+ Map containing the reservoir ID for each pixel of its extent
+
+
+
+
@@ -3343,6 +3366,59 @@ You can use builtin path variables in this template and reference to other paths
+
+
+ Reported transpiration maps, weighted sum over the fractions of each pixel [mm]
+
+
+
+
+
+ Reported total water storage storage [m]
+
+
+
+
+
+ Reported lake and reservoir storage [m]
+
+
+
+
+
+ Reported river storage [m]
+
+
+
+
+
+ Reported soil storage [m]
+
+
+
+
+
+ Reported groundwater storage [m]
+
+
+
+
+
+ Reported snow storage [m]
+
+
+
+
+
+ Reported cumulative interception and depression storage [m]
+
+
+
+
+
+ Reported riverflow momentum for HAM motion term [kgm/s]
+
+
@@ -3739,12 +3815,6 @@ You can use builtin path variables in this template and reference to other paths
-
-
- Reported total water storage [mm]
-
-
-
Reported days since last rain
@@ -4597,6 +4667,11 @@ You can use builtin path variables in this template and reference to other paths
+
+
+ Reported total water storage upstream average at gauges [m]
+
+
@@ -5513,6 +5588,14 @@ You can use builtin path variables in this template and reference to other paths
reservoir routine switches to flood control mode.
+
+
+
+ Map containing the reservoir ID for each pixel of its spatial extent.
+ Required when simulateReservoirs is active and repTWSMaps or repStorageMaps or repStateUpsGauges is enabled.
+
+
+
@@ -5559,6 +5642,14 @@ You can use builtin path variables in this template and reference to other paths
+
+
+ Map containing the lake ID for each pixel of its spatial extent.
+ Required when simulateLakes is active and repTWSMaps or repStorageMaps or repStateUpsGauges is enabled.
+
+
+
+
**************************************************************
Input tables
diff --git a/tests/data/LF_ETRS89_UseCase/maps/lake_extent.nc b/tests/data/LF_ETRS89_UseCase/maps/lake_extent.nc
new file mode 100644
index 00000000..d35af82f
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/maps/lake_extent.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/maps/res_extent.nc b/tests/data/LF_ETRS89_UseCase/maps/res_extent.nc
new file mode 100644
index 00000000..d633c630
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/maps/res_extent.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Cumstor.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Cumstor.nc
new file mode 100644
index 00000000..32af7218
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Cumstor.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/FlowMomentum.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/FlowMomentum.nc
new file mode 100644
index 00000000..898b9ace
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/FlowMomentum.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/tws.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/GWstor.nc
similarity index 64%
rename from tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/tws.nc
rename to tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/GWstor.nc
index 56b3724a..074cae87 100644
Binary files a/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/tws.nc and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/GWstor.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Lakestor.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Lakestor.nc
new file mode 100644
index 00000000..5ac62235
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Lakestor.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Riverstor.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Riverstor.nc
new file mode 100644
index 00000000..21efc749
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Riverstor.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Snowstor.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Snowstor.nc
new file mode 100644
index 00000000..c921db19
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Snowstor.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Soilstor.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Soilstor.nc
new file mode 100644
index 00000000..3ff1844c
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/Soilstor.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/TotalWS.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/TotalWS.nc
new file mode 100644
index 00000000..e33b93c4
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_6h/TotalWS.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Cumstor.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Cumstor.nc
new file mode 100644
index 00000000..ef99041e
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Cumstor.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/FlowMomentum.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/FlowMomentum.nc
new file mode 100644
index 00000000..a83463d2
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/FlowMomentum.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/GWstor.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/GWstor.nc
new file mode 100644
index 00000000..7f415dc4
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/GWstor.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Lakestor.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Lakestor.nc
new file mode 100644
index 00000000..a09910fe
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Lakestor.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Riverstor.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Riverstor.nc
new file mode 100644
index 00000000..3cf2895b
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Riverstor.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Snowstor.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Snowstor.nc
new file mode 100644
index 00000000..30cf7cb9
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Snowstor.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Soilstor.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Soilstor.nc
new file mode 100644
index 00000000..07f8bdee
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/Soilstor.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/TotalWS.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/TotalWS.nc
new file mode 100644
index 00000000..531f89e7
Binary files /dev/null and b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/TotalWS.nc differ
diff --git a/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/tws.nc b/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/tws.nc
deleted file mode 100644
index 2a2911f7..00000000
Binary files a/tests/data/LF_ETRS89_UseCase/reference/output_reference_daily/tws.nc and /dev/null differ
diff --git a/tests/data/LF_ETRS89_UseCase/settings/base.xml b/tests/data/LF_ETRS89_UseCase/settings/base.xml
index a2dab4ad..86d2fb71 100644
--- a/tests/data/LF_ETRS89_UseCase/settings/base.xml
+++ b/tests/data/LF_ETRS89_UseCase/settings/base.xml
@@ -41,7 +41,6 @@
-
@@ -65,6 +64,9 @@
+
+
+
@@ -240,8 +242,9 @@ The option "numCPUs_parallelNumba" may take the following values:
-
+
+ was 6000..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)
@@ -1521,6 +1524,30 @@ The option "numCPUs_parallelNumba" may take the following values:
+
+
+
+
+
+ **************************************************************
+ TWS OPTION
+ **************************************************************
+
+
+
+
+ Map containing the lake ID for each pixel of its extent
+
+
+
+
+
+ Map containing the reservoir ID for each pixel of its extent
+
+
+
+
+
@@ -3418,12 +3445,63 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
-
+
+
+ Reported total water storage storage [m]
+ added by GFZ
+
+
+
+
+
+ Reported lake and reservoir storage [m]
+ added by GFZ
+
+
+
+
+
+ Reported river storage [m]
+ added by GFZ
+
+
+
+
+
+ Reported soil storage [m]
+ added by GFZ
+
+
+
+
+
+ Reported groundwater storage [m]
+ added by GFZ
+
+
+
+
- Reported total water storage [mm]
+ Reported snow storage [m]
+ added by GFZ
+
+
+ Reported cumulative interception and depression storage storage [m]
+ added by GFZ
+
+
+
+
+
+ Reported riverflow momentum for HAM motion term [kgm/s]
+ added by GFZ
+
+
+
+
Reported days since last rain
@@ -5233,6 +5311,30 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
+
+
+
+
+
+ **************************************************************
+ TWS OPTION
+ **************************************************************
+
+
+
+
+ Map containing the lake ID for each pixel of its extent
+
+
+
+
+
+ Map containing the reservoir ID for each pixel of its extent
+
+
+
+
+
diff --git a/tests/data/LF_ETRS89_UseCase/settings/cold.xml b/tests/data/LF_ETRS89_UseCase/settings/cold.xml
index 737c1d12..d41d6257 100644
--- a/tests/data/LF_ETRS89_UseCase/settings/cold.xml
+++ b/tests/data/LF_ETRS89_UseCase/settings/cold.xml
@@ -100,7 +100,10 @@
-
+
+
+
+
@@ -1562,6 +1565,29 @@ threshold value below which there is no outflow to the channel
+
+
+
+
+ **************************************************************
+ TWS OPTION
+ **************************************************************
+
+
+
+
+ Map containing the lake ID for each pixel of its extent
+
+
+
+
+
+ Map containing the reservoir ID for each pixel of its extent
+
+
+
+
+
@@ -4234,7 +4260,12 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
Days since last rain [days]
-
+
+
+
+ Reported total water storage upstream average at gauges [m]
+
+
@@ -5300,6 +5331,29 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
+
+
+
+
+ **************************************************************
+ TWS OPTION
+ **************************************************************
+
+
+
+
+ Map containing the lake ID for each pixel of its extent
+
+
+
+
+
+ Map containing the reservoir ID for each pixel of its extent
+
+
+
+
+
diff --git a/tests/data/LF_ETRS89_UseCase/settings/full.xml b/tests/data/LF_ETRS89_UseCase/settings/full.xml
index f1da1c11..cd743674 100644
--- a/tests/data/LF_ETRS89_UseCase/settings/full.xml
+++ b/tests/data/LF_ETRS89_UseCase/settings/full.xml
@@ -55,7 +55,10 @@
-
+
+
+
+
@@ -2100,8 +2103,31 @@
+
+
+
+
+
+
+ **************************************************************
+ TWS OPTION
+ **************************************************************
+
+
+
+
+ Map containing the lake ID for each pixel of its extent
+
+
+
+
+
+ Map containing the reservoir ID for each pixel of its extent
+
+
+
@@ -6581,6 +6607,12 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
+
+
+
+ Reported total water storage upstream average at gauges [m]
+
+
@@ -8389,8 +8421,31 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
+
+
+
+
+
+
+ **************************************************************
+ TWS OPTION
+ **************************************************************
+
+
+
+
+ Map containing the lake ID for each pixel of its extent
+
+
+
+
+
+ Map containing the reservoir ID for each pixel of its extent
+
+
+
diff --git a/tests/data/LF_ETRS89_UseCase/settings/inflow.xml b/tests/data/LF_ETRS89_UseCase/settings/inflow.xml
index 0b55b8a8..2f71a149 100644
--- a/tests/data/LF_ETRS89_UseCase/settings/inflow.xml
+++ b/tests/data/LF_ETRS89_UseCase/settings/inflow.xml
@@ -61,7 +61,10 @@
-
+
+
+
+
diff --git a/tests/data/LF_ETRS89_UseCase/settings/mct_cold.xml b/tests/data/LF_ETRS89_UseCase/settings/mct_cold.xml
index 34bf434e..bbe89c51 100644
--- a/tests/data/LF_ETRS89_UseCase/settings/mct_cold.xml
+++ b/tests/data/LF_ETRS89_UseCase/settings/mct_cold.xml
@@ -163,7 +163,10 @@ You can use builtin path variables in this template and reference to other paths
-
+
+
+
+
@@ -3580,12 +3583,6 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
-
-
- Reported total water storage [mm]
-
-
-
Reported days since last rain
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 d0b754b1..4749693d 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
@@ -160,7 +160,10 @@ You can use builtin path variables in this template and reference to other paths
-
+
+
+
+
@@ -3530,12 +3533,6 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
-
-
- Reported total water storage [mm]
-
-
-
Reported days since last rain
diff --git a/tests/data/LF_ETRS89_UseCase/settings/mct_inflow.xml b/tests/data/LF_ETRS89_UseCase/settings/mct_inflow.xml
index b524d4b5..cf897d80 100644
--- a/tests/data/LF_ETRS89_UseCase/settings/mct_inflow.xml
+++ b/tests/data/LF_ETRS89_UseCase/settings/mct_inflow.xml
@@ -160,7 +160,10 @@ You can use builtin path variables in this template and reference to other paths
-
+
+
+
+
@@ -3583,12 +3586,6 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
-
-
- Reported total water storage [mm]
-
-
-
Reported days since last rain
diff --git a/tests/data/LF_ETRS89_UseCase/settings/mct_inflow_test.xml b/tests/data/LF_ETRS89_UseCase/settings/mct_inflow_test.xml
index 34b65929..1530db36 100644
--- a/tests/data/LF_ETRS89_UseCase/settings/mct_inflow_test.xml
+++ b/tests/data/LF_ETRS89_UseCase/settings/mct_inflow_test.xml
@@ -160,7 +160,10 @@ You can use builtin path variables in this template and reference to other paths
-
+
+
+
+
@@ -3583,12 +3586,6 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
-
-
- Reported total water storage [mm]
-
-
-
Reported days since last rain
diff --git a/tests/data/LF_ETRS89_UseCase/settings/mct_warm.xml b/tests/data/LF_ETRS89_UseCase/settings/mct_warm.xml
index fac126b3..76315d4f 100644
--- a/tests/data/LF_ETRS89_UseCase/settings/mct_warm.xml
+++ b/tests/data/LF_ETRS89_UseCase/settings/mct_warm.xml
@@ -162,7 +162,10 @@ You can use builtin path variables in this template and reference to other paths
-
+
+
+
+
@@ -3537,12 +3540,6 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
-
-
- Reported total water storage [mm]
-
-
-
Reported days since last rain
diff --git a/tests/data/LF_ETRS89_UseCase/settings/prerun.xml b/tests/data/LF_ETRS89_UseCase/settings/prerun.xml
index 994e10b9..bc12a8e5 100644
--- a/tests/data/LF_ETRS89_UseCase/settings/prerun.xml
+++ b/tests/data/LF_ETRS89_UseCase/settings/prerun.xml
@@ -60,7 +60,9 @@
-
+
+
+
diff --git a/tests/data/LF_ETRS89_UseCase/settings/warm.xml b/tests/data/LF_ETRS89_UseCase/settings/warm.xml
index 992da1a8..191919c2 100644
--- a/tests/data/LF_ETRS89_UseCase/settings/warm.xml
+++ b/tests/data/LF_ETRS89_UseCase/settings/warm.xml
@@ -86,7 +86,10 @@
-
+
+
+
+
diff --git a/tests/data/LF_MCT_UseCase/settings/mct_cold.xml b/tests/data/LF_MCT_UseCase/settings/mct_cold.xml
index 6c545239..caf44fc3 100644
--- a/tests/data/LF_MCT_UseCase/settings/mct_cold.xml
+++ b/tests/data/LF_MCT_UseCase/settings/mct_cold.xml
@@ -163,7 +163,10 @@ You can use builtin path variables in this template and reference to other paths
-
+
+
+
+
@@ -3693,12 +3696,6 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
-
-
- Reported total water storage [mm]
-
-
-
Reported days since last rain
diff --git a/tests/data/LF_MCT_UseCase/settings/mct_cold_for_results_generation.xml b/tests/data/LF_MCT_UseCase/settings/mct_cold_for_results_generation.xml
index 82f62c65..1eec4877 100644
--- a/tests/data/LF_MCT_UseCase/settings/mct_cold_for_results_generation.xml
+++ b/tests/data/LF_MCT_UseCase/settings/mct_cold_for_results_generation.xml
@@ -161,7 +161,10 @@ You can use builtin path variables in this template and reference to other paths
-
+
+
+
+
@@ -3690,12 +3693,6 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
-
-
- Reported total water storage [mm]
-
-
-
Reported days since last rain
diff --git a/tests/data/LF_MCT_UseCase/settings/mct_inflow.xml b/tests/data/LF_MCT_UseCase/settings/mct_inflow.xml
index 3d003e9c..f8934451 100644
--- a/tests/data/LF_MCT_UseCase/settings/mct_inflow.xml
+++ b/tests/data/LF_MCT_UseCase/settings/mct_inflow.xml
@@ -161,7 +161,10 @@ You can use builtin path variables in this template and reference to other paths
-
+
+
+
+
@@ -3695,12 +3698,6 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
-
-
- Reported total water storage [mm]
-
-
-
Reported days since last rain
diff --git a/tests/data/LF_MCT_UseCase/settings/mct_inflow_test.xml b/tests/data/LF_MCT_UseCase/settings/mct_inflow_test.xml
index d4afb104..d4663f71 100644
--- a/tests/data/LF_MCT_UseCase/settings/mct_inflow_test.xml
+++ b/tests/data/LF_MCT_UseCase/settings/mct_inflow_test.xml
@@ -160,7 +160,10 @@ You can use builtin path variables in this template and reference to other paths
-
+
+
+
+
@@ -3588,12 +3591,6 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
-
-
- Reported total water storage [mm]
-
-
-
Reported days since last rain
diff --git a/tests/data/LF_MCT_UseCase/settings/mct_prerun_test_only.xml b/tests/data/LF_MCT_UseCase/settings/mct_prerun_test_only.xml
index e9ce35dc..eb097a9c 100644
--- a/tests/data/LF_MCT_UseCase/settings/mct_prerun_test_only.xml
+++ b/tests/data/LF_MCT_UseCase/settings/mct_prerun_test_only.xml
@@ -162,7 +162,10 @@ You can use builtin path variables in this template and reference to other paths
-
+
+
+
+
@@ -3688,12 +3691,6 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
-
-
- Reported total water storage [mm]
-
-
-
Reported days since last rain
diff --git a/tests/data/LF_MCT_UseCase/settings/mct_warm.xml b/tests/data/LF_MCT_UseCase/settings/mct_warm.xml
index 0daf0e67..029694aa 100644
--- a/tests/data/LF_MCT_UseCase/settings/mct_warm.xml
+++ b/tests/data/LF_MCT_UseCase/settings/mct_warm.xml
@@ -162,7 +162,10 @@ You can use builtin path variables in this template and reference to other paths
-
+
+
+
+
@@ -3536,12 +3539,6 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
-
-
- Reported total water storage [mm]
-
-
-
Reported days since last rain
diff --git a/tests/data/LF_MCT_UseCase/settings/mct_warm_endmaps.xml b/tests/data/LF_MCT_UseCase/settings/mct_warm_endmaps.xml
index 80f39f53..876d2cbf 100644
--- a/tests/data/LF_MCT_UseCase/settings/mct_warm_endmaps.xml
+++ b/tests/data/LF_MCT_UseCase/settings/mct_warm_endmaps.xml
@@ -162,7 +162,10 @@ You can use builtin path variables in this template and reference to other paths
-
+
+
+
+
@@ -3536,12 +3539,6 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
-
-
- Reported total water storage [mm]
-
-
-
Reported days since last rain
diff --git a/tests/data/LF_lat_lon_UseCase/prerun_lat_lon.xml b/tests/data/LF_lat_lon_UseCase/prerun_lat_lon.xml
index 607d038b..4679cb35 100644
--- a/tests/data/LF_lat_lon_UseCase/prerun_lat_lon.xml
+++ b/tests/data/LF_lat_lon_UseCase/prerun_lat_lon.xml
@@ -80,7 +80,9 @@
-
+
+
+
diff --git a/tests/data/LF_lat_lon_UseCase/run_lat_lon.xml b/tests/data/LF_lat_lon_UseCase/run_lat_lon.xml
index 749c515e..3a3a7bb6 100644
--- a/tests/data/LF_lat_lon_UseCase/run_lat_lon.xml
+++ b/tests/data/LF_lat_lon_UseCase/run_lat_lon.xml
@@ -81,7 +81,9 @@
-
+
+
+
diff --git a/tests/test_results.py b/tests/test_results.py
index 106bfd88..6e1754d7 100644
--- a/tests/test_results.py
+++ b/tests/test_results.py
@@ -64,7 +64,7 @@ def run(self, dt_sec, step_start, step_end):
opts_to_set=('repDischargeTs', 'repDischargeMaps',
"repThetaMaps", "repThetaForestMaps",
"repThetaIrrigationMaps", "repE2O2",
- "repTotalWaterStorageMaps") + self.modules_to_set,
+ "repTWSMaps", "repStorageMaps", "repFlowMomMaps") + self.modules_to_set,
opts_to_unset=opts_to_unset,
vars_to_set={'StepStart': step_start,
'StepEnd': step_end,
@@ -72,7 +72,7 @@ def run(self, dt_sec, step_start, step_end):
'PathOut': output_dir})
mk_path_out(output_dir)
lisfloodexe(settings)
-
+
def test_output_daily(self):
self.run('86400', '02/01/2016 06:00', '02/07/2016 06:00')
self.compare_reference('dis', check='map', step_length='86400')
@@ -85,7 +85,14 @@ def test_output_daily(self):
self.compare_reference('tha', check='map', step_length='86400')
self.compare_reference('thc', check='map', step_length='86400')
self.compare_reference('lz', check='map', step_length='86400')
- self.compare_reference('tws', check='map', step_length='86400')
+ self.compare_reference('TotalWS', check='map', step_length='86400')
+ self.compare_reference('GWstor', check='map', step_length='86400')
+ self.compare_reference('Soilstor', check='map', step_length='86400')
+ self.compare_reference('Riverstor', check='map', step_length='86400')
+ self.compare_reference('Lakestor', check='map', step_length='86400')
+ self.compare_reference('Snowstor', check='map', step_length='86400')
+ self.compare_reference('Cumstor', check='map', step_length='86400')
+ self.compare_reference('FlowMomentum', check='map', step_length='86400')
def test_output_6h(self):
self.run('21600', '02/01/2016 06:00', '02/07/2016 06:00')
@@ -99,7 +106,14 @@ def test_output_6h(self):
self.compare_reference('tha', check='map', step_length='21600')
self.compare_reference('thc', check='map', step_length='21600')
self.compare_reference('lz', check='map', step_length='21600')
- self.compare_reference('tws', check='map', step_length='21600')
+ self.compare_reference('TotalWS', check='map', step_length='21600')
+ self.compare_reference('GWstor', check='map', step_length='21600')
+ self.compare_reference('Soilstor', check='map', step_length='21600')
+ self.compare_reference('Riverstor', check='map', step_length='21600')
+ self.compare_reference('Lakestor', check='map', step_length='21600')
+ self.compare_reference('Snowstor', check='map', step_length='21600')
+ self.compare_reference('Cumstor', check='map', step_length='21600')
+ self.compare_reference('FlowMomentum', check='map', step_length='21600')
def test_initvars(self):
output_dir = mk_path_out(os.path.join(self.case_dir, 'out/test_results_initvars'))
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 1f48b7b2..173716fa 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -201,18 +201,102 @@ class ETRS89TestCase(object):
'tss': None,
},
},
- 'tws': {
- 'report_map': 'TotalWaterStorageMaps',
+ 'TotalWS': {
+ 'report_map': 'TWSMaps',
'report_tss': None,
'86400': {
- 'map': os.path.join(ref_dir, 'output_reference_daily/tws.nc'),
+ 'map': os.path.join(ref_dir, 'output_reference_daily/TotalWS.nc'),
'tss': None,
},
'21600': {
- 'map': os.path.join(ref_dir, 'output_reference_6h/tws.nc'),
+ 'map': os.path.join(ref_dir, 'output_reference_6h/TotalWS.nc'),
'tss': None,
},
- },
+ },
+ 'GWstor': {
+ 'report_map': 'GWSMaps',
+ 'report_tss': None,
+ '86400': {
+ 'map': os.path.join(ref_dir, 'output_reference_daily/GWstor.nc'),
+ 'tss': None,
+ },
+ '21600': {
+ 'map': os.path.join(ref_dir, 'output_reference_6h/GWstor.nc'),
+ 'tss': None,
+ },
+ },
+ 'Soilstor': {
+ 'report_map': 'SoilSMaps',
+ 'report_tss': None,
+ '86400': {
+ 'map': os.path.join(ref_dir, 'output_reference_daily/Soilstor.nc'),
+ 'tss': None,
+ },
+ '21600': {
+ 'map': os.path.join(ref_dir, 'output_reference_6h/Soilstor.nc'),
+ 'tss': None,
+ },
+ },
+ 'Riverstor': {
+ 'report_map': 'RiverSMaps',
+ 'report_tss': None,
+ '86400': {
+ 'map': os.path.join(ref_dir, 'output_reference_daily/Riverstor.nc'),
+ 'tss': None,
+ },
+ '21600': {
+ 'map': os.path.join(ref_dir, 'output_reference_6h/Riverstor.nc'),
+ 'tss': None,
+ },
+ },
+ 'Lakestor': {
+ 'report_map': 'LakeSMaps',
+ 'report_tss': None,
+ '86400': {
+ 'map': os.path.join(ref_dir, 'output_reference_daily/Lakestor.nc'),
+ 'tss': None,
+ },
+ '21600': {
+ 'map': os.path.join(ref_dir, 'output_reference_6h/Lakestor.nc'),
+ 'tss': None,
+ },
+ },
+ 'Snowstor': {
+ 'report_map': 'SnowSMaps',
+ 'report_tss': None,
+ '86400': {
+ 'map': os.path.join(ref_dir, 'output_reference_daily/Snowstor.nc'),
+ 'tss': None,
+ },
+ '21600': {
+ 'map': os.path.join(ref_dir, 'output_reference_6h/Snowstor.nc'),
+ 'tss': None,
+ },
+ },
+ 'Cumstor': {
+ 'report_map': 'CumSMaps',
+ 'report_tss': None,
+ '86400': {
+ 'map': os.path.join(ref_dir, 'output_reference_daily/Cumstor.nc'),
+ 'tss': None,
+ },
+ '21600': {
+ 'map': os.path.join(ref_dir, 'output_reference_6h/Cumstor.nc'),
+ 'tss': None,
+ },
+ },
+ 'FlowMomentum': {
+ 'report_map': 'FlowMomMaps',
+ 'report_tss': None,
+ '86400': {
+ 'map': os.path.join(ref_dir, 'output_reference_daily/FlowMomentum.nc'),
+ 'tss': None,
+ },
+ '21600': {
+ 'map': os.path.join(ref_dir, 'output_reference_6h/FlowMomentum.nc'),
+ 'tss': None,
+ },
+ },
'avgdis': {
'report_map': 'AvgDis',
'report_tss': None,