These functions execute MODFLOW models.

rmf_execute(...)

# S3 method for character
rmf_execute(
  path,
  code = "2005",
  evaluate = NULL,
  backup = FALSE,
  preprocess = NULL,
  ui = NULL,
  convergence = "Normal termination",
  precision = "single"
)

# S3 method for modflow
rmf_execute(
  modflow,
  code = "2005",
  evaluate = NULL,
  ui = NULL,
  convergence = "Normal termination",
  precision = "single"
)

Arguments

path

Path to the NAM file. Typically with extension .nam.

code

Name of the MODFLOW variant to use, or path to the executable.

evaluate

Vector of PVAL file parameter values to evaluate. This should be a named vector if not all parameters are provided in their order of occurrence, where the names (can be regular expressions to) match the parameter names. Parameters that are not mentioned take the value from the PVAL file. If NULL (default), no values are changed in the original PVAL file.

backup

Logical. Should a backup (with .old suffix) of the original PVAL file be created? Defaults to FALSE.

preprocess

Function to do preprocessing, which takes the model pval object as input, and returns another pval object. See details for how to use this. Defaults to NULL.

ui

If NULL (default), MODFLOW output is shown in the R console. If "none", the output is suppressed.

convergence

Character. The message in the terminal output used to check for convergence.

precision

Character. Specifies if 'single' (default) or 'double' precision executable is used (MODFLOW-2005 only).

modflow

modflow object

Value

Invisible list with start and end time, elapsed run time, a logical indicating normal termination, and the stdout output, when done for an on disk model. Full modflow object including all results otherwise (in memory model).

Details

The preprocess argument can be used for different purposes:

  • Implementing derived parameters: One can make some of the pval parameters depend on others. The preprocess function should in this case just modify the pval object, and return it. Note that this means that the values of derived parameters specified in evaluate might be changed in this case.

  • Implementing any kind of parameter that is not directly supported by MODFLOW. This means the preprocess function should have some side effects, modifying some of the MODFLOW files. For this purpose, it is convenient to add extra parameters at the end of the pval file, while keeping the number of parameters (np) constant, and equal to the number of MODFLOW-supported parameters.

See also

rmf_install() for external code installation,
rmf_analyze() for local sensitivity analysis, and
rmf_optimize() for local calibration.