#include <NCIJuvenileGrowth.h>
Public Member Functions | |
clNCIJuvenileGrowth (clSimManager *p_oSimManager) | |
Constructor. | |
~clNCIJuvenileGrowth () | |
Destructor. | |
float | CalcDiameterGrowthValue (clTree *p_oTree, clTreePopulation *p_oPop, float fHeightGrowth) |
Returns the value in the tree's float data member that holds the value that was calculated by PreGrowthCalcs(). | |
void | PreGrowthCalcs (clTreePopulation *p_oPop) |
Calculates growth for all NCI trees. | |
void | DoShellSetup (xercesc::DOMDocument *p_oDoc) |
Does setup. | |
void | SetNameData (char *cNameString) |
Captures the namestring passed to this behavior. | |
Protected Member Functions | |
float | CalculateNCI (clTree *p_oTree, clTreePopulation *p_oPop, clAllometry *p_oAllom, clPlot *p_oPlot) |
Calculates the NCI value for a tree. | |
void | ValidateData () |
Makes sure all input data is valid. | |
void | GetTreeMemberCodes () |
Gets the return codes for needed tree data members. | |
void | ReadParameterFile (xercesc::DOMDocument *p_oDoc) |
Reads data from the parameter file. | |
void | AssembleUniqueTypes () |
Assembles a unique list of types applied to this behavior and places it in mp_iWhatBehaviorTypes. | |
Protected Attributes | |
short int ** | mp_iGrowthCodes |
Holds return data codes for the "Growth" tree data member. | |
short int * | mp_iWhatBehaviorTypes |
List of types managed by this behavior. | |
short int | m_iNumBehaviorTypes |
Number of types managed by this behavior. | |
float ** | mp_fLambda |
Lamba for NCI. | |
float * | mp_fAlpha |
Neighbor diam10 effect. | |
float * | mp_fBeta |
Neighbor distance effect. | |
float * | mp_fCrowdingSlope |
Crowding effect slope. | |
float * | mp_fCrowdingSteepness |
Crowding effect steepness. | |
float * | mp_fMinimumNeighborDiam10 |
The minimum Diam10, in cm, of neighbors to be included in NCI calculations. | |
float * | mp_fSizeEffectA |
Size effect "a" parameter. | |
float * | mp_fSizeEffectB |
Size effect "b" parameter. | |
float * | mp_fMaxGrowth |
Maximum growth, cm/yr. | |
float * | mp_fMaxCrowdingRadius |
Maximum search radius, in meters, in which to look for crowding neighbors. | |
float | m_fDiam10Divisor |
The value to divide diam10 by in NCI. | |
short int * | mp_iIndexes |
Speeds access to the arrays. | |
bool | m_bIncludeSnags |
Whether or not to include snags in NCI. |
This is a growth shell object which applies a variant on the NCI (neighborhood competition index) function designed for juvenile trees.
Growth per year is Growth = Max Growth * Size Effect * Crowding Effect. The amount of growth is in cm/year. For multi-year timesteps, the behavior will calculate total growth with a loop. Each loop iteration will increment DBH for one year. For each year, the Size Effect (SE) value is recalculated with the previous year's new DBH value. All values for each year of growth are summed to get the growth for the timestep.
Size Effect = a * d10 ^ b, where d10 is diameter at 10 cm height. Crowding Effect = exp(-C * NCI ^ D). NCI is calculated with d10, not DBH, even for adults; the d10 - DBH conversion equation will be used with the sapling parameters.
This can only be applied to seedlings and saplings. An error will be thrown otherwise.
The parameter file call string for this to be diameter-incrementing with auto-height updating is "NCI Juvenile Growth"; for diameter-only incrementing, use "NCI Juvenile Growth diam only". The namestring for this behavior is "ncijuvenilegrowthshell".
Copyright 2010 Charles D. Canham.
clNCIJuvenileGrowth::clNCIJuvenileGrowth | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
clNCIJuvenileGrowth::~clNCIJuvenileGrowth | ( | ) |
Destructor.
float clNCIJuvenileGrowth::CalcDiameterGrowthValue | ( | clTree * | p_oTree, | |
clTreePopulation * | p_oPop, | |||
float | fHeightGrowth | |||
) | [virtual] |
Returns the value in the tree's float data member that holds the value that was calculated by PreGrowthCalcs().
p_oTree | Tree to which to apply growth. | |
p_oPop | Tree population object. | |
fHeightGrowth | Amount of height growth, in m (ignored). |
Reimplemented from clGrowthBase.
void clNCIJuvenileGrowth::PreGrowthCalcs | ( | clTreePopulation * | p_oPop | ) | [virtual] |
Calculates growth for all NCI trees.
The values are stashed in the "Growth" tree float data member for later application.
Steps:
Growth per timestep is calculated by looping over the number of years per timestep and incrementing the DBH.
p_oPop | Tree population object. |
Reimplemented from clGrowthBase.
void clNCIJuvenileGrowth::DoShellSetup | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Does setup.
p_oDoc | DOM tree of parsed input tree. |
Reimplemented from clGrowthBase.
void clNCIJuvenileGrowth::SetNameData | ( | char * | cNameString | ) | [virtual] |
Captures the namestring passed to this behavior.
This is overridden from clBehaviorBase so we can capture the namestring passed. Since this class can create multiple kinds of behaviors that function differently, this will capture what kind of behavior this is supposed to be.
cNameString | Behavior's namestring. |
Reimplemented from clBehaviorBase.
float clNCIJuvenileGrowth::CalculateNCI | ( | clTree * | p_oTree, | |
clTreePopulation * | p_oPop, | |||
clAllometry * | p_oAllom, | |||
clPlot * | p_oPlot | |||
) | [protected] |
Calculates the NCI value for a tree.
p_oTree | Tree for which to calculate NCI. | |
p_oPop | Tree population object. | |
p_oAllom | Allometry object. | |
p_oPlot | Plot object. |
void clNCIJuvenileGrowth::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 clNCIJuvenileGrowth::GetTreeMemberCodes | ( | ) | [protected] |
Gets the return codes for needed tree data members.
modelErr | if a code comes back -1 for any species/type combo to which this behavior is applied. |
void clNCIJuvenileGrowth::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 seedling. |
void clNCIJuvenileGrowth::AssembleUniqueTypes | ( | ) | [protected] |
Assembles a unique list of types applied to this behavior and places it in mp_iWhatBehaviorTypes.
short int** clNCIJuvenileGrowth::mp_iGrowthCodes [protected] |
Holds return data codes for the "Growth" tree data member.
Array size is number of species to which this behavior applies by 2 (seedlings and saplings).
short int* clNCIJuvenileGrowth::mp_iWhatBehaviorTypes [protected] |
List of types managed by this behavior.
short int clNCIJuvenileGrowth::m_iNumBehaviorTypes [protected] |
Number of types managed by this behavior.
float** clNCIJuvenileGrowth::mp_fLambda [protected] |
Lamba for NCI.
Array is sized number of behavior species by number of total species. This array is accessed by using the species number as an array index.
float* clNCIJuvenileGrowth::mp_fAlpha [protected] |
Neighbor diam10 effect.
α variable in Crowding Effect equation. Array is sized number of species to which this behavior applies. This array is accessed by using the index returned for mp_iIndexes[species number].
float* clNCIJuvenileGrowth::mp_fBeta [protected] |
Neighbor distance effect.
β variable in Crowding Effect equation. Array is sized number of species to which this behavior applies. This array is accessed by using the index returned for mp_iIndexes[species number].
float* clNCIJuvenileGrowth::mp_fCrowdingSlope [protected] |
Crowding effect slope.
C in Crowding Effect equation. Array is sized number of species to which this behavior applies. This array is accessed by using the index returned for mp_iIndexes[species number].
float* clNCIJuvenileGrowth::mp_fCrowdingSteepness [protected] |
Crowding effect steepness.
D in Crowding Effect equation. Array is sized number of species to which this behavior applies. This array is accessed by using the index returned for mp_iIndexes[species number].
float* clNCIJuvenileGrowth::mp_fMinimumNeighborDiam10 [protected] |
The minimum Diam10, in cm, of neighbors to be included in NCI calculations.
Array is sized total number of species.
float* clNCIJuvenileGrowth::mp_fSizeEffectA [protected] |
Size effect "a" parameter.
Array is sized number of species to which this behavior applies. This array is accessed by using the index returned for mp_iIndexes[species number].
float* clNCIJuvenileGrowth::mp_fSizeEffectB [protected] |
Size effect "b" parameter.
Array is sized number of species to which this behavior applies. This array is accessed by using the index returned for mp_iIndexes[species number].
float* clNCIJuvenileGrowth::mp_fMaxGrowth [protected] |
Maximum growth, cm/yr.
Array is sized number of species to which this behavior applies. This array is accessed by using the index returned for mp_iIndexes[species number].
float* clNCIJuvenileGrowth::mp_fMaxCrowdingRadius [protected] |
Maximum search radius, in meters, in which to look for crowding neighbors.
For calculating the Crowding Effect. Array is sized number of species to which this behavior applies. This array is accessed by using the index returned for mp_iIndexes[species number].
float clNCIJuvenileGrowth::m_fDiam10Divisor [protected] |
The value to divide diam10 by in NCI.
q in the NCI equation above. May be set to 1.
short int* clNCIJuvenileGrowth::mp_iIndexes [protected] |
Speeds access to the arrays.
Array size is is number of species.
bool clNCIJuvenileGrowth::m_bIncludeSnags [protected] |
Whether or not to include snags in NCI.