SORTIE Core C++ Documentation
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clDetailedSubstrate Class Reference

DetailedSubstrate - Version 1.0. More...

#include <DetailedSubstrate.h>

Inheritance diagram for clDetailedSubstrate:
clBehaviorBase clWorkerBase

Public Member Functions

 clDetailedSubstrate (clSimManager *p_oSimManager)
 Constructor. More...
 
 ~clDetailedSubstrate ()
 Destructor. More...
 
void GetData (xercesc::DOMDocument *p_oDoc)
 Performs setup for substrate. More...
 
void Action ()
 Computes substrate for a timestep. More...
 
- Public Member Functions inherited from clBehaviorBase
virtual float GetBehaviorVersion ()
 Gets the behavior version number. More...
 
 clBehaviorBase (clSimManager *p_oSimManager)
 Constructor. More...
 
virtual ~clBehaviorBase ()
 Destructor. More...
 
virtual short int ValidateVersionNumber (float fTestVersion)
 Makes sure that the version number of a file passed is between the minimum and current version numbers. More...
 
virtual void RegisterTreeDataMembers ()
 Registers tree data members. More...
 
virtual void SetSpeciesTypeCombos (short int iNumCombos, stcSpeciesTypeCombo *p_whatCombos)
 Sets the species/type combos for a behavior. More...
 
virtual void SetNameData (std::string sNameString)
 Sets the string for the parameter file behavior. More...
 
virtual short int GetNewTreeInts ()
 Gets the number of new tree integer data members this behavior wants to register. More...
 
virtual short int GetNewTreeFloats ()
 Gets the number of new tree float data members this behavior wants to register. More...
 
virtual short int GetNewTreeChars ()
 Gets the number of new tree character data members this behavior wants to register. More...
 
virtual short int GetNewTreeBools ()
 Gets the number of new tree bool data members this behavior wants to register. More...
 
virtual short int GetNumSpeciesTypeCombos ()
 Gets the number of species/type combos to which this behavior applies. More...
 
virtual short int GetNumBehaviorSpecies ()
 Gets the number of unique tree species to which this behavior applies. More...
 
struct stcSpeciesTypeCombo GetSpeciesTypeCombo (short int iIndex)
 Gets one of this behavior's type/species combos. More...
 
virtual short int GetBehaviorSpecies (short int iIndex)
 Gets one of the behavior's species. More...
 
short int GetBehaviorListNumber ()
 Gets the behavior list number for this behavior, which differentiates between multiple copies of the behavior in the behavior list. More...
 
void SetBehaviorListNumber (short int iNumber)
 Sets the behavior list number for this behavior, which differentiates between multiple copies of the behavior in the behavior list. More...
 
std::string FormatSpeciesTypeQueryString ()
 Formats the string for species/types query. More...
 
virtual DOMElement * GetParentParametersElement (xercesc::DOMDocument *p_oDoc)
 This will get the correct set of parameters for this behavior based on the behavior list position number. More...
 
- Public Member Functions inherited from clWorkerBase
 clWorkerBase (clSimManager *p_oSimManager)
 Constructor. More...
 
virtual ~clWorkerBase ()
 Destructor. More...
 
std::string GetName ()
 Gets the object's namestring. More...
 
clSimManagerGetSimManager ()
 
void DoObjectSetup (xercesc::DOMDocument *p_oDoc, fileType iFileType)
 Triggers the setup process. More...
 
virtual void TimestepCleanup ()
 Performs any necessary cleanup operations at the end of a timestep. More...
 
virtual void EndOfRunCleanup ()
 Performs any necessary cleanup operations at the end of a run. More...
 

Protected Member Functions

void GetParameterFileData (xercesc::DOMDocument *p_oDoc)
 Gets the values from the parameter file. More...
 
void CalculateDecayProportions ()
 Calculates the proportion of decay for each timestep for logs, tip- up mounds, and scarified soil. More...
 
void SetupSubstrateGrids ()
 Sets up the substrate grids and registers all their data members. More...
 
void SetInitialSubstrate ()
 Adds the amount of substrate in the substrate map or parameter file to the substrate and calculations grids. More...
 
void GetCodes ()
 Populates the mp_iDeadCodes, mp_iFallCodes, mp_iOldBreakCodes, mp_iNewBreakCodes arrays with the data member codes for the "dead", "Fall", "SnagOldBreakHeight", and "NewBreakHeight" data members, respectively. More...
 
void AddHarvestSubstrate ()
 Adds the effects of harvests to the substrate grid. More...
 
void CalcMainGridTotals ()
 Calculates totals for packages and the calculations grid and writes them to the main substrate grid. More...
 
void DecaySubstrate ()
 Performs substrate decay. More...
 
void CalcVolumeAfterDecay ()
 Calculates the post-decay log volumes for each grid cell. More...
 
void MortalitySubstrate ()
 Adds the effects of the new dead trees to the substrate grid by calling AddNewDeadTrees() and AdjustSubstrateForMortality(). More...
 
