08.09.2014 Views

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 ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix 227<br />

DeclMV( meanLitt[leafSlow], 0.0, 50.0, "Slowly dec. foliage litter", "µLittLS", "t/ha", noF, noT, noG );<br />

DeclMV( meanLitt[roots], 0.0, 50.0, "Root litter", "µLittR", "t/ha", noF, noT, noG );<br />

DeclMV( meanLitt[twigs], 0.0, 50.0, "Twig litter", "µLittT", "t/ha", noF, noT, noG );<br />

DeclMV( meanLitt[wood], 0.0, 50.0, "Stemwood litter", "µLittW", "t/ha", noF, noT, noG );<br />

DeclP(kPDist, 0.0, 0.0, 1.0, noRtc, 'Disturbance probability', 'kPDist', '/year');<br />

DeclAllometricParameters;<br />

DeclSubMParameters;<br />

END DeclModelObjects;<br />

PROCEDURE DeclareGapModel;<br />

BEGIN<br />

DeclM(fp, discreteTime, Initialize, Input, Output, Dynamic, Term<strong>in</strong>ate,<br />

DeclModelObjects, modDescr, modIdent, NoAbout);<br />

SetSimTime( 0.0, 1200.0);<br />

SetMonInterval( 20.0 );<br />

END DeclareGapModel;<br />

(********************************************)<br />

(* Procedures for site & species selection *)<br />

(********************************************)<br />

PROCEDURE ChooseSpecies;<br />

VAR ok: BOOLEAN;<br />

BEGIN<br />

ReadSpeciesFile( firstSp, "", ok );<br />

IF ok THEN<br />

RemoveM( fp );<br />

DeclareGapModel;<br />

END; (* IF *)<br />

END ChooseSpecies;<br />

PROCEDURE DumpTheState;<br />

VAR x, y, z: INTEGER;<br />

f: TextFile;<br />

ok: BOOLEAN;<br />

BEGIN<br />

GetSeeds( x, y, z );<br />

CreateNewFile( f, "File to dump state vector", "ForClim-P State.DAT" );<br />

IF f.res = done THEN<br />

AssignStr<strong>in</strong>g( f.path, pathAndFilename );<br />

Concat( pathAndFilename, f.filename );<br />

Close( f );<br />

DumpStateToFile( ok, TRUNC(CurrentTime()), x, y ,z, site.name, pathAndFilename );<br />

END;<br />

END DumpTheState;<br />

PROCEDURE ReadTheState;<br />

VAR ok: BOOLEAN;<br />

x0New, y0New, z0New: INTEGER;<br />

f: TextFile;<br />

BEGIN<br />

GetExist<strong>in</strong>gFile( f, "File to read state vector" );<br />

ok := f.res = done;<br />

IF ok THEN<br />

AssignStr<strong>in</strong>g( f.path, pathAndFilename );<br />

Concat( pathAndFilename, f.filename );<br />

Close( f );<br />

ReadStateFromFile( ok, x0New, y0New, z0New, pathAndFilename );<br />

IF ok AND (x0New undefSeed) THEN<br />

SetRandomNumberSeeds( x0New, y0New, z0New );<br />

END;<br />

END;<br />

END ReadTheState;<br />

PROCEDURE DoTreeR<strong>in</strong>gs;<br />

BEGIN<br />

ChooseSpeciesForTreeR<strong>in</strong>gs( site.name );<br />

END DoTreeR<strong>in</strong>gs;<br />

PROCEDURE CustomizeStats;<br />

CONST startL<strong>in</strong>e = 3;<br />

VAR l<strong>in</strong>e, lem : INTEGER;<br />

ef : FormFrame;<br />

ok : BOOLEAN;<br />

BEGIN<br />

l<strong>in</strong>e := startL<strong>in</strong>e; lem := 2;<br />

WriteLabel( l<strong>in</strong>e-1, lem-1, "Customization <strong>of</strong> statistical output:" );<br />

INC( l<strong>in</strong>e );<br />

CheckBox( l<strong>in</strong>e, lem, "Write species biomasses higher than", withBiom );<br />

RealField(l<strong>in</strong>e, lem+34, 5, m<strong>in</strong>ValBiom, useAsDeflt, 0.0, 20.0 );<br />

WriteLabel( l<strong>in</strong>e, lem+40, "t/ha" ); INC( l<strong>in</strong>e );<br />

CheckBox( l<strong>in</strong>e, lem, "Write tree numbers higher than", withNr );<br />

RealField(l<strong>in</strong>e, lem+30, 5, m<strong>in</strong>ValNr, useAsDeflt, 0.0, 50.0 );<br />

WriteLabel( l<strong>in</strong>e, lem+36, "#/ha" );<br />

ef.x:= 0; ef.y:= -1; (* display entry form <strong>in</strong> middle <strong>of</strong> screen *)<br />

ef.l<strong>in</strong>es:= 8; ef.columns:= 50;<br />

UseEntryForm( ef,ok );<br />

END CustomizeStats;<br />

PROCEDURE DeclForClimP;<br />

VAR ok: BOOLEAN;<br />

BEGIN<br />

IF NOT MDeclared( fp ) THEN<br />

RemoveConstPlants;<br />

ReadSpeciesFile( firstSp, "SpecPars.DAT", ok );<br />

DeclMonitor<strong>in</strong>gProc( Monitor<strong>in</strong>g );<br />

DeclSiteProc( AssignMonitor<strong>in</strong>gAttributes );<br />

AssignMonitor<strong>in</strong>gAttributes;<br />

DeclareGapModel;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!