flopy.modflow.mf module
mf module. Contains the ModflowGlobal, ModflowList, and Modflow classes.
- class Modflow(modelname='modflowtest', namefile_ext='nam', version='mf2005', exe_name: str | PathLike = 'mf2005', structured=True, listunit=2, model_ws: str | PathLike = '.', external_path: str | PathLike | None = None, verbose=False, **kwargs)[source]
Bases:
BaseModel
MODFLOW Model Class.
- Parameters:
modelname (str, default "modflowtest") – Name of model. This string will be used to name the MODFLOW input that are created with write_model.
namefile_ext (str, default "nam") – Extension for the namefile.
version (str, default "mf2005") – MODFLOW version. Choose one of: “mf2k”, “mf2005” (default), “mfnwt”, or “mfusg”.
exe_name (str or PathLike, default "mf2005") – The name or path of the executable to use.
structured (bool, default True) – Specify if model grid is structured (default) or unstructured.
listunit (int, default 2) – Unit number for the list file.
model_ws (str or PathLike, default ".") – Model workspace. Directory name to create model data sets. (default is the present working directory).
external_path (str or PathLike, optional) – Location for external files.
verbose (bool, default False) – Print additional information to the screen.
Notes
Examples
>>> import flopy >>> m = flopy.modflow.Modflow()
- classmethod load(f: str, version='mf2005', exe_name: str | PathLike = 'mf2005', verbose=False, model_ws: str | PathLike = '.', load_only=None, forgive=False, check=True)[source]
Load an existing MODFLOW model.
- Parameters:
f (str) – Path to MODFLOW name file to load.
version (str, default "mf2005") – MODFLOW version. Choose one of: “mf2k”, “mf2005” (default), or “mfnwt”. Note that this can be modified on loading packages unique to different MODFLOW versions.
exe_name (str or PathLike, default "mf2005") – MODFLOW executable name or path.
verbose (bool, default False) – Show messages that can be useful for debugging.
model_ws (str or PathLike, default ".") – Model workspace path. Default is the current directory.
load_only (list, str or None) – List of case insensitive packages to load, e.g. [“bas6”, “lpf”]. One package can also be specified, e.g. “rch”. Default is None, which attempts to load all files. An empty list [] will not load any additional packages than is necessary. At a minimum, “dis” is always loaded.
forgive (bool, optional) – Option to raise exceptions on package load failure, which can be useful for debugging. Default False.
check (boolean, optional) – Check model input for common errors. Default True.
- Return type:
Examples
>>> import flopy >>> ml = flopy.modflow.Modflow.load('model.nam')
- property modelgrid
- property modeltime
- property ncol
- property ncpl
- property nlay
- property nper
- property nrow
- property nrow_ncol_nlay_nper
- property solver_tols