On the Ecology of Mountainous Forests in a Changing Climate: A ...
On the Ecology of Mountainous Forests in a Changing Climate: A ...
On the Ecology of Mountainous Forests in a Changing Climate: A ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
226 Appendix<br />
DeleteAllCohorts( sp );<br />
sp := sp^.next;<br />
END; (* WHILE *)<br />
ELSE (* normal year with all three submodels *)<br />
TreeDeathAndGrowth( firstSp, cumLA, gLAI );<br />
TreeEstablishment( firstSp, uWiT, uDD, gLAI, totalTrees, kPatchSize );<br />
END;<br />
END Dynamic;<br />
PROCEDURE Term<strong>in</strong>ate;<br />
VAR x, y, z: INTEGER;<br />
fn : ARRAY [0..31] OF CHAR;<br />
ok: BOOLEAN;<br />
BEGIN<br />
IF exp.writeState THEN<br />
GetSeeds( x, y, z );<br />
AssignStr<strong>in</strong>g( exp.outFileName, pathAndFilename );<br />
CreateStateFileName( fn );<br />
Concat( pathAndFilename, fn );<br />
DumpStateToFile( ok, TRUNC(CurrentTime()), x, y ,z, site.name, pathAndFilename );<br />
END;<br />
sp := firstSp;<br />
WHILE sp NIL DO<br />
DeleteAllCohorts( sp );<br />
sp := sp^.next;<br />
END; (* WHILE *)<br />
CloseTreeR<strong>in</strong>gFile;<br />
IF ExperimentRunn<strong>in</strong>g() AND ((CurrentSimNr() MOD TRUNC(exp.nrRuns+0.5)) = 0) THEN<br />
IF exp.type = manyRuns THEN<br />
DisplayStatArrays;<br />
END;<br />
IF exp.<strong>in</strong>BatchMode THEN<br />
AssignStr<strong>in</strong>g( site.name, fn );<br />
Concat( fn, ".LF.DAT" );<br />
ELSE<br />
fn[0] := 0C;<br />
END;<br />
IF NOT exp.doSensAnalysis AND NOT ExperimentAborted() THEN<br />
CalcAndWriteLimFactorsToFile( fn, firstSp );<br />
END;<br />
END;<br />
EnableCommand( fMenu, statsCmd );<br />
EnableCommand( fMenu, newSpeciesCmd );<br />
EnableCommand( fMenu, chooseSiteCmd );<br />
EnableCommand( fMenu, chooseWea<strong>the</strong>rCmd );<br />
EnableCommand( fMenu, treeR<strong>in</strong>gCmd );<br />
END Term<strong>in</strong>ate;<br />
(*************************************)<br />
(* Procedures for model declaration *)<br />
(*************************************)<br />
PROCEDURE DeclModelObjects;<br />
VAR str: ARRAY [0..6] OF CHAR;<br />
BEGIN<br />
sp := firstSp; (* declare biomass MVs *)<br />
WHILE sp NIL DO<br />
WITH sp^ DO<br />
DeclMV( biomass, 0.0, maxBioScal<strong>in</strong>g, longDescBio, shortDescBio, "kg/patch", noF, noT, mon.graphBio);<br />
END; (* WITH *)<br />
sp := sp^.next;<br />
END; (* WHILE *)<br />
DeclMV( totalBiomass, 0.0, maxBioScal<strong>in</strong>g, "Total biomass", "totBio" , "kg/patch", noF, isT, noG);<br />
DeclMV( gLAI, 0.0, 20.0, "Leaf area <strong>in</strong>dex", "gLAI" , "--", noF, isT, noG);<br />
sp := firstSp; (* declare tree number MVs *)<br />
WHILE sp NIL DO<br />
WITH sp^ DO<br />
DeclMV( nrTrees, 0.0, 100.0, longDescNr, shortDescNr, "#/patch", noF, noT, mon.graphNr);<br />
END; (* WITH *)<br />
sp := sp^.next;<br />
END; (* WHILE *)<br />
DeclMV( totalTrees, 0.0, 200.0, "Total number <strong>of</strong> trees", "totNr" , "#/patch", noF, isT, noG);<br />
sp := firstSp; (* declare average biomass MVs *)<br />
WHILE sp NIL DO<br />
WITH sp^ DO<br />
AssignStr<strong>in</strong>g( shortDescBio, str ); AppendCh( str, "µ" );<br />
DeclMV( meanBio, 0.0, 400.0, longDescBio, str, "t/ha", noF, noT, noG);<br />
END; (* WITH *)<br />
sp := sp^.next;<br />
END; (* WHILE *)<br />
DeclMV( meanLAI, 0.0, 20.0, "Mean leaf area <strong>in</strong>dex", "µLAI" , "--", noF, noT, noG);<br />
DeclMV( meanTotBio, 0.0, 400.0, "Mean total biomass", "µtotBio" , "t/ha", noF, noT, noG);<br />
sp := firstSp; (* declare average number MVs *)<br />
WHILE sp NIL DO<br />
WITH sp^ DO<br />
AssignStr<strong>in</strong>g( shortDescNr, str ); AppendCh( str, "µ" );<br />
DeclMV( meanNr, 0.0, 100.0, sp^.longDescNr, str, "#/ha", noF, noT, noG);<br />
END; (* WITH *)<br />
sp := sp^.next;<br />
END; (* WHILE *)<br />
DeclMV( meanTotNr, 0.0, 200.0, "Mean total number <strong>of</strong> trees", "µtotNr" , "#/ha", noF, noT, noG);<br />
DeclMV( uLitt[leafFast], 0.0, 50.0, "Fast decay<strong>in</strong>g foliage litter", "uLittLF", "t/ha", noF, noT, noG );<br />
DeclMV( uLitt[leafMedium], 0.0, 50.0, "Medium dec. foliage litter", "uLittLM", "t/ha", noF, noT, noG );<br />
DeclMV( uLitt[leafSlow], 0.0, 50.0, "Slowly dec. foliage litter", "uLittLS", "t/ha", noF, noT, noG );<br />
DeclMV( uLitt[roots], 0.0, 50.0, "Root litter", "uLittR", "t/ha", noF, noT, noG );<br />
DeclMV( uLitt[twigs], 0.0, 50.0, "Twig litter", "uLittT", "t/ha", noF, noT, noG );<br />
DeclMV( uLitt[wood], 0.0, 50.0, "Stemwood litter", "uLittW", "t/ha", noF, noT, noG );<br />
DeclMV( meanLitt[leafFast], 0.0, 50.0, "Fast decay<strong>in</strong>g foliage litter", "µLittLF", "t/ha", noF, noT, noG );<br />
DeclMV( meanLitt[leafMedium], 0.0, 50.0, "Medium dec. foliage litter", "µLittLM", "t/ha", noF, noT, noG );