feat(netcdf): support writing simulation#2564
Open
mjreno wants to merge 44 commits intomodflowpy:developfrom
Open
feat(netcdf): support writing simulation#2564mjreno wants to merge 44 commits intomodflowpy:developfrom
mjreno wants to merge 44 commits intomodflowpy:developfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #2564 +/- ##
===========================================
+ Coverage 55.5% 72.2% +16.6%
===========================================
Files 644 667 +23
Lines 124135 130721 +6586
===========================================
+ Hits 68947 94422 +25475
+ Misses 55188 36299 -18889
🚀 New features to boost your workflow:
|
d4fbc10 to
83e5167
Compare
f9f6427 to
d4aeff6
Compare
added 19 commits
October 9, 2025 09:44
added 24 commits
October 9, 2025 09:54
Member
|
I think the pattern here is great — iteratively building a dataset from select packages. A similar way to achieve the same thing with xarray could be a |
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.
NetCDF simulation write support:
netcdfargument supported forwrite_simulation()READARRAYGRIDpackages including layered aux variablesNetCDFinput filesNetCDFfile (ASCII inputs updated in all cases)Non-interactive example:
Internally, the dataset is generated by the model
modelgridobject. Package variables and data are added by mf6 package objects. User facing functions are intended, however, to support different approaches to building the dataset.Create a base dataset:
ds = gwf.modelgrid.dataset(modeltime=gwf.modeltime)Add package variables with data:
To retrieve information about package netcdf variables without requesting the package to update the dataset:
Or, if a simulation doesn't yet exist:
In this case the dictionary contains very similar information to the one above but that is not always true. This approach offers the ability to construct a
MODFLOW 6compliantNetCDFinput file with help frommodelgrid / modeltimeandFloPystatic model and package functions.Layered Mesh (UGRID)versions of these examples also are supported.