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 reproducibility issues for certain irregular layout when running in repro 64bit mode #57

Merged
merged 4 commits into from
Dec 2, 2024

Conversation

JosephMouallem
Copy link
Contributor

SHiELD RTS cases fail to reproduce when using irregular PE layouts. The problem occurred exclusively in 64-bit repro mode, while 32-bit repro and both 32/64-bit debug modes were unaffected. This PR resolves the issue, ensuring reproducibility for scripts utilizing the TKE PBL scheme when compiled with a lower optimization level (AVX_LEVEL=-march=core-avx-i). Reproducibility has been verified for C48 tests on both C5 and C6.

Copy link
Contributor

@bensonr bensonr left a comment

Choose a reason for hiding this comment

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

This looks good for now, but we should consider updating the constants sprinkled throughout the code to use proper precision extensions, e.g. lines 368-390.

@laurenchilutti laurenchilutti merged commit b68d4c0 into NOAA-GFDL:main Dec 2, 2024
2 checks passed
ust3(i) = ustar(i)**3.
wscale(i)=(ust3(i)+wfac*vk*wst3(i)*sfcfrac)**h1
tem = gotvx(i,1)*sflux(i)*hpbl(i)
wscale(i)=(ustar(i)**3+wfac*vk*tem*sfcfrac)**h1
Copy link
Contributor

Choose a reason for hiding this comment

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

Good optimization!!

@lharris4
Copy link
Contributor

lharris4 commented Dec 2, 2024

Great detective work @JosephMouallem @laurenchilutti . This extra effort is much appreciated.

In the future, should we add a condition on new codes that constants are properly defined to avoid this problem in the future? Is this something that potentially a 'lint'-type source code checker could catch?

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.

4 participants