SFMM to XML Conversion — A program to convert SFMM input files to ForestModel XML format



ca.spatial.tracks.sfmm.XMLSfmm {input_file} {output_file}






The name of the SFMM input file to be converted



The name to be given to the output ForestModel XML file.



If the file uses a siteclass suffix



The XMLSfmm program is a translator that converts a SFMM input file into the ForestModel XML format. The program is automated and requires no parameters other than the names of the input and output files. During operation the program

  1. Reads a specified SFMM input file,

  2. Parses the entries into relational tables,

  3. Extracts the numeric values from the model, and

  4. Formats and outputs the model values in ForestModel XML format.

ForestModel XML is a language that is used to describe stand dynamics and silvicultural treatment options. Most of what is contained within the SFMM input file can be expressed in the ForestModel language. The ForestModel file is an abstract description: it does not describe the area breakdown of the forest. The MatrixBuilder application will create input files suitable for Patchworks by reading the ForestModel and a GIS-based forest inventory, to create polygon-specific data inputs.

The translator handles even-aged and shelterwood silviculture, as well as mid-rotation tending treatments (PCT and CT). Uneven-aged forest units and silvicultural treatments are not supported.

The important categories of information that are translated are:

  • Growing stock and yield

  • Natural succession patterns

  • Silvicultural options and operability limits

  • Post-treatment response patterns

  • Harvest volumes (with appropriate modifiers for unharvested volume)

  • Area reductions for reserves and non-forest conversion

  • Habitat values

  • Seral stage classifications

Area summaries are ignored. Patchworks calculates areas by reading directly from GIS datasets. Disturbance processes (for example fire, as represented by the disturbance cycle parameter) are ignored (stochastic disturbance regimes are not suited to deterministic models such as Patchworks). NSR and rehabilitation forestry are ignored in the current version of the translator. Many of the tables that describe management flow constraints are not converted, because these are expressed as "targets" within the Patchworks model.

The following sets, parameters and tables are used in the conversion process (all other data not mentioned here are ignored):





Specifies the length of the modeling horizon.

This value is copied to the "horizon" attribute of the ForestModel element, and controls the behaviour of the MatrixBuilder.


Width of each planning period.

This value is used to interpret the width of planning periods within the SFMM input file data statements. The ForestModel format is independent of planning period widths, and this value is not represented in the output file.


Starting year of the simulation.

This value is recorded as metadata in the ForestModel element, but is not otherwise used.


Name of the landbase that this input file represents.

This value is copied and saved as metadata in the comments section of the ForestModel XML file.


String describing the input file.

This value is copied to the "description" attribute of the ForestModel element (not currently used).


Set that enumerates the management unit (or sub unit) codes that are used in the input file. The values in this field are expected to exactly match the values that are used in the inventory file.

Used by the translator to iterate over the set of management sub-units.


Set that enumerates the forest units that are used in this model.

Used by the translator to iterate over the set of even-aged forest units.


Set that enumerates the silvicultural treatments that are used in this model.

Used by the translator to iterate over the set of possible silvicultural intensities.


Set that enumerates the age classes used within the model.

Used by the translator to determine age classes used in the model.


Set that enumerates the tree species that are listed in the "Yield_1" table and used elsewhere.

Used by the translator to iterate over tree species codes.


Set that enumerates the names of the planning periods.

Used by the translator to iterate over planning period names.


Table defining associations between tree species codes and species groups.

The translator will use these associations to link products harvested by species to the product values and product proportions that are specified by species groups.


Table describing the base yield curves on a per hectare basis, prior to reductions for unharvested volume and retained area.

These curves are copied and reformatted to the output XML file. The reformatting process removes redundant points (i.e. consecutive points that describe a flat line on a curve).


Relation used to define the breakup and renewal rules that mimic the process of natural (non-catastrophic) succession.

Target forest unit, breakup and renewal timings are copied to the XML file. Since Patchworks is a deterministic model that tracks development on a polygon-by-polygon basis, only a single transition rule should be specified for each combination of stratification variables.


Table that defines the harvest operability ranges for forest units under the clearcut silvicultural system.

Defines the eligible even-aged treatments. Early and late operability ages are copied as-is to the XML file.


Table that describes the post-treatment forest units for treated forest.

Target forest unit is copied to the XML file.


Table that describes the post-treatment silvicultural intensity.

Target silvicultural intensity is copied to the XML file.