void AddNewDeadTrees ()
 Finds new fallen dead trees, and fallen snags, and broken snags to add to substrate. More...
 
void AdjustSubstrateForMortality ()
 For each grid cell in the substrate and calculations arrays, this adjusts the package and log values for new substrate added in AddNewDeadTrees(). More...
 
- Protected Member Functions inherited from clWorkerBase
void AssembleFileCode (int iFileType, int iFileVersion, char *cCode)
 Creates the proper identifying filecode for an XML file. More...
 

Protected Attributes

int ** mp_iDeadCodes
 Array (species by type) of codes for the "dead" tree bool data member. More...
 
int * mp_iFallCodes
 Array of codes for the "Fall" data member. More...
 
int ** mp_iNewBreakCodes
 Array of codes for the "NewBreakHeight" data member. More...
 
int * mp_iOldBreakCodes
 Array of codes for the "SnagOldBreakHeight" data member. More...
 
double * mp_fInitialLogMeanDiameter
 Mean diameter of small and large logs at initial conditions. More...
 
double * mp_fPartCutLogMeanDiameter
 Mean diameter of small and large logs added by a harvest partial cut. More...
 
double * mp_fGapCutLogMeanDiameter
 Mean diameter of small and large logs added by a harvest gap cut. More...
 
double * mp_fClearCutLogMeanDiameter
 Mean diameter of small and large logs added by a harvest clear cut. More...
 
double * mp_fPropFallenTreesLogDecayClass
 Proportion of live trees that enter decay classes 1-5. More...
 
double * mp_fPropFallenSnagsLogDecayClass
 Proportion of snags that enter decay classes 1-5. More...
 
int * mp_iLogSpGroupAssignment
 Species grouping to which each tree species falls into. More...
 
double *** mp_fLogDecayAlpha
 Alpha decay parameter for logs. More...
 
double *** mp_fLogDecayBeta
 Beta decay parameter for logs. More...
 
int m_iNumLogSpGroupsUsed
 The number of species groups used (1-3). More...
 
double m_fLogSizeClassBoundary
 Boundary between two log diameter classes, in cm. More...
 
double * mp_fPropOfFallenThatUproot
 Proportion of fallen dead trees that uproot. More...
 
double * mp_fPropOfSnagsThatUproot
 Proportion of snags that uproot. More...
 
double ***** mp_fLogDecayProp
 Decay proportion each year for logs. More...
 
double * mp_fScarSoilDecayProp
 Decay proportion for each timestep for scarified soil. More...
 
double * mp_fTipupDecayProp
 Decay proportion for each timestep for tip-up mounds. More...
 
int **** mp_iLogCalcsCode
 Codes for using log data members of calculations grid. More...
 
int *** mp_iNewLogCalcsCode
 Codes for using the new log data members of calculations grid. More...
 
int m_iNewTipupCalcsCode
 Code for using newtipup data member of calculations grid. More...
 
bool ** mp_bSubstrateApplies
 Array (species by type) of whether or not substrate applies to this tree kind. More...
 
double m_fScarifiedSoilA
 Scarified soil alpha decay parameter. More...
 
double m_fTipUpA
 Tip-up alpha decay parameter. More...
 
double m_fScarifiedSoilB
 Scarified soil beta decay parameter. More...
 
double m_fTipUpB
 Tip-up beta decay parameter. More...
 
double m_fInitScarifiedSoil
 Scarified soil initial conditions proportion. More...
 
double m_fInitTipUp
 Tip-up initial conditions proportion. More...
 
double *** mp_fInitLog
 Log initial conditions proportion. More...
 
double m_fPartCutScarifiedSoil
 Scarified soil partial cut proportion. More...
 
double m_fPartCutTipUp
 Tip-up partial cut proportion. More...
 
double *** mp_fPartCutLog
 Log partial cut proportion. More...
 
double m_fGapCutScarifiedSoil
 Scarified soil gap cut proportion. More...
 
double m_fGapCutTipUp
 Tip-up gap cut proportion. More...
 
double *** mp_fGapCutLog
 Log gap cut proportion. More...
 
double m_fClearCutScarifiedSoil
 Scarified soil clear cut proportion. More...
 
double m_fClearCutTipUp
 Tip-up clear cut proportion. More...
 
double *** mp_fClearCutLog
 Log clear cut proportion. More...
 
double m_fRootTipupFactor
 Amount by which the tree radius is multiplied when calculating the tip-up mound to account for the effects of root rip-out. More...
 
double m_fMossProportion
 Proportion of the litter/moss pool that is moss. More...
 
float m_fGridCellArea
 Grid cell area of substrate grid. More...
 
int m_iMaxDecayYears
 Maximum number of years a package is allowed to exist. More...
 
int m_iMaxDecayTimesteps
 m_iMaxDecayYears divided by the number of years per timestep, for setting up grid data members. More...
 
int m_iNumTotalSpecies
 Total number of species - for destructor. More...
 
int m_iScarSoilCode
 Code for using scarsoil grid data member. More...
 
