NCAR / NCAR/fire_behavior

Specific humidity vs mixing ratio in the Fuel Moisture Model (WRF-Fire/SFIRE bug)

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Initialization
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:

  1. Vapor pressure is calculated as

    Pᵥ = P Q / [ε + (1 − ε)Q]
    
  2. 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 Q2 with QV, and QV is defined as mixing ratio. Registry.EM_COMMON
  • The surface driver calls q2 the diagnostic 2 m mixing ratio. module_surface_driver.F
  • WRF passes grid%q2 directly 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 Q2 directly.

  • Online WRF continues passing grid%q2 directly.

  • 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:

  1. In the scientific correction PR, retain the public fire_q2 member and NetCDF variable for compatibility.
  2. Document it explicitly as “WRF Q2 convention: 2 m water-vapor mixing ratio.”
  3. Rename local and dummy variables within the fuel-moisture calculation to r2.
  4. Correct the vapor-pressure equation.
  5. Convert UFS specific humidity at the NUOPC boundary.
  6. Treat fire_q2 as a legacy interface name.
  7. Consider a coordinated fire_r2 rename 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.