#include <TempDependentNeighborhoodSurvival.h>
Public Member Functions | |
clTempDependentNeighborhoodSurvival (clSimManager *p_oSimManager) | |
Constructor. | |
~clTempDependentNeighborhoodSurvival () | |
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) |
Does beginning of the time step setup. | |
Protected Member Functions | |
void | ValidateData () |
Makes sure N for each species does not = 0 and that the neighbor search radius >= 0. | |
void | ReadParameterFile (xercesc::DOMDocument *p_oDoc, clTreePopulation *p_oPop) |
Reads data from the parameter file. | |
float | GetBAT (float &fX, float &fY, clTreePopulation *p_oPop) |
Gets the total adult neighborhood basal area within the specified radius from a given point. | |
void | SetupGrid (clTreePopulation *p_oPop) |
Sets up the "Temperature Dependent Neighborhood Survival" grid. | |
Protected Attributes | |
clGridBase * | mp_oGrid |
Grid holding survival rate for each species. | |
float * | mp_fM |
Temperature function M - sized number of species. | |
float * | mp_fN |
Temperature function N - sized number of species. | |
float * | mp_fA |
A parameter - sized number of species. | |
float * | mp_fB |
B parameter - sized number of species. | |
float * | mp_fTempFunction |
Temperature portion of the survival function - sized number of species. | |
short int * | mp_iGridSurvivalCodes |
Holds data member codes for the "survival_x" data members of the "Temperature Dependent Neighborhood Survival" grid. | |
float | m_fRadius |
Neighborhood search radius. | |
float | m_fMinSaplingHeight |
Minimum sapling height. | |
short int | m_iBATCode |
Return code for the "BAT" grid data member. |
This is a mortality shell object which calculates survival as a function of climate and adult neighbor basal area.
The equation for one year's survival is:
Rather than calculate a survival rate for each individual tree, this calculates a survival rate for each cell in a grid. Trees then get the survival rate of the grid cell in which they are found. For efficiency, the survival rate for a cell is not calculated until there is a tree that needs it.
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.
The parameter file call string for this is "Temp Dependent Neighborhood Survival". The namestring for this behavior is "TempDependentNeighborhoodmortshell".
Copyright 2010 Charles D. Canham.
clTempDependentNeighborhoodSurvival::clTempDependentNeighborhoodSurvival | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
clTempDependentNeighborhoodSurvival::~clTempDependentNeighborhoodSurvival | ( | ) |
Destructor.
deadCode clTempDependentNeighborhoodSurvival::DoMort | ( | clTree * | p_oTree, | |
const float & | fDbh, | |||
const short int & | iSpecies | |||
) | [virtual] |
Determines mortality for a tree.
This starts by checking the grid cell of the tree to see if survival rate has already been calculated. If so, use it. If not, calculate it for this species for this grid cell. If not already determined, get the adult neighborhood basal area for the cell and calculate the probability of survival using the equation above. Use the random number generator to decide life or death; return the result.
p_oTree | Tree being evaluated. | |
fDbh | DBH of tree being evaluated. | |
iSpecies | Species of tree being evaluated. |
Implements clMortalityBase.
void clTempDependentNeighborhoodSurvival::DoShellSetup | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Does setup.
p_oDoc | DOM tree of parsed input tree. |
Reimplemented from clMortalityBase.
void clTempDependentNeighborhoodSurvival::PreMortCalcs | ( | clTreePopulation * | p_oPop | ) | [virtual] |
Does beginning of the time step setup.
This clears all grid values and calculates the temperature portion of the survival function for each species.
p_oPop | Tree population. |
Reimplemented from clMortalityBase.
void clTempDependentNeighborhoodSurvival::ValidateData | ( | ) | [protected] |
Makes sure N for each species does not = 0 and that the neighbor search radius >= 0.
modelErr | if the above conditions are not met. |
void clTempDependentNeighborhoodSurvival::ReadParameterFile | ( | xercesc::DOMDocument * | p_oDoc, | |
clTreePopulation * | p_oPop | |||
) | [protected] |
Reads data from the parameter file.
p_oDoc | DOM tree of parsed input tree. | |
p_oPop | Tree population. |
float clTempDependentNeighborhoodSurvival::GetBAT | ( | float & | fX, | |
float & | fY, | |||
clTreePopulation * | p_oPop | |||
) | [protected] |
Gets the total adult neighborhood basal area within the specified radius from a given point.
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.
fX | X coordinate of point for which to calculate neighborhood basal area | |
fY | Y coordinate of point for which to calculate neighborhood basal area | |
p_oPop | Tree population. |
void clTempDependentNeighborhoodSurvival::SetupGrid | ( | clTreePopulation * | p_oPop | ) | [protected] |
Sets up the "Temperature Dependent Neighborhood Survival" grid.
This ignores any maps.
p_oPop | Tree population object. |
clGridBase* clTempDependentNeighborhoodSurvival::mp_oGrid [protected] |
Grid holding survival rate for each species.
The grid name is "Temperature Dependent Neighborhood Survival". It has X+1 float data members, where X = the total number of species. The data member names are "survival_x", for the time step survival rate (where "x" is the species number), and "BAT" for the total adult neighborhood basal area.
float* clTempDependentNeighborhoodSurvival::mp_fM [protected] |
Temperature function M - sized number of species.
float* clTempDependentNeighborhoodSurvival::mp_fN [protected] |
Temperature function N - sized number of species.
float* clTempDependentNeighborhoodSurvival::mp_fA [protected] |
A parameter - sized number of species.
float* clTempDependentNeighborhoodSurvival::mp_fB [protected] |
B parameter - sized number of species.
float* clTempDependentNeighborhoodSurvival::mp_fTempFunction [protected] |
Temperature portion of the survival function - sized number of species.
short int* clTempDependentNeighborhoodSurvival::mp_iGridSurvivalCodes [protected] |
Holds data member codes for the "survival_x" data members of the "Temperature Dependent Neighborhood Survival" grid.
Array size is total # species.
float clTempDependentNeighborhoodSurvival::m_fRadius [protected] |
Neighborhood search radius.
float clTempDependentNeighborhoodSurvival::m_fMinSaplingHeight [protected] |
Minimum sapling height.
For doing neighbor searches.
short int clTempDependentNeighborhoodSurvival::m_iBATCode [protected] |
Return code for the "BAT" grid data member.