Skip to content

Improve lake gwt - #562

Merged
rubencalje merged 3 commits into
devfrom
improve_lake_gwt
Aug 27, 2026
Merged

Improve lake gwt#562
rubencalje merged 3 commits into
devfrom
improve_lake_gwt

Conversation

@rubencalje

@rubencalje rubencalje commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

This PR improves the support for a GroundWater Transport (GWT) model in the Lake (LAK) package. The user can now supply the concentration of the fluxes in and out of the lake, in the same way he can supply the fluxes for the GroundWater Flow (GWF) model.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request extends lake_from_gdf to better support the MF6 Lake Transport (LKT/GWT) workflow by allowing users to provide concentration inputs for lake-related fluxes (analogous to how fluxes are provided for the LAK/GWF model).

Changes:

  • Adds support for GWT-specific lake setting columns (e.g., GWT_CONCENTRATION, GWT_RUNOFF, GWT_EXT-INFLOW) and writes them into lakeperioddata.
  • Improves outlet handling by recognizing lakeout = "-1" (string) as a sentinel meaning “remove from model”.
  • Generalizes stress-period value resolution so settings can be taken from the dataset (when present) or treated as literal values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nlmod/gwf/lake.py
Comment on lines 224 to 231
lakeout = _get_and_check_single_value(lake_gdf, "lakeout")
if isinstance(lakeout, str):
if isinstance(lakeout, str) and lakeout == "-1":
# an integer -1 could have been converted to a string after saving gdf to disk
lakeout = int(lakeout)
elif isinstance(lakeout, str):
# when lakeout is a string, it represents the boundname
# we need to find the lakeno that belongs to this boundname
boundnameout = lakeout
Comment thread nlmod/gwf/lake.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread nlmod/gwf/lake.py
and not lake_gdf["lakeout"].eq("").all()
):
lakeout = _get_and_check_single_value(lake_gdf, "lakeout")
if isinstance(lakeout, str):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this logic be part of _get_and_check_single_value()?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it is way easier and robust to just expect boundnames, and to be strings? I don't like this behavior of using a single argument for either indices or names. The indices seem fragile anyway, when adding a feature, suddenly the numbering has to be checked

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only lakeout can be an integer as well. If we put this check in _get_and_check_single_value, unexpected things can happen to other variables.

I agree it is a bit ugly, that lakeout can be an integer (the lake number) or a string (the boundname). But, for backwards compatibility, I would like to keep both.

@dbrakenhoff dbrakenhoff left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@rubencalje
rubencalje merged commit 0ab3a62 into dev Aug 27, 2026
2 of 3 checks passed
@rubencalje
rubencalje deleted the improve_lake_gwt branch August 27, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants