#include <WeibullClimateSurvival.h>
Public Member Functions | |
clWeibullClimateSurvival (clSimManager *p_oSimManager) | |
Constructor. | |
~clWeibullClimateSurvival () | |
Destructor. | |
deadCode | DoMort (clTree *p_oTree, const float &fDbh, const short int &iSpecies) |
Determines mortality for a tree. | |
void | DoShellSetup (xercesc::DOMDocument *p_oDoc) |
Does setup. | |
void | PreMortCalcs (clTreePopulation *p_oPop) |
Calculates temperature and precipitation effects for each species for the current time step. | |
Protected Member Functions | |
void | ValidateData () |
Makes sure all input data is valid. | |
void | ReadParameterFile (xercesc::DOMDocument *p_oDoc) |
Reads data from the parameter file. | |
int | GetNumLargerNeighbors (clTree *p_oTarget) |
Counts the number of trees a target's neighborhood that have a DBH bigger than the target. | |
Protected Attributes | |
float ** | mp_fMaxRG |
Maximum potential annual survival value. | |
float ** | mp_fCompC |
Competition effect C. | |
float ** | mp_fCompD |
Competition effect D. | |
float ** | mp_fGamma |
Size sensitivity to crowding parameter. | |
double ** | mp_fSizeX0 |
Size effect X0. | |
float ** | mp_fSizeXb |
Size effect Xb. | |
float ** | mp_fPrecipA |
Precipitation effect A. | |
float ** | mp_fPrecipB |
Precipitation effect B. | |
float ** | mp_fPrecipC |
Precipitation effect C. | |
float ** | mp_fTempA |
Temperature effect A. | |
float ** | mp_fTempB |
Temperature effect B. | |
float ** | mp_fTempC |
Temperature effect C. | |
float ** | mp_fTempEffect |
Temperature effect. | |
float ** | mp_fPrecipEffect |
Precipitation effect. | |
float * | mp_fMaxCrowdingRadius |
Maximum search radius, in meters, in which to look for crowding neighbors. | |
float * | mp_fMinimumNeighborDBH |
The minimum DBH, in cm, of neighbors to be included in the neighbor count. | |
float * | mp_fSizeMinDBH |
Size effect minimum DBH. | |
short int * | mp_iIndexes |
Speeds access to the arrays. | |
float | m_fMinSaplingHeight |
Minimum sapling height. | |
short int | m_iNumTotalSpecies |
Keep our own copy for the destructor. |
This is a mortality shell object which calculates survival as a function of climate and neighbor density.
The equation for one year's survival is:
All parameters have separate copies for juveniles and adults.
The equation for Size Effect is:
where:
Size effect is subject to a minimum value for DBH, below which all trees will just get the minimum.
Precipitation Effect and Temperature Effect use the same function form. The function is: Climate Effect <- exp(-0.5*(abs(CV - C)/A)B) where:
Competition Effect is calculated as:
Snags, seedlings, and trees that are already dead from disturbance events are never counted in the neighbor count.
For multi year time steps, the annual probability of survival is raised to the power of the number of years per time step.
This cannot be applied to seedlings. An error will be thrown if seedlings are passed.
The parameter file call string for this is "WeibullClimateSurvival". The namestring for this behavior is "WeibullClimatemortshell".
Copyright 2010 Charles D. Canham.
clWeibullClimateSurvival::clWeibullClimateSurvival | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
clWeibullClimateSurvival::~clWeibullClimateSurvival | ( | ) |
Destructor.
deadCode clWeibullClimateSurvival::DoMort | ( | clTree * | p_oTree, | |
const float & | fDbh, | |||
const short int & | iSpecies | |||
) | [virtual] |
Determines mortality for a tree.
For this tree, count the number of larger neighbors. Then calculate the probability of survival for each using the equations above. Use the random number generator to decide life or death.
p_oTree | Tree being evaluated. | |
fDbh | DBH of tree being evaluated. | |
iSpecies | Species of tree being evaluated. |
Implements clMortalityBase.
void clWeibullClimateSurvival::DoShellSetup | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Does setup.
p_oDoc | DOM tree of parsed input tree. |
Reimplemented from clMortalityBase.
void clWeibullClimateSurvival::PreMortCalcs | ( | clTreePopulation * | p_oPop | ) | [virtual] |
Calculates temperature and precipitation effects for each species for the current time step.
p_oPop | Tree population. |
Reimplemented from clMortalityBase.
void clWeibullClimateSurvival::ValidateData | ( | ) | [protected] |
Makes sure all input data is valid.
The following must all be true:
modelErr | if any of the above conditions are not met. |
void clWeibullClimateSurvival::ReadParameterFile | ( | xercesc::DOMDocument * | p_oDoc | ) | [protected] |
Reads data from the parameter file.
p_oDoc | DOM tree of parsed input tree. |
modelErr | if this behavior has been applied to any types except sapling and adult. |
int clWeibullClimateSurvival::GetNumLargerNeighbors | ( | clTree * | p_oTarget | ) | [protected] |
Counts the number of trees a target's neighborhood that have a DBH bigger than the target.
Neighbors must have a DBH greater than the minimum. They also cannot be dead from a disturbance event; but any trees that have a dead code of "natural" are assumed to have died in the current time step mortality cycle and thus should be counted.
p_oTarget | Target tree for which to count the larger neighbors. |
float** clWeibullClimateSurvival::mp_fMaxRG [protected] |
Maximum potential annual survival value.
Array is sized 2 (juveniles = index 0, adults = index 1) by number of species to which this behavior applies.
float** clWeibullClimateSurvival::mp_fCompC [protected] |
Competition effect C.
Array is sized 2 (juveniles = index 0, adults = index 1) by number of species to which this behavior applies.
float** clWeibullClimateSurvival::mp_fCompD [protected] |
Competition effect D.
Array is sized 2 (juveniles = index 0, adults = index 1) by number of species to which this behavior applies.
float** clWeibullClimateSurvival::mp_fGamma [protected] |
Size sensitivity to crowding parameter.
γ in Competition Effect equation above. Array is sized 2 (juveniles = index 0, adults = index 1) by number of species to which this behavior applies.
double** clWeibullClimateSurvival::mp_fSizeX0 [protected] |
Size effect X0.
This must be an array of doubles in order to support very small values. Array is sized 2 (juveniles = index 0, adults = index 1) by number of species to which this behavior applies.
float** clWeibullClimateSurvival::mp_fSizeXb [protected] |
Size effect Xb.
Array is sized 2 (juveniles = index 0, adults = index 1) by number of species to which this behavior applies.
float** clWeibullClimateSurvival::mp_fPrecipA [protected] |
Precipitation effect A.
Array is sized 2 (juveniles = index 0, adults = index 1) by number of species to which this behavior applies.
float** clWeibullClimateSurvival::mp_fPrecipB [protected] |
Precipitation effect B.
Array is sized 2 (juveniles = index 0, adults = index 1) by number of species to which this behavior applies.
float** clWeibullClimateSurvival::mp_fPrecipC [protected] |
Precipitation effect C.
Array is sized 2 (juveniles = index 0, adults = index 1) by number of species to which this behavior applies.
float** clWeibullClimateSurvival::mp_fTempA [protected] |
Temperature effect A.
Array is sized 2 (juveniles = index 0, adults = index 1) by number of species to which this behavior applies.
float** clWeibullClimateSurvival::mp_fTempB [protected] |
Temperature effect B.
Array is sized 2 (juveniles = index 0, adults = index 1) by number of species to which this behavior applies.
float** clWeibullClimateSurvival::mp_fTempC [protected] |
Temperature effect C.
Array is sized 2 (juveniles = index 0, adults = index 1) by number of species to which this behavior applies.
float** clWeibullClimateSurvival::mp_fTempEffect [protected] |
Temperature effect.
Keep a copy so we only have to calculate once per time step. Array is sized 2 (juveniles = index 0, adults = index 1) by number of species to which this behavior applies.
float** clWeibullClimateSurvival::mp_fPrecipEffect [protected] |
Precipitation effect.
Keep a copy so we only have to calculate once per time step. Array is sized 2 (juveniles = index 0, adults = index 1) by number of species to which this behavior applies.
float* clWeibullClimateSurvival::mp_fMaxCrowdingRadius [protected] |
Maximum search radius, in meters, in which to look for crowding neighbors.
For calculating the Competition Effect. Array is sized number of species to which this behavior applies.
float* clWeibullClimateSurvival::mp_fMinimumNeighborDBH [protected] |
The minimum DBH, in cm, of neighbors to be included in the neighbor count.
Array is sized number of species.
float* clWeibullClimateSurvival::mp_fSizeMinDBH [protected] |
Size effect minimum DBH.
Array is sized number of species to which this behavior applies.
short int* clWeibullClimateSurvival::mp_iIndexes [protected] |
Speeds access to the arrays.
Array size is number of species.
float clWeibullClimateSurvival::m_fMinSaplingHeight [protected] |
Minimum sapling height.
For doing neighbor searches.
short int clWeibullClimateSurvival::m_iNumTotalSpecies [protected] |
Keep our own copy for the destructor.
This is the total number of tree species.
Reimplemented from clMortalityBase.