Table that describes single-pass harvesting practices in even-aged forest that retain some growing stock on-site.

Harvested volumes are reduced by the factors specified in this table.


Table that handles the portion of harvested area that is not renewed after being harvested, but instead transfers to non-forest land (such as B&Sc or roads & landing)s.

Only the values specified for period 1 are used. These factors are applied against all silvicultural intensities other than "Prsnt". Any polygon that has received a treatment (historically or within the simulation) will have its net area reduced by these factors.


Table that handles the portion of area within harvest zones that is left as accumulating reserve types, rather than being harvested.

Only the values specified for period 1 are used. These factors are used to net areas out of the land base. The areas are tracked as "unmanaged" forest.


Table that describes the renewal costs for each treatment, to be charged in the first year of the treatment.

These values are recorded as treatment costs.


Table that represents the proportion of each tree species that is harvested in a mid-rotation treatment operation.

These factors are used to determine volume harvested volumes and residual growing stock.


Table that describes the eligibility, timing, response and cost of mid-rotation treatment options (primarily thinning operations).

The values from this table are used to set up mid-rotation treatments. The operability window for the treatment is considered to be +/- 5 years from the mid-point of the age class.


Parameter set that contains the number of shelterwood stages in each FU that allows shelterwood silviculture.

Identifies the forest units that have shelterwood management defined.


Table that identifies the names that will be used for each shelterwood stage.

Associates stage names for shelterwood treatments. The translator will use labels such as "PCut", "SCut", "FCut", and "LCut" to name these stages.


Table containing the lower and upper entry ages for each shelterwood FU.

Eligibility limits for shelterwood management treatments.


Table containing the shortest and longest delays between each management stage in each shelterwood FU.

The lower delay period is used to set up a "retain" constraint within Patchworks.


Table containing the proportion of volume harvested in each management stage.

These factors are used to determine harvested volumes and residual growing stock.


Table containing the future forest type and ages that areas enter immediately after receiving the harvest associated with the final stage of management.

Define final harvest treatment response rules.


Table that describes the area retention requirements for preferred habitat.

These targets are not imported into Patchworks directly, but the presence of a target value will direct the translator to load the indicators for the specified habitat type.


Table that describes the proportion of the area in each forest unit that represents area within each wildlife habitat unit.

The translator will generate curves of preferred habitat by forest unit using these factors and the HabQuality table.


Table that describes the ages that each seral stage begins within each habitat unit (years).

This is used in the translation process to convert ages to seral stage class.


Table that estimates habitat quality for each wildlife species, within each habitat unit and habitat seral stage.

The following tables can be used to supplement the SFMM model. These tables are utilized if present, and ignored if not available. These tables describe:

  • Product values and age-dependent product proportions;

  • harvest costs;

  • management costs that are incurred at some time after the initial treatment; and

  • seral stage classifications.

Table name



A set enumerating all product value category names used in the input file.


This table lists the product price in $/m3 by product class. It is applied to product volumes that are computed by combining yield values from Yield_1 and product proportions from ProductProportion.


This table breaks down the anticipated product yield by forest unit, silvicultural intensity, species group and age class. Values are shown as a proportion of the total harvest for the species group.


This table shows harvesting costs by cost category, by species.


This table describes seral stage class breaks (used in seral stage and old-growth retention targets).


This table lists management costs that apply at times other than the period when the treatment was implements. For example, a tending cost that is scheduled to occur 10 years after planting could be listed here. The Patchworks model will use this information to ensure that the expenditure is accounted in the correct planning period.

Processing Notes

The SFMM input file to be processed should represent a full working input file.

We have noticed several minor inconsistencies in the SFMM input file format, such as formatting and misplacement of semicolons. These errors need to be corrected prior to running the translator.

In some datasets that we have processed we have also noticed a lack of consistency between forest unit and silvicultural intensity condition names used in the forest inventory database and the SFMM input file. For example, we have seen cases where the inventory file describe the intensity as "Inten1" and the SFMM file as "Intn1". The Patchworks dataset building process uses an exact matching process, and these inconsistencies will cause problems.

We have also found problems where the forest inventory contains combinations of forest units and silvicultural treatments that do not exist in the SFMM file (such as an intensive condition in a forest unit that does not have a defined intensive option). These inconsistencies will also cause problems in the translation process and must be corrected prior to running the translator.

