Skip to content

Conversation

@theweathermanda
Copy link

@theweathermanda theweathermanda commented Aug 23, 2025

TYPE: Bug fix

KEYWORDS: seg fault, diag_nwp2

SOURCE: Menda Chasteen

DESCRIPTION OF CHANGES:
Running with diag_nwp2 = 1 leads to a segmentation fault related to prematurely deallocating dz8w in start_em.F. This PR fixes the error by moving the deallocate statement to after the trad_fields call.

LIST OF MODIFIED FILES:
dyn_em/start_em.F

TESTS CONDUCTED:
The regression tests are all passing.

RELEASE NOTE: This PR fixes a seg fault error due to early deallocation of array dz8w for diag_nwp2=2 option in start_em.F.

Move DEALLOCATE(dz8w) to after the diag_nwp2 calculation routine. dz8w is called by this routine, leading to the following error when diag_nwp2 = 1:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
@dudhia dudhia changed the base branch from master to develop August 23, 2025 00:30
@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

Copy link
Collaborator

@islas islas left a comment

Choose a reason for hiding this comment

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

@theweathermanda Could you update your PR description to use the PR template?

@weiwangncar
Copy link
Collaborator

@theweathermanda I modified your PR message. Please see if there is anything you would like to change.

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