settings_searchFiles: Function to serach and automatically upadte values in a CWatM...

View source: R/modelSetupRun.R

settings_searchFilesR Documentation

Function to serach and automatically upadte values in a CWatM named settings list

Description

This function search user-defined folders for CWatM data inputs and automatically updates a settings named list

Usage

settings_searchFiles(settingsList = NULL, ...)

Arguments

settingsList

named list with CWatM settings

...

additional arguments (see details)

Details

This function assumes that the CWatM data folders' structure and file names follows the convention described in the models' documentation: https://cwatm.iiasa.ac.at/. The user can provoke a call to settings_setFilePaths(), if character FILE_PATHS are provided. In order to search for a specific file, the function uses a set of pre-defined variable-specific search expressions. When updated with a new file path; the followin comment ("Updated") is appended to the settings table. If the search results with multiple matchs, the first one is updated and the following comment is appended to the settings table: "Multiple results were found; taken the first one".

Value

named list; a CWatM settings list.

Examples

## Not run: 
my_settings <- settings_ini2list(inipath = "./cwatm/settings_template.ini")

# set user-defined paths
root = "d:/cwatm/model_data"
maps = "d:/cwatm/model_data/maps"
meteo = "./climate"

my_settings <- settings_searchFiles(settingsList = my_settings,
                                     PathRoot = root,
                                     PathMaps = maps,
                                     PathMeteo = meteo)

## End(Not run)

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