Skip to content

Commit 3bab042

Browse files
committed
Added lake ids in lakes warning msg
1 parent 9361e5a commit 3bab042

File tree

1 file changed

+5
-3
lines changed
  • src/lisflood/hydrological_modules

1 file changed

+5
-3
lines changed

src/lisflood/hydrological_modules/lakes.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ def dynamic_inloop(self, NoRoutingExecuted):
242242
# Check LakeOutflowCC for negative values
243243
if any(LakeStorageIndicator < 0):
244244
# this can happen with large oscillations in the lake inflow
245-
msg = f"Negative outflow from lakes. (Total negative values: {sum(LakeStorageIndicator < 0)}) \n" \
245+
msg = f"Negative outflow from lakes. \n" \
246+
f"(Total negative values: {sum(LakeStorageIndicator < 0)}, " \
247+
f"Lakes IDs: {self.var.LakeSitesCC[LakeStorageIndicator < 0]}) \n" \
246248
"Consider increasing computation time step for routing (DtSecChannel) \n"
247249
warnings.warn(LisfloodWarning(msg))
248250
LakeStorageIndicator[LakeStorageIndicator < 0] = 0
@@ -274,8 +276,8 @@ def dynamic_inloop(self, NoRoutingExecuted):
274276
# Check LakeStorageM3CC for negative values and set them to zero
275277
if any(np.isnan(self.var.LakeStorageM3CC)) or any(self.var.LakeStorageM3CC < 0):
276278
msg = "Negative or NaN volume for lake storage set to 0. \n" \
277-
f"(Total negative values: {sum(self.var.LakeStorageM3CC < 0)}, " \
278-
f"Total NaN values: {sum(np.isnan(self.var.LakeStorageM3CC))})\n" \
279+
f"Total negative values: {sum(self.var.LakeStorageM3CC < 0)}, Lakes IDs: {self.var.LakeSitesCC[self.var.LakeStorageM3CC < 0]} \n" \
280+
f"Total NaN values: {sum(np.isnan(self.var.LakeStorageM3CC))}, Lakes IDs: {self.var.LakeSitesCC[np.isnan(self.var.LakeStorageM3CC)]} \n" \
279281
"Increase computation time step for routing (DtSecChannel) \n"
280282
warnings.warn(LisfloodWarning(msg))
281283
self.var.LakeStorageM3CC[self.var.LakeStorageM3CC < 0] = 0

0 commit comments

Comments
 (0)