int m_iFFMossCode
 Code for using ffmoss grid data member. More...
 
int m_iFFLitterCode
 Code for using fflitter grid data member. More...
 
int m_iTipupCode
 Code for using tipup grid data member. More...
 
int m_iOrigScarSoilCode
 Code for using scarsoil grid data member in original substrate grid. More...
 
int m_iOrigFFMossCode
 Code for using ffmoss grid data member in original substrate grid. More...
 
int m_iOrigFFLitterCode
 Code for using fflitter grid data member in original substrate grid. More...
 
int m_iOrigTipupCode
 Code for using tipup grid data member in original substrate grid. More...
 
int m_iOrigFreshLogCode
 Code for using freshlog grid data member in original substrate grid. More...
 
int m_iOrigDecLogCode
 Code for using declog grid data member in original substrate grid. More...
 
int *** mp_iLogCodes
 Code for using log area grid data members. More...
 
int *** mp_iLogVolCodes
 Code for using log volume grid data members. More...
 
int m_iPkgAgeCode
 Code for using age package data member. More...
 
int m_iPkgScarSoilCode
 Code for using scarsoil package data member. More...
 
int m_iPkgTipupCode
 Code for using tipup package data member. More...
 
int m_iHarvestTypeCode
 Code for using harvesttype data member of harvest grid. More...
 
int m_iTotalLogCode
 Code for using the total log area grid data member. More...
 
int m_iTotalLogVolCode
 Code for using the total log volume grid data member. More...
 
bool m_bParFileHasSubstrateMap
 Whether or not the parameter file had a substrate map in it. More...
 
bool m_bUseDirectionalTreeFall
 Whether to use directional tree fall. More...
 
clGridmp_oSubstrateGrid
 Grid object containing substrate data, called "DetailedSubstrate". More...
 
clGridmp_oCalcGrid
 Grid object for intermediate calculations. More...
 
clGridmp_oHarvestGrid
 Harvest grid object, if it exists. More...
 
clGridmp_oOriginalSubstrateGrid
 Original "Substrate" grid with same data members as the original substrate behavior. More...
 
- Protected Attributes inherited from clBehaviorBase
short int m_iNumSpeciesTypeCombos
 How many type/species combos a behavior will act on. More...
 
short int m_iNumBehaviorSpecies
 How many distinct species are in the combo list - important for filling species-specific values from parameter file. More...
 
short int * mp_iWhatSpecies
 List of distinct species - for filling species-specific values from parameter file. More...
 
stcSpeciesTypeCombomp_whatSpeciesTypeCombos
 Array of species/type combos that the behavior will act on. More...
 
short int m_iNewTreeInts
 The number of new tree integer data members this behavior wants to add. More...
 
short int m_iNewTreeFloats
 The number of new tree float data members this behavior wants to add. More...
 
short int m_iNewTreeChars
 The number of new tree character data members this behavior wants to add. More...
 
short int m_iNewTreeBools
 The number of new tree boolean data members this behavior wants to add. More...
 
short int m_iBehaviorListNumber
 The number of this behavior in the behavior list, to differentiate between possible multiple copies of this behavior. More...
 
float m_fVersionNumber
 Version number - this will be rounded to 2 digits after the decimal place. More...
 
std::string m_sXMLRoot
 XML root that encloses the parameters for this behavior. More...
 
float m_fMinimumVersionNumber
 Minimum version number - this behavior will run parameter data for a file marked between this number and the current version number, inclusive. More...
 
- Protected Attributes inherited from clWorkerBase
std::string m_sNameString
 If a behavior has registered a command line command with the sim manager, this allows it to be called. More...
 
clSimManagermp_oSimManager
 Pointer to the simulation manager object. More...
 
int * mp_iAllowedFileTypes
 List of the input file types this object can handle. More...
 
int m_iNumAllowedTypes
 Number of input file types this object can handle. More...
 

Detailed Description

DetailedSubstrate - Version 1.0.

Substrate keeps track of what the forest floor in a particular location is made of at any given time. There are five kinds of substrate: logs, scarified soil, tip-up, forest floor litter, and forest floor moss. Logs are in turn divided into up to 3 species groups, 2 size classes, and 5 decay classes, which are all tracked separately. This behavior tracks the input of new logs and tip-up through the fall of dead trees, the changing of substrate conditions due to harvest, and the decay of all other substrate types into forest floor litter and moss. Forest floor litter and forest floor moss act as a common pool, with one in fixed proportion to the other.

In addition to tracking the area covered by all five substrate types, logs are tracked by volume as well. Unlike area, log volume has no upper limit and is not overlaid by new logs and tipups. Log volume is, however, reduced by scarified soil after harvesting to simulate its destruction by harvest and site preparation operations.

New dead saplings, fallen or broken dead adult trees, and snags can create log substrate, and fallen adults and snags have a certain probability of creating new tip-up. Dead saplings do not create snags and are presumed to fall in the same timestep that they die. Dead saplings do not create tip-up mounds. Dead snags have their own decay class probability distribution and probability of creating tip-up. The amount of logs and tip-up contributed by a downed tree depends on the size of the tree.

