nfdrs

package module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package nfdrs computes the fire danger indices of the US National Fire Danger Rating System, version 2016.

The system produces four indices for a fuel model and the daily fire weather:

  • the spread component (SC), the forward rate of spread of the head fire;
  • the energy release component (ERC), the energy release per unit area of the flaming front;
  • the burning index (BI), a combination of the spread component and the energy release component;
  • the ignition component (IC), the chance that a firebrand starts a fire.

The subpackages compute the fuel moisture that the indices need. The nelson package computes the dead fuel moisture. The gsi package computes the live fuel moisture. This package holds the fuel models and the index equations.

The FuelModel type holds the parameters of a fuel model. The package has the five standard NFDRS2016 fuel models: V, W, X, Y, and Z. The Compute method takes the fuel moisture, the drought, the wind, and the slope, then it returns the four indices.

The Driver type is the stateful driver. It takes the hourly weather, runs the fuel moisture models, then it computes the indices. Use Compute for the pure index equations, or Driver for the full system from the raw weather.

The equations are a port of the iCalcIndexes function of the firelab/NFDRS4 C++ program, which follows the National Fire Danger Rating System of 2016.

References:

  • Bradshaw, L.S.; Deeming, J.E.; Burgan, R.E.; Cohen, J.D. 1984. The 1978 National Fire-Danger Rating System: technical documentation. General Technical Report INT-169. Ogden, UT: USDA Forest Service.
  • Jolly, W.M.; Freeborn, P.H.; and others. 2019. Simplified fuel models and improved live and dead fuel moisture for the US National Fire Danger Rating System. (The NFDRS2016 fuel models V, W, X, Y, and Z.)
  • Andrews, P.L. 2018. The Rothermel surface fire spread model and associated developments: a comprehensive explanation. General Technical Report RMRS-GTR-371. Fort Collins, CO: USDA Forest Service.

Index

Constants

This section is empty.

Variables

View Source
var (
	// FuelModelV is grass (based on the fire behavior model GR2).
	FuelModelV = FuelModel{
		Code: 'V', Name: "Grass",
		Load1: 0.1, Load10: 0, Load100: 0, Load1000: 0,
		LoadHerb: 1, LoadWoody: 0, LoadDrought: 0,
		SAV1: 2000, SAV10: 109, SAV100: 30, SAV1000: 8, SAVHerb: 2000, SAVWoody: 1500,
		HeatContent: 8000, ExtinctionMoisture: 15, Depth: 1, WindReductionFactor: 0.6, MaxSpreadComponent: 108,
	}
	// FuelModelW is grass-shrub (based on the fire behavior model GS2).
	FuelModelW = FuelModel{
		Code: 'W', Name: "Grass-Shrub",
		Load1: 0.5, Load10: 0.5, Load100: 0, Load1000: 0,
		LoadHerb: 0.6, LoadWoody: 1, LoadDrought: 1,
		SAV1: 2000, SAV10: 109, SAV100: 30, SAV1000: 8, SAVHerb: 2000, SAVWoody: 1500,
		HeatContent: 8000, ExtinctionMoisture: 15, Depth: 1.5, WindReductionFactor: 0.4, MaxSpreadComponent: 62,
	}
	// FuelModelX is brush (based on the fire behavior model SH9).
	FuelModelX = FuelModel{
		Code: 'X', Name: "Brush",
		Load1: 4.5, Load10: 2.45, Load100: 0, Load1000: 0,
		LoadHerb: 1.55, LoadWoody: 7, LoadDrought: 2.5,
		SAV1: 2000, SAV10: 109, SAV100: 30, SAV1000: 8, SAVHerb: 2000, SAVWoody: 1500,
		HeatContent: 8000, ExtinctionMoisture: 25, Depth: 4.4, WindReductionFactor: 0.4, MaxSpreadComponent: 104,
	}
	// FuelModelY is timber (based on the fire behavior model TL1).
	FuelModelY = FuelModel{
		Code: 'Y', Name: "Timber",
		Load1: 2.5, Load10: 2.2, Load100: 3.6, Load1000: 10.16,
		LoadHerb: 0, LoadWoody: 0, LoadDrought: 5,
		SAV1: 2000, SAV10: 109, SAV100: 30, SAV1000: 8, SAVHerb: 2000, SAVWoody: 1500,
		HeatContent: 8000, ExtinctionMoisture: 25, Depth: 0.6, WindReductionFactor: 0.2, MaxSpreadComponent: 5,
	}
	// FuelModelZ is slash (based on the fire behavior model SB2).
	FuelModelZ = FuelModel{
		Code: 'Z', Name: "Slash",
		Load1: 4.5, Load10: 4.25, Load100: 4, Load1000: 4,
		LoadHerb: 0, LoadWoody: 0, LoadDrought: 7,
		SAV1: 2000, SAV10: 109, SAV100: 30, SAV1000: 8, SAVHerb: 2000, SAVWoody: 1500,
		HeatContent: 8000, ExtinctionMoisture: 25, Depth: 1, WindReductionFactor: 0.4, MaxSpreadComponent: 19,
	}
)

