Epic: Modflow 6: Differentiate Package objects into low-level and high-level abstraction layers
It has become somewhat clear through the Lake Package (!166 (closed)), Well, etc. that we could use both a "high level" package interface next to a "low level" one, which (mostly) matches the mf6 input one-to-one.
The high level classes would contain to_mf6_pkg
method, which takes a model grid, and returns a low-level grid with the data regridded to the model grid. The low level classes would contain to_grid
to go from low-level to high-level (or more general name, wells would be turned into points or something). In MR197, a prototype low-level class was introduced, with a ncellid
dimension, which contain the cellids, and the nmax_cellid
dimension. The latter can have length 1 (cell3d
for DISU), length 2 (layer, cell2d
for DISV) or length 3 (layer, row, column
for DIS).
This would replace the "to_recarr" functions and "to_sparse" method (which is a bit of a misnomer). Benefit is that users can completely inspect the intermediate objects, rather than having to debug the files.
A high-level package has the following functionality:
- Regrid to any provided grid
- Mask cells in inactive model cells
- Clip from a provided clipping box (xmin/xmax, ymin/ymax, time_min/time_max, zmin/zmax).
- Write to netcdf
- Read from netcdf
- Connect to GIS world (Inherent from using x,y coordinates)
- Convert to low-level
The low-level package the following:
- Writing Modflow 6 files
- Reading Modflow 6 files
- Convert to high-level
A draft feature branch was created here: !199