Trees can collapse vertically to put all of their log area in the grid cell in which they are rooted, or they can fall in a random direction and contribute fresh log area to more than one cell. This option is controlled by the user. All tip-up area is always contributed to the cell in which the tree is rooted.

The change in substrate contributed by harvest events is set directly in the parameter file. Harvest is the only way to introduce new scarified soil substrate.

The substrate behavior will create a grid called "DetailedSubstrate." In this grid are contained, for each grid cell, the relative proportions of the various types of substrate as a value between 0 and 1. It also contains the volume of each type of log, in m3 per ha. Values in the DetailedSubstrate grid are also summarized written to a grid called "Substrate" for compatibility with behaviors that use that grid.

An input of new substrate through mortality or harvest is tracked in a grid package (scarified soil and tipup) and a separate calculations grid (logs). The relative proportions of substrate are subjected through time to increasing levels of substrate decay, until the substrate reaches the maximum age limit and is removed. The master grid cell substrate proportions are calculated from the input of all the packages and calculations grid data members associated with that cell. Forest floor litter and moss is calculated as the remaining area not covered by scarified soil, tipup, and logs.

Substrate parameters relating to harvest are not required unless the Harvest behavior is being used for a run.

Substrate should be applied to saplings, adults and/or snags of all the species that can contribute to new log generation. Substrate depends on there being bool data members called "dead" (all) and "Fall" (adults), and float data members called "NewBreakHeight" (adults, snags), and "SnagOldBreakHeight" (snags) in these trees (the absence of these code being previously defined will cause a fatal error). Dead trees should not have been changed to snags and fallen snags should not yet have been removed from the tree population. Substrate cannot be applied to seedlings; trying to do so causes a fatal error.

If an adult tree falls over, DetailedSubstrate calls the tree population's KillTree() function, with a reason code of "remove", to force its removal from memory.

The namestring and parameter file call string of this behavior are both "DetailedSubstrate".

Copyright 2003 Charles D. Canham.

Author
Mark Vanderwel


Edit history:
--------------—
October 11, 2007 - Created from existing substrate behavior.

Constructor & Destructor Documentation

◆ clDetailedSubstrate()

clDetailedSubstrate::clDetailedSubstrate ( clSimManager p_oSimManager)

Constructor.

Parameters
p_oSimManagerSim Manager object.

◆ ~clDetailedSubstrate()

clDetailedSubstrate::~clDetailedSubstrate ( )

Destructor.

Member Function Documentation

◆ Action()

void clDetailedSubstrate::Action ( )
virtual

Computes substrate for a timestep.

First HarvestSubstrate() adds the effects of any harvests that occurred this timestep. Then CalcMainGridTotals() writes the results to the substrate grid. Then DecaySubstrate() decays substrate through the calculations grid. Then CalcVolumeAfterDecay() calculates new decay-class-specific log volumes. Then MortalitySubstrate() adds new dead trees. Then CalcMainGridTotals() is called again to write everything back to the substrate grid.

Reimplemented from clBehaviorBase.

◆ AddHarvestSubstrate()

void clDetailedSubstrate::AddHarvestSubstrate ( )
protected

Adds the effects of harvests to the substrate grid.

If Harvest isn't being used, or no harvest occurred this timestep, nothing happens. If there was a harvest, each grid cell in which harvest occurred is evaluated separately. All existing substrate for a cell is scaled down by the amount of new substrate created. New harvest substrate is created with the conditions from the parameter file matching the harvest type in the "harvestresults" grid. Age is set to 0, but harvest occurs before decay so there will be 1 timestep's decay before the outputting final grid cell values.

◆ AddNewDeadTrees()

void clDetailedSubstrate::AddNewDeadTrees ( )
protected

Finds new fallen dead trees, and fallen snags, and broken snags to add to substrate.

Fallen dead trees are identifiable as adults with a value of true in their "dead" and "Fall" data members. Fallen snags are identifiable as snags with a value of true in their "dead" data member. The tops and bottoms of broken snags also add to substrate. A snag contributing it's top to substrate has a value of false in it's "dead" data member and a value >0.0 in its "NewBreakHeight" data member, with that value indicating the height of the breakage. A broken snag contributing its bottom to substrate has a value of true in it's "dead" data member and a value >0.0 in its "SnagOldBreakHeight" data member, with that value indicating the height of the breakage. The values of "Fall", "NewBreakHeight", and "SnagOldBreakHeight" data members should be set by a snag dynamics behavior that determines whether snags and dead trees have fallen or broken in a given timestep.

For fallen trees, a random number determines if it uproots (and thus adds to the new tip-up area exposed). Adults and snags have separate probabilities of uproot.

Newly dead trees that fall are passed to clTreePopulation::KillTree() with remove as the code to force them to go away. This ensures they do not become snags. Fallen snags are removed later by the Dead Tree Remover behavior.

