flopy.modpath.mpbas Module

mpbas module. Contains the ModpathBas class. Note that the user can access the ModpathBas class as flopy.modflow.ModpathBas.

Additional information for this MODFLOW/MODPATH package can be found at the Online MODFLOW Guide.

class flopy.modpath.mpbas.ModpathBas(model, hnoflo=-9999.0, hdry=-8888.0, def_face_ct=0, bud_label=None, def_iface=None, laytyp=0, ibound=1, prsity=0.3, prsityCB=0.3, extension='mpbas', unitnumber=86)

MODPATH Basic Package Class.


model : model object

The model object (of type flopy.modpath.mp.Modpath) to which this package will be added.

hnoflo : float

Head value assigned to inactive cells (default is -9999.).

hdry : float

Head value assigned to dry cells (default is -8888.).

def_face_ct : int

Number fo default iface codes to read (default is 0).

bud_label : str or list of strs

MODFLOW budget item to which a default iface is assigned.

def_iface : int or list of ints

Cell face (iface) on which to assign flows from MODFLOW budget file.

laytyp : int or list of ints

MODFLOW layer type (0 is convertible, 1 is confined).

ibound : array of ints, optional

The ibound array (the default is 1).

prsity : array of ints, optional

The porosity array (the default is 0.30).

prsityCB : array of ints, optional

The porosity array for confining beds (the default is 0.30).

extension : str, optional

File extension (default is ‘mpbas’).


>>> import flopy
>>> m = flopy.modpath.Modpath()
>>> mpbas = flopy.modpath.ModpathBas(m)


heading (str) Text string written to top of package input file.
check(f=None, verbose=True, level=1)

Check package data for common errors.


f : str or file handle

String defining file name or file handle for summary file of check method output. If a sting is passed a file handle is created. If f is None, check method does not write results to a summary file. (default is None)

verbose : bool

Boolean flag used to determine if check method results are written to the screen

level : int

Check method analysis level. If level=0, summary checks are performed. If level=1, full checks are performed.




>>> import flopy
>>> m = flopy.modflow.Modflow.load('model.nam')
>>> m.dis.check()
load(model, pack_type, f, nper=None, pop_key_list=None, check=True, unitnumber=None, ext_unit_dict=None)

The load method has not been implemented for this package.


Plot 2-D, 3-D, transient 2-D, and stress period list (MfList) package input data


**kwargs : dict

filename_base : str

Base file name that will be used to automatically generate file names for output image files. Plots will be exported as image files if file_name_base is not None. (default is None)

file_extension : str

Valid matplotlib.pyplot file extension for savefig(). Only used if filename_base is not None. (default is ‘png’)

mflay : int

MODFLOW zero-based layer number to return. If None, then all all layers will be included. (default is None)

kper : int

MODFLOW zero-based stress period number to return. (default is zero)

key : str

MfList dictionary key. (default is None)


axes : list

Empty list is returned if filename_base is not None. Otherwise a list of matplotlib.pyplot.axis are returned.


>>> import flopy
>>> ml = flopy.modflow.Modflow.load('test.nam')
>>> ml.dis.plot()
to_shapefile(filename, **kwargs)

Export 2-D, 3-D, and transient 2-D model data to shapefile (polygons). Adds an attribute for each layer in each data array


filename : str

Shapefile name to write




>>> import flopy
>>> ml = flopy.modflow.Modflow.load('test.nam')
>>> ml.lpf.to_shapefile('test_hk.shp')

Write the package file