Package 'libcbmr'

Title: Interface to the Carbon Budget Model Library Based on CBM-CFS3
Description: Provides wrappers for working with 'libcbm_py' in R.
Authors: Scott Morken [aut], Celine Boisvenue [aut], Alex M Chubaty [aut, cre] (ORCID: <https://orcid.org/0000-0001-7146-8135>), Eliot McIntire [aut]
Maintainer: Alex M Chubaty <[email protected]>
License: MPL-2.0 + file(LICENSE)
Version: 0.0.1.9000
Built: 2026-06-03 06:44:19 UTC
Source: https://github.com/PredictiveEcology/libcbmr

Help Index


Get the default parameters bundled with libcbm for running the cbm_exn package

Description

Get the default parameters bundled with libcbm for running the cbm_exn package

Usage

cbm_exn_get_default_parameters()

get the default spinup op sequence names

Description

get the default spinup op sequence names

Usage

cbm_exn_get_spinup_op_sequence()

Value

list of strings - list of the names of the default spinup ops


get the default step op sequence names for disturbances

Description

get the default step op sequence names for disturbances

Usage

cbm_exn_get_step_disturbance_ops_sequence()

Value

list of strings - list of the names of the default disturbance step ops


get the default step op sequence names

Description

get the default step op sequence names

Usage

cbm_exn_get_step_ops_sequence()

Value

list of strings - list of the names of the default step ops


Run the cbm_exn spinup routine which initializes C pools and state for simulations

Description

Run the cbm_exn spinup routine which initializes C pools and state for simulations

Usage

cbm_exn_spinup(
  spinup_input,
  spinup_ops,
  spinup_op_list,
  parameters,
  spinup_debug_output_dir = NULL
)

Arguments

spinup_input

a dictionary of spinup_parameters, spinup_increments

spinup_ops

the formatted matrix operations to apply

spinup_op_list

list of operation names to apply in spinup stepping (references spinup ops)

parameters

named list of default parameters for model initilization

spinup_debug_output_dir

optional path which defaults to NULL. If specified, the path is used to write debugging CSV files with full model state and variable details about spinup timesteps.

Value

cbm_vars - a collection of simulation state and variables for time-stepping with subsequent cbm processes


Get the default spinup ops

Description

Get the default spinup ops

Usage

cbm_exn_spinup_ops(spinup_input, parameters)

Run all C dynamics for one timestep

Description

Run all C dynamics for one timestep

Usage

cbm_exn_step(
  cbm_vars,
  operations,
  disturbance_op_sequence,
  step_op_sequence,
  parameters
)

Arguments

cbm_vars

named list of dataframes containing the simulation state and variables for the timestep

operations

list of formatted matrix operations to apply to the pools.

disturbance_op_sequence

list of named disturbance operations to apply to the pools referencing the values in the specified operations

step_op_sequence

list of named annual process operations to apply to the pools referencing the values in the specified operations

parameters

named list of default parameter for model initialization


Get the default matrix operations for cbm_exn stepping as a list of matrices

Description

Get the default matrix operations for cbm_exn stepping as a list of matrices

Usage

cbm_exn_step_ops(cbm_vars, parameters)

Arguments

cbm_vars

named list of dataframes containing the simulation state and variables for computing the default operations

parameters

named list of default parameters. For default value see the cbm_exn_get_default_parameters function.

Value

list - list of structured matrix operations


get_cbm_defaults_path

Description

Get path of the CBM defaults SQLite database. This will be the path to the packaged default database or a path set with the option libcbmr.cbm_defaults_path.

Usage

get_cbm_defaults_path()

get_cbm_exn_parameters_dir

Description

Get path of the parameters directory for libcbm.cbm_exn.cbm_exn_model. This will be the path to the packaged default parameters or a path set with the option libcbmr.cbm_exn_parameters_dir.

Usage

get_cbm_exn_parameters_dir()

Install libcbm python package

Description

Install libcbm python package

Usage

install_libcbm(method = "auto", conda = "auto", envname = NULL)

Arguments

method

Installation method. By default, "auto" automatically finds a method that will work in the local environment. Change the default to force a specific installation method. Note that the "virtualenv" method is not available on Windows.

conda

The path to a conda executable. Use "auto" to allow reticulate to automatically find an appropriate conda binary. See Finding Conda and conda_binary() for more details.

envname

The name, or full path, of the environment in which Python packages are to be installed. When NULL (the default), the active environment as set by the RETICULATE_PYTHON_ENV variable will be used; if that is unset, then the r-reticulate environment will be used.


cbm_exn_model

Description

DESCRIPTION NEEDED

Usage

libcbm_cbm_exn_model()

cbm_variables

Description

DESCRIPTION NEEDED

Usage

libcbm_cbm_variables()

libcbm_resources

Description

DESCRIPTION NEEDED

Usage

libcbm_libcbm_resources()

model_variables

Description

DESCRIPTION NEEDED

Usage

libcbm_model_variables()

output_processor

Description

DESCRIPTION NEEDED

Usage

libcbm_output_processor()

Use conda or virtual environment

Description

Will try to guess whether to use use_condaenv() or use_virtualenv.

Usage

py_use_env(envname = NULL)

Arguments

envname

Either the name of, or the path to, a Python virtual or conda environment.