Skip to content

Fixed the volc diags bounds crash#2353

Open
saneku wants to merge 2 commits into
wrf-model:masterfrom
saneku:Fixed-the-VOLC_DIAGS-bounds-crash
Open

Fixed the volc diags bounds crash#2353
saneku wants to merge 2 commits into
wrf-model:masterfrom
saneku:Fixed-the-VOLC_DIAGS-bounds-crash

Conversation

@saneku

@saneku saneku commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Fixed volcanic diagnostics bounds crash and minor volcanic transport fixes.

TYPE: bug fix

KEYWORDS: volcanic run, chem_opt=402, volcanic diagnostics, wet scavenging, emissions

SOURCE: Alexander Ukhov (KAUST)

DESCRIPTION OF CHANGES:

Problem:
Several volcanic diagnostic explicit interfaces declared volc_diags with a hard-coded third dimension of 1:9. The Registry-generated volcanic diagnostics package is sized by num_volc_diags, and p_ash_fall resolves to index 10. Debug builds with bounds checking therefore crashed in module_vash_settling when writing volc_diags(i,j,p_ash_fall). Optimized builds did not expose the bounds violation consistently.

Solution:
Replaced hard-coded volc_diags(...,1:9) declarations with volc_diags(...,num_volc_diags), and imported num_volc_diags where needed.

Additional minor fixes:

  • Updated volcanic emission cell-area calculation to use map factors per active eruption grid cell.
  • Ensured convective wet scavenging density is initialized before use in module_ctrans_grell.

LIST OF MODIFIED FILES:
M chem/dry_dep_driver.F
M chem/emissions_driver.F
M chem/mechanism_driver.F
M chem/module_ctrans_grell.F
M chem/module_vash_settling.F
M chem/module_volc_chem.F

TESTS CONDUCTED:

  • Ran volcanic WRF-Chem simulation with chem_opt=402 using a debug build with bounds checking. The previous p_ash_fall / volc_diags bounds crash no longer occurs.
  • Ran volcanic WRF-Chem simulation with chem_opt=402 using a non-debug optimized build. The simulation also runs successfully.

RELEASE NOTE:
Fixed a volcanic diagnostics bounds crash for chem_opt=402 and included minor volcanic emissions / scavenging
fixes.

@weiwangncar

Copy link
Copy Markdown
Collaborator

The regression test results:

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           57
Number of Simulations  : 158           150        0
Number of Comparisons  : 95           86        0

Failed Simulations are: 
None
Which comparisons are not bit-for-bit: 
None

@saneku saneku marked this pull request as ready for review June 15, 2026 11:43
@saneku saneku requested a review from a team as a code owner June 15, 2026 11:43
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.

3 participants