#include <SnagDecomp.h>
Public Member Functions | |
clSnagDecomp (clSimManager *p_oSimManager) | |
Constructor. | |
~clSnagDecomp () | |
Destructor. | |
void | Action () |
Runs snags through the fall models and decay class transition matrix. | |
void | CalcGridValues () |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Does setup for this behavior. | |
void | RegisterTreeDataMembers () |
Registers the "SnagDecayClass" int data member. | |
Protected Attributes | |
float | mp_fSnagTransProb [6][6] |
Species-specific matrices of transition probabilities. | |
float | m_fTreefallAlpha |
Parameters used in treefall and snag fall models. | |
float * | mp_fTreefallBeta |
float | m_fTreefallDelta |
float | m_fTreefallTheta |
float | m_fTreefallIota |
float | m_fTreefallLamda |
float | m_fSnagfallAlpha |
float * | mp_fSnagfallBeta |
float * | mp_fSnagfallGamma |
float | m_fSnagfallZeta |
float | m_fSnagfallEta |
float | m_fSnagfallKappa |
float | m_fMinBreakHeight |
The minimum snag break height. | |
float | m_fMaxBreakHeight |
The maximum snag break height. | |
char * | m_cQuery |
String to pass to clTreePopulation::Find() in order to get the trees for which to run snag dynamics. | |
clGridBase * | mp_oBasalAreaGrid |
Grid to hold live and cut basal area in local cells. | |
short int | m_iLiveBACode |
short int | m_iCutBACode |
float | m_fGridCellLength |
short int ** | mp_iSnagDCCode |
Holds relevant data member codes. | |
short int ** | mp_iNewBreakCode |
short int ** | mp_iDeadCodes |
short int * | mp_iAdultFallCode |
short int * | mp_iOldBreakCode |
short int * | mp_iIndexes |
int | m_iNumSpecies |
Keep a copy of this for the destructor. |
This class simulates the dynamics of standing dead trees as they pass through a series of decay classes and eventually fall.
Trees that die from natural causes in the timestep are run through a tree fall model to determine whether they become a snag, or fall and are removed from tree population. Snags created in previous timesteps are run through a separate fall model to determine whether they remain standing or are removed. Snags remaining standing are run through a decay class transition matrix (decay class is a parameter of the snag fall model).
This behavior adds one integer data member called "SnagDecayClass" representing snag decay class. There are five decay classes, numbered 1-5. Parameter values can be set to utilize fewer classes if desired.
This behavior adds two float data members called "NewBreakHeight" and "SnagOldBreakHeight", both of which represent the height at which a snag has broken. This is held by NewBreakHeight if the breakage occurred this timestep, or SnagOldBreakHeight otherwise. If the snag is unbroken or did not break at the appropriate time, the value of these members is -1.0.
This behavior adds one bool data member called "Fall". This represents whether or not a tree that has died this timestep has fallen (true), or remains standing as a snag (false).
Parameters correspond to the tree fall and snag fall models in Vanderwel et al. 2006 (Can. J. For. Res. 36: 2769-2779), and to a transition matrix representing the probability of undergoing a transition from a given decay class to another (or the same one) during the timestep. All transition matrix values must be non-negative and the sum of each column should add up to 1.
All parameters are based on a five-year timestep; the behavior will adjust fall probabilities for other timestep lengths if necessary.
This class's namestring and parameter call string are both "snag decay class dynamics".
This behavior can be applied to adults and snags. It should run after mortality and before substrate and dead tree remover behaviors are applied in each timestep.
Copyright 2005 Charles D. Canham.
clSnagDecomp::clSnagDecomp | ( | clSimManager * | p_oSimManager | ) |
clSnagDecomp::~clSnagDecomp | ( | ) |
Destructor.
Deletes arrays.
void clSnagDecomp::Action | ( | ) | [virtual] |
Runs snags through the fall models and decay class transition matrix.
A query is sent to the tree population to get all snags to which this behavior is applied. For each that is still standing, the new decay class is calculated and the value is placed in the "SnagDecayClass" int tree data member. Snags that fall are removed by calling clTreePopulation::KillTree()
Reimplemented from clBehaviorBase.
void clSnagDecomp::CalcGridValues | ( | ) |
void clSnagDecomp::GetData | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Does setup for this behavior.
Steps:
p_oDoc | DOM tree of parsed input file. |
modelErr | if:
|
Implements clWorkerBase.
void clSnagDecomp::RegisterTreeDataMembers | ( | ) | [virtual] |
Registers the "SnagDecayClass" int data member.
The return codes are captured in the mp_iSnagDCCodes array.
modelErr | if this behavior is being applied to any tree type except snags. |
Reimplemented from clBehaviorBase.
float clSnagDecomp::mp_fSnagTransProb[6][6] [protected] |
Species-specific matrices of transition probabilities.
Array size is 6 x 6.
float clSnagDecomp::m_fTreefallAlpha [protected] |
Parameters used in treefall and snag fall models.
float* clSnagDecomp::mp_fTreefallBeta [protected] |
float clSnagDecomp::m_fTreefallDelta [protected] |
float clSnagDecomp::m_fTreefallTheta [protected] |
float clSnagDecomp::m_fTreefallIota [protected] |
float clSnagDecomp::m_fTreefallLamda [protected] |
float clSnagDecomp::m_fSnagfallAlpha [protected] |
float* clSnagDecomp::mp_fSnagfallBeta [protected] |
float* clSnagDecomp::mp_fSnagfallGamma [protected] |
float clSnagDecomp::m_fSnagfallZeta [protected] |
float clSnagDecomp::m_fSnagfallEta [protected] |
float clSnagDecomp::m_fSnagfallKappa [protected] |
float clSnagDecomp::m_fMinBreakHeight [protected] |
The minimum snag break height.
Actually break height is a height between min and max drawn from a uniform distribution.
float clSnagDecomp::m_fMaxBreakHeight [protected] |
The maximum snag break height.
char* clSnagDecomp::m_cQuery [protected] |
String to pass to clTreePopulation::Find() in order to get the trees for which to run snag dynamics.
This will instigate a species search for all the species to which this behavior applies.
clGridBase* clSnagDecomp::mp_oBasalAreaGrid [protected] |
Grid to hold live and cut basal area in local cells.
short int clSnagDecomp::m_iLiveBACode [protected] |
short int clSnagDecomp::m_iCutBACode [protected] |
float clSnagDecomp::m_fGridCellLength [protected] |
short int** clSnagDecomp::mp_iSnagDCCode [protected] |
Holds relevant data member codes.
First array index is # species and second, if present, is type (adult or snag).
short int** clSnagDecomp::mp_iNewBreakCode [protected] |
short int** clSnagDecomp::mp_iDeadCodes [protected] |
short int* clSnagDecomp::mp_iAdultFallCode [protected] |
short int* clSnagDecomp::mp_iOldBreakCode [protected] |
short int* clSnagDecomp::mp_iIndexes [protected] |
int clSnagDecomp::m_iNumSpecies [protected] |
Keep a copy of this for the destructor.