next up previous contents
Next: The .stnd File Up: Program Execution & Data Previous: The .trl File
Go to: SmartForest Home Printer-friendly: sf-impl.pdf


The .slf File

The slfReader function parses the .slf file and stores the data in the standInfoArray variable. Each set of stand information in the .slf file is composed of four records. Each record is designated with an A, B, C or D in the file. The program, therefore, has four different data types to hold each record type. The data types are called StandInfo_A, StandInfo_B, StandInfo_C and StandInfo_D where each holds its respective designated record. Every set of these records along with the stand's identifier is stored in a StandInfo structure. The standInfoArray is simply an array of pointers to StandInfo structures along with a count of how many items are stored in the array.

The format of an A-record in the .slf file is:

Never Data Field Purpose
Used Type Name  
X char * fvsFName The name of the file in FVS that generated the .slf file.
X char * dataFlag It's not clear what this field is. The value NoPointData is found here.
X Node * variants A linked list of strings (strings' length is at most 2.)

The format of a B-record in the .slf file is:

Never Data Field Purpose
Used Type Name  
  int inventoryYear  
  int latitude  
  int longitude  
X char * locationCode  
X char * habitatType  
  int originYear  
  int aspect aspect in degrees
  int slope percentage
  int elevation elevation in hundreds of feet
  float basalAreaFactor a negative value is read as inverse of large-tree fixed plot
      size in acres
  float inversePlotSize inverse of fixed plot size in acres
X float breakPtDBH in inches
X int numOfPlots  
X int numOfNSPlots number of non-stockable plots
X float sampleWeight stand sampling weight or size (usually acres) used to
      compute weighted average yield tables and other weighted
      averages among some set of stands.
  int stockable stockable percent.
X char * diaTransCode diameter growth translation code as defined for FVS
X int diaMeasurePd diameter growth measurement period (in years)
X char * htTransCode height growth translation code as defined for FVS
X int htMeasurePd height growth measurement period (in years)
X int mortalMeasurePd mortality measurement period (in years)
  float maxBasalArea maximum basal area
  int maxDensityIndex maximum stand density index
  int species site species code
  int index site index
X int type modes type code
  int region physiographic region code
  int forestType forest type code

The format of a C-record in the .slf file is:

Never Data Field Purpose
Used Type Name  
X char ** key  
X char ** value  
  int count The number of key-value pairs

The C-record is clearly a dictionary. The dictionary is never used, however.

The format of a D-record in the .slf file is:

Never Data Field Purpose
Used Type Name  
X char ** addFile  
  int count The number of files in the array

The StandInfo* structures are all used solely as an interface to the .slf file (really only the StandInfo_B structure is used.) The data in these structures is used to populate the stands variable in standInterface.c. The stands variable is then used for the data abstractions for the application. Note that the stands variable is not populated until after the .stnd file is read (see Section 4.2.5). The parsing of the .slf file only creates the StandInfo* structures that are used as the file interface. With that understanding, the table below is presented here for completeness.

stands[] Field Name Initialized by StandInfo_B Field
(Application Abstraction) (File Interface)
inventoryYear inventoryYear
origin_year originYear
aspect aspect
slope slope
elevation elevation
app inversePlotSize
stockable stockable
max_basal_area maxBasalArea
density maxDensityIndex
site species
index index
physiographic_region region
forest_type forestType


next up previous contents
Next: The .stnd File Up: Program Execution & Data Previous: The .trl File
Matthew S. Davis
2002-08-07