The decay class a fallen tree enters is determined by comparing a random number to the probabilities of entering each decay class in mp_fPropFallenTreesLogDecayClass[1-5].

Both the amount of new log and the amount of tip-up added are a function of tree size. New log area is calculated as A = r*h, where A is new log area in square meters, r is tree radius in meters, and h is tree height in meters. New log volume is calculated as V = 1/3 * pi * r2 * h. New tip-up area is calculated as OA = pi * (r*F)2, where OA is the new tip-up area in square meters, r is the tree radius in meters, and F is the value in m_fRootTipupFactor, which accounts for the effects of root disturbance.

The area of the log is divided evenly into h*2 chunks, where h is the tree height in m. The size class of a chunk of fallen tree is determined by comparing it's midpoint diameter to mp_fLogSizeClassBoundary.

If m_bDirectionalTreeFall is true, trees that fall do so in a random direction. The function walks out the length of the log in 0.5-m intervals, and whatever grid cell the end of the interval falls in gets a log area chunk. If m_bDirectionalTreeFall is false, all log area is put in the cell in which the tree was rooted. Tipup area is always added to the cell in which the tree was rooted.

For each tree, its amounts of new logs and new tip-up, in square meters, are added to the newloggroup<1-3><small/large>decay<1-5> and newtipup data members of the calculations grid. It's new volume is added to vloggroup<1-3><small/large>decay<1-5> data members of the substrate grid.

◆ AdjustSubstrateForMortality()

void clDetailedSubstrate::AdjustSubstrateForMortality ( )
protected

For each grid cell in the substrate and calculations arrays, this adjusts the package and log values for new substrate added in AddNewDeadTrees().

First, the amounts of new substrate for new logs and new tip-up in square meters of area is converted to a proportion of total substrate. Then the proportions of all existing substrate are reduced accordingly to make way for the new stuff. The new substrate from mortality is then added in.

◆ CalcMainGridTotals()

void clDetailedSubstrate::CalcMainGridTotals ( )
protected

Calculates totals for packages and the calculations grid and writes them to the main substrate grid.

It also write the values to the original "substrate" grid for compatibility with behaviors that use it.

◆ CalculateDecayProportions()

void clDetailedSubstrate::CalculateDecayProportions ( )
protected

Calculates the proportion of decay for each timestep for logs, tip- up mounds, and scarified soil.

This calculates exp( α * t β ) for each timestep up to m_iMaxDecayTimesteps.

◆ CalcVolumeAfterDecay()

void clDetailedSubstrate::CalcVolumeAfterDecay ( )
protected

Calculates the post-decay log volumes for each grid cell.

Log volume is not tracked by age, so changes in volume are made proportional to the changes in area after decay.

◆ DecaySubstrate()

void clDetailedSubstrate::DecaySubstrate ( )
protected

Performs substrate decay.

Log decay is iterated on an annual basis so that logs can pass through >1 decay class over the timestep. Each year, the amount of log in a decay class advancing to the next decay class is calculated and stored in a temporary array. After all annual iterations, the logs that decayed are written to age 0 or 1 positions of the calculations grid (rounded based on the year of the last transition). The age-specific amount of log that did not decay is written to the next higher age bin in the calculations grid.

Tipup and scarified soil packages are reduced by the amount of decay they experience and their age is incremented. Packages that exceed the maximum age are deleted.

◆ GetCodes()

void clDetailedSubstrate::GetCodes ( )
protected

Populates the mp_iDeadCodes, mp_iFallCodes, mp_iOldBreakCodes, mp_iNewBreakCodes arrays with the data member codes for the "dead", "Fall", "SnagOldBreakHeight", and "NewBreakHeight" data members, respectively.

Also fills in the mp_bSubstrateApplies array.

Exceptions
Errorif there is a species/type combo which participates in substrate but does not have a bool data member called "dead" registered.
Errorif the appropriate species/type combos that participate in substrate do not have a bool data member called "Fall" and float data members called "SnagOldBreakHeight" and "NewBreakHeight" registered.

◆ GetData()

void clDetailedSubstrate::GetData ( xercesc::DOMDocument *  p_oDoc)
virtual

Performs setup for substrate.

First, GetParameterFileData() reads values from the parameter file. Then CalculateDecayProportions() is called. Then SetupSubstrateGrids(). Then PopulateInitialConditions(). Then GetCodes().

Parameters
p_oDocDOM tree of parsed input file.

Implements clWorkerBase.

◆ GetParameterFileData()

void clDetailedSubstrate::GetParameterFileData ( xercesc::DOMDocument *  p_oDoc)
protected

Gets the values from the parameter file.

Parameters
p_oDocDOM tree of parsed input file.

◆ MortalitySubstrate()

void clDetailedSubstrate::MortalitySubstrate ( )
protected

Adds the effects of the new dead trees to the substrate grid by calling AddNewDeadTrees() and AdjustSubstrateForMortality().

◆ SetInitialSubstrate()

void clDetailedSubstrate::SetInitialSubstrate ( )
protected

Adds the amount of substrate in the substrate map or parameter file to the substrate and calculations grids.

◆ SetupSubstrateGrids()

void clDetailedSubstrate::SetupSubstrateGrids ( )
protected

Sets up the substrate grids and registers all their data members.

If the harvest grid exists, substrate is required to match its grid cell resolution.

Member Data Documentation

◆ m_bParFileHasSubstrateMap

bool clDetailedSubstrate::m_bParFileHasSubstrateMap
protected

Whether or not the parameter file had a substrate map in it.

If it did, initial conditions will not be populated.

◆ m_bUseDirectionalTreeFall

bool clDetailedSubstrate::m_bUseDirectionalTreeFall
protected

Whether to use directional tree fall.

If true, trees fall in a random direction and contribute log area to potentially multiple grid cells. If false, trees that fall contribute all of their fresh log area to the cell in which they are rooted.

◆ m_fClearCutScarifiedSoil

double clDetailedSubstrate::m_fClearCutScarifiedSoil
protected

Scarified soil clear cut proportion.

Not required if Harvest is not being used.

◆ m_fClearCutTipUp

double clDetailedSubstrate::m_fClearCutTipUp
protected

Tip-up clear cut proportion.

Not required if Harvest is not being used.

◆ m_fGapCutScarifiedSoil

double clDetailedSubstrate::m_fGapCutScarifiedSoil
protected

Scarified soil gap cut proportion.

Not required if Harvest is not being used.

◆ m_fGapCutTipUp

double clDetailedSubstrate::m_fGapCutTipUp
protected

Tip-up gap cut proportion.

Not required if Harvest is not being used.

◆ m_fGridCellArea

float clDetailedSubstrate::m_fGridCellArea
protected

Grid cell area of substrate grid.

◆ m_fInitScarifiedSoil

double clDetailedSubstrate::m_fInitScarifiedSoil
protected

Scarified soil initial conditions proportion.

◆ m_fInitTipUp

double clDetailedSubstrate::m_fInitTipUp
protected

Tip-up initial conditions proportion.

◆ m_fLogSizeClassBoundary

double clDetailedSubstrate::m_fLogSizeClassBoundary
protected

Boundary between two log diameter classes, in cm.

◆ m_fMossProportion

double clDetailedSubstrate::m_fMossProportion
protected

Proportion of the litter/moss pool that is moss.

◆ m_fPartCutScarifiedSoil

double clDetailedSubstrate::m_fPartCutScarifiedSoil
protected

Scarified soil partial cut proportion.

Not required if Harvest is not being used.

◆ m_fPartCutTipUp

double clDetailedSubstrate::m_fPartCutTipUp
protected

Tip-up partial cut proportion.

Not required if Harvest is not being used.

◆ m_fRootTipupFactor

double clDetailedSubstrate::m_fRootTipupFactor
protected

Amount by which the tree radius is multiplied when calculating the tip-up mound to account for the effects of root rip-out.

◆ m_fScarifiedSoilA

double clDetailedSubstrate::m_fScarifiedSoilA
protected

Scarified soil alpha decay parameter.

◆ m_fScarifiedSoilB

double clDetailedSubstrate::m_fScarifiedSoilB
protected

Scarified soil beta decay parameter.

◆ m_fTipUpA

double clDetailedSubstrate::m_fTipUpA
protected

Tip-up alpha decay parameter.

◆ m_fTipUpB

double clDetailedSubstrate::m_fTipUpB
protected

Tip-up beta decay parameter.

◆ m_iFFLitterCode

int clDetailedSubstrate::m_iFFLitterCode
protected

Code for using fflitter grid data member.

◆ m_iFFMossCode

int clDetailedSubstrate::m_iFFMossCode
protected

Code for using ffmoss grid data member.

◆ m_iHarvestTypeCode

int clDetailedSubstrate::m_iHarvestTypeCode
protected

Code for using harvesttype data member of harvest grid.

◆ m_iMaxDecayTimesteps

int clDetailedSubstrate::m_iMaxDecayTimesteps
protected

m_iMaxDecayYears divided by the number of years per timestep, for setting up grid data members.

◆ m_iMaxDecayYears

int clDetailedSubstrate::m_iMaxDecayYears
protected

Maximum number of years a package is allowed to exist.

◆ m_iNewTipupCalcsCode

int clDetailedSubstrate::m_iNewTipupCalcsCode
protected

Code for using newtipup data member of calculations grid.

◆ m_iNumLogSpGroupsUsed

int clDetailedSubstrate::m_iNumLogSpGroupsUsed
protected

The number of species groups used (1-3).

◆ m_iNumTotalSpecies

int clDetailedSubstrate::m_iNumTotalSpecies
protected

Total number of species - for destructor.

◆ m_iOrigDecLogCode

int clDetailedSubstrate::m_iOrigDecLogCode
protected

Code for using declog grid data member in original substrate grid.

◆ m_iOrigFFLitterCode

int clDetailedSubstrate::m_iOrigFFLitterCode
protected

Code for using fflitter grid data member in original substrate grid.

◆ m_iOrigFFMossCode

