Skip to contents

Creates the following SIPNET files:

  • job.sh — Job submission script. Populated from inst/template.job

  • sipnet.in — Sipnet configuration file. Populated from inst/sipnet.in_v*

  • events.in — Copied from inputs$events$path or settings$run$inputs$events$path. This needs to be in the SIPNET event format; see write.events.SIPNET() for generating these files

  • *.param — SIPNET parameter file. Includes both traits and initial conditions.

  • *.clim — SIPNET meteorology driver (from settings$run$inputs$met$path, overriden by inputs$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>, ...))). Only defaults[[1]]$constants is 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... path/to/sipnet2.0.2path/to/restart.inpath/to/restart.in01 [...] ```

...will be rendered in sipnet.in as...:

RESTART_IN = path/to/restart.in
RESTART_OUT = path/to/restart.out
GDD = 0
ANAEROBIC = 1

...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.

Author

Michael Dietze, Alexey Shiklomanov