Skip to content

Commit

Permalink
Fix bug when recharge or evaporation did not contain a time dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
rubencalje committed Nov 6, 2024
1 parent 0d1bc4c commit 281de38
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nlmod/gwf/lake.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,13 @@ def _cut_da_from_ds(gdf, ds, variable, boundname_column=None):
if "time" in ds[variable].dims:
da_cells = ds[variable].loc[:, cellids].copy()
ds[variable][:, cellids] = 0.0
# calculate thea area-weighted mean
df[column] = (da_cells * area).sum("icell2d") / area.sum()
else:
da_cells = ds[variable].loc[cellids].copy()
ds[variable][cellids] = 0.0
# calculate thea area-weighted mean
df[column] = (da_cells * area).sum("icell2d") / area.sum()
# calculate thea area-weighted mean
df[column] = float((da_cells * area).sum("icell2d") / area.sum())
return df


Expand Down

0 comments on commit 281de38

Please sign in to comment.