addCohort: Add another cohort to the soil profile

View source: R/addCohort.R

addCohortR Documentation

Add another cohort to the soil profile

Description

This function adds a new cohort to a soil profile. Cohorts are constructed as follows:

  1. Cohorts are aged by timeStep increment.

  2. Organic matter pools decay

  3. If there are non-zero mineral inputs, they are added to the top of the soil profile as a new cohort.

  4. The top and bottom of the cohort layer is recalculated.

  5. A new root profile is constructed based on the cohort layers.

Usage

addCohort(
  massPools,
  rootTurnover,
  rootOmFrac,
  omDecayRate,
  packing,
  mineralInput = NA,
  mineralInput.fn = sedimentInputs,
  massLiveRoots.fn = massLiveRoots,
  calculateDepthOfNonRootVolume.fn = calculateDepthOfNonRootVolume,
  timeStep = 1,
  ...
)

Arguments

massPools

A data frame containing the following columns: age, fast_OM, slow_OM, mineral, layer_top, layer_bottom, root_mass. Each row of this data frame represents a single cohort. To increase runtime in simulations, the profile is buffered with NA's at the top of the data frame, see code comments for details.

rootTurnover

A numeric as the root turnover time in faction per year.

rootOmFrac

A list of numerics called fast and slow which is the allocation fraction between fast and slow organic matter pool respectively for dead roots.

omDecayRate

A list of numerics called fast and slow which is the decay rate for the fast and slow organic matter pool in fraction per year.

packing

A list of numerics with mineral and organic arguments representing their respective packing densities.

mineralInput

An optional value for mineral input in grams per year (numeric) if mineralInput.fn is not used

mineralInput.fn

A function that returns the mineral input in grams per year (numeric)

massLiveRoots.fn

A function that returns the mass of live roots for specified depth layers, must accept layerBottom and layerTop as arguments.

calculateDepthOfNonRootVolume.fn

A function that returns the depth of a specified volume of soil, must accept nonRootVolume as an argument.

timeStep

A numeric of the time step in years. Typically set to 1 year.

...

arguments to be passed to the specified functions

Value

A new data frame similar to massPool with the added cohort and simulated change in the cohort pools.


tilbud/rCTM documentation built on March 30, 2024, 10:06 a.m.