Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust do loop bounds in a2b_ord2 to prevent reading from uninitialized memory #349

Merged

Conversation

DusanJovic-NOAA
Copy link
Contributor

Description

This PR fixes occasional model crashes in debug mode caused by floating-point exception in subroutine a2b_ord2 in model/a2b_edge.F90. See issue #346 for details.

In subroutine a2b_ord2 do loop bounds are changed to avoid reading from uninitialized elements of qin array.

Intel Fortran compiler flag (-init=snan,arrays) has been added to debug flags.

Fixes #346

How Has This Been Tested?

Several debug ufs-weather-model regression tests have been run on Hera and few other NOAA systems successfully. I will run full regression test on Hera.

Checklist:

Please check all whether they apply or not

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

…tialized elements of qin array

Input array qin in a2b_ord2 routine is declared as qin(is-ng:ie+ng,js-ng:je+ng) but only elements in
(is-1:ie+1, js-1:je+1) range are initialized in a calling routine, for example pin array in adv_pe routine in dyn_core.F90
Copy link
Contributor

@XiaqiongZhou-NOAA XiaqiongZhou-NOAA left a comment

Choose a reason for hiding this comment

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

Loop i-, j-dimensions of qin are consistent with that in dyn_core.F90 now.

Copy link
Contributor

@lharris4 lharris4 left a comment

Choose a reason for hiding this comment

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

This should be fine. Do keep an eye out for potential artifacts at nested and regional domain boundaries.

@zach1221
Copy link

@bensonr testing on WM PR-2362 is complete. Can you please merge this cubed-sphere PR?

@jkbk2004
Copy link

@laurenchilutti This pr can be merged.

@laurenchilutti laurenchilutti merged commit 1720f85 into NOAA-GFDL:dev/emc Jul 16, 2024
@DusanJovic-NOAA DusanJovic-NOAA deleted the dycore_a2b_ord2_bugfix branch July 16, 2024 13:40
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.

None yet

7 participants