flopy.modflow.mfzon module¶
mfzon module. Contains the ModflowZone class. Note that the user can access the ModflowZone class as flopy.modflow.ModflowZone.
Additional information for this MODFLOW package can be found at the Online MODFLOW Guide.
- class ModflowZon(model, zone_dict=None, extension='zon', unitnumber=None, filenames=None)[source]¶
Bases:
flopy.pakbase.Package
MODFLOW Zone Package Class.
- Parameters
model (model object) – The model object (of type
flopy.modflow.mf.Modflow
) to which this package will be added.zone_dict (dict) – Dictionary with zone data for the model. zone_dict is typically instantiated using load method.
extension (string) – Filename extension (default is ‘zon’)
unitnumber (int) – File unit number (default is None).
filenames (str or list of str) – Filenames to use for the package. If filenames=None the package name will be created using the model name and package extension. If a single string is passed the package will be set to the string. Default is None.
Notes
Parameters are supported in Flopy only when reading in existing models. Parameter values are converted to native values in Flopy and the connection to “parameters” is thus nonexistent.
Examples
>>> import flopy >>> m = flopy.modflow.Modflow() >>> zonedict = flopy.modflow.ModflowZon(m, zone_dict=zone_dict)
- classmethod load(f, model, nrow=None, ncol=None, ext_unit_dict=None)[source]¶
Load an existing package.
- Parameters
f (filename or file handle) – File to load.
model (model object) – The model object (of type
flopy.modflow.mf.Modflow
) to which this package will be added.nrow (int) – number of rows. If not specified it will be retrieved from the model object. (default is None).
ncol (int) – number of columns. If not specified it will be retrieved from the model object. (default is None).
ext_unit_dict (dictionary, optional) – If the arrays in the file are specified using EXTERNAL, or older style array control records, then f should be a file handle. In this case ext_unit_dict is required, which can be constructed using the function
flopy.utils.mfreadnam.parsenamefile
.
- Returns
zone
- Return type
ModflowZone dict
Examples
>>> import flopy >>> m = flopy.modflow.Modflow() >>> zon = flopy.modflow.ModflowZon.load('test.zon', m)