hffmc: Hourly Fine Fuel Moisture Code

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/hffmc.r


hffmc is used to calculate hourly Fine Fuel Moisture Code (FFMC) and is based on a calculation routine first described in detail by Van Wagner (1977) and which has been updated in minor ways by the Canadian Forest Service to have it agree with the calculation methodology for the daily FFMC (see fwi). In its simplest typical use this current routine calculates a value of FFMC based on a series of uninterrupted hourly weather observations of screen level (~1.4 m) temperature, relative humidity, 10 m wind speed, and 1-hour rainfall. This implementation of the function includes an optional time.step input which is defaulted to one hour, but can be reduced if sub-hourly calculation of the code is needed. The FFMC is in essence a bookkeeping system for moisture content and thus it needs to use the last time.step's value of FFMC in its calculation as well. This function could be used for either one weather station or for multiple weather stations.





A dataframe containing input variables of hourly weather observations. It is important that variable names have to be the same as in the following list, but they are case insensitive. The order in which the input variables are entered is not important.

temp (required) Temperature (centigrade)
rh (required) Relative humidity (%)
ws (required) 10-m height wind speed (km/h)
prec (required) 1-hour rainfall (mm)
hr (optional) Hourly value to calculate sub-hourly ffmc
bui (optional) Daily BUI value for the computation of hourly FWI. It is required when hourlyFWI=TRUE.

Typically this dataframe also contains date and hour fields so outputs can be associated with a specific day and time, however these fields are not used in the calculations. If multiple weather stations are being used, a weather station ID field is typically included as well, though this is simply for bookkeeping purposes and does not affect the calculation.


Initial FFMC. At the start of calculations at a particular station there is a need to provide an estimate of the FFMC in the previous timestep; this is because the FFMC is, in essence, a bookkeeping system for moisture. If no estimate of previous hour's FFMC is available the function will use default value, ffmc_old=85. When using the routine to calculate hourly FFMC at multiple stations the ffmc_old argument can also accept a vector with the same number of weather stations.


Is the time (in hours) between the previous value of FFMC and the current time at which we want to calculate a new value of the FFMC. When not specified it will take on a default value of time.step=1.


Optional for whether time step between two observations is calculated. Default is FALSE, no calculations. This is used when time intervals are not uniform in the input.


Whether the computation is iterative or single step, default is TRUE. When batch=TRUE, the function will calculate hourly or sub-hourly FFMC for one weather station over a period of time iteratively. If multiple weather stations are processed, an additional "id" column is required in the input weatherstream to label different stations, and the data needs to be sorted by date/time and "id". If batch=FALSE, the function calculates only one time step base on either the previous hourly FFMC or the initial start value.


Optional for the computation of hourly ISI, FWI, and DSR. Default is FALSE. While hourlyFWI=TRUE, daily BUI is required for the computation of FWI.


The hourly FFMC is very similar in its structure and calculation to the Canadian Forest Fire Weather Index System's daily FFMC (fwi) but has an altered drying and wetting rate which more realistically reflects the drying and wetting of a pine needle litter layer sitting on a decaying organic layer. This particular implementation of the Canadian Forest Fire Danger Rating System's hourly FFMC provides for a flexible time step; that is, the data need not necessarily be in time increments of one hour. This flexibility has been added for some users who use this method with data sampled more frequently that one hour. We do not recommend using a time step much greater than one hour. An important and implicit assumption in this calculation is that the input weather is constant over the time step of each calculation (e.g., typically over the previous hour). This is a reasonable assumption for an hour; however it can become problematic for longer periods. For brevity we have referred to this routine throughout this description as the hourly FFMC.

Because of the shortened time step, which can lead to more frequent calculations and conversion between moisture content and the code value itself, we have increased the precision of one of the constants in the simple formula that converts litter moisture content to the 'Code' value. This is necessary to avoid a potential bias that gets introduced during extremely dry conditions. This is simply a change in the precision at which this constant is used in the equation and is not a change to the standard FFMC conversion between moisture and code value (which is referred to as the FF-scale).

The calculation requires the previous hour's FFMC as an input to the calculation of the current hour's FFMC; this is because the routine can be thought of as a bookkeeping system and needs to know the amount of moisture being held in the fuel prior to any drying or wetting in the current period. After each hour's calculation that newly calculated FFMC simply becomes the starting FFMC in the next hour's calculation. At the beginning of the calculations at a station this previous hours FFMC must be estimated. It is typical to use a value of 85 when this value cannot be estimated more accurately; this code value corresponds to a moisture content of about 16% in typical pine litter fuels.


