flopy.mf6.modflow.mfsimulation module

class MFSimulation(sim_name: str = 'sim', version: str = 'mf6', exe_name: str | PathLike = 'mf6', sim_ws: str | PathLike = '.', verbosity_level: int = 1, write_headers: bool = True, use_pandas: bool = True, lazy_io: bool = False, continue_=None, nocheck=None, memory_print_option=None, profile_option=None, maxerrors=None, print_input=None, hpc_data=None)[source]

Bases: MFSimulationBase

MFSimulation is used to load, build, and/or save a MODFLOW 6 simulation. A MFSimulation object must be created before creating any of the MODFLOW 6 model objects.

Parameters:
  • continue (keyword) – keyword flag to indicate that the simulation should continue even if one or more solutions do not converge.

  • nocheck (keyword) – keyword flag to indicate that the model input check routines should not be called prior to each time step. checks are performed by default.

  • memory_print_option (string) – is a flag that controls printing of detailed memory manager usage to the end of the simulation list file. none means do not print detailed information. summary means print only the total memory for each simulation component. all means print information for each variable stored in the memory manager. none is default if memory_print_option is not specified.

  • profile_option (string) – is a flag that controls performance profiling and reporting. none disables profiling. summary means to measure and print a coarse performance profile. detail means collect and print information with the highest resolution available. none is default if profile_option is not specified.

  • maxerrors (integer) – maximum number of errors that will be stored and printed.

  • print_input (keyword) – keyword to activate printing of simulation input summaries to the simulation list file (mfsim.lst). with this keyword, input summaries will be written for those packages that support newer input data model routines. not all packages are supported yet by the newer input data model routines.

  • hpc_data (record hpc6 filein hpc6_filename) – Contains data for the hpc package. Data can be passed as a dictionary to the hpc package with variable names as keys and package data as values. Data for the hpc_data variable is also acceptable. See hpc package documentation for more information.

  • tdis6 (string) – is the name of the temporal discretization (tdis) input file.

  • models (list) – is the list of model types, model name files, and model names.

  • exchanges (list) – is the list of exchange types, exchange files, and model names.

  • mxiter (integer) – is the maximum number of outer iterations for this solution group. the default value is 1. if there is only one solution in the solution group, then mxiter must be 1.

  • solutiongroup (list) – is the list of solution types and models in the solution.

load : (sim_name : str, version : string,

exe_name : str or PathLike, sim_ws : str or PathLike, strict : bool, verbosity_level : int, load_only : list, verify_data : bool, write_headers : bool, lazy_io : bool, use_pandas : bool, ) : MFSimulation a class method that loads a simulation from files

classmethod load(sim_name='modflowsim', version='mf6', exe_name: str | PathLike = 'mf6', sim_ws: str | PathLike = '.', strict=True, verbosity_level=1, load_only=None, verify_data=False, write_headers=True, lazy_io=False, use_pandas=True)[source]

Load an existing model. Do not call this method directly. Should only be called by child class.

Parameters:
  • cls_child – cls object of child class calling load

  • sim_name (str) – Name of the simulation.

  • version (str) – MODFLOW version

  • exe_name (str or PathLike) – Path to MODFLOW executable (relative to the simulation workspace or absolute)

  • sim_ws (str or PathLike) – Path to simulation workspace

  • strict (bool) – Strict enforcement of file formatting

  • verbosity_level (int) –

    Verbosity level of standard output

    0: No standard output 1: Standard error/warning messages with some informational

    messages

    2: Verbose mode with full error/warning/informational

    messages. This is ideal for debugging.

  • load_only (list) – List of package abbreviations or package names corresponding to packages that flopy will load. default is None, which loads all packages. the discretization packages will load regardless of this setting. subpackages, like time series and observations, will also load regardless of this setting. example list: [‘ic’, ‘maw’, ‘npf’, ‘oc’, ‘ims’, ‘gwf6-gwf6’]

  • verify_data (bool) – Verify data when it is loaded. this can slow down loading

  • write_headers (bool) – When true flopy writes a header to each package file indicating that it was created by flopy

  • lazy_io (bool) – When true flopy only reads external data when the data is requested and only writes external data if the data has changed. This option automatically overrides the verify_data and auto_set_sizes, turning both off.

  • use_pandas (bool) – Load/save data using pandas dataframes (for supported data)

Returns:

sim

Return type:

MFSimulation object

Examples

>>> s = flopy.mf6.mfsimulation.load('my simulation')