This will try and find the PEcAn settings file in the following order:

  1. --settings <file>passed as command line argument using --settings

  2. inputfilepassed as argument to function

  3. PECAN_SETTINGSenvironment variable PECAN_SETTINGS pointing to a specific file

  4. ./pecan.xmlpecan.xml in the current folder

Once the function finds a valid file, it will not look further. Thus, if inputfile is supplied, PECAN_SETTINGS will be ignored. Even if a file argument is passed, it will be ignored if a file is passed through a higher priority method.

read.settings(inputfile = "pecan.xml")

Arguments

inputfile

the PEcAn settings file to be used.

outputfile

the name of file to which the settings will be written inside the outputdir. If set to null nothing is saved.

Value

list of all settings as loaded from the XML file(s)

Examples

# NOT RUN {
## bash shell:
## example workflow.R and pecan.xml files in pecan/tests
R --vanilla -- --settings path/to/mypecan.xml < workflow.R 

## R:

settings <- read.settings()
settings <- read.settings(file="willowcreek.xml")
test.settings.file <- system.file("tests/test.xml", package = "PEcAn.all")
settings <- read.settings(test.settings.file)
# }