run_rhessys_single: Run RHESSys simulation

View source: R/run_rhessys_single.R

run_rhessys_singleR Documentation

Run RHESSys simulation

Description

Writes files and assembles inputs to run a single instance of RHESSys.

Usage

run_rhessys_single(
  input_rhessys,
  hdr_files,
  tec_data = NULL,
  def_pars = NULL,
  clim_base = NULL,
  output_filter = NULL,
  cmd_pars = NULL,
  par_option = TRUE,
  return_cmd = FALSE,
  write_run_metadata = FALSE,
  write_log = FALSE,
  log_loc = "~/rhessys_run_log",
  runID = NULL
)

Arguments

input_rhessys

List containing the following named elements: "rhessys_version" (path to rhessys binary), "tec_file"(name for tec file to be built), "world_file"(path to existing worldfile), "world_hdr_prefix"(prefix for headers to create), "flow_file"(path to existing flowtable), "start_date"(format c('yyyy mm dd hr')), "end_date"(format c('yyyy mm dd hr')), "output_folder"(path to output folder), "output_filename"(prefix for output files to create), "command_options"(additional commandline options)

hdr_files

List of named elements, named for each def file type (basin_def, hillslope_def, zone_def, soil_def, landuse_def, patch_def, stratum_def) as well as an element named "base_stations". Each element should contain the path to the corresponding def file.

tec_data

Input tec events, see input_tec function

def_pars

To overwrite def file parameters. Format is a list of lists, with each sub-list having the format: list(<path to def/just use the input_hdr_list$yourheader>, <parameter name>, <value>). Defaults to NULL

clim_base

Data for input climate basestation to be written. Defaults to NULL, which assumes you havean existing basestation pointed to in input_rhessys.

output_filter

An output filter, either an R list with 1 to n number of filters read in/modified/generated via IOin_output_filter.R (or associated functions - build_output_filter.R, read_output_filter.R, modify_output_filter.R), or a file path pointing to an existing output filter.

cmd_pars

List of standard (command line) parameters.

par_option

TRUE/FALSE if the -par command line options should be used if running multiple runs and outputting current worldfile state. Can also just set as a number to set specific par ID.

return_cmd

TRUE/FALSE if run_rhessys_single should return the command line call INSTEAD of running.

write_run_metadata

TRUE/FALSE if a text file containing run metadata should be written to the same location as your output.

write_log

TRUE/FALSE Writes or appends a log to a specified file, by row

runID

The unique ID used to track input and output files if running multiple scenarios, and thus multiple instances of run_rhessys_core.

log_log

Location of the log to be written/appended


RHESSys/RHESSysIOinR documentation built on June 9, 2025, 5:56 p.m.