int clDetailedSubstrate::m_iOrigFFMossCode
protected

Code for using ffmoss grid data member in original substrate grid.

◆ m_iOrigFreshLogCode

int clDetailedSubstrate::m_iOrigFreshLogCode
protected

Code for using freshlog grid data member in original substrate grid.

◆ m_iOrigScarSoilCode

int clDetailedSubstrate::m_iOrigScarSoilCode
protected

Code for using scarsoil grid data member in original substrate grid.

◆ m_iOrigTipupCode

int clDetailedSubstrate::m_iOrigTipupCode
protected

Code for using tipup grid data member in original substrate grid.

◆ m_iPkgAgeCode

int clDetailedSubstrate::m_iPkgAgeCode
protected

Code for using age package data member.

◆ m_iPkgScarSoilCode

int clDetailedSubstrate::m_iPkgScarSoilCode
protected

Code for using scarsoil package data member.

◆ m_iPkgTipupCode

int clDetailedSubstrate::m_iPkgTipupCode
protected

Code for using tipup package data member.

◆ m_iScarSoilCode

int clDetailedSubstrate::m_iScarSoilCode
protected

Code for using scarsoil grid data member.

◆ m_iTipupCode

int clDetailedSubstrate::m_iTipupCode
protected

Code for using tipup grid data member.

◆ m_iTotalLogCode

int clDetailedSubstrate::m_iTotalLogCode
protected

Code for using the total log area grid data member.

◆ m_iTotalLogVolCode

int clDetailedSubstrate::m_iTotalLogVolCode
protected

Code for using the total log volume grid data member.

◆ mp_bSubstrateApplies

bool** clDetailedSubstrate::mp_bSubstrateApplies
protected

Array (species by type) of whether or not substrate applies to this tree kind.

◆ mp_fClearCutLog

double*** clDetailedSubstrate::mp_fClearCutLog
protected

Log clear cut proportion.

Array indexes are species group, size, and decay class. Not required if Harvest is not being used.

◆ mp_fClearCutLogMeanDiameter

double* clDetailedSubstrate::mp_fClearCutLogMeanDiameter
protected

Mean diameter of small and large logs added by a harvest clear cut.

Used to calculate volume. Array index is size class.

◆ mp_fGapCutLog

double*** clDetailedSubstrate::mp_fGapCutLog
protected

Log gap cut proportion.

Array indexes are species group, size, and decay class. Not required if Harvest is not being used.

◆ mp_fGapCutLogMeanDiameter

double* clDetailedSubstrate::mp_fGapCutLogMeanDiameter
protected

Mean diameter of small and large logs added by a harvest gap cut.

Used to calculate volume. Array index is size class.

◆ mp_fInitialLogMeanDiameter

double* clDetailedSubstrate::mp_fInitialLogMeanDiameter
protected

Mean diameter of small and large logs at initial conditions.

Used to calculate volume. Array index is size class. If not provided, mean diameters will be 0.5 * m_fLogSizeClassBoundary and 1.5 * m_fLogSizeClassBoundary for small and large logs, respectively.

◆ mp_fInitLog

double*** clDetailedSubstrate::mp_fInitLog
protected

Log initial conditions proportion.

◆ mp_fLogDecayAlpha

double*** clDetailedSubstrate::mp_fLogDecayAlpha
protected

Alpha decay parameter for logs.

Array indexes are species group, size, and decay class.

◆ mp_fLogDecayBeta

double*** clDetailedSubstrate::mp_fLogDecayBeta
protected

Beta decay parameter for logs.

Array indexes are species group, size, and decay class.

◆ mp_fLogDecayProp

double***** clDetailedSubstrate::mp_fLogDecayProp
protected

Decay proportion each year for logs.

This is exp( α * t β ) . Array indexes are species group, size, decay class, m_iMaxDecayTimesteps, and years per timestep.

◆ mp_fPartCutLog

double*** clDetailedSubstrate::mp_fPartCutLog
protected

Log partial cut proportion.

Array indexes are species group, size, and decay class. Not required if Harvest is not being used.

◆ mp_fPartCutLogMeanDiameter

double* clDetailedSubstrate::mp_fPartCutLogMeanDiameter
protected

Mean diameter of small and large logs added by a harvest partial cut.

Used to calculate volume. Array index is size class.

◆ mp_fPropFallenSnagsLogDecayClass

double* clDetailedSubstrate::mp_fPropFallenSnagsLogDecayClass
protected

Proportion of snags that enter decay classes 1-5.

Array index is decay class #.

◆ mp_fPropFallenTreesLogDecayClass

double* clDetailedSubstrate::mp_fPropFallenTreesLogDecayClass
protected

Proportion of live trees that enter decay classes 1-5.

Array index is decay class #.

◆ mp_fPropOfFallenThatUproot

double* clDetailedSubstrate::mp_fPropOfFallenThatUproot
protected

Proportion of fallen dead trees that uproot.

Array size is total number of species.

◆ mp_fPropOfSnagsThatUproot

