flopy.modflow.mfag module

mfag module which contains the ModflowAg class.

Note that the user can access the ModflowAg class as flopy.modflow.ModflowAg.

Additional information for this MODFLOW package can be found at <https://www.sciencedirect.com/science/article/pii/S1364815219305080>`_.

class ModflowAg(model, options=None, time_series=None, well_list=None, irrdiversion=None, irrwell=None, supwell=None, extension='ag', unitnumber=None, filenames=None, nper=0)[source]

Bases: flopy.pakbase.Package

The ModflowAg class is used to build read, write, and edit data from the MODFLOW-NWT AG package.

Parameters:
  • model (flopy.modflow.Modflow object) – model object
  • options (flopy.utils.OptionBlock object) – option block object
  • time_series (np.recarray) – numpy recarray for the time series block
  • well_list (np.recarray) – recarray of the well_list block
  • irrdiversion (dict {per: np.recarray}) – dictionary of the irrdiversion block
  • irrwell (dict {per: np.recarray}) – dictionary of the irrwell block
  • supwell (dict {per: np.recarray}) – dictionary of the supwell block
  • extension (str, optional) – default is .ag
  • unitnumber (list, optional) – fortran unit number for modflow, default 69
  • filenames (list, optional) – file name for ModflowAwu package to write input
  • nper (int) – number of stress periods in the model

Examples

load a ModflowAg file

>>> import flopy
>>> ml = flopy.modflow.Modflow('agtest')
>>> ag = flopy.modflow.ModflowAg.load('test.ag', ml, nper=2)
static get_default_dtype(maxells=0, block='well')[source]

Function that gets a default dtype for a block

Parameters:
  • maxells (int) – maximum number of irrigation links
  • block (str) – str which indicates data set valid options are “well” “tabfile_well” “timeseries” “irrdiversion” “irrwell” “supwell”
Returns:

dtype

Return type:

(list, tuple)

static get_empty(numrecords, maxells=0, block='well')[source]

Creates an empty record array corresponding to the block data type it is associated with.

Parameters:
  • numrecords (int) – number of records to create recarray with
  • maxells (int, optional) – maximum number of irrigation links
  • block (str) – str which indicates data set valid options are “well” , “tabfile_well” , “timeseries” , “irrdiversion_modflow” , “irrdiversion_gsflow” , “irrwell_modflow” , “irrwell_gsflow” , “supwell”
Returns:

Return type:

np.recarray

classmethod load(f, model, nper=0, ext_unit_dict=None)[source]

Method to load the AG package from file

Parameters:
  • f (str) – filename
  • model (gsflow.modflow.Modflow object) – model to attach the ag pacakge to
  • nper (int) – number of stress periods in model
  • ext_unit_dict (dict, optional) –
Returns:

Return type:

ModflowAg object

plotable
segment_list

Method to get a unique list of segments from irrdiversion

Returns:
Return type:list
write_file(check=False)[source]

Write method for ModflowAg

Parameters:check (bool) – not implemented