SORTIE-ND
Software for spatially-explicit simulation of forest dynamics

Parameter files

(and how to hack them)

Before reading this, you should know the basics of what a parameter file is, as well as how to read XML. You can look at more information about parameter files in the user parameter file topic, the Model I/O topic, or look at an XML tutorial at http://www.w3schools.com/xml/default.asp.

In this document:

Editing parameter files
Why edit parameter files?
Validating parameter files
Figuring out parameters
Sample parameter file
Parameter file tag
Plot parameters
Tree parameters
Behavior list
Behavior parameters

Editing parameter files

A parameter file is not formatted for easy reading by humans. The text is written in one continuous stream, without tabs, spaces, or new line characters. There's a good reason for this. Formatting characters make it harder to correctly parse the file to get the data out of it.

If you want to look at a parameter file, I recommend a browser such as Internet Explorer. A browser will format the XML for you in a way that makes it easy to read.

To directly edit a parameter file, all you need is some kind of a text editor. If you have an XML or HTML editor that will color-code the text for you, that's helpful for avoiding mistakes. You can put newlines and tabs into the text by hand if it helps you edit it. You can even leave them in when you use the file. If the parser has trouble, you can try taking them out then.

Why edit parameter files?

The biggest reason to understand parameter files intimately is for testing. If you write an automated test, you might start by writing code that generates a parameter file and feeds it to the model. You have to know how to write this file correctly.

Additionally, there are a few reasons when you might need to edit parameter files by hand. For instance, perhaps you have put a new behavior into the core model that isn't yet in the GUI. To test it, you would need to add its parameters by hand to a parameter file. There are a few test behaviors that you can't add through the GUI, and must add by hand instead. Also, there are some parameter file formats that make perfectly legitimate runs that the GUI won't allow you to do; for instance, putting seed dispersal behaviors at the beginning of a timestep.

Well-formed parameter files

When an XML file is well-formed, it means that the XML syntax is correct: opening elements and closing elements are correctly paired, attributes have quotation marks in the right place, etc. An XML file MUST be well-formed to be used.

Once you've edited your parameter file, you have to make sure it's well-formed. There are online well-formedness checkers, or you can open it in a browser. If you can see the whole file all the way to the bottom, it's well-formed. If it's not well-formed, the browser will stop displaying text at some point and display an error.

On a large scale, the order that the elements go in is important to the GUI (less so to the core model). The order of individual elements don't matter but the large scale groupings should be the same. Follow the order set in a file created by the GUI.

Figuring out parameters

You may look at a parameter file and need some help knowing what an XML tag represents. The help file for a behavior should help you begin to puzzle it out. Looking at the actual Java code should resolve all doubt.

There are two formats that almost all parameters follow. The first is the single piece of data, like this:

< li_julianDayGrowthStarts> 120< /li_julianDayGrowthStarts>

This particular parameter is the first day of the growing season, for light behaviors.

The second format is for species-specific parameters, like this:

< tr_canopyRadiusExponent>
< tr_creVal species="ACRU"> 1.0< /tr_creVal>
< tr_creVal species="ACSA"> 1.0< /tr_creVal>
< tr_creVal species="BEAL"> 1.0< /tr_creVal>
< /tr_canopyRadiusExponent>

This parameter is an equation exponent for tree allometry for each species.

Parameter names sometimes change as behaviors change. Often, an XML tag will be left with the old name so old files will still work.

Sample parameter file

