Skip to content

Commit

Permalink
Update waterabstraction.py
Browse files Browse the repository at this point in the history
Add .copy() to Wold to avoid overwriting of the variable when self.var.W1 is updated at line 587
  • Loading branch information
r3dmos authored Nov 21, 2024
1 parent b398fe1 commit 5501537
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lisflood/hydrological_modules/waterabstraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ def dynamic(self):
IrrigationWaterDemand = irrigation_for_prescribed*self.var.M3toMM
IrrigationWaterDemand = np.where(self.var.SoilFraction.values[ivegIrrigatedPrescribed] > 0, IrrigationWaterDemand / self.var.SoilFraction.values[ivegIrrigatedPrescribed], 0)
# updating soil moisture of LISFLOOD on Irrigated_prescribed fraction
Wold = self.var.W1.values[ivegIrrigatedPrescribed]
Wold = self.var.W1.values[ivegIrrigatedPrescribed].copy()
# if irrigated soil is less than Pf3 then fill up to Pf3 (if there is water demand)
# if more than Pf3 the additional water is transpirated
# there is no water demand if the soil is frozen
Expand Down

0 comments on commit 5501537

Please sign in to comment.