-
Notifications
You must be signed in to change notification settings - Fork 225
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
Fixes an integer-kind mismatch in MOM_random, seed_from_time() #1113
Fixes an integer-kind mismatch in MOM_random, seed_from_time() #1113
Conversation
- gcc/8.3.0 issued `Error: Integer too big for its kind` reported in feedback on PR #1111. The intent was to assume kind=4 in these calculations but apparently our compilers were promoting `mod(dy + 32*(mo + 13*yr), 2147483648)` to kind=8. There were two mistakes in the expression: - the use of `2147483648` in the `mod` is not representable with kind=4; - the `mod` produces negative values and should have been a `modulo`. - This commit reduces the range of the results by one number on the positive side and removes all the negatives.
Codecov Report
@@ Coverage Diff @@
## dev-master-candidate-2020-05-15 #1113 +/- ##
==================================================================
Coverage ? 46.07%
==================================================================
Files ? 214
Lines ? 69379
Branches ? 0
==================================================================
Hits ? 31964
Misses ? 37415
Partials ? 0 Continue to review full report at Codecov.
|
I know this isn't the only place where this is being violated, but we really ought to stop assuming that I'd recommend using |
I can confirm it builds with gnu/8.3.0. |
@marshallward , it looks like If you want to support earlier Fortran versions, you can use Does the MOM6 development team have a position on minimal Fortran version required for model development? I don't see this at https://mom6.readthedocs.io/en/dev-gfdl/index.html or https://github.com/NOAA-GFDL/MOM6/wiki. |
@klindsay28 I recall last we discussed this, we found FMS had already moved onto 2008, and so we've opted to do the same. (We're already using I agree we need to clarify our target standard somewhere in the docs. |
Error: Integer too big for its kind
reported infeedback on PR dev/master candidate 2020-05-15 #1111. The intent was to assume kind=4 in these
calculations but apparently our compilers were promoting
mod(dy + 32*(mo + 13*yr), 2147483648)
to kind=8. There were twomistakes in the expression:
2147483648
in themod
is not representable with kind=4;mod
produces negative values and should have been amodulo
.positive side and removes all the negatives.
@gustavo-marques Could you test this patch for me? It passes everything at our end but so did the original PR.