clLaggedPostHarvestGrowth Class Reference

Lagged Post-Harvest Growth - Version 1.0. More...

#include <LaggedPostHarvestGrowth.h>

Inheritance diagram for clLaggedPostHarvestGrowth:

clGrowthBase clBehaviorBase clWorkerBase

List of all members.

Public Member Functions

 clLaggedPostHarvestGrowth (clSimManager *p_oSimManager)
 Constructor.
 ~clLaggedPostHarvestGrowth ()
 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 trees.
void DoShellSetup (xercesc::DOMDocument *p_oDoc)
 Does setup.
void SetNameData (char *cNameString)
 Captures the namestring passed to this behavior.
void RegisterTreeDataMembers ()
 Registers the "PreHarvGr" tree float data member.

Protected Member Functions

void ValidateData ()
 Makes sure all input data is valid.
void GetTreeMemberCodes ()
 Gets the return codes for needed tree "Growth" 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.
void SetupTimeSinceHarvestGrid ()
 This creates the Years Since Harvest grid at the beginning of the simulation if it doesn't already exist, and sets pointers to grids and saves other relevant grid info in class members.
float LocalBasalAreaAroundTree (clTree *p_oTree)
 This calculates the basal area (in m2) of all trees within a certain distance of the tree passed as an argument.
int GetTimeSinceHarvest (clTree *p_oTree)
 Returns the Time value from the Years Since Harvest grid at the location of a tree.
void CalcTimeSinceHarvest ()
 Updates the Years Since Last Harvest grid, if it hasn't already been updated.

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 m_fNciDistanceRadius
 Distance (m) from a given tree out to which local basal area is calculated.
float * mp_fMaxGrowthConstant
 Maximum growth constant , p0 , in growth equation.
float * mp_fMaxGrowthDbhEffect
 Maximum growth DBH effect , p1 , in growth equation.
float * mp_fNciConstant
 NCI constant , p2 , in growth equation.
float * mp_fNciDbhEffect
 NCI DBH effect , p3 , in growth equation.
float * mp_fTimeSinceHarvestRateParam
 Rate parameter , p4 , which determines how quickly after harvest growth increases to it's new value.
short int * mp_iIndexes
 Speeds access to the arrays.
short int m_iNumTotalSpecies
 Keep our own copy for the destructor.
short int ** mp_iPreHarvGrowthCodes
 Codes for pre-harvest growth data member.
int m_iHarvestTypeCode
 Code for Harvest Type in Harvest Results grid.
int m_iTimeCode
 Code for Time (since last harvest) in the Years Since Last Harvest grid.
int m_iLastUpdated
 Code for LastUpdated (timestep) in the Years Since Last Harvest grid.
int m_iNumXCells
 Number of X cells in grids.
int m_iNumYCells
 Number of Y cells in grids.
clGridBasemp_oTimeSinceHarvestGrid
 Pointer to Years Since Last Harvest grid.
clGridBasemp_oHarvestResultsGrid
 Pointer to Harvest Results grid.
float m_fNumberYearsPerTimestep
 Number of years per timestep.


Detailed Description

Lagged Post-Harvest Growth - Version 1.0.

This is a growth shell object that incorporates a lag period after harvest during which growth increases gradually to a higher value.

Diameter growth of tree i before (Gpre) and well after harvest (Gpost) is calculated as:

Gpre/post = MG * exp(-p2NCIi)
Where Maximum growth (MG) is:
MG = p0 * exp(-p1 * dbhi)
and NCIi is: NCIi = (Σ BAn) * exp(-p3*dbhi)

Growth YSH years after harvest is calculated as:

G = Gpre + (Gpost - Gpre)*(1-exp(-p4*YSH))

The amount of growth is in cm/year. For multi-year timesteps, the behavior will calculate total growth by multiplying by the number of years per timestep.

This cannot be applied to seedlings. An error will be thrown if seedlings are passed.

This creates one new tree float data member called "PreHarvGr".

This also creates a grid called "Years Since Last Harvest".

The parameter file call string for this to be diameter-incrementing with auto-height updating is "lagged post-harvest growth"; for diameter-only incrementing, use "lagged post-harvest growth diam only". The namestring for this behavior is "laggedpostharvestgrowthshell".

Copyright 2003 Charles D. Canham.

Author:
Lora E. Murphy

Edit history:
-----------------
January 20, 2008 - Submitted as beta (MCV)

Constructor & Destructor Documentation

clLaggedPostHarvestGrowth::clLaggedPostHarvestGrowth ( clSimManager p_oSimManager  ) 

Constructor.

Parameters:
p_oSimManager Sim Manager object.

clLaggedPostHarvestGrowth::~clLaggedPostHarvestGrowth (  ) 

Destructor.


Member Function Documentation

float clLaggedPostHarvestGrowth::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().

Parameters:
p_oTree Tree to which to apply growth.
p_oPop Tree population object.
fHeightGrowth Amount of height growth, in m (ignored).
Returns:
Amount of diameter growth, in cm.

Reimplemented from clGrowthBase.

void clLaggedPostHarvestGrowth::PreGrowthCalcs ( clTreePopulation p_oPop  )  [virtual]

Calculates growth for all trees.

The values are stashed in the "Growth" tree float data member for later application.

