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

removed use of Fortran fraction intrinsic from ocn diagnostics #5128

Merged

Conversation

philipwjones
Copy link
Contributor

The ocean surface layer averaging routine was using a Fortran fraction intrinsic incorrectly, so this replaces the intrinsic with code that computes a fraction correctly. Also did some reformatting for long lines and documenting variables. Because it removes the fraction intrinsic, it fixes another issue in which that instrinsic was not supported on the GPU by the Cray compiler on Crusher.

NOTE: This code computes variables that are never used except to compute surface-displaced density which is also currently not used (and is an expensive EOS calc). This makes this PR bfb but we might consider removing these expensive calculations if really not needed.

[bfb]
Fixes #5126
Fixes #5112

  the surface layer averaging routine was using a Fortran
  fraction intrinsic incorrectly, so replaced with code that
  computes a fraction correctly

  also did some reformatting for long lines and documenting
  variables
@philipwjones philipwjones added mpas-ocean bug fix PR BFB PR leaves answers BFB Cray Cray compiler related issues Crusher labels Aug 11, 2022
@philipwjones
Copy link
Contributor Author

Forgot to mention, I did verify manually that the fractions were computed correctly with this change and the new function appeared to be working as designed even if the results are never used. Used a simple QU240 test.

Copy link
Contributor

@mark-petersen mark-petersen left a comment

Choose a reason for hiding this comment

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

Passes nightly suite for gnu debug and intel debug, and matches previous bfb with gnu optimized. Thanks for the note on the surface displaced density. I'll take a look at that.

jonbob added a commit that referenced this pull request Aug 16, 2022
Remove use of Fortran fraction intrinsic from ocn diagnostics

The ocean surface layer averaging routine was using a Fortran fraction
intrinsic incorrectly, so this replaces the intrinsic with code that
computes a fraction correctly. Also did some reformatting for long lines
and documenting variables. Because it removes the fraction intrinsic, it
fixes another issue in which that instrinsic was not supported on the
GPU by the Cray compiler on Crusher.

Fixes #5126
Fixes #5112
[BFB]
@jonbob
Copy link
Contributor

jonbob commented Aug 16, 2022

Passes:

  • ERS.ne11_oQU240.WCYCL1850NS.chrysalis_intel
  • SMS_D_Ld3.T62_oQU120.CMPASO-IAF.chrysalis_intel
  • PEM_Ln9.ne30pg2_EC30to60E2r2.WCYCL1850.chrysalis_intel

merged to next

@jonbob jonbob merged commit d7d4ab1 into E3SM-Project:master Aug 17, 2022
@jonbob
Copy link
Contributor

jonbob commented Aug 17, 2022

merged to master

@philipwjones philipwjones deleted the philipwjones/mpas-ocean/frac-fix branch February 16, 2023 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFB PR leaves answers BFB bug fix PR Cray Cray compiler related issues Crusher mpas-ocean
Projects
None yet
3 participants