Here is a sample parameter file that we will look at piece by piece. (This file doesn't make a very good simulation; I edited it to make it shorter.)

< ?xml version="1.0" encoding="UTF-8"?>
< paramFile fileCode="07020101">
< plot>
< timesteps> 10< /timesteps>
< randomSeed> 0< /randomSeed>
< yearsPerTimestep> 5.0< /yearsPerTimestep>
< plot_lenX> 300.0< /plot_lenX>
< plot_lenY> 300.0< /plot_lenY>
< plot_latitude> 41.92< /plot_latitude>
< plot_title> Default parameter file-use for testing only< /plot_title>
< /plot>
< trees>
< tr_speciesList>
< tr_species speciesName="ACRU"/>
< tr_species speciesName="ACSA"/>
< /tr_speciesList>
< tr_seedDiam10Cm> 0.2< /tr_seedDiam10Cm>
< tr_minAdultDBH>
< tr_madVal species="ACRU"> 10.0< /tr_madVal>
< tr_madVal species="ACSA"> 10.0< /tr_madVal>
< /tr_minAdultDBH>
< tr_maxSeedlingHeight>
< tr_mshVal species="ACRU"> 1.35< /tr_mshVal>
< tr_mshVal species="ACSA"> 1.35< /tr_mshVal>
< /tr_maxSeedlingHeight>
< /trees>
< behaviorList>
< behavior>
< behaviorName> QuadratLight< /behaviorName>
< version> 1.0< /version>
< listPosition> 1< /listPosition>
< applyTo species="ACRU" type="Seedling"/>
< applyTo species="ACSA" type="Seedling"/>
< /behavior>
< behavior>
< behaviorName> RelUnlimGrowth< /behaviorName>
< version> 1.2< /version>
< listPosition> 2< /listPosition>
< applyTo species="ACRU" type="Seedling"/>
< applyTo species="ACSA" type="Seedling"/>
< applyTo species="ACRU" type="Sapling"/>
< applyTo species="ACSA" type="Sapling"/>
< /behavior>
< behavior>
< behaviorName> GMFMortality< /behaviorName>
< version> 1.0< /version>
< listPosition> 3< /listPosition>
< applyTo species="ACRU" type="Seedling"/>
< applyTo species="ACSA" type="Seedling"/>
< /behavior>
< /behaviorList>
< allometry>
< tr_whatAdultHeightDiam>
< tr_wahdVal species="ACRU"> 0< /tr_wahdVal>
< tr_wahdVal species="ACSA"> 0< /tr_wahdVal>
< /tr_whatAdultHeightDiam>
< tr_whatSaplingHeightDiam>
< tr_wsahdVal species="ACRU"> 0< /tr_wsahdVal>
< tr_wsahdVal species="ACSA"> 0< /tr_wsahdVal>
< /tr_whatSaplingHeightDiam>
< tr_whatSeedlingHeightDiam>
< tr_wsehdVal species="ACRU"> 0< /tr_wsehdVal>
< tr_wsehdVal species="ACSA"> 0< /tr_wsehdVal>
< /tr_whatSeedlingHeightDiam>
< tr_whatAdultCrownRadDiam>
< tr_wacrdVal species="ACRU"> 0< /tr_wacrdVal>
< tr_wacrdVal species="ACSA"> 0< /tr_wacrdVal>
< /tr_whatAdultCrownRadDiam>
< tr_whatSaplingCrownRadDiam>
< tr_wscrdVal species="ACRU"> 0< /tr_wscrdVal>
< tr_wscrdVal species="ACSA"> 0< /tr_wscrdVal>
< /tr_whatSaplingCrownRadDiam>
< tr_whatAdultCrownHeightHeight>
< tr_wachhVal species="ACRU"> 0< /tr_wachhVal>
< tr_wachhVal species="ACSA"> 0< /tr_wachhVal>
< /tr_whatAdultCrownHeightHeight>
< tr_whatSaplingCrownHeightHeight>
< tr_wschhVal species="ACRU"> 0< /tr_wschhVal>
< tr_wschhVal species="ACSA"> 0< /tr_wschhVal>
< /tr_whatSaplingCrownHeightHeight>
< tr_canopyHeight>
< tr_chVal species="ACRU"> 25.7< /tr_chVal>
< tr_chVal species="ACSA"> 24.8< /tr_chVal>
< /tr_canopyHeight>
< tr_stdAsympCrownRad>
< tr_sacrVal species="ACRU"> 0.108< /tr_sacrVal>
< tr_sacrVal species="ACSA"> 0.107< /tr_sacrVal>
< /tr_stdAsympCrownRad>
< tr_stdCrownRadExp>
< tr_screVal species="ACRU"> 1.0< /tr_screVal>
< tr_screVal species="ACSA"> 1.0< /tr_screVal>
< /tr_stdCrownRadExp>
< tr_stdAsympCrownHt>
< tr_sachVal species="ACRU"> 0.49< /tr_sachVal>
< tr_sachVal species="ACSA"> 0.58< /tr_sachVal>
< /tr_stdAsympCrownHt>
< tr_stdCrownHtExp>
< tr_scheVal species="ACRU"> 1.0< /tr_scheVal>
< tr_scheVal species="ACSA"> 1.0< /tr_scheVal>
< /tr_stdCrownHtExp>
< tr_conversionDiam10ToDBH>
< tr_cdtdVal species="ACRU"> 0.75< /tr_cdtdVal>
< tr_cdtdVal species="ACSA"> 0.75< /tr_cdtdVal>
< /tr_conversionDiam10ToDBH>
< tr_interceptDiam10ToDBH>
< tr_idtdVal species="ACRU"> 0.0< /tr_idtdVal>
< tr_idtdVal species="ACSA"> 0.0< /tr_idtdVal>
< /tr_interceptDiam10ToDBH>
< tr_slopeOfAsymHeight>
< tr_soahVal species="ACRU"> 0.063< /tr_soahVal>
< tr_soahVal species="ACSA"> 0.0623< /tr_soahVal>
< /tr_slopeOfAsymHeight>
< tr_slopeOfHeight-Diam10>
< tr_sohdVal species="ACRU"> 0.03< /tr_sohdVal>
< tr_sohdVal species="ACSA"> 0.03< /tr_sohdVal>
< /tr_slopeOfHeight-Diam10>
< /allometry>
< GeneralLight>
< li_lightExtinctionCoefficient>
< li_lecVal species="ACRU"> 0.399< /li_lecVal>
< li_lecVal species="ACSA"> 0.399< /li_lecVal>
< /li_lightExtinctionCoefficient>
< li_beamFractGlobalRad> 0.5< /li_beamFractGlobalRad>
< li_clearSkyTransCoeff> 0.65< /li_clearSkyTransCoeff>
< li_julianDayGrowthStarts> 120< /li_julianDayGrowthStarts>
< li_julianDayGrowthEnds> 270< /li_julianDayGrowthEnds>
< /GeneralLight>
< QuadratLight1> < li_numAziGrids> 18< /li_numAziGrids>
< li_numAltGrids> 12< /li_numAltGrids>
< li_minSunAngle> 0.779< /li_minSunAngle>
< li_quadratLightHeight> 0.675< /li_quadratLightHeight>
< li_quadratAllGLIs> 0< /li_quadratAllGLIs>
< /QuadratLight1>
< RelUnlimGrowth2>
< gr_asympDiameterGrowth>
< gr_adgVal species="ACRU"> 0.167< /gr_adgVal>
< gr_adgVal species="ACSA"> 0.125< /gr_adgVal>
< /gr_asympDiameterGrowth>
< gr_slopeGrowthResponse>
< gr_sgrVal species="ACRU"> 0.027< /gr_sgrVal>
< gr_sgrVal species="ACSA"> 0.159< /gr_sgrVal>
< /gr_slopeGrowthResponse>
< gr_relGrowthDiamExp>
< gr_rgdeVal species="ACRU"> 1.0< /gr_rgdeVal>
< gr_rgdeVal species="ACSA"> 1.0< /gr_rgdeVal>
< /gr_relGrowthDiamExp>
< /RelUnlimGrowth2>
< GMFMortality3>
< mo_mortAtZeroGrowth>
< mo_mazgVal species="ACRU"> 0.99< /mo_mazgVal>
< mo_mazgVal species="ACSA"> 0.998< /mo_mazgVal>
< /mo_mortAtZeroGrowth>
< mo_lightDependentMortality>
< mo_ldmVal species="ACRU"> 6.64< /mo_ldmVal>
< mo_ldmVal species="ACSA"> 4.79< /mo_ldmVal>
< /mo_lightDependentMortality>
< /GMFMortality3>
< /paramFile>

Parameter file tag

< paramFile fileCode="07020101">

The root tag of the parameter file contains a file code which identifies it as a parameter file for a certain version of SORTIE-ND. For an explanation of the different elements of the file code, see the Model I/O topic.

Plot parameters

< plot>
< timesteps> 10< /timesteps>
< randomSeed> 0< /randomSeed>
< yearsPerTimestep> 5.0< /yearsPerTimestep>
< plot_lenX> 300.0< /plot_lenX>
< plot_lenY> 300.0< /plot_lenY>
< plot_latitude> 41.92< /plot_latitude>
< plot_title> Default parameter file-use for testing only< /plot_title>
< /plot>

Plot parameters are required and are always present. They must always come first. There are optional additional parameters in plot depending on the needs of the behaviors.

Tree parameters

< trees>
< tr_speciesList>
< tr_species speciesName="ACRU"/>
< tr_species speciesName="ACSA"/>
< /tr_speciesList>
< tr_seedDiam10Cm> 0.2< /tr_seedDiam10Cm>
< tr_minAdultDBH>
< tr_madVal species="ACRU"> 10.0< /tr_madVal>
< tr_madVal species="ACSA"> 10.0< /tr_madVal>
< /tr_minAdultDBH>
< tr_maxSeedlingHeight>
< tr_mshVal species="ACRU"> 1.35< /tr_mshVal>
< tr_mshVal species="ACSA"> 1.35< /tr_mshVal>
< /tr_maxSeedlingHeight>
< /trees>

The tree parameters are always present. They must always come before the behavior list. In addition to the parameters shown above, the < tree> tag may also contain a tree map. If you want to remove a tree map from a parameter file, it is sometimes easier to do it by hand if the map is large.

Behavior list

< behaviorList>
< behavior>
< behaviorName> QuadratLight< /behaviorName>
< version> 1.0< /version>
< listPosition> 1< /listPosition>
< applyTo species="ACRU" type="Seedling"/>
< applyTo species="ACSA" type="Seedling"/>
< /behavior>
< behavior>
< behaviorName> RelUnlimGrowth< /behaviorName>
< version> 1.2< /version>
< listPosition> 2< /listPosition>
< applyTo species="ACRU" type="Seedling"/>
< applyTo species="ACSA" type="Seedling"/>
< applyTo species="ACRU" type="Sapling"/>
< applyTo species="ACSA" type="Sapling"/>
< /behavior>
< behavior>
< behaviorName> GMFMortality< /behaviorName>
< version> 1.0< /version>
< listPosition> 3< /listPosition>
< applyTo species="ACRU" type="Seedling"/>
< applyTo species="ACSA" type="Seedling"/>
< /behavior>
< /behaviorList>

The behavior list specifies the behaviors for this simulation in the order in which they will be called each timestep. Each behavior gets a version number and the trees to which it is applied.

You can change around the order of behaviors, but be sure you know what you are doing. In the list above, switching the first two behaviors would cause a fatal error. You can always switch behaviors of the same type, such as growth behaviors or mortality behaviors (but this is something you can do easily in the GUI as well). The list positions must match later parameter groupings.

In the C++ code documentation, each behavior class should tell you in the class documentation what string you use to call it from the parameter file. It should also tell you its version number (if it doesn't, it's probably version 1.0).

Not all behaviors are applied to trees. If they are, they may interpret the list in different ways. Again, class documentation should tell you if the behavior will do something unusual with the list of trees to which it is applied.

Allometry parameters

< allometry>
< tr_whatAdultHeightDiam>
< tr_wahdVal species="ACRU"> 0< /tr_wahdVal>
< tr_wahdVal species="ACSA"> 0< /tr_wahdVal>
< /tr_whatAdultHeightDiam>
< tr_whatSaplingHeightDiam>
< tr_wsahdVal species="ACRU"> 0< /tr_wsahdVal>
< tr_wsahdVal species="ACSA"> 0< /tr_wsahdVal>
< /tr_whatSaplingHeightDiam>
< tr_whatSeedlingHeightDiam>
< tr_wsehdVal species="ACRU"> 0< /tr_wsehdVal>
< tr_wsehdVal species="ACSA"> 0< /tr_wsehdVal>
< /tr_whatSeedlingHeightDiam>
< tr_whatAdultCrownRadDiam>
< tr_wacrdVal species="ACRU"> 0< /tr_wacrdVal>
< tr_wacrdVal species="ACSA"> 0< /tr_wacrdVal>
< /tr_whatAdultCrownRadDiam>
< tr_whatSaplingCrownRadDiam>
< tr_wscrdVal species="ACRU"> 0< /tr_wscrdVal>
< tr_wscrdVal species="ACSA"> 0< /tr_wscrdVal>
< /tr_whatSaplingCrownRadDiam>
< tr_whatAdultCrownHeightHeight>
< tr_wachhVal species="ACRU"> 0< /tr_wachhVal>
< tr_wachhVal species="ACSA"> 0< /tr_wachhVal>
< /tr_whatAdultCrownHeightHeight>
< tr_whatSaplingCrownHeightHeight>
< tr_wschhVal species="ACRU"> 0< /tr_wschhVal>
< tr_wschhVal species="ACSA"> 0< /tr_wschhVal>
< /tr_whatSaplingCrownHeightHeight>
< tr_canopyHeight>
< tr_chVal species="ACRU"> 25.7< /tr_chVal>
< tr_chVal species="ACSA"> 24.8< /tr_chVal>
< /tr_canopyHeight>
< tr_stdAsympCrownRad>
< tr_sacrVal species="ACRU"> 0.108< /tr_sacrVal>
< tr_sacrVal species="ACSA"> 0.107< /tr_sacrVal>
< /tr_stdAsympCrownRad>
< tr_stdCrownRadExp>
< tr_screVal species="ACRU"> 1.0< /tr_screVal>
< tr_screVal species="ACSA"> 1.0< /tr_screVal>
< /tr_stdCrownRadExp>
< tr_stdAsympCrownHt>
< tr_sachVal species="ACRU"> 0.49< /tr_sachVal>
< tr_sachVal species="ACSA"> 0.58< /tr_sachVal>
< /tr_stdAsympCrownHt>
< tr_stdCrownHtExp>
< tr_scheVal species="ACRU"> 1.0< /tr_scheVal>
< tr_scheVal species="ACSA"> 1.0< /tr_scheVal>
< /tr_stdCrownHtExp>
< tr_conversionDiam10ToDBH>
< tr_cdtdVal species="ACRU"> 0.75< /tr_cdtdVal>
< tr_cdtdVal species="ACSA"> 0.75< /tr_cdtdVal>
< /tr_conversionDiam10ToDBH>
< tr_interceptDiam10ToDBH>
< tr_idtdVal species="ACRU"> 0.0< /tr_idtdVal>
< tr_idtdVal species="ACSA"> 0.0< /tr_idtdVal>
< /tr_interceptDiam10ToDBH>
< tr_slopeOfAsymHeight>
< tr_soahVal species="ACRU"> 0.063< /tr_soahVal>
< tr_soahVal species="ACSA"> 0.0623< /tr_soahVal>
< /tr_slopeOfAsymHeight>
< tr_slopeOfHeight-Diam10>
< tr_sohdVal species="ACRU"> 0.03< /tr_sohdVal>
< tr_sohdVal species="ACSA"> 0.03< /tr_sohdVal>
< /tr_slopeOfHeight-Diam10>
< /allometry>

Tree allometry parameters are required and always present. They always come after the behavior list.

Behavior parameters

< GeneralLight>
< li_lightExtinctionCoefficient>
< li_lecVal species="ACRU"> 0.399< /li_lecVal>
< li_lecVal species="ACSA"> 0.399< /li_lecVal>
< /li_lightExtinctionCoefficient>
< li_beamFractGlobalRad> 0.5< /li_beamFractGlobalRad>
< li_clearSkyTransCoeff> 0.65< /li_clearSkyTransCoeff>
< li_julianDayGrowthStarts> 120< /li_julianDayGrowthStarts>
< li_julianDayGrowthEnds> 270< /li_julianDayGrowthEnds>
< /GeneralLight>
< QuadratLight1> < li_numAziGrids> 18< /li_numAziGrids>
< li_numAltGrids> 12< /li_numAltGrids>
< li_minSunAngle> 0.779< /li_minSunAngle>
< li_quadratLightHeight> 0.675< /li_quadratLightHeight>
< li_quadratAllGLIs> 0< /li_quadratAllGLIs>
< /QuadratLight1>
< RelUnlimGrowth2>
< gr_asympDiameterGrowth>
< gr_adgVal species="ACRU"> 0.167< /gr_adgVal>
< gr_adgVal species="ACSA"> 0.125< /gr_adgVal>
< /gr_asympDiameterGrowth>
< gr_slopeGrowthResponse>
< gr_sgrVal species="ACRU"> 0.027< /gr_sgrVal>
< gr_sgrVal species="ACSA"> 0.159< /gr_sgrVal>
< /gr_slopeGrowthResponse>
< gr_relGrowthDiamExp>
< gr_rgdeVal species="ACRU"> 1.0< /gr_rgdeVal>
< gr_rgdeVal species="ACSA"> 1.0< /gr_rgdeVal>
< /gr_relGrowthDiamExp>
< /RelUnlimGrowth2>
< GMFMortality3>
< mo_mortAtZeroGrowth>
< mo_mazgVal species="ACRU"> 0.99< /mo_mazgVal>
< mo_mazgVal species="ACSA"> 0.998< /mo_mazgVal>
< /mo_mortAtZeroGrowth>
< mo_lightDependentMortality>
< mo_ldmVal species="ACRU"> 6.64< /mo_ldmVal>
< mo_ldmVal species="ACSA"> 4.79< /mo_ldmVal>
< /mo_lightDependentMortality>
< /GMFMortality3>
< /paramFile>

The parameters for one behavior are grouped together. There may be multiple copies of a single behavior. They can be distinguished by the number at the end of the behavior name tag, which matches their list position.

Only the parameters actually required by the behaviors in the behavior list must be present. If a behavior has optional parameters, the GUI usually writes them out even if they aren't needed.

The parameter groups usually go in the same order as the behaviors themselves in the behavior list, but they don't have to. If you changed the parameter groups around the file would still work fine.