SORTIE C++ Test Documentation
Public Member Functions | Protected Member Functions | List of all members
clTestDetailedSubstrate Class Reference

This class tests substrate. More...

#include <TestDetailedSubstrate.h>

Inheritance diagram for clTestDetailedSubstrate:

Public Member Functions

void TestDetailedSubstrate ()
 Groups the other substrate tests.
 

Protected Member Functions

void TestSubstrateGridSetup (clSimManager *p_oSimManager)
 Tests aspects of substrate grid setup.
 
void TestNewInputs (clSimManager *p_oSimManager)
 Tests new inputs to substrate.
 
void TestSubstrateRun1 (clSimManager *p_oSimManager)
 Substrate normal processing run 1.
 
void TestSubstrateRun2 (clSimManager *p_oSimManager)
 Substrate normal processing, run 2.
 
void VerifyRun1TS1Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 1 of TestSubstrateRun1().
 
void VerifyRun1TS2Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 2 of TestSubstrateRun1().
 
void VerifyRun1TS3Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 3 of TestSubstrateRun1().
 
void VerifyRun1TS4Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 4 of TestSubstrateRun1().
 
void VerifyRun2TS1Proportions (clGrid *p_oSubstrateGrid)
 Verifies the substrate proportions for timestep 1 of TestSubstrateRun2().
 
const char * WriteXMLFile1 (int iYearsPerTS)
 Writes a parameter file for testing grid setup and normal processing runs 1 and 2.
 
const char * WriteXMLFile2 ()
 Writes a file for testing grid setup with map files.
 
const char * WriteXMLFile3 ()
 Writes a parameter file for testing new substrate inputs.
 

Detailed Description

This class tests substrate.

Member Function Documentation

void clTestDetailedSubstrate::TestDetailedSubstrate ( )

Groups the other substrate tests.

void clTestDetailedSubstrate::TestNewInputs ( clSimManager *  p_oSimManager)
protected

Tests new inputs to substrate.

A single tree is entered into each of 8 separate grid cells. The trees are different combinations of adult/snag, standing/fallen, intact/newly broken/previously broken. We check to make sure the correct amount of new log and tipup is added to the cells after one timestep.

void clTestDetailedSubstrate::TestSubstrateGridSetup ( clSimManager *  p_oSimManager)
protected

Tests aspects of substrate grid setup.

This will enter two parameter files:

  1. With no grid maps defined
  2. With Substrate and substratecalcs grid maps

In the first case, grid cell resolution should match harvest and the plot; in the second, it should be what was specified in the map. The second case also tests that a value is correctly read in from the map.

void clTestDetailedSubstrate::TestSubstrateRun1 ( clSimManager *  p_oSimManager)
protected

Substrate normal processing run 1.

Verifies substrate decay calculations over 4 timesteps with a 1-year timestep length. This run has 5 cells with different harvest and mortality regimes. Non-directional tree fall and 100% decay class and tipup probabilities are used to avoid having to average over large numbers of trees. This function tests that the substrate numbers are calculated correctly for all types of logs, tipup, scarified soil, moss, and litter after each timestep.

void clTestDetailedSubstrate::TestSubstrateRun2 ( clSimManager *  p_oSimManager)
protected

Substrate normal processing, run 2.

This tests substrate calculations in Cell 1 from run 1 (no harvest or mortality) with a 2-year timestep length this time. Model is run for 1 timestep and final proportions are checked to match those after 2 timesteps in run 1. The numbers would not match for more complicated scenarios where mortality and harvest occur at different times, or where cohorts are removed over longer runs.

void clTestDetailedSubstrate::VerifyRun1TS1Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 1 of TestSubstrateRun1().

void clTestDetailedSubstrate::VerifyRun1TS2Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 2 of TestSubstrateRun1().

void clTestDetailedSubstrate::VerifyRun1TS3Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 3 of TestSubstrateRun1().

void clTestDetailedSubstrate::VerifyRun1TS4Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 4 of TestSubstrateRun1().

void clTestDetailedSubstrate::VerifyRun2TS1Proportions ( clGrid *  p_oSubstrateGrid)
protected

Verifies the substrate proportions for timestep 1 of TestSubstrateRun2().

const char* clTestDetailedSubstrate::WriteXMLFile1 ( int  iYearsPerTS)
protected

Writes a parameter file for testing grid setup and normal processing runs 1 and 2.

Returns
Filename written.
const char* clTestDetailedSubstrate::WriteXMLFile2 ( )
protected

Writes a file for testing grid setup with map files.

Returns
Filename written.
const char* clTestDetailedSubstrate::WriteXMLFile3 ( )
protected

Writes a parameter file for testing new substrate inputs.

Returns
Filename written.

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