Writes configuration files for one invocation of the SIPNET model
Source:R/write.configs.SIPNET.R
write.config.SIPNET.RdCreates the following SIPNET files:
job.sh— Job submission script. Populated frominst/template.jobsipnet.in— Sipnet configuration file. Populated frominst/sipnet.in_v*events.in— Copied frominputs$events$pathorsettings$run$inputs$events$path. This needs to be in the SIPNET event format; seewrite.events.SIPNET()for generating these files*.param— SIPNET parameter file. Includes both traits and initial conditions.*.clim— SIPNET meteorology driver (fromsettings$run$inputs$met$path, overriden byinputs$met$path). Note that the dates in this file determine the SIPNET start and end dates.
If you relocate files between config generation and Sipnet runtime,
note that write.configs() does not copy *.clim. Instead it records the
path to its current location. At Sipnet runtime, job.sh then creates
a symbolic link to that path.
Usage
write.config.SIPNET(
defaults,
trait.values,
settings,
run.id,
inputs = NULL,
IC = NULL,
restart = NULL,
spinup = NULL
)Arguments
- defaults
nested list of named constant parameter values. The structure is
list(list(constants = list(trait1 = <value>, trait2 = <value>, ...))). Onlydefaults[[1]]$constantsis used; all other elements are silently ignored.- trait.values
vector of samples for a given trait
- settings
PEcAn settings object
- run.id
run ID
- inputs
list of model inputs
- IC
initial condition
- restart
In case this is a continuation of an old simulation. restart needs to be a list with name tags of runid, inputs, new.params (parameters), new.state (initial condition), ensemble.id (ensemble id), start.time and stop.time.See Details.
- spinup
currently unused, included for compatibility with other models
Model version specification
write.config.SIPNET() matches its output format to the version of Sipnet
listed in settings$model$revision. This should be a numeric version
(e.g. 2.0.1) and needs to match the version of your Sipnet binary.
You can check your binary's version by running
./path/to/your/sipnet --version, which should report something similar
to SIPNET version 2.0.0 (4baf19a66c). If it says "illegal option" then you
have Sipnet 1.x and can report the version as "v1".
Command line arguments
SIPNET run-time options can be passed through a named list via
settings$model$options. For example, this...
...will be rendered in sipnet.in as...:
...though not necessarily in this order. If the sipnet.in template already
defines an option specified in settings$model$options, its value will be
updated in place; options not already in the file will be added to the bottom.