Skip to content

Synchronize WRF-CFBM restarts and update atmospheric forcing interpolation - #2446

Merged
weiwangncar merged 3 commits into
wrf-model:release-v4.8.1from
NCAR:cfbm-restart-current
Nov 21, 2026
Merged

weiwangncar merged 3 commits into
wrf-model:release-v4.8.1from
NCAR:cfbm-restart-current

Conversation

@masih-e

@masih-e masih-e commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Synchronize WRF-CFBM restarts and update atmospheric forcing interpolation

TYPE: enhancement

KEYWORDS: WRF, CFBM, restart, coupling, interpolation, winds, MPI

SOURCE: Masih Eghdami, Pedro Jimenez, Maria Frediani. OpenAI Codex assisted.

DESCRIPTION OF CHANGES:

Problem:

WRF-CFBM runs need restart capability for long simulations.

Horizontal interpolation also needs to distinguish physical source-domain bounds from array memory bounds. Using memory bounds alone can include invalid outer boundary storage when interpolating winds, temperature, moisture forcing, and surface roughness. Interpolating three-dimensional winds near MPI patch edges additionally requires current neighboring wind and height profiles.

Solution:

  • Set the effective CFBM restart flag from WRF and write CFBM checkpoints when WRF requests a restart checkpoint. Require restart_interval = -1 in namelist.cfbm to disable independent CFBM checkpoint scheduling. Reject a CFBM-only restart request when WRF is not restarting. CFBM continues to read and write its own fire checkpoint files.
  • Pass full WRF memory arrays and separate inclusive physical mass-grid bounds (ids:ide-1, jds:jde-1) to the CFBM horizontal interpolation routines. Apply this interface to surface roughness, temperature, humidity, pressure, precipitation, and winds. This excludes invalid outer storage while retaining exchanged MPI halos within the physical domain.
  • Update the three-dimensional wind interpolation call to pass fire tiles, terrain height, and the mandatory hinterp_opt argument. The merged CFBM implementation supports nearest-neighbor and bilinear horizontal interpolation and uses the shared Calc_fire_wind routine for vertical interpolation.
  • Add a halo exchange for u_phy, v_phy, and z_at_w before interpolating three-dimensional winds, including the first step after restarting. - Pin both the CFBM submodule and optional-external configuration to merged CFBM commit f456cd5f00ce1ea42e28486f6d970599e3626272. This includes the changes in NCAR/fire_behavior#71. The dependency defaults to wind_vinterp_opt = 0 (three-dimensional winds) and fire_wind_height = 1.0 m; explicit namelist settings override these defaults.

ISSUE:
Related to NCAR/fire_behavior#71, now merged. No separate WRF issue is linked.

LIST OF MODIFIED FILES:

M Registry/Registry.EM_COMMON
M arch/OptionalExternals_cfbm.cfg
M dyn_em/module_first_rk_step_part1.F
M dyn_em/start_em.F
M phys/fire_behavior

TESTS CONDUCTED:

Validation was conducted on Derecho.

Four offline configurations covering both horizontal interpolation and wind-source options produced 152 exact before/after saved-field comparisons. Native WRF-CFBM runs completed in serial, four-rank MPI, and four-rank/four-thread MPI/OpenMP configurations. Across 90 fire output files, no missing or nonfinite values were found in the eight checked forcing fields (uf, vf, fz0, zsf, fire_t2, fire_q2, fire_psfc, and fire_rain). These runs used GNU 12.4 and Cray MPICH 8.1.29.

RELEASE NOTE:

WRF-CFBM runs now have synchronized restart capability. Atmospheric forcing interpolation uses explicit physical source-domain bounds, and three-dimensional wind profiles are exchanged across MPI patch boundaries before interpolation.

masih-e and others added 3 commits November 4, 2026 14:12
Restrict roughness, temperature, humidity, surface pressure, accumulated
rain, and 10 m wind interpolation to valid WRF mass cells. Retain MPI
halo cells inside the physical domain and preserve fire-grid tile bounds.

Pass WRF domain bounds to the updated CFBM wind interface. Enforce
coupled restart ownership and report contradictory restart settings.

AI assistance: OpenAI Codex assisted with implementation and code
review.

Co-authored-by: Pedro A. Jimenez <jimenez@ucar.edu>
Co-authored-by: Maria Frediani <frediani@ucar.edu>
Keep source memory bounds separate from inclusive physical mass-grid
bounds when interpolating surface forcing and winds onto the fire grid.
Let the shared CFBM interpolators exclude outer storage while retaining
valid exchanged MPI neighbors.

Pin OptionalExternals_cfbm.cfg and the fire_behavior submodule to CFBM
1bab409a46dff9839fc482f8ec6f4fbbcaf9e653, which provides the updated
horizontal interface, shared vertical wind calculation, and 1 m default
fire wind height.

Validation: focused serial and OpenMP interpolation tests passed after
the guard cleanup. Before that cleanup, this shared-domain caller passed
60-second serial, four-rank MPI, and four-rank/four-thread runs, with all
eight checked forcing fields finite across 90 fire outputs. Offline
before/after checks matched exactly in four configurations.
Update OptionalExternals_cfbm.cfg and the fire_behavior submodule pointer
to f456cd5f00ce1ea42e28486f6d970599e3626272, the merged CFBM PR wrf-model#71 commit
on develop.

The merged source tree is identical to the previously pinned PR revision
1bab409a46dff9839fc482f8ec6f4fbbcaf9e653; this changes only the references.
@masih-e
masih-e requested review from a team as code owners November 6, 2026 22:36

@dudhia dudhia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to make sure hash is updated as we don't use manage externals in WRF now. I think it is.

@weiwangncar
weiwangncar merged commit 8a914ab into wrf-model:release-v4.8.1 Nov 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants