rmlPar: Get or set default parameters for the package.

Description Usage Arguments Details See Also

Description

Get or set default parameters for the package. Notice changes done to the parameter values are reset everytime the R session is closed and the package is reloaded.

Usage

1
2
3
4
5
rmlPar(par = NULL, reset = FALSE, encoding, maxPathLength,
  fileNameTemplate, idWidth, tz, errorKeywords, handleErrors, balanceFile,
  macro_path, macro_exe, macro_exeparfile, macro_path_default,
  macro_exe_default, macro_exeparfile_default, digits_parfile_k,
  digits_dt50_depth_f, id_range, log_width)

Arguments

par

Three possible cases:

  • If par is NULL (default): All the actual value of the parameters will be silently returned.

  • If par is a vector of character strings representing parameter names. The value of the parameters named here will be (silently) returned.

  • If par is a list following the format tag = value, where tag is the name of the parameter to be changed, and value is its new value. Such a list is returned by rmlPar(). Notice that parameters can also be set individually, using the options listed below.

reset

Single logical. If TRUE, all the parameters will be set to their default value. Values are reset before any change to the parameter values, as listed below.

encoding

Vector of three character strings. (1) encoding of the MACRO par file (when imported), passed to readLines, (2) encoding of the MACRO par file (when exported), passed to writeLines (via file), and (3) encoding of the MACRO crop parameter file (when imported).

maxPathLength

Single integer value. Maximum length of a path for the MACRO command line modules:

fileNameTemplate

List of character strings, with two items, "r" and "macro". "macro" is a single character string, the name and extension (but without path) of the default MACRO parameter files that is exported and MACRO output file to be generated. Should include the wilcard %s, that will internally be replaced by the simulation ID (RUNID), and a second willcard %s instead of the extension. For example rml%s.%s . "r" is the same thing, except that it the the template for how the file should be renamed after it has been output by MACRO, or for how the package should name the files it generates.

idWidth

Single integer value. Width of the formatted simulation ID in MACRO In FOCUS output files (bin-files). Also used for formatting the par-files generated by this package.

tz

See as.POSIXct. Time zone.

errorKeywords

Vector of character strings. Keywords that should be interpreted as an error or problem in MACRO command message output.

handleErrors

Single character string. If set to TRUE, rmacro tries to handle error when running a list of MACRO simulations, in order to avoid crashing the whole list.

balanceFile

Single of character string. Name of the file containing output water and solute balance, as internally calculated by MACRO.

macro_path

Single character string. Path to the folder where the MACRO or MACRO In FOCUS executable is installed. See rmacroliteSetModelVar and rmacrolite-system-variables. If equal to NULL (the default), the value defined in the Windows Environment Variable called rmacrolite_macro_path will be used in the 1st place, when it exists, or alternatively the value in macro_path_default (see below)

macro_exe

Single character string. Name of the the MACRO or MACRO In FOCUS executable to be used to run simulations, in the folder defined by macro_path. See rmacroliteSetModelVar and rmacrolite-system-variables. If equal to NULL (the default), the value defined in the Windows Environment Variable called rmacrolite_macro_exe will be used in the 1st place, when it exists, or alternatively the value in macro_exe_default (see below)

macro_exeparfile

Single character string. Name of the the "exeparfile" executable that converts par-files into MACRO input files (indump.tmp), in the folder defined by macro_path. Notice that the exeparfile is not provided with MACRO 5.2, while it is provided with MACRO In FOCUS. It can thus be copied from the MACRO In FOCUS installation directory to the MACRO installation directory. See rmacroliteSetModelVar and rmacrolite-system-variables. If equal to NULL (the default), the value defined in the Windows Environment Variable called rmacrolite_macro_exeparfile will be used in the 1st place, when it exists, or alternatively the value in macro_exeparfile_default (see below)

macro_path_default

Single character string. Default value for macro_path (see above).

macro_exe_default

Single character string. Default value for macro_exe (see above).

macro_exeparfile_default

Single character string. Default value for macro_exeparfile (see above).

digits_parfile_k

Single integer values. Number of significant digits to be used when rounding degradation rates (DEMAL, DEGMAS, DEGMIL, DEGMIS) in the par-file when modifying degradation parameters.

digits_dt50_depth_f

Single integer value. Number of digits to be used when rounding the factor describing DT50 decrease with depth when calculating the values from the par-file or writing new degradation values in a par-file.

id_range

Vector of 2 integer values. Min and max value allowed for MACRO RUNID.

log_width

Single integer value. Width of the log output messages (maximum number of characters). Notice that some messages may get larger.

Details

The function has 3 possible, non-exclusive behaviours:

Notice that when reset=TRUE and some new parameter values are provided, the parameters are first reset, and then the new parameter values are set. If par is a list, parameters are set first according to values in par, and then according to values in the parameters listed below. This combination is not recommended, but nonetheless possible.

The actual value of the parameters is stored in (and can be retrieved from) the environment rspPars. The default value of the parameters are stored in the environment rspPars. Do not use them directly.

See Also

getRmlPar.


julienmoeys/rmacrolite documentation built on May 22, 2019, 6:31 p.m.