# imod.run - Write iMODFLOW Runfiles¶

Write iMODFLOW Runfiles.

imod.run.get_runfile(model, directory, output_packages=['shd'])[source]

Generates an collections.OrderedDict containing the values to be filled in in a runfile template, from the data contained in model. These values are mainly the paths of the IDFs and IPFs, nested in such a way that it can be easily unpacked when filling in the runfiles; plus a fairly large number of configuration values.

For packages that do not have stress periods, the nesting is: package - field - layer

For packages that have stress periods, the nesting is: package - field - system - layer - time

Note: every xarray.DataArray containing the data must have layer coordinates specified; use da.assign_coords(layer=...).

Parameters
• model (collections.OrderedDict) – Dictionary containing the model data.

• directory (str) – Directory in which the model will be written (and therefore necessary for generating paths)

Returns

parameter_values – Dictionary containing all the values necessary for filling in a runfile. Nested in such a way that it can be easily unpacked in a template.

Return type

collections.OrderedDict

imod.run.seawat_get_runfile(model, directory)[source]

Generates an collections.OrderedDict containing the values to be filled in in a runfile template, from the data contained in model, specifically for an IMODSEAWAT model.

Deprecated since version 0.7.0: imod.run.seawat_get_runfile is deprecated, use imod.wq instead.

These values are mainly the paths of the IDFs and IPFs, nested in such a way that it can be easily unpacked when filling in the runfiles; plus a fairly large number of configuration values.

For packages that do not have stress periods, the nesting is: package - field - layer

For packages that have stress periods, the nesting is: package - field - system - layer - time

Note: every xarray.DataArray containing the data must have layer specified; use da.assign_coords(layer=...).

Parameters
• model (collections.OrderedDict) – Dictionary containing the model data.

• directory (str) – Directory in which the model will be written (and therefore necessary for generating paths)

Returns

parameter_values – Dictionary containing all the values necessary for filling in a runfile. Nested in such a way that it can be easily unpacked in a template.

Return type

collections.OrderedDict

imod.run.seawat_write_runfile(path, runfile_parameters)[source]

Writes an IMODSEAWAT runfile from metadata collected from model by imod.run.get_runfile().

Deprecated since version 0.7.0: imod.run.seawat_write_runfile is deprecated, use imod.wq instead.

Parameters
• path (str) – Path to write runfile contents to.

• runfile_parameters (collections.OrderedDict) – Dictionary used to fill in runfile.

Returns

Return type

None

imod.run.write_runfile(path, runfile_parameters)[source]

Writes an IMODFLOW runfile from metadata collected from model by imod.run.get_runfile().

Parameters
• path (str) – Path to write runfile contents to.

• runfile_parameters (collections.OrderedDict) – Dictionary used to fill in runfile.

Returns

Return type

None