hffmc returns a vector of hourly or sub-hourly FFMC values, which may contain 1 or multiple elements. Optionally when hourlyFWI=TRUE, the function also output a data.frame contains input weatherstream as well as the hourly or sub-hourly FFMC, ISI, FWI, and DSR.


Xianli Wang, Mike Wotton, Alan Cantin, Brett Moore, and Mike Flannigan


Van Wagner, C.E. 1977. A method of computing fine fuel moisture content throughout the diurnal cycle. Environment Canada, Canadian Forestry Service, Petawawa Forest Experiment Station, Chalk River, Ontario. Information Report PS-X-69. http://cfs.nrcan.gc.ca/pubwarehouse/pdfs/25591.pdf

See Also

fbp, fwi, hffmcRaster


# show the data format:
# (1)hffmc default: 
# Re-order the data by year, month, day, and hour:
test_hffmc<-test_hffmc[with(test_hffmc, order(yr,mon,day,hr)),]
# Because the test data has 24 hours input variables 
# it is possible to calculate the hourly FFMC chronically 
# through multiple days(with the default initial ffmc_old=85):
# (2) Calculate FFMC for multiple stations:
# Calculate hourly FFMC with only one initial 
# value (ffmc_old=85), but multiple weather stations. 
# Sort the input by date/time and the station id:
# Add weather station id:
#check the data:
# With multiple initial FFMC (ffmc_old) as a vector: 
test_hffmc$ffmc02<- hffmc(test_hffmc,ffmc_old = sample(70:100,10, replace=TRUE),batch=TRUE)
# One time step assuming all records are from different 
# weather stations: 
# (3) output all hourly FWI System variables:
test_hffmc<-test_hffmc[with(test_hffmc,    order(yr,mon,day,hr)),]
# this will not run: warning message requesting for daily BUI
# (4) Calculate time steps in case the time intervals are 
# not uniform:
# with or without calc.step, hffmc is going to generate
# different FFMC values.
# without calculating time step (default):
# with calc.step=TRUE, time.step=1 is applied to 
# only the first record, the rests would be calculated:

Example output

Loading required package: rgdal
Loading required package: sp
rgdal: version: 1.2-10, (SVN revision 673)
 Geospatial Data Abstraction Library extensions to R successfully loaded
 Loaded GDAL runtime: GDAL 1.10.1, released 2013/08/26
 Path to GDAL shared files: /usr/share/gdal/1.10
 Loaded PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 480]
 Path to PROJ.4 shared files: (autodetected)
WARNING: no proj_defs.dat in PROJ.4 shared files
 Linking to sp version: 1.2-3 
Loading required package: raster
Loading required package: foreach
Loading required package: data.table

Attaching package: 'data.table'

The following object is masked from 'package:raster':


Loading required package: spatial.tools
Loading required package: parallel
Loading required package: iterators
    yr mon day hr temp rh  ws prec
1 2001   7  12  0 16.5 75 5.0    0
2 2001   7  12  1 15.5 80 3.3    0
3 2001   7  12  2 15.0 97 5.5    0
4 2001   7  12  3 14.8 93 7.4    0
5 2001   7  12  4 13.5 95 6.1    0
6 2001   7  12  5 14.0 94 6.5    0
      yr mon day hr temp  rh   ws prec ffmc_default id
1   2001   7  12  0 16.5  75  5.0    0     84.85927  1
25  2001   7  13  0 16.8  92  8.7    0     79.81525  2
49  2001   7  14  0 17.3  91  2.5    0     83.22640  3
73  2001   7  15  0 18.8  91  7.2    0     70.35593  4
97  2001   7  16  0 19.3 100  8.1    0     78.71421  5
121 2001   7  17  0 20.0  94 14.1    0     79.85574  6
Warning message:
In hffmc(test_hffmc, hourlyFWI = TRUE) :
  Daily BUI is required to calculate hourly FWI
 [1] 84.71464 83.47647 82.71540 81.93461 81.32430 81.17964 82.03626 82.87154
 [9] 84.31357 85.66876 86.66545 87.43255 88.25535 73.98864 75.72249 76.46587
[17] 76.84539 77.41909 77.41909 77.47113
 [1] 84.71464 83.47647 82.71540 81.93461 81.32430 81.17964 83.42769 84.07594
 [9] 86.37334 87.39358 88.11006 88.64611 89.27191 74.65322 77.81334 78.92583
[17] 79.12879 79.50947 79.38089 79.38089

cffdrs documentation built on July 1, 2020, 6:04 p.m.