This function runs the SWAP model for the given project directory, and
optionally, a certain swap_file
.
If you desire, you can automatically match the output of the SWAP model to the data provided in the rswap_observed_data.csv
file by setting autoset_output
to TRUE
.
verbose
will print not only model running status, but also what rswap is doing
timeout
allows you to set the maximum runtime of the model
run_swap(
project_path,
swap_file = "swap.swp",
autoset_output = F,
verbose = F,
timeout = Inf
)
path to the project directory (string)
name of the *.swp main file (leave blank for "swap.swp")
If set to TRUE
, rswap will automatically detect
your observed data provided in the observed file and match it to the SWAP
output. if this is set to FALSE
, then INLIST csv must be set by the user either
manually or with set_swp_output()
or change_swap_par()
for several other rswap
function to work
print status? (flag)
number of seconds before run timeout (unlimited by default) (numeric)
Returns the status code of the run.
This function does more than simply run the model, it does the following, in this order:
Build the rswap directory: build_rswap_directory()
Parses the main swap file: parse_swap_file()
Updates several parameters in the main file (such as paths, and output settings): set_swap_output()
Writes the new SWAP main file: write_swp_file()
Runs the new SWAP main file.