stack()
run a stack of TROLL
simulation. The minimal set of input files
required for a TROLL
run include (i) climate data for the focal location
(climate
and daily
), (ii) functional traits for the list of species at
the focal location (species
), and (iii) global parameters (global
), i.e.
parameters that do not depend on species identity.
stack(
name = NULL,
simulations,
path = NULL,
global,
species,
climate,
daily,
lidar = NULL,
forest = NULL,
load = TRUE,
cores = NULL,
verbose = TRUE,
overwrite = TRUE,
thin = NULL
)
char. Stack name (if NULL the timestamp will be used).
char. Simulation names (corrsponding to simulation indexes in orresponding tables, see example below).
char. Path to save the stack of simulation outputs (parent folder), the default is null corresponding to a simulation in memory without saved intermediary files (based on temporary files from option.rcontroll).
df. Global parameters (e.g. TROLLv3_input or using
generate_parameters()
).
df. Species parameters (e.g. TROLLv3_species).
df. Climate parameters (e.g. TROLLv3_climatedaytime12).
df. Daily variation parameters (e.g. TROLLv3_daytimevar).
df. Lidar simulation parameters (e.g. using generate_lidar()
),
if null not computed (default NULL).
df. TROLL with forest input, if null starts from an empty grid
(default NULL) (e.g. using TROLLv3_output with get_forest()
).
bool. TROLL outputs are loaded in R memory, if not only the path
and name of the stack of simulations is kept in the resulting
trollstack()
object but the content can be accessed later using the
load_sim()
method.
int. Number of cores for parallelization, if NULL available
cores - 1 (default NULL). You can use parallel::detectCores()
to know
available cores on your machine.
bool. Show TROLL log in the console.
bool. Overwrite previous outputs folder and files.
int. Vector of integers corresponding to the iterations to be kept to reduce output size, default is NULL and corresponds to no thinning.
A trollstack()
object.
if (FALSE) { # \dontrun{
data("TROLLv3_species")
data("TROLLv3_climatedaytime12")
data("TROLLv3_daytimevar")
data("TROLLv3_output")
TROLLv3_input_stack <- generate_parameters(
cols = 100, rows = 100,
iterperyear = 12, nbiter = 12 * 1
) %>%
mutate(simulation = list(c("seed50000", "seed500"))) %>%
unnest(simulation)
TROLLv3_input_stack[62, 2] <- 500 # Cseedrain
stack(
name = "teststack",
simulations = c("seed50000", "seed500"),
global = TROLLv3_input_stack,
species = TROLLv3_species,
climate = TROLLv3_climatedaytime12,
daily = TROLLv3_daytimevar,
load = TRUE,
cores = 2,
verbose = FALSE,
thin = c(1, 5, 10)
)
} # }