Skip to content

Conversation

@jackbartlett20
Copy link

Prevent floating point exception in phys/module_mp_radar.F when debugging with -D related to new variables in UDM scheme.

TYPE: bug fix

KEYWORDS: debug, radar, microphysics, UDM, -D

SOURCE: Jack Bartlett (Imperial College London)

DESCRIPTION OF CHANGES:
Problem:
Lines 225 and 226 in phys/module_mp_radar.F trigger a floating point exception when debugging with option -D and using any microphysics scheme which calls radar_init except the UDM scheme because xam_h and xbm_h are not initialised in any other microphysics scheme.

Solution:
Initialise xam_h and xbm_h at 0 and check if they have been given a value greater than 0 before finding their reciprocals.

ISSUE: For use when this PR closes an issue.
Fixes #2248

LIST OF MODIFIED FILES: list of changed files (use git diff --name-status master to get formatted list)
phys/module_mp_radar.F

TESTS CONDUCTED:
Only tested by trying mp_physics=8 with debugging option -D and the new fixes (which previously triggered a fpe).

Problem: Lines 225 and 226 in phys/module_mp_radar.F trigger a floating point exception when debugging with option -D and using any microphysics scheme which calls radar_init except the UDM scheme.

Solution: Initialise xam_h and xbm_h at 0 and check if they have been given a value greater than 0 before inverting them.

Resolves wrf-model#2248
@jackbartlett20 jackbartlett20 requested a review from a team as a code owner September 24, 2025 11:04
@weiwangncar
Copy link
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

@islas islas changed the base branch from master to develop October 21, 2025 23:16
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.

Floating point exception in phys/module_mp_radar.F with debugging option -D

2 participants