| Title: | PEcAn Functions Used for Ecological Forecasts and Reanalysis |
|---|---|
| Description: | The Predictive Ecosystem Carbon Analyzer (PEcAn) is a scientific workflow management tool that is designed to simplify the management of model parameterization, execution, and analysis. The goal of PEcAn is to streamline the interaction between data and models, and to improve the efficacy of scientific investigation. This package provides workhorse functions that can be used to run the major steps of a PEcAn analysis. |
| Authors: | Mike Dietze [aut], David LeBauer [aut, cre], Xiaohui Feng [aut], Dan Wang [aut], Carl Davidson [aut], Rob Kooper [aut], Shawn Serbin [aut], University of Illinois, NCSA [cph] |
| Maintainer: | David LeBauer <[email protected]> |
| License: | BSD_3_clause + file LICENSE |
| Version: | 1.10.0.9000 |
| Built: | 2026-06-05 14:44:25 UTC |
| Source: | https://github.com/PecanProject/pecan |
Input conversion workflow
do_conversions( settings, overwrite.met = FALSE, overwrite.fia = FALSE, overwrite.ic = FALSE )do_conversions( settings, overwrite.met = FALSE, overwrite.fia = FALSE, overwrite.ic = FALSE )
settings |
PEcAn settings list |
overwrite.met, overwrite.fia, overwrite.ic
|
logical |
Ryan Kelly, Rob Kooper, Betsy Cowdery, Istem Fer
Write model-specific run scripts and configuration files
run.write.configs( settings, ensemble.size, input_design, write = TRUE, posterior.files = rep(NA, length(settings$pfts)), overwrite = TRUE )run.write.configs( settings, ensemble.size, input_design, write = TRUE, posterior.files = rep(NA, length(settings$pfts)), overwrite = TRUE )
settings |
a PEcAn settings list |
ensemble.size |
number of ensemble runs |
input_design |
Input design data.frame coordinating input files across
runs. Contains columns for each sampled input (met, param, etc.) with row
indices, as documented in |
write |
should the runs be written to the database? |
posterior.files |
Filenames for posteriors for drawing samples for
ensemble and sensitivity analysis (e.g. |
overwrite |
logical: Replace output files that already exist? |
Upstream contract (reads from settings$outdir):
samples.RdataProduced by get.parameter.samples.
Contains 5 bundled objects: trait.samples,
sa.samples, ensemble.samples, runs.samples, env.samples.
This function loads trait.samples and sa.samples to build
model configuration files. If input_design contains a param
column, ensemble.samples is rebuilt by subsetting trait.samples
according to the design indices.
File-based side effects (saved to settings$outdir):
sensitivity.samples.<ensemble_id>.RdataContains sa.run.ids
(named list of run IDs per PFT/trait/quantile), sa.ensemble.id,
sa.samples, pft.names, and trait.names. Saved when sensitivity
analysis is configured.
ensemble.samples.<ensemble_id>.RdataContains ens.run.ids
(vector of run IDs), ens.ensemble.id, ens.samples, pft.names,
and trait.names. Saved when ensemble is configured.
runs_manifest.csvA CSV table tracking all runs created, appended across ensemble and SA analyses.
Downstream contract: The sensitivity.samples.*.Rdata and
ensemble.samples.*.Rdata files are loaded by get.results
to match model outputs to their corresponding
parameter sets. This implicit file-based coupling is a refactoring target.
The default value for posterior.files is NA, in which case the
most recent posterior or prior (in that order) for the workflow is used.
When specified, posterior.files should be a vector of filenames with one
entry for each PFT. Specify filenames with no path; PFT outdirs will be
appended. This forces use of only files within this workflow, to avoid
confusion.
The settings list (invisibly), updated with ensemble IDs for SA
and ensemble analysis (e.g. settings$sensitivity.analysis$ensemble.id,
settings$ensemble$ensemble.id).
David LeBauer, Shawn Serbin, Ryan Kelly, Mike Dietze, Akash B V
Get trait data for all PFTs in a settings list
runModule.get.trait.data(settings)runModule.get.trait.data(settings)
settings |
PEcAn configuration list. Must have class 'Settings' or 'MultiSettings' |
This function serves as the orchestration layer between PEcAn workflows and
the config-writing machinery. It generates appropriate input designs
(ensemble and/or SA) if not provided. For MultiSettings, it generates designs once
from the first site then shares across all sites for consistent sampling. Finally,
it delegates to run.write.configs for actual config generation.
The input design determines how parameter samples and input files (met, soil,
etc.) are coordinated across runs. Ensemble designs typically use random or
quasi-random sampling, while SA designs hold non-parameter inputs constant
(OAT methodology).
runModule.run.write.configs(settings, overwrite = TRUE, input_design = NULL)runModule.run.write.configs(settings, overwrite = TRUE, input_design = NULL)
settings |
a PEcAn Settings or MultiSettings object |
overwrite |
logical: Replace config files if they already exist? |
input_design |
Optional. Input design data.frame linking parameter draws and sampled inputs across runs. Include a 'param' column whose values select rows from 'trait.samples'/'ensemble.samples', plus optional columns named for ‘settings$run$inputs' tags (e.g. 'met', 'soil') with indices into each input’s 'path' list. Can be:
Usually generated by 'generate_joint_ensemble_design()' for ensemble runs or 'generate_OAT_SA_design()' for sensitivity analysis. |
A modified settings object, invisibly
Start selected ecosystem model runs within PEcAn workflow
start_model_runs(settings, write = TRUE, stop.on.error = TRUE) runModule_start_model_runs(settings, stop.on.error = TRUE)start_model_runs(settings, write = TRUE, stop.on.error = TRUE) runModule_start_model_runs(settings, stop.on.error = TRUE)
settings |
pecan settings object |
write |
(logical) Whether or not to write to the database. Default TRUE. |
stop.on.error |
Throw error if _any_ of the runs fails. Default TRUE. |
runModule_start_model_runs(): A lightweight wrapper around 'start_model_runs' that takes 'write' from
'settings' instead of as a separate argument.
Shawn Serbin, Rob Kooper, David LeBauer, Alexey Shiklomanov
## Not run: settings <- PEcAn.settings::read.settings("pecan.xml") start_model_runs(settings) ## End(Not run)## Not run: settings <- PEcAn.settings::read.settings("pecan.xml") start_model_runs(settings) ## End(Not run)