The five standard NFDRS2016 fuel models. The parameters are from the National Wildfire Coordinating Group fuel model parameter table (https://www.wildfire.gov/page/nfdrs-fuel-model-parameters), which follows Jolly and others (2019). Every model shares the same surface-area-to-volume ratios and the same heat content. The drought fuel load adds to all four dead fuel load classes.

Functions

This section is empty.

Types

type Conditions

type Conditions struct {
	// Dead fuel moisture by time-lag class (percent).
	Moisture1, Moisture10, Moisture100, Moisture1000 float64
	// Live fuel moisture (percent).
	MoistureHerb, MoistureWoody float64

	// KBDI is the Keetch-Byram Drought Index (0 to 800).
	KBDI float64
	// KBDIThreshold is the drought index above which the drought fuel load
	// starts. It is a site setting.
	KBDIThreshold float64

	// WindSpeed is the wind speed at the 20-foot height. The model reduces it to
	// the midflame height with the wind reduction factor of the fuel model.
	WindSpeed firewx.MilesPerHour
	// SlopeClass is the slope steepness class, 1 to 5. A value outside this
	// range makes Compute return zero indices.
	SlopeClass int

	// FuelTemperature is the fuel surface temperature for the ignition
	// component. Use the temperature of the Nelson one-hour stick.
	FuelTemperature firewx.Celsius

	// Curing inputs for the herbaceous load transfer. The model ignores them
	// when the fuel model has no herbaceous load.
	GSI, GSIMax, GreenupThreshold float64
}

Conditions holds the fuel moisture and the weather for an index computation. The moistures are percentages of the dry weight.

type Config

type Config struct {
	// FuelModel is the fuel model of the site.
	FuelModel FuelModel
	// Latitude is the site latitude in decimal degrees, for the day length.
	Latitude float64
	// SlopeClass is the slope steepness class, 1 to 5.
	SlopeClass int
	// KBDIThreshold is the drought index above which the drought fuel load
	// starts.
	KBDIThreshold float64
	// MeanAnnualPrecip is the mean annual precipitation, for the drought index.
	MeanAnnualPrecip firewx.Inches
	// AnnualHerb sets whether the herbaceous fuel is annual.
	AnnualHerb bool

	// RegObsHour is the hour of the daily observation in local standard time.
	// The driver updates the live fuel moisture and the drought index at this
	// hour.
	RegObsHour int
	// LSTOffset is the fixed offset from UTC that defines local standard time.
	LSTOffset time.Duration
}

Config holds the site settings for a Driver.

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

Driver runs the National Fire Danger Rating System over a series of hourly weather observations. It advances the Nelson dead fuel moisture sticks every hour. It advances the live fuel moisture and the drought index once per day, at the regular observation hour. It computes the four indices every hour.

A Driver is not safe for concurrent use.

func NewDriver

func NewDriver(cfg Config) *Driver

NewDriver returns a Driver for the site settings. The Nelson sticks and the live fuel moisture models start from their default initial states.

func (*Driver) DeadMoistures

func (d *Driver) DeadMoistures() (mc1, mc10, mc100, mc1000 firewx.Percent)

DeadMoistures returns the four dead fuel moisture contents from the most recent update, as percentages.

func (*Driver) Indices

func (d *Driver) Indices() Indices

Indices returns the four indices from the most recent update.

func (*Driver) SetState added in v0.4.0

func (d *Driver) SetState(s DriverState) error

SetState restores the Driver from a saved state. The Driver keeps its Config, so construct it with the same Config first. SetState returns an error if the schema version does not match or a sub-model is absent.

func (*Driver) State added in v0.4.0

func (d *Driver) State() DriverState

State returns the full state of the Driver. Marshal it to JSON to persist the Driver between runs.

func (*Driver) Update

func (d *Driver) Update(o firewx.Obs) bool

Update advances the system by one hourly observation. It returns false if the observation lacks the temperature, the humidity, the solar radiation, or the precipitation that the Nelson sticks need.

type DriverState added in v0.4.0

type DriverState struct {
	SchemaVersion int `json:"schema_version"`

	Stick1    *nelson.Stick    `json:"stick_1hr"`
	Stick10   *nelson.Stick    `json:"stick_10hr"`
	Stick100  *nelson.Stick    `json:"stick_100hr"`
	Stick1000 *nelson.Stick    `json:"stick_1000hr"`
	Herb      *gsi.Model       `json:"herb"`
	Woody     *gsi.Model       `json:"woody"`
	KBDI      simple.KBDIState `json:"kbdi"`

	// Dead fuel moisture and fuel temperature from the most recent update.
	MC1      float64 `json:"mc_1hr"`
	MC10     float64 `json:"mc_10hr"`
	MC100    float64 `json:"mc_100hr"`
	MC1000   float64 `json:"mc_1000hr"`
	FuelTemp float64 `json:"fuel_temp_c"`

	// Live fuel moisture and drought from the most recent daily update.
	GSIValue  float64 `json:"gsi"`
	MCHerb    float64 `json:"mc_herb"`
	MCWood    float64 `json:"mc_woody"`
	KBDIValue float64 `json:"kbdi_value"`

	// Daily accumulators over the current local standard day.
	HaveDay    bool    `json:"have_day"`
	DayMinTemp float64 `json:"day_min_temp_f"`
	DayMaxTemp float64 `json:"day_max_temp_f"`
	DayMinRH   float64 `json:"day_min_rh"`
	DayPrecip  float64 `json:"day_precip_in"`

	Last     time.Time `json:"last"`
	HaveLast bool      `json:"have_last"`
	Indices  Indices   `json:"indices"`
}

DriverState is the full serializable state of a Driver. It holds the state of the four Nelson sticks, the two live fuel moisture models, the drought index, and the driver's own daily accumulators and last outputs.

A DriverState marshals to JSON and back with an exact round trip, so a caller can persist a Driver between runs and resume without the long spin-up that the 1000-hour stick needs from a cold start. The caller must construct the Driver with the same Config, then restore the state.

The sub-model pointers alias the Driver's live models. Marshal the state before the next call to Update.

type FuelModel

type FuelModel struct {
	// Code is the letter of the fuel model, for example 'Y'.
	Code rune
	// Name describes the fuel model.
	Name string

	// Dead fuel loads by time-lag class (tons/acre).
	Load1, Load10, Load100, Load1000 float64
	// Live fuel loads (tons/acre).
	LoadHerb, LoadWoody float64
	// LoadDrought is the extra dead fuel load at the maximum drought
	// (tons/acre). The drought index adds it to the four dead classes.
	LoadDrought float64

	// Surface-area-to-volume ratios (1/ft).
	SAV1, SAV10, SAV100, SAV1000 float64
	SAVHerb, SAVWoody            float64

	// HeatContent is the low heat of combustion (BTU/lb).
	HeatContent float64
	// ExtinctionMoisture is the dead fuel moisture of extinction (percent).
	ExtinctionMoisture float64
	// Depth is the fuel bed depth (ft).
	Depth float64
	// WindReductionFactor scales the 20-foot wind to the midflame wind.
	WindReductionFactor float64
	// MaxSpreadComponent is the spread component above which every ignition
	// becomes a reportable fire. The ignition component uses it.
	MaxSpreadComponent float64
}

FuelModel holds the parameters of an NFDRS fuel model. The loads are in tons per acre. The surface-area-to-volume ratios are in reciprocal feet. The heat content is in British thermal units per pound. The extinction moisture is a percentage. The depth is in feet.

func (FuelModel) Compute

func (fm FuelModel) Compute(c Conditions) Indices

Compute returns the four fire danger indices for the fuel model under the conditions. It is a port of the iCalcIndexes function of firelab/NFDRS4.

Compute returns zero indices for an invalid input, which matches firelab/NFDRS4. The slope class must be 1 to 5, the wind speed must not be negative, and the fuel bed depth must be more than zero.

type Indices

type Indices struct {
	// SpreadComponent is the forward rate of spread of the head fire, related
	// to feet per minute.
	SpreadComponent float64 `json:"spread_component"`
	// EnergyReleaseComponent is the energy release per unit area of the flaming
	// front.
	EnergyReleaseComponent float64 `json:"energy_release_component"`
	// BurningIndex combines the spread component and the energy release
	// component.
	BurningIndex float64 `json:"burning_index"`
	// IgnitionComponent is the chance that a firebrand starts a fire, from 0 to
	// 100.
	IgnitionComponent float64 `json:"ignition_component"`
}

Indices holds the four fire danger indices of the National Fire Danger Rating System.

Directories

Path Synopsis
Package gsi implements the Growing Season Index live fuel moisture model.
Package gsi implements the Growing Season Index live fuel moisture model.
Package nelson implements the Nelson (2000) dead fuel moisture model.
Package nelson implements the Nelson (2000) dead fuel moisture model.
Package rothermel implements the Rothermel surface fire spread model.
Package rothermel implements the Rothermel surface fire spread model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL