This is a wrapper for generatePixelGroups, initiateNewCohort and updates to pixelGroupMap via assignment to new pixelIndex values in newPixelCohortData. By running these all together, there is less chance that they will diverge. There are some checks internally for consistency.

Calculate new values for B, add age, then rbindlist this with cohortData.

updateCohortData(
  newPixelCohortData,
  cohortData,
  pixelGroupMap,
  currentTime,
  speciesEcoregion,
  treedFirePixelTableSinceLastDisp = NULL,
  successionTimestep,
  cohortDefinitionCols = c("pixelGroup", "age", "speciesCode"),
  initialB = 10,
  verbose = getOption("LandR.verbose", TRUE),
  doAssertion = getOption("LandR.assertions", TRUE)
)

.initiateNewCohorts(
  newPixelCohortData,
  cohortData,
  pixelGroupMap,
  currentTime,
  cohortDefinitionCols = c("pixelGroup", "speciesCode", "age"),
  speciesEcoregion,
  successionTimestep,
  initialB = 10
)

Arguments

newPixelCohortData

must be a complete cohortData object with newly created cohorts. They do not have to have pixelGroup values yet; they can be overlapping with cohortData, (i.e., they can be regenerated on empty pixels or on already occupied pixels). Must contain the columns: pixelIndex, speciesCode, ecoregionGroup. The remaining 4 (see cohortData) will be created with 0s.

cohortData

A data.table with columns: pixelGroup, ecoregionGroup, speciesCode, and optionally age, B, mortality, aNPPAct, and sumB.

pixelGroupMap

A RasterLayer with pixel values equal to a pixel group number that corresponds exactly to pixelGroup column in cohortData.

currentTime

The current simulation time e.g., time(sim).

speciesEcoregion

A data.table with species-ecoregion-specific species trait values. Ecoregion refers to "ecolocation", a categorical variable grouping sites with similar biophysical characteristics. The table should have at least the following columns: speciesCode and ecoregionGroup, character representation of species and ecoregion groups respectively, maxB the maximum biomass for the species in a given 'ecoregion', maxANPP the maximum aboveground net primary productivity and SEP the species establishment probability. May contain columns inflationFactor (used to adjust maxB) and mANPPproportion (used to calculate maxANPP).

treedFirePixelTableSinceLastDisp

A data.table with at least 2 columns, pixelIndex and pixelGroup. This will be used in conjunction with cohortData and pixelGroupMap to ensure that everything matches correctly.

successionTimestep

The time between successive seed dispersal events. In LANDIS-II, this is called "Succession Timestep".

cohortDefinitionCols

the columns in cohortData that define unique cohorts

initialB

the initial biomass of new cohorts. Defaults to 10. If NULL or NA, initial cohort biomass is calculated as in LANDIS-II Biomass Succession Extension v3.2.1 (Scheller & Miranda, 2015):

initialB = asInteger(pmin(maxANPP, asInteger(pmax(1, maxANPP \* exp(-1.6 \* sumB / maxB_eco)))))

where maxANPP and maxB_eco are the maximum ANPP and B parameters of the species in question within the pixel's ecolocation, and sumB is the total stand biomass excluding cohorts with ages less than successionTimestep.

verbose

Controls message output. Defaults to getOption("LandR.verbose")

doAssertion

A logical indicating whether some internal tests should be run to ensure the function is running correctly. Default: getOption("LandR.assertions", TRUE).

Value

A list of length 2, cohortData and pixelGroupMap, with newPixelCohortData inserted.

A data.table with a new rbindlisted cohortData

Details

Does the following:

  1. add new cohort (not survivor) data into cohortData;

  2. assign initial B and age for new cohort;

  3. assign the new pixelGroup to the pixels that have new cohort;

  4. update the pixelGroup map.

Note that if newPixelCohortData is generated after a disturbance it must contain a type column indicating the origin of the cohorts (e.g. "survivor", "serotiny", "resprouting"). "Survivor" cohorts will not be added to the output objects, as they are assumed to be accounted for in the input cohortData and, correspondingly, pixelGroupMap.