Skip to content

Allow terrain coverage smaller than domain extent - near fire area only - #7

Open
mefrediani wants to merge 3 commits into
mainfrom
agent/pr6-clipped-coverage
Open

Allow terrain coverage smaller than domain extent - near fire area only#7
mefrediani wants to merge 3 commits into
mainfrom
agent/pr6-clipped-coverage

Conversation

@mefrediani

@mefrediani mefrediani commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Allow the high-resolution fuel and terrain rasters to cover only the area where fire behavior will be simulated rather than the complete WRF domain.

Changes

  • Track valid fuel and DEM coverage during raster reprojection.
  • Use high-resolution data only where fuel and terrain coverage overlap.
  • Set NFUEL_CAT to the selected fuel table no-fuel category outside the joint coverage.
  • Interpolate atmospheric HGT_M to the complete fire grid and use it as the finite ZSF background outside high-resolution terrain coverage.
  • Calculate DZDXF and DZDYF from the merged ZSF field.
  • Set both gradients to zero where the finite-difference stencil crosses the high-resolution coverage boundary, preventing the artificial terrain transition from affecting fire spread.
  • Evaluate map factors in row chunks and restrict projection work to the applicable coverage bounds.
  • Add regression tests and test documentation for terrain interpolation, joint coverage, planar gradients, and boundary masking.

Validation

  • /glade/work/frediani/casper/anaconda3/envs/py314/bin/python -m unittest discover -v
  • All 4 regression tests pass.
  • Python compilation checks pass for the modified modules and tests.
  • A copied production geo_em.d02 completed with a 4804 x 4804 fire grid using clipped fuel and DEM coverage. All four output fields were finite, terrain gradients were nonzero within valid coverage, and the result was accepted by the downstream prepare_wrf_fire.py dry run for the corresponding nested wrfinput_d02.

@mefrediani
mefrediani marked this pull request as ready for review August 26, 2026 03:45
@mefrediani
mefrediani requested a review from mkavulich August 26, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant