clWindstorm Class Reference

Windstorm version 1.0. More...

#include <Windstorm.h>

Inheritance diagram for clWindstorm:

clBehaviorBase clWorkerBase List of all members.

Public Member Functions

 clWindstorm (clSimManager *p_oSimManager)
 Constructor.
 ~clWindstorm ()
 Destructor.
void GetData (xercesc::DOMDocument *p_oDoc)
 Does behavior setup.
void Action ()
 Does windstorms each timestep.

Protected Member Functions

void DoGridSetup ()
 Sets up the "Windstorm Results" grid.
void ReadParFile (xercesc::DOMDocument *p_oDoc, clTreePopulation *p_oPop)
 Reads in parameters from the parameter file.
void GetDeadCodes (clTreePopulation *p_oPop)
 Gets codes for the "dead" data member for each tree type to which this behavior applies.
void FormatQueryString (clTreePopulation *p_oPop)
 Formats the string in m_cQuery.

Protected Attributes

clGridBasemp_oResultsGrid
 Windstorm Results grid This grid is named "Windstorm Results" and it contains the data for all storms that happened in the previous timestep.
int ** mp_iDeadCodes
 Return codes for the "dead" bool tree data member.
float * mp_fStormProbabilities
 Annual probability of the occurence of a storm of each return interval.
float * mp_fStormSeverities
 Severity of each storm return interval.
float * mp_fA
 Storm intercept for tree mortality (a) parameter.
float * mp_fB
 The "b" parameter for each species.
float * mp_fC
 The "d" parameter for each species.
float * mp_fMinDBH
 Minimum DBH for trees to be killed in storms.
short int * mp_iBa_xCodes
 Return codes for the "ba_x" package float data members of the "Windstorm Results" grid.
short int * mp_iDensity_xCodes
 Return codes for the "density_x" package float data members of the "Windstorm Results" grid.
char * m_cQuery
 String to pass to clTreePopulation::Find() in order to get the trees to apply damage to.
int m_iNumReturnIntervals
 The total number of storm return intervals.
int m_iFirstStormTimestep
 The timestep to start storms.
int m_iTotalNumSpecies
 Total number of species.
int m_iSeverityCode
 Return code for the "severity" package float data member of the "Windstorm Results" grid.

Detailed Description

Windstorm version 1.0.

Windstorm creates storm events and kills trees as a result.

Windstorm defines 11 different storm return intervals: 1, 5, 10, 20, 40, 80, 160, 320, 640, 1280, and 2560. (This code was present in pre-6.0 versions of SORTIE as well. At that point, it did not have the 1-year return interval. I added it for testing purposes, and thought others might want access to it as well.) For each return interval, the user provides a storm severity, from 0 (no damage) to 1 (complete devastation).

Each timestep, this behavior decides what storms will occur. The inverse of the return interval equals the annual probability of each storm. SORTIE uses independent random number draws for each year of the timestep for each return interval. This means multiple storms can happen per timestep, and if the timestep length is more than one year, multiple storms of the same severity can happen.

A tree's probability of dying in a given storm is:

mort = exp(a + c * s * DBH b)/(1 + exp(a + c * s * DBH b))

where:

Each storm gets a crack at all the trees "independently" of the others. This means that, if two storms happen in one timestep, this behavior will cycle twice through all the trees in the plot and assess each one's mortality for the two storms separately. Of course, the two events cannot be truly independent, because the second storm can only kill trees not killed by the first storm.

Storms of severity below a certain minimum (currently set at 0.1) do not use the equation above; the storm severity is used directly as a mortality probability for trees.

Storms of severity 0 cannot occur. Any return interval with a severity of 0 is skipped.

The user has the option to not start storms at the beginning of the run. They can set a timestep for storms to start. Before this timestep no storms are allowed to occur.

This behavior will not kill trees below a minimum DBH set by the user. Because of the need for DBH, obviously seedlings are ignored. Snags and already-dead trees are ignored as well. All trees that die get their "dead" flags set to true. (This flag comes from mortality behaviors and is not added by this behavior.) This behavior then has nothing more to do with these trees.

Storm results are placed in a grid called "Windstorm Results".

This behavior's call string and name string are both "Windstorm".

Copyright 2006 Charles D. Canham

Author:
Lora E. Murphy
Edit history:
-----------------
March 16, 2006 - Created (LEM)


Constructor & Destructor Documentation

clWindstorm::clWindstorm clSimManager p_oSimManager  ) 
 

Constructor.

Parameters:
p_oSimManager Sim Manager object.

clWindstorm::~clWindstorm  ) 
 

Destructor.

Frees memory.


Member Function Documentation

void clWindstorm::Action  )  [virtual]
 

Does windstorms each timestep.

If the timestep has not yet reached the value in m_iFirstStormTimestep, then nothing happens. Otherwise: first, the "Windstorm Results" grid is cleared. Then, a random number is drawn for each year of the timestep for each storm return interval. If the random number is less than the probability of that storm, then that storm occurs. For each storm that occurs, this will fetch all trees that can be killed in storms, and each that is not already dead has its probability of dying in the current storm calculated. A random number is compared to this probability to see if the tree dies.

Reimplemented from clBehaviorBase.

void clWindstorm::DoGridSetup  )  [protected]
 

Sets up the "Windstorm Results" grid.

Any maps in the parameter file are ignored.

void clWindstorm::FormatQueryString clTreePopulation p_oPop  )  [protected]
 

Formats the string in m_cQuery.

This value will be used in Action() to pass to clTreePopulation::Find() in order to get the trees to act on.

Parameters:
p_oPop Tree population object.

void clWindstorm::GetData xercesc::DOMDocument *  p_oDoc  )  [virtual]
 

Does behavior setup.

Calls the following functions:

  1. ReadParFile()
  2. DoGridSetup()
  3. GetDeadCodes()
  4. FormatQueryString()
Parameters:
p_oDoc DOM tree of parsed input file.

Implements clWorkerBase.

void clWindstorm::GetDeadCodes clTreePopulation p_oPop  )  [protected]
 

Gets codes for the "dead" data member for each tree type to which this behavior applies.

Parameters:
p_oPop Tree population object.
Exceptions:
modelErr if the codes are not available for every tree type to which this behavior is applied, or if this behavior is applied to seedlings.

void clWindstorm::ReadParFile xercesc::DOMDocument *  p_oDoc,
clTreePopulation p_oPop
[protected]
 

Reads in parameters from the parameter file.

This also calculates storm probabilities.

Parameters:
p_oDoc DOM tree of parsed input file.
p_oPop Tree population object.
Exceptions:
modelErr if:
  • A value in the minimum DBH is less than 0
  • The timestep to start storms is less than 0
  • The storm severity for any return interval is not between 0 and 1


Member Data Documentation

char* clWindstorm::m_cQuery [protected]
 

String to pass to clTreePopulation::Find() in order to get the trees to apply damage to.

This will instigate a species/type search for all the species and types to which this behavior applies.

int clWindstorm::m_iNumReturnIntervals [protected]
 

The total number of storm return intervals.

Hardcoded at 11.

int clWindstorm::m_iTotalNumSpecies [protected]
 

Total number of species.

Primarily for the destructor.

float* clWindstorm::mp_fA [protected]
 

Storm intercept for tree mortality (a) parameter.

Array size is total # species.

float* clWindstorm::mp_fB [protected]
 

The "b" parameter for each species.

Array size is total # species.

float* clWindstorm::mp_fC [protected]
 

The "d" parameter for each species.

Array size is total # species.

float* clWindstorm::mp_fMinDBH [protected]
 

Minimum DBH for trees to be killed in storms.

Array size is total # species.

float* clWindstorm::mp_fStormProbabilities [protected]
 

Annual probability of the occurence of a storm of each return interval.

If the user has set the storm severity of a given return interval to 0, its probability is also set to 0. Array size is m_iNumReturnIntervals.

float* clWindstorm::mp_fStormSeverities [protected]
 

Severity of each storm return interval.

Array size is m_iNumReturnIntervals.

short int* clWindstorm::mp_iBa_xCodes [protected]
 

Return codes for the "ba_x" package float data members of the "Windstorm Results" grid.

Array size is total # species.

int** clWindstorm::mp_iDeadCodes [protected]
 

Return codes for the "dead" bool tree data member.

Array index one is sized m_iTotalNumSpecies; array index two is sized 2 (for saplings and adults).

short int* clWindstorm::mp_iDensity_xCodes [protected]
 

Return codes for the "density_x" package float data members of the "Windstorm Results" grid.

Array size is total # species.

clGridBase* clWindstorm::mp_oResultsGrid [protected]
 

Windstorm Results grid This grid is named "Windstorm Results" and it contains the data for all storms that happened in the previous timestep.

There is one grid cell per plot, and this is not user-changeable.

Each storm gets one package. The packages occur in the order than the storms occurred in the timestep. Each package contains the following data members: One float called "severity", which holds the severity of the storm as a value from 0 to 1. Then there is one float per species called "ba_x", where x is the species number. This holds the amount of basal area per hectare killed in the storm for that species. Then there is another float per species called "density_x", where x is the species number. This holds the density per hectare killed in the storm for that species.


The documentation for this class was generated from the following file:
Generated on Mon Mar 27 12:51:27 2006 for SORTIE Core C++ Documentation by  doxygen 1.4.6-NO