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 OPenMP issues in carchm #244

Merged

Conversation

jmaerz
Copy link
Collaborator

@jmaerz jmaerz commented Feb 17, 2023

Hi @TomasTorsvik and @JorgSchwinger , in connection to PR #243, I checked the OMP private statement in carchm. Indeed a number of local real values were not included (I am aware that loop indices are private by default, but it doesn't harm to be even more explicit) - probably most importantly also for the Si units: rrho. The fix is only related to carchm. In combination with the fix in #243, variations in DIC inventories during the first time steps disappear. I hope, no further local real value escaped my investigation. Upon request, I sort in the values in the OMP statement (for now I thought it is easier to see the changes). Issues with the sinking in OCPROD still remain (I guess, the easiest would be to un-OMP the settling to avoid race conditions for k versus kdonor).

@jmaerz jmaerz added the iHAMOCC Issue mainly concerns the iHAMOCC code base label Feb 17, 2023
@jmaerz jmaerz self-assigned this Feb 17, 2023
Copy link
Contributor

@TomasTorsvik TomasTorsvik left a comment

Choose a reason for hiding this comment

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

Thanks @jmaerz !
it seems that some of these variables were missing in the private statement.
I believe the convention is that the index of the first DO statement inside a OMP PARALLEL DO is always private by defaault, but I can't find the reference now. Still, I don't think there is any harm in explicitly declaring them as private.

@jmaerz jmaerz merged commit 74752f3 into NorESMhub:feature-hamocc_beyond-CMIP6 Feb 17, 2023
@jmaerz jmaerz deleted the fix-carchm-OpenMP branch November 23, 2023 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iHAMOCC Issue mainly concerns the iHAMOCC code base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants