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,
force = T,
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_swap_output()
or change_swap_par()
for several other rswap
function to work
If an rswap directory already exists, no new one will be generated/reloaded unless force=TRUE
defaults to true.
print status? (flag)
number of seconds before run timeout (unlimited by default) (numeric)
Returns the status code of the run.
If you pass more than one project_path
, then rswap will run your multiple
projects in parallel using run_swap_parallel()
. If you would like finer
control over the parallel specific parameters, please use that function.
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.
@seealso run_swap_parallel()