Specific humidity vs mixing ratio in the Fuel Moisture Model (WRF-Fire/SFIRE bug)
Nobody has claimed this yet.
- Dominant language
- Fortran
- Stars
- 11
- Forks
- 17
- Avg merge
- 21h 12m
- Merged PRs (30d)
- 1
Description
The paper (doi: 10.1016/j.procs.2012.04.119) and source code indicate that WRF-SFIRE has a humidity-convention bug, which CFBM inherited during the port.
Evidence from the papers
Mandel et al. (2012), says that fuel equilibrium moisture is driven by temperature and relative humidity from WRF, but it does not document how WRF Q2 is converted to relative humidity. See Section 7 of the stable arXiv copy.
A related paper by the WRF-SFIRE developers provides the missing detail. Kochanski et al. (2012) states both of the following:
-
Vapor pressure is calculated as
Pᵥ = P Q / [ε + (1 − ε)Q] -
The input is WRF
Q2, described as “water vapor mixing ratio.”
These statements appear on pages 1 and 3 of Kochanski et al. (2012).
They are mathematically inconsistent.
For specific humidity q:
e = q p / [ε + (1 − ε)q]
For mixing ratio r:
e = r p / (ε + r)
The published equation is therefore the specific-humidity equation, while the paper explicitly says that Q2 is mixing ratio.
Evidence from WRF-SFIRE and WRF
WRF 4.8.1 confirms that Q2 is mixing ratio:
- The Registry associates
Q2withQV, andQVis defined as mixing ratio. Registry.EM_COMMON - The surface driver calls
q2the diagnostic 2 m mixing ratio. module_surface_driver.F - WRF passes
grid%q2directly into the fire-moisture calculation without conversion.
The WRF-SFIRE implementation then applies the specific-humidity equation directly to that mixing ratio. module_fr_fire_phys.F
I also traced the CFBM Git history. The equation in CFBM originates in the earlier WRF-SFIRE fuel-moisture source. The CFBM port preserved both the equation and the q2 argument. This mismatch was inherited rather than introduced during the CFBM port.
The WRF-SFIRE Registry itself contains the same contradiction: it labels q2_old as specific humidity even though that array receives WRF Q2, which is mixing ratio.
Numerical effect
Using mixing ratio directly in the specific-humidity equation overestimates vapor pressure and relative humidity.
For p = 90,000 Pa and WRF r₂ = 0.006 kg kg⁻¹:
Correct mixing-ratio equation: e = 859.872611 Pa
Current WRF-SFIRE/CFBM calculation: e = 865.013103 Pa
Relative bias: 0.5978%
The relative vapor-pressure bias increases with humidity:
| Mixing ratio | Relative vapor-pressure bias |
|---|---|
| 0.006 | 0.60% |
| 0.010 | 0.99% |
| 0.020 | 1.98% |
The bias propagates through relative humidity, wetting and drying equilibria, dead-fuel moisture, and eventually rate of spread. The response will be nonlinear when fuel moisture is near an equilibrium boundary or extinction threshold.
Recommended CFBM convention
CFBM should use the WRF convention internally and treat the field as 2 m water-vapor mixing ratio, r₂.
That approach provides the clearest compatibility path:
-
Standalone WRF input continues reading
Q2directly. -
Online WRF continues passing
grid%q2directly. -
The fuel-moisture equation changes to:
e = r₂ p / (ε + r₂) -
The NUOPC adapter converts UFS specific humidity before storing it:
r₂ = q₂/(1 − q₂) -
The WRF-file NUOPC component must convert WRF mixing ratio to specific humidity before exporting a field advertised as
inst_spec_humid_height2m:q₂ = r₂/(1 + r₂)
This requires no changes in UFSATM or the UFS mediator. The conversions belong in the CFBM NUOPC adapters.
Renaming fire_q2
fire_r2 is the better scientific name under this convention. An immediate derived-type rename would break source compatibility with WRF 4.8.1 because WRF directly assigns grid%fire_state%fire_q2.
I recommend a staged change:
- In the scientific correction PR, retain the public
fire_q2member and NetCDF variable for compatibility. - Document it explicitly as “WRF Q2 convention: 2 m water-vapor mixing ratio.”
- Rename local and dummy variables within the fuel-moisture calculation to
r2. - Correct the vapor-pressure equation.
- Convert UFS specific humidity at the NUOPC boundary.
- Treat
fire_q2as a legacy interface name. - Consider a coordinated
fire_r2rename later with matching WRF, restart, NetCDF, and downstream-analysis changes.
This should be a separate scientific-interface PR. It is also a baseline blocker for any case with active fuel-moisture evolution. A focused unit test can establish thermodynamic correctness before the later small-domain coupled tests.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the CFBM fuel-moisture calculation and NUOPC adapters; the issue identifies these entry points but gives no repository paths. Review existing unit-test coverage and define completion around the documented WRF mixing-ratio convention, adapter boundaries, fire_q2 compatibility, and a focused thermodynamic test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fortran
- Domain
- backend, testing-qa
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100