#include <ExpResourceMortality.h>
Inheritance diagram for clExpResourceMortality:
Public Member Functions | |
clExpResourceMortality (clSimManager *p_oSimManager) | |
Constructor. | |
~clExpResourceMortality () | |
Destructor. | |
void | DoShellSetup (xercesc::DOMDocument *p_oDoc) |
Performs setup for this behavior. | |
bool | DoMort (clTree *p_oTree, const float &fDbh, const short int &iSpecies) |
Calculates mortality according to the growth-resource mortality equation. | |
Protected Member Functions | |
void | ReadParameterFileData (xercesc::DOMDocument *p_oDoc) |
Reads in parameter file data. | |
void | GetResourceGrid () |
Gets the "Resource" grid. | |
void | GetTreeDataMemberCodes () |
Queries for the return codes of the "Growth", "X", and "Y" float data members of a tree. | |
Protected Attributes | |
clGridBase * | mp_oResourceGrid |
Grid containing the levels of the second resource. | |
short int ** | mp_iGrowthCodes |
Data member codes for "Growth" member - # behavior species by total # types. | |
short int ** | mp_iXCodes |
Data member codes for "X" tree data member - # behavior species by total # types. | |
short int ** | mp_iYCodes |
Data member codes for "Y" tree data member - # behavior species by total # types. | |
float * | mp_fA |
Mortality at zero growth parameter - "a" in equation above. | |
float * | mp_fB |
Light dependent mortality parameter - "b" in equation above. | |
float * | mp_fC |
Resource dependent mortality parameter - "c" in equation above. | |
float * | mp_fD |
"d" in equation above. | |
short int * | mp_iIndexes |
For array access. | |
float | m_fNumberYearsPerTimestep |
Number of years per timestep. | |
short int | m_iResourceCode |
Index for "Resource" data member of the "Resource" grid. |
This evaluates mortality probability as a function of growth and a second (unidentified) resource.
The probability of mortality is:
where:
To compound the mortality probability over the number of years per timestep, use 1-(1-P)X, where P is the annual probability of mortality and X is the number of years per timestep.
Once a tree's mortality probability has been calculated, a random number is used to determine if the tree lives or dies.
The value of the second resource comes from a grid called "Resource", with a single float member named "Resource". This behavior doesn't create this grid, and it's considered a fatal error if it is not present at setup. This behavior will not modify the contents of this grid in any way.
This class's namestring is "expresourcemortshell". Its parameter file call string is "Exponential growth resource mortality".
Copyright 2006 Charles D. Canham.
clExpResourceMortality::clExpResourceMortality | ( | clSimManager * | p_oSimManager | ) |
Constructor.
Sets the namestring.
void clExpResourceMortality::DoShellSetup | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Performs setup for this behavior.
Calls:
p_oDoc | Parsed DOM tree of parameter file. |
Reimplemented from clMortalityBase.
bool clExpResourceMortality::DoMort | ( | clTree * | p_oTree, | |
const float & | fDbh, | |||
const short int & | iSpecies | |||
) | [virtual] |
Calculates mortality according to the growth-resource mortality equation.
The equation is listed above.
fDbh | DBH of tree being evaluated - for seedlings will be 0 | |
p_oTree | Tree being evaluated | |
iSpecies | Species of the tree being evaluated |
Implements clMortalityBase.
void clExpResourceMortality::ReadParameterFileData | ( | xercesc::DOMDocument * | p_oDoc | ) | [protected] |
Reads in parameter file data.
p_oDoc | Parsed DOM tree of parameter file. |
void clExpResourceMortality::GetResourceGrid | ( | ) | [protected] |
Gets the "Resource" grid.
modelErr | if the grid named "Resource" is not present, or is not set up correctly. |
void clExpResourceMortality::GetTreeDataMemberCodes | ( | ) | [protected] |
Queries for the return codes of the "Growth", "X", and "Y" float data members of a tree.
The "Growth" data member should have been registered by a child class of clGrowthBase.
modelErr | if there is no code for any species/type combo which uses this behavior. |
clGridBase* clExpResourceMortality::mp_oResourceGrid [protected] |
Grid containing the levels of the second resource.
This is not created by this behavior; it is expected to already be available. It should be named "Resource" and have one float data member called "Resource".
float* clExpResourceMortality::mp_fA [protected] |
Mortality at zero growth parameter - "a" in equation above.
Array size is number of behavior species.
float* clExpResourceMortality::mp_fB [protected] |
Light dependent mortality parameter - "b" in equation above.
Array size is number of behavior species.
float* clExpResourceMortality::mp_fC [protected] |
Resource dependent mortality parameter - "c" in equation above.
Array size is number of behavior species.
float* clExpResourceMortality::mp_fD [protected] |
"d" in equation above.
Array size is number of behavior species.