Skip to content

Commit 419df0a

Browse files
authoredJan 23, 2024
Merge pull request #146 from ec-jrc/development
Total water storage reporting
2 parents dd1abb4 + 6c218d2 commit 419df0a

File tree

19 files changed

+242
-258
lines changed

19 files changed

+242
-258
lines changed
 

‎VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.3.0
1+
4.3.1

‎docs/3_step3_preparing-setting-file/lisfloodSettings_reference.xml

+7-9
Original file line numberDiff line numberDiff line change
@@ -3378,14 +3378,6 @@ soil layer 2 (lower layer) [V/V] [mm3/mm3]
33783378
</comment>
33793379
</textvar>
33803380

3381-
<textvar name="ThetaMaps" value="$(PathOut)/th">
3382-
<comment>
3383-
Reported volumetric soil moisture content for combined
3384-
soil layer 1 and 2 [V/V] [mm3/mm3]
3385-
</comment>
3386-
</textvar>
3387-
3388-
33893381
<textvar name="UZMaps" value="$(PathOut)/uz">
33903382
<comment>
33913383
Reported storage in upper response box [mm]
@@ -3510,7 +3502,7 @@ soil layer 2 (lower layer) [V/V] [mm3/mm3]
35103502
</comment>
35113503
</textvar>
35123504

3513-
<textvar name="UZForestMaps" value="$(PathOut)/uzF">
3505+
<textvar name="UZForestMaps" value="$(PathOut)/uzf">
35143506
<comment>
35153507
Reported storage in upper response box [mm]
35163508
</comment>
@@ -3783,6 +3775,12 @@ Reported upper zone outflow [mm]
37833775
</comment>
37843776
</textvar>
37853777

3778+
<textvar name="UZOutflowIrrigationMaps" value="$(PathOut)/quzi">
3779+
<comment>
3780+
Reported upper zone outflow [mm]
3781+
</comment>
3782+
</textvar>
3783+
37863784
<textvar name="GwPercUZLZForestMaps" value="$(PathOut)/uz2lzF">
37873785
<comment>
37883786
Reported percolation from upper to lower zone [mm]

‎docs/4_annex_output-files/index.md

+64-133
Large diffs are not rendered by default.

‎src/lisflood/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
__version__ = version
1212
__authors__ = "Ad de Roo, Emiliano Gelati, Peter Burek, Johan van der Knijff, Niko Wanders"
13-
__date__ = "05/01/2024"
13+
__date__ = "23/01/2024"
1414
__copyright__ = "Copyright 2019-2024, European Commission - Joint Research Centre"
1515
__maintainer__ = "Stefania Grimaldi, Cinzia Mazzetti, Carlo Russo, Damien Decremer, Corentin Carton De Wiart, Valerio Lorini, Ad de Roo"
1616
__status__ = "Operation"

‎src/lisflood/global_modules/default_options.py

