The Simple Forest Model Generator

by Tom Moore , October 16, 2024

Originally written June 29, 2022, Updated October 16, 2024

Raised Image

The ForestModel language is used within Patchworks™ to describe stand dynamics. ForestModel is highly expressive and can represent a very broad range of forest conditions, silvicultural practices and disturbance events. The MatrixBuilder tools combines a ForestModel recipe with a forest inventory input to create an input matrix for the Patchwork model. Due to the scope of the language elements writing a ForestModel file by hand would be challenging, but the Simple Forest Model Generator simplifies this process.

The Simple Forest Model Generator is a Microsoft™ Excel workbook application. The workbook contains a set of pre-formatted worksheets and Visual Basic macros that assist in the entry and partial validation of a variety of modeling data. There are worksheet types for collecting yield data, lookup tables, constants, attribute, succession and silvicultural treatments and responses.

The workbook application makes use of the best features of Excel: data validation, easy copy and paste, access to cell formulas for power users. Once the information is filled in a simple click on a menu item calls a VBA macro to gather the information and write out a ForestModel XML file.

The C5 sample dataset that is distributed with Patchworks contains a copy of the Simple Forest Model Generator that is populated with a small sample model, and a copy of this workbook is linked below. This workbook has been updated with the latest ForestModel features, and is a good starting point for developing your own model.

This workbook will continue to get updates as new features are added and bugs are fixed. Check back here often for the latest version, especially prior to beginning a new project.

It is possible to upgrade older workbooks to the latest version, in order to take advantage of newer features. To do so:

  1. Close all Excel workbooks.
  2. Download and open the latest ForestModel workbook.
  3. Press Alt+F8 to show the "View Macros" dialog.
  4. Select the "UpgradeModel" macro and click on the "Run" button.
  5. In the dialog provided, select the name of the workbook that you wish to upgrade, and also the name for the newly upgraded workbook. The new workbook must not already exist.
  6. Click on the "Upgrade" button. The upgrade process may take several minutes, do not click on any windows during this process.
After the upgrade process has completed then save the new workbook, and close the other workbooks.

Download Version October 16, 2024

Cumulative update history

DateChange
October 16, 2024Better handling of inline yield curves with more than 32K entries
July 17, 2024Add options to specify exec tasks, change input workbook metadata
June 28, 2024Add options to override the default output file names
March 18, 2024Add middle constants section
March 2024remove hidden named ranges
October 17, 2023Add succession renewal value repeat expression
June 24, 2022Refactor inputs for initial constants and include xml fragment at beginning
June 14, 2022Refactor repeat attribute columns, add repeat for inputs, succession, features, products
June 8, 2022Add select repeat clause around attributes
June 8, 2022Table references with files use the filename instead of an entity
March 2, 2022If treatment name is an expression then do not add quotes
February 27, 2022Fixed upgrade and select repeat clause
January 27, 2022Add treatment repeat clause
January 16, 2022fix some issues caused by upgrade macro
November 26, 2021Add upgrade macro