This is a convenience function for modifying an ed2in list object. Arguments passed in all caps are assumed to be ED2IN namelist parameters and are inserted directly into the ed2in list objects. Lowercase arguments are defined explicitly (see "Parameters"), and those that do not match explicit arguments will be ignored with a warning. Because the lowercase arguments come with additional validity checks, they are recommended over modifying the ED2IN file directly via uppercase arguments.

modify_ed2in(ed2in, ..., veg_prefix = NULL, latitude = NULL,
  longitude = NULL, met_driver = NULL, start_date = NULL,
  end_date = NULL, EDI_path = NULL, output_types = NULL,
  output_dir = NULL, run_dir = NULL, runtype = NULL,
  run_name = NULL, pecan_defaults = FALSE, add_if_missing = FALSE,
  check_paths = TRUE, .dots = list())

Arguments

...

Namelist arguments (see Description and Details)

veg_prefix

Vegetation file prefix (SFILIN). If lat and lon are part of the prefix,

latitude

Run latitude coordinate. If veg_prefix is also provided, pass to read_ed_veg, otherwise set in ED2IN directly. Should be omitted if lat and lon are already part of veg_prefix.

longitude

Run longitude coordinate. If veg_prefix is also provided, pass to read_ed_veg, otherwise set in ED2IN directly. Should be omitted if lat and lon are already part of veg_prefix.

met_driver

Path and filename of met driver header (ED_MET_DRIVER_DB)

start_date

Run start date (IMONTHA, IDATEA, IYEARA, ITIMEA)

end_date

Run end date (IMONTHZ, IDATEZ, IYEARZ ITIMEZ)

EDI_path

Path to EDI directory, which often has the VEG_DATABASE and THSUMS_DATABASE files.

output_types

Character vector of output types (see Details)

output_dir

Output directory, for FFILOUT (analysis) and SFILOUT (history) files

run_dir

Directory in which to store run-related config files (e.g. config.xml).

runtype

ED initialization mode; either "INITIAL" or "HISTORY"

pecan_defaults

Logical. If TRUE, set common ED2IN defaults.

add_if_missing

Logical. If TRUE, all-caps arguments not found in existing ed2in list will be added to the end. Default = FALSE.

check_paths

Logical. If TRUE (default), for any parameters that expect files, check that files exist and throw an error if they don't.

.dots

A list of ... arguments.

Value

Modified ed2in list object. See read_ed2in.

Details

Namelist arguments are applied last, and will silently overwrite any arguments set by special case arguments.

Namelist arguments can be stored in a list and passed in via the .dots argument (e.g. .dots = list(SFILIN = "/path/prefix_", ...)), or using the rlang::!!! splicing operator. If both are provided, they will be spliced together, with the ... taking precedence.

For output_types, select one or more of the following:

  • "fast" -- Fast analysis; mostly polygon-level averages (IFOUTPUT)

  • "daily -- Daily means (one file per day) (IDOUTPUT)

  • "monthly" -- Monthly means (one file per month) (IMOUTPUT)

  • "monthly_diurnal" -- Monthly means of the diurnal cycle (one file per month) (IQOUTPUT)

  • "annual" -- Annual (one file per year) (IYOUTPUT)

  • "instant" -- Instantaneous fluxes, mostly polygon-level variables, one file per year (ITOUTPUT)

  • "restart" -- Restart file for HISTORY runs. (ISOUTPUT)

  • "all" -- All output types