Steps:

  1. Get all trees for this behavior.
  2. For each tree, calculate the amount of growth for each using the equations above. Stash the end result in "Growth".
This must be called before any growth stuff because it uses nearby BA, and this must be calculated before growth has been applied.

Growth per timestep is calculated by multiplying by the number of years per timestep.

Parameters:
p_oPop Tree population object.

Reimplemented from clGrowthBase.

void clLaggedPostHarvestGrowth::DoShellSetup ( xercesc::DOMDocument *  p_oDoc  )  [virtual]

Does setup.

  1. AssembleUniqueTypes() is called to create a list of unique behavior types.
  2. ReadParameterFile() is called to read the parameter file's data.
  3. ValidateData() is called to validate the data.
  4. GetTreeMemberCodes() is called to get tree data return codes.
  5. SetupTimeSinceHarvestGrid() is called to create a time since harvest grid, if it doesn't already exist.

Parameters:
p_oDoc DOM tree of parsed input tree.

Reimplemented from clGrowthBase.

void clLaggedPostHarvestGrowth::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.

Parameters:
cNameString Behavior's namestring.

Reimplemented from clBehaviorBase.

void clLaggedPostHarvestGrowth::RegisterTreeDataMembers (  )  [virtual]

Registers the "PreHarvGr" tree float data member.

Reimplemented from clGrowthBase.

void clLaggedPostHarvestGrowth::ValidateData (  )  [protected]

Makes sure all input data is valid.

The following must all be true:

  • Maximum potential growth (MPG) must be non-negative.
  • Time since harvest rate parameter must be greater than 0.
  • The basal area distance radius must be greater than 0.

Exceptions:
modelErr if any of the above conditions are not met.

void clLaggedPostHarvestGrowth::GetTreeMemberCodes (  )  [protected]

Gets the return codes for needed tree "Growth" data members.

Exceptions:
modelErr if a code comes back -1 for any species/type combo to which this behavior is applied.

void clLaggedPostHarvestGrowth::ReadParameterFile ( xercesc::DOMDocument *  p_oDoc  )  [protected]

Reads data from the parameter file.

Parameters:
p_oDoc DOM tree of parsed input tree.
Exceptions:
modelErr if this behavior has been applied to any types except sapling and adult.

void clLaggedPostHarvestGrowth::AssembleUniqueTypes (  )  [protected]

Assembles a unique list of types applied to this behavior and places it in mp_iWhatBehaviorTypes.

void clLaggedPostHarvestGrowth::SetupTimeSinceHarvestGrid (  )  [protected]

This creates the Years Since Harvest grid at the beginning of the simulation if it doesn't already exist, and sets pointers to grids and saves other relevant grid info in class members.

float clLaggedPostHarvestGrowth::LocalBasalAreaAroundTree ( clTree p_oTree  )  [protected]

This calculates the basal area (in m2) of all trees within a certain distance of the tree passed as an argument.

Parameters:
p_oTree Tree being evaluated
Returns:
The local basal area of nearby trees.

int clLaggedPostHarvestGrowth::GetTimeSinceHarvest ( clTree p_oTree  )  [protected]

Returns the Time value from the Years Since Harvest grid at the location of a tree.

If there has been no harvest in the tree's grid cell, a value of 1000 will be returned.

Parameters:
p_oTree Tree being evaluated
Returns:
The time since harvest, in years, at the tree's location.

void clLaggedPostHarvestGrowth::CalcTimeSinceHarvest (  )  [protected]

Updates the Years Since Last Harvest grid, if it hasn't already been updated.


Member Data Documentation

Holds return data codes for the "Growth" tree data member.

Array size is number of species to which this behavior applies by 2 (saplings and adults).

List of types managed by this behavior.

Number of types managed by this behavior.

Distance (m) from a given tree out to which local basal area is calculated.

Maximum growth constant , p0 , in growth equation.

Array assumed to be sized number of species to which this behavior applies. This array is accessed by using the index returned for mp_iIndexes[species number].

Maximum growth DBH effect , p1 , in growth equation.

Array assumed to be sized number of species to which this behavior applies. This array is accessed by using the index returned for mp_iIndexes[species number].

NCI constant , p2 , in growth equation.

Array assumed to be sized number of species to which this behavior applies. This array is accessed by using the index returned for mp_iIndexes[species number].

NCI DBH effect , p3 , in growth equation.

Array assumed to be sized number of species to which this behavior applies. This array is accessed by using the index returned for mp_iIndexes[species number].

Rate parameter , p4 , which determines how quickly after harvest growth increases to it's new value.

Array assumed to be sized number of species to which this behavior applies. This array is accessed by using the index returned for mp_iIndexes[species number].

Speeds access to the arrays.

Array size is assumed to be number of species.

Keep our own copy for the destructor.

This is the total number of tree species.

Codes for pre-harvest growth data member.

Code for Harvest Type in Harvest Results grid.

Code for Time (since last harvest) in the Years Since Last Harvest grid.

Code for LastUpdated (timestep) in the Years Since Last Harvest grid.

Number of X cells in grids.

Number of Y cells in grids.

Pointer to Years Since Last Harvest grid.

Pointer to Harvest Results grid.

Number of years per timestep.


The documentation for this class was generated from the following file:

Generated on Wed Oct 28 13:58:46 2009 for SORTIE Core C++ Documentation by  doxygen 1.5.6