Suffixes starting with an underscore should be removed before looking up values from the habitat matrix.


The translator will only allow a single succession or post-harvest treatment response rule.


The translator generates a large number of attributes that describe the development of unique forest classes (combinations of MU, FU, RI and management status). Management status includes "managed" (areas available for forest management treatments), and "unmanaged" (areas not available for forest management).

The translator creates attributes describing extant conditions (what is on the landscape), and for products of management (yields, benefits and costs that result from a management treatment). The following attributes are created to describe extant conditions:

  • area by forest unit and management status;

  • area of preferred habitat, by habitat type;

  • area by originating treatment and management status;

  • area by seral stage class

  • growing stock by mangement status and species code.

The following attributes describe management treatment outcomes:

  • area treated by forest unit;

  • costs by silvicultural treatment;

  • area treated by stand origin;

  • area treated by management treatment;

  • value by product;

  • yield by tree species.

Additional attributes can be added to the XML file to describe the development of other stand attributes (e.g. snags, DWD, water yield, etc.).


The following set, parameter and table examples demonstrate the format of the supplemental information that can be translated by the SFMMXml tool.

   Set: prv "Timber Product Values" /
   SPF_L "Large Sawlogs"
   SPF_M "Medium Sawlogs"
   SPF_P "Pulp"
   Other "Other"

  Table: ProductProportions(mu,fu,spg,ac,ri,pr)
  ! MU . FU  . RI    . SPG . AC ------ Product Values ------
                                 SPF_L  SPF_M  SPF_P  Other

   RMF . PJ1 . Prsnt . SPF . A5      0      0    100 
   RMF . PJ1 . Prsnt . SPF . A15     0      0    100 
   RMF . PJ1 . Prsnt . SPF . A25     0      0    100 
   RMF . PJ1 . Prsnt . SPF . A35     0      0    100 
   RMF . PJ1 . Prsnt . SPF . A45     0   34.1   65.9 
   RMF . PJ1 . Prsnt . SPF . A55     0   41.3   58.7 
   RMF . PJ1 . Prsnt . SPF . A65     0   47.6   52.4 
   RMF . PJ1 . Prsnt . SPF . A75     0     53     47 
   RMF . PJ1 . Prsnt . SPF . A85  37.5   35.9   26.6 
   RMF . PJ1 . Prsnt . SPF . A95  41.7   35.6   22.7 

  Parameter: ProductValues(prv) /
  SPF_L 55.46
  SPF_M 50.46
  SPF_P 36.00
  Other 19.43

  Table: HarvestCosts(mu,cs,sp)

  ! MU . CS -------------- Tree Species -----------
                    Pw    Pr    Pj    Sb    Sw    Bf    Ce   etc... 
   RMF . Harv    24.84 24.84 24.84 24.84 24.84 24.84 24.84 ...
   RMF . Stmp     0.59  0.59  3.44  3.44  3.44  3.44  3.44 ...
   RMF . Renew    6.00  6.00  4.30  4.30  4.30  4.30  4.30 
   RMF . Loading  2.40  2.40  2.40  2.40  2.40  2.40  2.40 

  Table: FutureCosts(mu,fu,ri,ac,cs)

  ! Sub-   --- Current Class --- 
  ! unit  Forest   Silv   Age           Cost
  !     . Unit  . Inten . Class         Factor
  ! Additional costs required to achieve silv standard

  RMF   . PJ1   . Intn1 . A20      500
  RMF   . PJ1   . Elit1 . A20      500
  RMF   . PJ1   . Elit2 . A20      500

  RMF   . PJ2   . Intn1 . A20      500
  RMF   . PJ2   . Elit1 . A20      500
  RMF   . PJ2   . Elit2 . A20      500


  Table: Fu_Seral(mu,fu,ser,level)

  ! - Forest Type: - 
  ! Sub-   ForUnit 
  ! unit .  Group   . Stage
                                 Lower   Upper
    RMF  .  PJ1     . PjMature      75    inf
    RMF  .  PJ1     . PjLate       105    inf

    RMF  .  PR1     . PwrMature     85    inf
    RMF  .  PR1     . PwrLate      135    inf
    RMF  .  PRW     . PwrMature     85    inf
    RMF  .  PRW     . PwrLate      135    inf
    RMF  .  PW1     . PwrMature     85    inf
    RMF  .  PW1     . PwrLate      135    inf