-
Notifications
You must be signed in to change notification settings - Fork 342
feat(netcdf): support writing simulation #2564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
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
|
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 |
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.