modflowpy / flopy

A Python package to create, run, and post-process MODFLOW-based models.
https://flopy.readthedocs.io
Other
517 stars 313 forks source link

feature: warn on unrecognized units #2008

Open wpbonelli opened 11 months ago

wpbonelli commented 11 months ago

Suggested in https://github.com/MODFLOW-USGS/modflow6/issues/1452

wpbonelli commented 11 months ago

This seems more involved than anticipated — when length_units are passed to e.g. flopy.mf6.ModflowGwfdis they are first set on the discretization instance via generic mfdata mechanisms before making their way into a Grid, which parses the value and attempts to assign a recognized unit. While Grid recognizes "cm" as "centimeters", this info is not passed back to the discretization during model initialization or when write_simulation() is called.

Intercepting somewhere and warning on unrecognized length units is possible but it seems better to consider refactoring init- and/or write-time logic so input files reflect everything flopy knows about the grid discretization