|
Tests the growth-and-resource mortality class.
First run: WriteXMLFile1() creates the parameter file. The file has the following characteristics:
-
Timestep length of 1 year.
-
3 species: Species 1, Species 2, Species 3 (Species 2 isn't used).
-
Growth and resource mortality applied to saplings and adults of both species.
-
The resource grid has specified values for 4 cells.
The function does the following:
-
1000 trees are created of each species for both saplings and adults.
-
Saplings of species 1 all get a value of 0 in their "lgm" data member and 0 for their resource level.
-
Saplings of Species 3 all get a value of 0 in their "lgm" data member and 1.2 for their resource level.
-
Adults of Species 1 all get a value of 4 in their "lgm" data member and 0 for their resource level.
-
Adults of Species 3 all get a value of 25.1 in their "lgm" data member and 0.01 for their resource level.
-
The model is run for 1 timestep.
-
The remaining trees of each tree type and species are counted.
-
The counts are compared to expected results, give or take 5% (or greater tolerance at lower numbers).
Second run: WriteXMLFile2() creates the parameter file. The file has the following characteristics:
-
Timestep length of 5 years.
-
3 species: Species 1, Species 2, Species 3 (Species 2 isn't used).
-
Growth and resource mortality applied to saplings and adults of both species.
-
The resource grid has specified values for 4 cells.
The function does the following:
-
1000 trees are created of each species for both saplings and adults.
-
Saplings of species 1 all get a value of 0 in their "lgm" data member and 0 for their resource level.
-
Saplings of Species 3 all get a value of 0 in their "lgm" data member and 1.2 for their resource level.
-
Adults of Species 1 all get a value of 4 in their "lgm" data member and 0 for their resource level.
-
Adults of Species 3 all get a value of 25.1 in their "lgm" data member and 0.01 for their resource level.
-
The model is run for 1 timestep.
-
The remaining trees of each tree type and species are counted.
-
The counts are compared to expected results, give or take 5% (or greater tolerance at lower numbers).
|