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

Fix uninitialized variables for GCC 13 #96

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

mathomp4
Copy link
Member

@mathomp4 mathomp4 commented Apr 26, 2024

NOTE: View changes with whitespace off:

https://github.com/GEOS-ESM/GFDL_atmos_cubed_sphere/pull/96/files?w=1

as my editor cleans up trailing spaces.


This PR fixes an issue found by @tclune and @atrayano in their AIST work and in my work with GCC 13.

The issue GCC 13 found was that because these variables that control FMS diagnostic use in FV3 were not being set code like this:

           if( idiag%id_te>0 ) then
               used = send_data(idiag%id_te, teq, fv_time)
           endif

was being triggered. I guess Intel must set uninit integers to zero, but GCC 13 does not. So, when memory space is shifted enough, things like idiag%id_te could be randomly greater than zero. This then triggers the if-block and send_data will only work if diag_manager_init is called. This is not done in FV3 and you end up with:

FATAL from PE    31: diag_manager_mod::send_data_3d: diag_manager NOT initialized

I will test this along with GEOS-ESM/FVdycoreCubed_GridComp#280 with both Intel and GCC to make sure it is zero diff.

@mathomp4 mathomp4 added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Apr 26, 2024
@mathomp4 mathomp4 self-assigned this Apr 26, 2024
@mathomp4 mathomp4 requested a review from a team April 26, 2024 15:25
@mathomp4 mathomp4 marked this pull request as ready for review April 26, 2024 16:39
@mathomp4 mathomp4 merged commit 4bac7bb into geos/main Apr 29, 2024
10 checks passed
@mathomp4 mathomp4 deleted the hotfix/mathomp4/fix-uninit-gcc13 branch April 29, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 diff The changes in this pull request have verified to be zero-diff with the target branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant