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 settingautoset_output
toTRUE
.verbose
will print not only model running status, but also what rswap is doingtimeout
allows you to set the maximum runtime of the model
Usage
run_swap(
project_path,
swap_file = "swap.swp",
autoset_output = F,
force = T,
verbose = F,
timeout = Inf
)
Arguments
- project_path
path to the project directory (string)
- swap_file
name of the *.swp main file (leave blank for "swap.swp")
- autoset_output
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 toFALSE
, then INLIST csv must be set by the user either manually or withset_swap_output()
orchange_swap_par()
for several otherrswap
function to work- force
If an rswap directory already exists, no new one will be generated/reloaded unless
force=TRUE
defaults to true.- verbose
print status? (flag)
- timeout
number of seconds before run timeout (unlimited by default) (numeric)
Details
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()