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 215<br />
FROM SimBase IMPORT DeclM, IntegrationMethod, NoDynamic, RTCType, DeclP,<br />
StashFil<strong>in</strong>g, DeclMV, Tabulation, NoAbout, Graph<strong>in</strong>g, NoInput,<br />
RemoveM, CurrentTime, MDeclared, GetGlobSimPars;<br />
FROM TabFunc IMPORT TabFUNC, DeclTabF, Yie, RemoveTabF;<br />
FROM DMEntryForms IMPORT FormFrame, WriteLabel, RadioButtonID, Def<strong>in</strong>eRadioButtonSet,<br />
RadioButton, UseEntryForm;<br />
FROM DMFiles IMPORT Lookup, ReadChar, GetReal, EOF, EOL, Close, TextFile,<br />
Response, Reset, SkipGap, GetExist<strong>in</strong>gFile, legalNum;<br />
FROM DMStr<strong>in</strong>gs IMPORT AssignStr<strong>in</strong>g;<br />
FROM DMMenus IMPORT InstallCommand, InstallAliasChar, InstallSeparator,<br />
Separator, AccessStatus, Mark<strong>in</strong>g, Command, SeparatorPosition,<br />
RemoveSeparatorAtCommand, RemoveCommand, DisableCommand,<br />
EnableCommand;<br />
FROM DMMessages IMPORT Warn;<br />
FROM StochStat IMPORT StatArray, Prob2Tail, DeclStatArray, notExist<strong>in</strong>gStatArray,<br />
PutValue, DeclDispMV, DisplayArray;<br />
FROM SimGraphUtils IMPORT timeIsIndep;<br />
FROM RandNormal IMPORT InstallU;<br />
FROM RandGen IMPORT U;<br />
FROM Jacobi IMPORT Vector;<br />
FROM MultiNormal IMPORT MultiN;<br />
FROM SYSTEM IMPORT Exp;<br />
FROM ForestBase IMPORT Month, site, RemoveConstEnvironment, DeclConstEnvironment,<br />
fe, uDD, uDrStr, uWiT, uAET, fMenu, Power, Rmax, Rm<strong>in</strong>, exp,<br />
ExperimentType, DeclMonitor<strong>in</strong>gProc, RemoveMonitor<strong>in</strong>gProc,<br />
DeclStatArrayForOutput, GetCur<strong>Climate</strong>, <strong>Climate</strong>;<br />
CONST<br />
kDays = 30.5;<br />
modIdent = "ForClim-E";<br />
modDescrStoch = "ForClim-E: Abiotic environment";<br />
modDescrFileW = "ForClim-E: Wea<strong>the</strong>r data from file";<br />
modDescrFileE = "ForClim-E: Bioclimatic variables from file";<br />
TYPE<br />
EnvironmentType = ( undefE, stochE, fileW, fileE );<br />
VAR<br />
a, b, rTVect, rPVect, zeroSDVect: ARRAY [Jan..Dec] OF REAL;<br />
month: Month;<br />
uPET, k1, k2, k3, k4, k5, k6, k7, k8, kPM,<br />
tSuMod, tWiMod, tSDSuMod, tSDWiMod, pSuMod, pWiMod, pSDSuMod, pSDWiMod,<br />
tMod, pMod, tSDMod, pSDMod, currWater, kPMod,<br />
meanAET, meanDD, meanDrStr, meanWiT,<br />
tzero, hm: REAL;<br />
tSuTab, tWiTab, tSDSuTab, tSDWiTab, pSuTab, pWiTab, pSDSuTab, pSDWiTab,<br />
corrDDTab: TabFUNC;<br />
time, modifier: ARRAY [1..20] OF REAL;<br />
fileName: ARRAY [0..63] OF CHAR;<br />
<strong>in</strong>F: TextFile;<br />
declEMod: EnvironmentType;<br />
fceCmd, chooseEnvCmd: Command;<br />
uAETStatArray, uDDStatArray, uDrStrStatArray, uWiTStatArray: StatArray;<br />
PROCEDURE EmptyProc; BEGIN END EmptyProc;<br />
PROCEDURE RemoveAllWea<strong>the</strong>rTabFuncs;<br />
BEGIN<br />
(* assumes that RemoveTabF will not <strong>in</strong>form on attempts to remove nonexist<strong>in</strong>g TabFs *)<br />
RemoveTabF( corrDDTab );<br />
RemoveTabF( tSuTab ); RemoveTabF( tWiTab );<br />
RemoveTabF( tSDSuTab ); RemoveTabF( tSDWiTab );<br />
RemoveTabF( pSuTab ); RemoveTabF( pWiTab );<br />
RemoveTabF( pSDSuTab ); RemoveTabF( pSDWiTab );<br />
tSuMod := 0.0; pSuMod := 0.0; tWiMod := 0.0; pWiMod := 0.0;<br />
tSDSuMod := 1.0; tSDWiMod := 1.0; pSDSuMod := 1.0; pSDWiMod := 1.0;<br />
END RemoveAllWea<strong>the</strong>rTabFuncs;<br />
PROCEDURE CalculateWea<strong>the</strong>rModifiers;<br />
VAR t: REAL;<br />
BEGIN<br />
t := CurrentTime();<br />
tSuMod := Yie( tSuTab, t );<br />
pSuMod := Yie( pSuTab, t );<br />
IF declEMod = stochE THEN<br />
tWiMod := Yie( tWiTab, t );<br />
tSDSuMod := Yie( tSDSuTab, t );<br />
tSDWiMod := Yie( tSDWiTab, t );<br />
pWiMod := Yie( pWiTab, t );<br />
pSDSuMod := Yie( pSDSuTab, t );<br />
pSDWiMod := Yie( pSDWiTab, t );<br />
END; (* IF *)<br />
END CalculateWea<strong>the</strong>rModifiers;