Skip to content

Commit 5aae8b0

Browse files
bug fixes reservoirs.py
1 parent c0ec4fc commit 5aae8b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lisflood/hydrological_modules/reservoir.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def initial(self):
153153

154154
# factor of the flood outflow
155155
if str(binding['ReservoirFloodOutflowFactor']).endswith('txt'):
156-
factor_outflow = lookupscalar(str(binding['ReservoirFloodStorage']), ReservoirSitePcr)
156+
factor_outflow = lookupscalar(str(binding['ReservoirFloodOutflowFactor']), ReservoirSitePcr)
157157
factor_outflow = compressArray(factor_outflow)
158158
else:
159159
factor_outflow = loadmap('ReservoirFloodOutflowFactor')
@@ -187,14 +187,14 @@ def initial(self):
187187
flood_outflow = lookupscalar(str(binding['ReservoirFloodOutflow']), ReservoirSitePcr)
188188
flood_outflow = compressArray(flood_outflow)
189189
flood_outflow = np.compress(self.var.ReservoirSitesC > 0, flood_outflow)
190-
self.var.FloodReservoirOutflow = factor_outflow * flood_outflow
190+
self.var.FloodReservoirOutflow = np.maximum(self.var.NormalReservoirOutflow, factor_outflow * flood_outflow)
191191

192192
# release coefficient
193193
self.var.k = np.maximum(1 - 5 * self.var.TotalReservoirStorageM3CC * (1 - self.var.FloodStorageLimit) / self.var.CatchmentAreaM2, 0)
194194

195195
# INITIAL CONDITIONS
196196

197-
# initial reservoir fill (fraction of total storage, [-])
197+
# initial reservoir fill (fraction of total storage, [-])
198198
# -9999: assume reservoirs are filled to 80% of the flood storage limit
199199
initial_fill = loadmap('ReservoirInitialFill')
200200
if np.max(initial_fill) == -9999:
@@ -271,7 +271,7 @@ def dynamic_inloop(self, NoRoutingExecuted: int):
271271
# conservative zone
272272
outflow = np.where(
273273
self.var.ReservoirFillCC <= conservative_fill,
274-
normal_outflow * self.var.ReservoirFillCC / conservative_fill,
274+
normal_outflow * self.var.ReservoirFillCC / flood_fill,
275275
outflow
276276
)
277277
# normal zone and NO flood inflow

0 commit comments

Comments
 (0)