double* clDetailedSubstrate::mp_fPropOfSnagsThatUproot
protected

Proportion of snags that uproot.

Array size is total number of species.

◆ mp_fScarSoilDecayProp

double* clDetailedSubstrate::mp_fScarSoilDecayProp
protected

Decay proportion for each timestep for scarified soil.

This is exp( α * t β ) . Array size is m_iMaxDecayTimesteps.

◆ mp_fTipupDecayProp

double* clDetailedSubstrate::mp_fTipupDecayProp
protected

Decay proportion for each timestep for tip-up mounds.

This is exp( α * t β ) . Array size is m_iMaxDecayTimesteps.

◆ mp_iDeadCodes

int** clDetailedSubstrate::mp_iDeadCodes
protected

Array (species by type) of codes for the "dead" tree bool data member.

◆ mp_iFallCodes

int* clDetailedSubstrate::mp_iFallCodes
protected

Array of codes for the "Fall" data member.

Index is # of species.

◆ mp_iLogCalcsCode

int**** clDetailedSubstrate::mp_iLogCalcsCode
protected

Codes for using log data members of calculations grid.

Array indexes are species group, size, decay class, and age (in timesteps)

◆ mp_iLogCodes

int*** clDetailedSubstrate::mp_iLogCodes
protected

Code for using log area grid data members.

Array indexes are species group, size, and decay class.

◆ mp_iLogSpGroupAssignment

int* clDetailedSubstrate::mp_iLogSpGroupAssignment
protected

Species grouping to which each tree species falls into.

Array index is total number of species.

◆ mp_iLogVolCodes

int*** clDetailedSubstrate::mp_iLogVolCodes
protected

Code for using log volume grid data members.

Array indexes are species group, size, and decay class.

◆ mp_iNewBreakCodes

int** clDetailedSubstrate::mp_iNewBreakCodes
protected

Array of codes for the "NewBreakHeight" data member.

First array index is # of species, and second is type #.

◆ mp_iNewLogCalcsCode

int*** clDetailedSubstrate::mp_iNewLogCalcsCode
protected

Codes for using the new log data members of calculations grid.

Array indexes are species group, size, and decay class.

◆ mp_iOldBreakCodes

int* clDetailedSubstrate::mp_iOldBreakCodes
protected

Array of codes for the "SnagOldBreakHeight" data member.

Index is # of species.

◆ mp_oCalcGrid

clGrid* clDetailedSubstrate::mp_oCalcGrid
protected

Grid object for intermediate calculations.

This grid is called "detailedsubstratecalcs". The grid cell resolution matches "Detailed Substrate". Data members:

Data member name Data type Description
newtipup float New tip-up area by grid cell, in square meters
newloggroup<1-3><small/large>decay<1-5> float Area of new species group <1-3>, small/large, decay class <1-5> logs added this timestep, in square meters
loggroup<1-3><small/large>decay<1-5>_<0-m_iMaxDecayTimesteps> float Species group <1-3>, small/large, decay class <1-5> logs added <0-m_iMaxDecayTimesteps> timesteps ago, as a proportion of grid cell area

◆ mp_oHarvestGrid

clGrid* clDetailedSubstrate::mp_oHarvestGrid
protected

Harvest grid object, if it exists.

◆ mp_oOriginalSubstrateGrid

clGrid* clDetailedSubstrate::mp_oOriginalSubstrateGrid
protected

Original "Substrate" grid with same data members as the original substrate behavior.

Values are copied to it for compatibility with behaviors looking for this grid

◆ mp_oSubstrateGrid

clGrid* clDetailedSubstrate::mp_oSubstrateGrid
protected

Grid object containing substrate data, called "DetailedSubstrate".

If there is a harvest grid, the grid cell resolution must match it. If this is not the case, and there is no user-defined grid cell resolution, then the default grid resolution is used.

Maps of this grid in the parameter file will be honored, but they must define all data members below (even if they don't include values for all of them).

The grid cell record will consist of 66 float data members. They are:

Data member name Data type Description
scarsoil float Scarified soil, expressed as a proportion between 0 and 1.
ffmoss float Forest floor moss, expressed as a proportion between 0 and 1.
fflitter float Forest floor litter, expressed as a proportion between 0 and 1.
tipup float Tip-up, expressed as a proportion between 0 and 1.
loggroup<1-3><small/large>decay<1-5> float Species group <1-3>, small (or large), decay class <1-5> logs, as a proportion between 0 and 1.
vloggroup<1-3><small/large>decay<1-5> float Species group <1-3>, small (or large), decay class <1-5> logs, as volume in m3 per ha.
totallog float Total logs, expressed as a proportion between 0 and 1. Should be the sum of all log proportions
totallogvol float Total log volume, in m3 per ha. Should be the sum of all log volumes

The packages will have the following structure:

Data member name Data type Description
age int Age of package in timesteps
scarsoil float Scarified soil added this package. Should not be changed.
tipup float Tip-up added this package. Should not be changed.

The packages will be in the order of oldest first.


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