call_cwatm: Call a CWatM simulation from within R

View source: R/modelSetupRun.R

call_cwatmR Documentation

Call a CWatM simulation from within R

Description

This function calls a CWatM simulation from within R.

Usage

call_cwatm(modelpath = NULL, settingsfile, overwrite = FALSE, ...)

Arguments

modelpath

character. defines the path to the folder with CWatM (see details)

settingsfile

character. defines the path to an MS Excel settings spreadsheet or to a settings.ini file (see details)

overwrite

logical. Currently out of use

...

additional arguments passed to the system() function

Details

The function uses the system() function to call a CWatM simulation. In case the function receives a settings file as an MS Excel file (.xlsx), the function calls createSettingsFile(), and saves the output in the same folder with a combination of file name and a unique date-time identifier (E.g., cwatm_settings_20212904102753.ini). The function automatically uses this settings.ini file for the call. The modelpath argument indicates where are the CWatM files located (e.g., run_cwatm.py). If set to NULL the function assumes that they are located in the parent directory of the PathRoot folder.

Value

CWatM outputs

Examples

## Not run: 
call_cwatm(settingsfile = "C:/IIASA/cwatm/cwatm_settings/cwatm_settings.xlsx", intern = TRUE) # for `intern` see `?system`
call_cwatm(settingsfile = "C:/IIASA/cwatm/cwatm_settings/cwatm_settings_sorekBasin.ini")

## End(Not run)

dof1985/cwatm4r documentation built on Nov. 8, 2022, 7:30 p.m.