parflow.tools.core.Run

class parflow.tools.core.Run(name, basescript=None)

Main object that can be used to define a ParFlow simulation

Parameters:
  • name (str) – Name for the given run.

  • basescript (str) – Path to current file so the simulation execution and relative path will be assumed to have the script directory as their working directory. If not provided, the working directory will be the directory where the python executable was run from.

__init__(name, basescript=None)

Create container object while keeping a reference to your parent

Methods

__init__(name[, basescript])

Create container object while keeping a reference to your parent

check_nans(working_directory[, include_forcing])

Check the input files for NaNs.

clone(name)

Method to generate a clone of a run (for generating run ensembles, etc.)

details([location])

Return details based on a location.

dist(pfb_file, **kwargs)

Distribute a PFB file using the P/Q/R settings from the run or override them with the provided arguments.

doc([location])

Return docs based on a location.

from_definition(file_path)

Method to generate a Run object from a file.

full_name()

Helper method returning the full name of a given ParFlow key.

get_children_of_type(class_name)

Return a list of PFDBObj of a given type that are part of our children.

get_context_settings()

Return global settings for our current parflow run.

get_name()

Returns name of run

keys([skip_default])

Gets the key names necessary for the run while skipping unset ones

pfset([key, value, yaml_file, yaml_content, ...])

Allow to define any parflow key so it can be exported. Many formats are supported: - key/value: To set a single value relative to our current PFDBObj. - yaml_file: YAML file path to load and import using the current PFDBObj as root. - yaml_content: YAML string to load and import using the current PFDBObj as root. - hierarchical_map: Nested dict containing several key/value pair using the current PFDBObj as root. - flat_map: Flat dict with parflow key/value pair to set using the current PFDBObj as root.

run([working_directory, skip_validation, undist])

Method to run simulation

select([location])

Return a PFDBObj object based on a location.

set_name(new_name)

Setting new name for a run

to_dict()

Method that will return a flat map of all the ParFlow keys.

to_pf_name(parent_namespace, key)

Helper method returning the key to use for Parflow on a given field key.

undist([run_file, working_directory])

Undistribute a PFB file.

validate([indent, verbose, enable_print, ...])

Method to validate sub hierarchy

value([location, skip_default])

Return a value based on a location.

write([file_name, file_format, ...])

Method to write database file to disk

write_subsurface_table([file_name, ...])

Attributes

data_accessor

Return a DataAccessor to streamline access to numpy array of the various field this run is linked to.