feat(gridgen): build GNC package input from gridgen output - #2789
Open
jdhughes-dev wants to merge 2 commits into
Open
feat(gridgen): build GNC package input from gridgen output#2789jdhughes-dev wants to merge 2 commits into
jdhughes-dev wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2789 +/- ##
===========================================
+ Coverage 55.5% 72.7% +17.2%
===========================================
Files 644 662 +18
Lines 124135 132705 +8570
===========================================
+ Hits 68947 96542 +27595
+ Misses 55188 36163 -19025
🚀 New features to boost your workflow:
|
jdhughes-dev
force-pushed
the
feat-gridgen-gnc
branch
from
August 4, 2026 21:01
1a36867 to
4eeab30
Compare
Gridgen computes the ghost node data whenever it exports a grid and writes it to qtg.gnc.dat, but the file was not read, so the data it already had was not reaching the GNC Package. Gridgen now reads the file with get_gnc and converts it to MODFLOW 6 and MODFLOW-USG GNC Package input with get_gridprops_gnc6 and get_gridprops_gnc5. Two notebooks show the workflow, and the MODFLOW 6 notebook compares the corrected and uncorrected solutions against the exact solution for a confined homogeneous problem with a linear head field. Also corrects MfUsgGnc.write_file, which formatted the contributing factors with %10.2e and truncated them to three significant digits, wrote the options list with its Python repr, and wrote the record fields with no separator so that a value filling its width ran into the next value.
jdhughes-dev
force-pushed
the
feat-gridgen-gnc
branch
from
August 4, 2026 23:03
4eeab30 to
bfb655e
Compare
fmt_string joined the field formats with no separator regardless of the format of the list, so the fields of a free format list were held apart only by the padding in each format. A value that filled its width ran into the next value and the record could no longer be read with URWORD. Ten digit node numbers were enough to merge four fields of a gnc record into one token, and a free format CLN model was already writing output that only held together because of the field widths. The separator now follows the format of the list, the way MfList.fmt_string already does it: a space for free format, which URWORD reads, and nothing for fixed format, which is read by position. This replaces the sep argument added earlier in this branch, which put the choice on the caller instead of taking it from the format. Closes modflowpy#2788
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
Gridgen.get_gncto read the ghost node data gridgen writes toqtg.gnc.datAdded
Gridgen.get_gridprops_gnc6,Gridgen.get_gridprops_gnc5, andget_gridprops_gnc5to convert it to MODFLOW 6 and MODFLOW-USG GNC Package inputFixed
MfUsgGnc.write_file, which truncated the contributing factors to three significant digits and wrote the options list with its Python reprFixed
fmt_string, which joined the field formats with no separator regardless of the format of the list, so a value that filled its width ran into the next valueCloses bug: CLN package list output has no separator between fields #2788