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 ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Appendix 223<br />
FROM FCPFileIO IMPORT DeclAllometricParameters, AssignAllometricParameters,<br />
AssignMonitor<strong>in</strong>gAttributes, DumpStateToFile,<br />
ReadStateFromFile, undefSeed, ReadSpeciesFile,<br />
CalcAndWriteLimFactorsToFile;<br />
FROM FCPGrFact IMPORT SoilNitrogenGrowthFactor, DegreeDayGrowthFactor,<br />
StandCharacteristics, maxHeight, DroughtGrowthFactor;<br />
FROM FCPDynamic IMPORT TreeDeathAndGrowth, TreeEstablishment, UpdateGap,<br />
DeclSubMParameters, LitterInitialization;<br />
CONST<br />
modIdent = "ForClim-P";<br />
modDescr = "ForClim-P: Plant dynamics model";<br />
noT = notInTable; noG = notInGraph; noF = not<strong>On</strong>File; isT = writeInTable;<br />
VAR<br />
chooseSiteCmd, chooseWea<strong>the</strong>rCmd, editParsCmd, histoCmd, newSpeciesCmd,<br />
dumpStateCmd, readStateCmd, treeR<strong>in</strong>gCmd, animCmd, statsCmd, fcpCmd: Command;<br />
sp: SpeciesPtr;<br />
kPDist, maxBioScal<strong>in</strong>g: REAL;<br />
cumLA: ARRAY [1..maxHeight] OF REAL;<br />
pathAndFilename: ARRAY [0..63] OF CHAR;<br />
fn: ARRAY [0..31] OF CHAR;<br />
statArrLAI, statArrTotBio, statArrTotNr : StatArray;<br />
statArrLitt: ARRAY [MIN(Litter)..MAX(Litter)] OF StatArray;<br />
tzero, hm,<br />
m<strong>in</strong>ValBiom, m<strong>in</strong>ValNr : REAL;<br />
withBiom, withNr, ok: BOOLEAN;<br />
startupLevel: CARDINAL;<br />
meanLitt: ARRAY [MIN(Litter)..MAX(Litter)] OF REAL;<br />
(* for sensitivity analysis <strong>of</strong> species parameters only: *)<br />
sensFirstSp, sensSp, modelSp: SpeciesPtr;<br />
PROCEDURE EmptyProc; BEGIN END EmptyProc;<br />
PROCEDURE CreateStateFileName( VAR fn: ARRAY OF CHAR );<br />
VAR nrStr: ARRAY [0..7] OF CHAR;<br />
BEGIN<br />
AssignStr<strong>in</strong>g( "ForClim-P State.", fn );<br />
Concat( fn, site.name );<br />
IntToStr<strong>in</strong>g( CurrentSimNr(), nrStr, 3 );<br />
Concat( fn, nrStr );<br />
END CreateStateFileName;<br />
(**************************)<br />
(* Monitor<strong>in</strong>g procedure *)<br />
(**************************)<br />
PROCEDURE Monitor<strong>in</strong>g;<br />
VAR t, convFBio, convFNr : REAL;<br />
<strong>in</strong>dex : INTEGER;<br />
sp : SpeciesPtr;<br />
i: Litter;<br />
BEGIN<br />
HistogramMonitor<strong>in</strong>g;<br />
AnimationMonitor<strong>in</strong>g;<br />
IF ExperimentRunn<strong>in</strong>g() THEN<br />
IF exp.type = estimEquil THEN<br />
t := 0.0;<br />
<strong>in</strong>dex := 1;<br />
ELSE<br />
t := CurrentTime();<br />
<strong>in</strong>dex := TRUNC( (t-tzero)/hm + 0.5 ) + 1;<br />
END;<br />
IF NOT ((exp.type = estimEquil) AND (CurrentTime()