From 05c4369c6d612f8a805207fd2bedd54f90d150b4 Mon Sep 17 00:00:00 2001 From: Brett M Date: Tue, 28 Oct 2025 15:29:46 -0600 Subject: [PATCH 1/2] Possible incorrect equation reference in comments Fixes #56 --- R/fine_fuel_moisture_code.r | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/fine_fuel_moisture_code.r b/R/fine_fuel_moisture_code.r index b4508ec..0f6615f 100644 --- a/R/fine_fuel_moisture_code.r +++ b/R/fine_fuel_moisture_code.r @@ -46,7 +46,7 @@ fine_fuel_moisture_code <- function(ffmc_yda, temp, rh, ws, prec) { ) # The real moisture content of pine litter ranges up to about 250 percent, # so we cap it at 250 - wmo <- ifelse(wmo > 250, 250, wmo) + <- ifelse(wmo > 250, 250, wmo) # Eq. 4 Equilibrium moisture content from drying ed <- (0.942 * (rh^0.679) + (11 * exp((rh - 100) / 10)) + 0.18 * (21.1 - temp) * (1 - 1 / exp(rh * 0.115))) @@ -62,7 +62,7 @@ fine_fuel_moisture_code <- function(ffmc_yda, temp, rh, ws, prec) { ) # Eq. 6b Affect of temperature on drying rate x <- z * 0.581 * exp(0.0365 * temp) - # Eq. 8 + # Eq. 9 wm <- ifelse(wmo < ed & wmo < ew, ew - (ew - wmo) / (10^x), wmo) # Eq. 7a (ko) Log wetting rate at the normal temperature of 21.1 C z <- ifelse( @@ -73,7 +73,7 @@ fine_fuel_moisture_code <- function(ffmc_yda, temp, rh, ws, prec) { ) # Eq. 7b Affect of temperature on wetting rate x <- z * 0.581 * exp(0.0365 * temp) - # Eq. 9 + # Eq. 8 wm <- ifelse(wmo > ed, ed + (wmo - ed) / (10^x), wm) # Eq. 10 Final ffmc calculation ffmc1 <- (59.5 * (250 - wm)) / (FFMC_COEFFICIENT + wm) From 8d201e23867e41af893d0d6593468e2c373e0c9f Mon Sep 17 00:00:00 2001 From: Brett M Date: Wed, 29 Oct 2025 10:40:33 -0600 Subject: [PATCH 2/2] Update fine_fuel_moisture_code.r Mistaken deletion of an argument. --- R/fine_fuel_moisture_code.r | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/fine_fuel_moisture_code.r b/R/fine_fuel_moisture_code.r index 0f6615f..64419ee 100644 --- a/R/fine_fuel_moisture_code.r +++ b/R/fine_fuel_moisture_code.r @@ -46,7 +46,7 @@ fine_fuel_moisture_code <- function(ffmc_yda, temp, rh, ws, prec) { ) # The real moisture content of pine litter ranges up to about 250 percent, # so we cap it at 250 - <- ifelse(wmo > 250, 250, wmo) + wmo <- ifelse(wmo > 250, 250, wmo) # Eq. 4 Equilibrium moisture content from drying ed <- (0.942 * (rh^0.679) + (11 * exp((rh - 100) / 10)) + 0.18 * (21.1 - temp) * (1 - 1 / exp(rh * 0.115))) @@ -87,3 +87,4 @@ fine_fuel_moisture_code <- function(ffmc_yda, temp, rh, ws, prec) { .Deprecated("fine_fuel_moisture_code") return(fine_fuel_moisture_code(...)) } +