+34-11
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
'repLZOutflowMaps': False,
5252
'repLeafDrainageMaps': False,
5353
'repMBTs': False,
54+
'repTotalWaterStorageMaps': False,
5455
'repMeteoUpsGauges': False,
5556
'repPFMaps': False,
5657
'repPFSites': False,
@@ -222,6 +223,12 @@
222223
end=['repEndMaps'], steps=[], all=[],
223224
restrictoption=[], monthly=False,
224225
yearly=False),
226+
'CumIntSealedMaps': ReportedMap(name='CumIntSealedMaps',
227+
output_var='CumInterSealed',
228+
unit='mm', end=[], steps=[],
229+
all=['repCumInterCeptionMaps'],
230+
restrictoption=['nonInit'],
231+
monthly=False, yearly=False),
225232
'CumIntSealedState': ReportedMap(name='CumIntSealedState',
226233
output_var='CumInterSealed', unit='mm',
227234
end=[], steps=['repStateMaps'], all=[],
@@ -232,6 +239,17 @@
232239
end=['repEndMaps'], steps=[], all=[],
233240
restrictoption=[], monthly=False,
234241
yearly=False),
242+
'CumInterceptionMaps': ReportedMap(name='CumInterceptionMaps',
243+
output_var='CumInterception[0]', unit='mm',
244+
end=[], steps=[],
245+
all=['repCumInterCeptionMaps'],
246+
restrictoption=['nonInit'], monthly=False,
247+
yearly=False),
248+
'CumInterceptionState': ReportedMap(name='CumInterceptionState',
249+
output_var='CumInterception[0]', unit='mm',
250+
end=[], steps=['repStateMaps'], all=[],
251+
restrictoption=['nonInit'], monthly=False,
252+
yearly=False),
235253
'CumInterceptionForestEnd': ReportedMap(name='CumInterceptionForestEnd',
236254
output_var='CumInterception[1]',
237255
unit='mm', end=['repEndMaps'],
@@ -256,21 +274,16 @@
256274
steps=[], all=[],
257275
restrictoption=[],
258276
monthly=False, yearly=False),
277+
'CumInterceptionIrrigationMaps': ReportedMap(name='CumInterceptionIrrigationMaps',
278+
output_var='CumInterception[2]',
279+
unit='mm', end=[], steps=[],
280+
all=['repCumInterCeptionMaps'],
281+
restrictoption=['nonInit'],
282+
monthly=False, yearly=False),
259283
'CumInterceptionIrrigationState': ReportedMap(
260284
name='CumInterceptionIrrigationState', output_var='CumInterception[2]',
261285
unit='mm', end=[], steps=['repStateMaps'], all=[],
262286
restrictoption=['nonInit'], monthly=False, yearly=False),
263-
'CumInterceptionMaps': ReportedMap(name='CumInterceptionMaps',
264-
output_var='CumInterception[0]', unit='mm',
265-
end=[], steps=[],
266-
all=['repCumInterCeptionMaps'],
267-
restrictoption=['nonInit'], monthly=False,
268-
yearly=False),
269-
'CumInterceptionState': ReportedMap(name='CumInterceptionState',
270-
output_var='CumInterception[0]', unit='mm',
271-
end=[], steps=['repStateMaps'], all=[],
272-
restrictoption=['nonInit'], monthly=False,
273-
yearly=False),
274287
'DSLREnd': ReportedMap(name='DSLREnd', output_var='DSLR[0]', unit='-',
275288
end=['repEndMaps'], steps=[], all=[],
276289
restrictoption=[], monthly=False, yearly=False),
@@ -1099,6 +1112,10 @@
10991112
unit='mm', end=['repEndMaps'], steps=[],
11001113
all=[], restrictoption=[],
11011114
monthly=False, yearly=False),
1115+
'UZIrrigationMaps': ReportedMap(name='UZIrrigationMaps', output_var='UZ[2]',
1116+
unit='mm', end=[], steps=[],
1117+
all=['repUZMaps'], restrictoption=['nonInit'],
1118+
monthly=False, yearly=False),
11021119
'UZIrrigationState': ReportedMap(name='UZIrrigationState', output_var='UZ[2]',
11031120
unit='mm', end=[], steps=['repStateMaps'],
11041121
all=[], restrictoption=['nonInit'],
@@ -1167,6 +1184,12 @@
11671184
unit='m', end=[], steps=[],
11681185
all=[], restrictoption=['nonInit'],
11691186
monthly=False, yearly=False),
1187+
'TotalWaterStorageMaps': ReportedMap(name='TotalWaterStorageMaps',
1188+
output_var='TotalWaterStorageMM',
1189+
unit='mm', end=[], steps=[],
1190+
all=['repTotalWaterStorageMaps'],
1191+
restrictoption=['nonInit'],
1192+
monthly=False, yearly=False),
11701193
'WaterSecurityIndex': ReportedMap(name='WaterSecurityIndex',
11711194
output_var='WaterSecurityIndex', unit='-',
11721195
end=[], steps=['repWIndex'], all=[],

‎src/lisflood/hydrological_modules/waterbalance.py

+27-15
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,24 @@ def initial(self):
108108

109109
self.var.DischargeM3StructuresIni = np.take(np.bincount(self.var.Catchments, weights=DisStructure), self.var.Catchments)
110110

111+
# --------------------------------------------------------------------------
112+
# -------------------------------------------------------------------------
113+
114+
def storage_channel(self, option):
115+
ChannelStoredM3 = self.var.ChanM3.copy()
116+
if option['simulateLakes']:
117+
ChannelStoredM3 += self.var.LakeStorageM3Balance
118+
if option['simulateReservoirs']:
119+
ChannelStoredM3 += self.var.ReservoirStorageM3
120+
if option['simulatePolders']:
121+
ChannelStoredM3 += self.var.PolderStorageM3
122+
return ChannelStoredM3
123+
124+
def storage_hillslope(self):
125+
ax_veg = self.var.SoilFraction.dims.index("vegetation")
126+
Hill1 = self.var.LZ + np.sum(self.var.SoilFraction * (self.var.CumInterception + self.var.W1 + self.var.W2 + self.var.UZ), ax_veg)
127+
HillslopeStoredMM = self.var.WaterDepth + self.var.SnowCover + Hill1 + self.var.DirectRunoffFraction * self.var.CumInterSealed
128+
return HillslopeStoredMM * self.var.MMtoM3
111129

112130
# --------------------------------------------------------------------------
113131
# -------------------------------------------------------------------------
@@ -118,6 +136,11 @@ def dynamic(self):
118136
settings = LisSettings.instance()
119137
option = settings.options
120138
maskinfo = MaskInfo.instance()
139+
140+
if (not(option['InitLisflood'])) and option['repTotalWaterStorageMaps']:
141+
ChannelStoredM3 = self.storage_channel(option)
142+
HillslopeStoredM3 = self.storage_hillslope()
143+
self.var.TotalWaterStorageMM = (ChannelStoredM3 + HillslopeStoredM3) * self.var.M3toMM
121144

122145
if (not(option['InitLisflood'])) and option['repMBTs']:
123146

@@ -143,22 +166,12 @@ def dynamic(self):
143166
# spatially variable
144167

145168
# This is stored:
146-
ChannelStoredM3 = self.var.ChanM3.copy()
147-
if option['simulateLakes']:
148-
ChannelStoredM3 += self.var.LakeStorageM3Balance
149-
if option['simulateReservoirs']:
150-
ChannelStoredM3 += self.var.ReservoirStorageM3
151-
if option['simulatePolders']:
152-
ChannelStoredM3 += self.var.PolderStorageM3
153-
169+
ChannelStoredM3 = self.storage_channel(option)
154170
# ChannelStoredM3=ChanM3 + ReservoirStorageM3 + LakeStorageM3 + PolderStorageM3;
155171
# Water stored in channel network [m3] (including reservoirs,
156172
# lakes, polders)
157173

158-
ax_veg=self.var.SoilFraction.dims.index("vegetation")
159-
Hill1 = self.var.LZ + np.sum(self.var.SoilFraction * (self.var.CumInterception + self.var.W1 + self.var.W2 + self.var.UZ),ax_veg)
160-
HillslopeStoredM3 = (self.var.WaterDepth + self.var.SnowCover + Hill1 + self.var.DirectRunoffFraction * self.var.CumInterSealed) * self.var.MMtoM * self.var.PixelArea
161-
174+
HillslopeStoredM3 = self.storage_hillslope()
162175
# Water stored at hillslope elements [m3]
163176
# Note that W1, W2 and TotalGroundWater are defined for the pixel's permeable fraction
164177
# only, which is why we need to multiply with PermeableFraction to get the volumes right (no soil moisture
@@ -184,8 +197,7 @@ def dynamic(self):
184197
if not option["cropsEPIC"]: # If EPIC is active, the rice fraction initialisation is handled by EPIC (setSoilFractions in EPIC_main.py)
185198
self.var.SoilFraction.values[self.var.vegetation.index('Rainfed_prescribed')] += self.var.RiceFraction
186199

187-
Hill1 = self.var.LZ + (self.var.SoilFraction * (self.var.CumInterception + self.var.W1 + self.var.W2 + self.var.UZ)).sum("vegetation").values
188-
HillslopeStoredM3 = (self.var.WaterDepth + self.var.SnowCover + Hill1 + self.var.DirectRunoffFraction * self.var.CumInterSealed) * self.var.MMtoM * self.var.PixelArea
200+
HillslopeStoredM3 = self.storage_hillslope()
189201
WaterStored_nextstep =np.take(np.bincount(self.var.Catchments,weights=ChannelStoredM3),self.var.Catchments)
190202
WaterStored_nextstep += np.take(np.bincount(self.var.Catchments,weights=HillslopeStoredM3),self.var.Catchments)
191203

@@ -273,4 +285,4 @@ def dynamic(self):
273285
ones = maskinfo.in_zero() + 1.0
274286
numpixels = np.take(np.bincount(self.var.Catchments, weights=ones),self.var.Catchments)
275287
self.var.MBErrorStorage = self.var.MBError/(self.var.WaterInit)
276-
self.var.AverageFractions = SumFractions/numpixels
288+
self.var.AverageFractions = SumFractions/numpixels

‎src/lisfloodSettings_reference.xml

+32-10
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ You can use builtin path variables in this template and reference to other paths
109109
<setoption choice="1" name="repPercolationMaps"/>
110110
<setoption choice="1" name="repRWS"/>
111111
<setoption choice="1" name="repPFMaps"/>
112+
<setoption choice="1" name="repTotalWaterStorageMaps"/>
112113
<setoption choice="1" name="repPFForestMaps"/>
113114

114115
<setoption choice="1" name="repTotalAbs"/>
@@ -3385,14 +3386,6 @@ soil layer 2 (lower layer) [V/V] [mm3/mm3]
33853386
</comment>
33863387
</textvar>
33873388

3388-
<textvar name="ThetaMaps" value="$(PathOut)/th">
3389-
<comment>
3390-
Reported volumetric soil moisture content for combined
3391-
soil layer 1 and 2 [V/V] [mm3/mm3]
3392-
</comment>
3393-
</textvar>
3394-
3395-
33963389
<textvar name="UZMaps" value="$(PathOut)/uz">
33973390
<comment>
33983391
Reported storage in upper response box [mm]
@@ -3429,6 +3422,12 @@ Reported storage in lower response box [mm]
34293422
</comment>
34303423
</textvar>
34313424

3425+
<textvar name="TotalWaterStorageMaps" value="$(PathOut)/tws">
3426+
<comment>
3427+
Reported total water storage [mm]
3428+
</comment>
3429+
</textvar>
3430+
34323431
<textvar name="DSLRMaps" value="$(PathOut)/dslr">
34333432
<comment>
34343433
Reported days since last rain
@@ -3483,7 +3482,6 @@ Reported interception storage, other fraction [mm]
34833482
</comment>
34843483
</textvar>
34853484

3486-
34873485
<textvar name="DSLRForestMaps" value="$(PathOut)/dslrf">
34883486
<comment>
34893487
Reported days since last rain
@@ -3496,6 +3494,12 @@ Reported interception storage, forest fraction [mm]
34963494
</comment>
34973495
</textvar>
34983496

3497+
<textvar name="CumInterceptionIrrigationMaps" value="$(PathOut)/cumi">
3498+
<comment>
3499+
Reported interception storage, irrigation fraction [mm]
3500+
</comment>
3501+
</textvar>
3502+
34993503
<textvar name="Theta1ForestMaps" value="$(PathOut)/thfa">
35003504
<comment>
35013505
Reported volumetric soil moisture content for
@@ -3517,11 +3521,17 @@ soil layer 2 (lower layer) [V/V] [mm3/mm3]
35173521
</comment>
35183522
</textvar>
35193523

3520-
<textvar name="UZForestMaps" value="$(PathOut)/uzF">
3524+
<textvar name="UZForestMaps" value="$(PathOut)/uzf">
35213525
<comment>
35223526
Reported storage in upper response box [mm]
35233527
</comment>
35243528
</textvar>
3529+
3530+
<textvar name="CumIntSealedMaps" value="$(PathOut)/cums">
3531+
<comment>
3532+
Reported interception (depression) storage, direct runoff (impervious) fraction [mm]
3533+
</comment>
3534+
</textvar>
35253535
</group>
35263536

35273537
<group>
@@ -3790,6 +3800,12 @@ Reported upper zone outflow [mm]
37903800
</comment>
37913801
</textvar>
37923802

3803+
<textvar name="UZOutflowIrrigationMaps" value="$(PathOut)/quzi">
3804+
<comment>
3805+
Reported upper zone outflow [mm]
3806+
</comment>
3807+
</textvar>
3808+
37933809
<textvar name="GwPercUZLZForestMaps" value="$(PathOut)/uz2lzF">
37943810
<comment>
37953811
Reported percolation from upper to lower zone [mm]
@@ -3829,6 +3845,12 @@ soil layer 2 [V/V] [mm3/mm3]
38293845
</comment>
38303846
</textvar>
38313847

3848+
<textvar name="UZIrrigationMaps" value="$(PathOut)/uzi">
3849+
<comment>
3850+
Reported storage in upper response box [mm]
3851+
</comment>
3852+
</textvar>
3853+
38323854
</group>
38333855

38343856

Binary file not shown.
Binary file not shown.

‎tests/data/LF_ETRS89_UseCase/settings/base.xml

+14-9
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<setoption choice="0" name="repsimulateReservoirs"/>
4141
<setoption choice="0" name="repSnowMaps"/>
4242
<setoption choice="0" name="repPFMaps"/>
43+
<setoption choice="0" name="repTotalWaterStorageMaps"/>
4344

4445
<setoption choice="0" name="repLZMaps"/>
4546

@@ -3183,14 +3184,6 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
31833184
</comment>
31843185
</textvar>
31853186

3186-
<textvar name="ThetaMaps" value="$(PathOut)/th">
3187-
<comment>
3188-
Reported volumetric soil moisture content for combined
3189-
soil layer 1 and 2 [V/V]
3190-
</comment>
3191-
</textvar>
3192-
3193-
31943187
<textvar name="UZMaps" value="$(PathOut)/uz">
31953188
<comment>
31963189
Reported storage in upper response box [mm]
@@ -3226,6 +3219,12 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
32263219
Reported storage in lower response box [mm]
32273220
</comment>
32283221
</textvar>
3222+
3223+
<textvar name="TotalWaterStorageMaps" value="$(PathOut)/tws">
3224+
<comment>
3225+
Reported total water storage [mm]
3226+
</comment>
3227+
</textvar>
32293228

32303229
<textvar name="DSLRMaps" value="$(PathOut)/dslr">
32313230
<comment>
@@ -3315,7 +3314,7 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
33153314
</comment>
33163315
</textvar>
33173316

3318-
<textvar name="UZForestMaps" value="$(PathOut)/uzF">
3317+
<textvar name="UZForestMaps" value="$(PathOut)/uzf">
33193318
<comment>
33203319
Reported storage in upper response box [mm]
33213320
</comment>
@@ -3540,6 +3539,12 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
35403539
</comment>
35413540
</textvar>
35423541

3542+
<textvar name="UZOutflowIrrigationMaps" value="$(PathOut)/quzi">
3543+
<comment>
3544+
Reported upper zone outflow [mm]
3545+
</comment>
3546+
</textvar>
3547+
35433548
<textvar name="GwPercUZLZForestMaps" value="$(PathOut)/uz2lzF">
35443549
<comment>
35453550
Reported percolation from upper to lower zone [mm]

0 commit comments

Comments
 (0)
Please sign in to comment.