Removal of non-standard extensions#110
Conversation
This patch removes any non-standard compiler extensions from the source and replaces them with equivalent standard statements. Specifically, this allows the code to be compiled with GCC using the -std=f2018 flag. None of these changes impact GFDL testing, since all extensions were supported by GNU, Intel, and PGI, but at least offer some greater assurance that the code will compile and behave more predicably on as-yet untested platforms. The specific changes are outlined below: * `loc() == 0` tests have been replaced with `associated()` where appropriate. (If field is not a pointer then it was removed, since using loc() was already a very bad idea.) * the `dfloat()` type conversion was replaced with `real()`. For consistency with existing MOM code, the `kind` remains unspecified. Technically this could represent an answer change, but was only applied to nz, which is always a very small integer. * `abort()` is an extension, and is replaced with the compliant (and admittedly platform-dependent) `error stop` statement.
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #110 +/- ##
============================================
- Coverage 28.76% 28.76% -0.01%
============================================
Files 248 248
Lines 72984 72982 -2
============================================
- Hits 20991 20990 -1
+ Misses 51993 51992 -1
Continue to review full report at Codecov.
|
Hallberg-NOAA
left a comment
There was a problem hiding this comment.
This all looks perfectly sensible. @marshallward go ahead and merge this in when it rises to the top of the queue after it passes the TC and pipeline testing.
|
Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/15225 ✔️ |
This patch removes any non-standard compiler extensions from the source
and replaces them with equivalent standard statements.
Specifically, this allows the code to be compiled with GCC using the
-std=f2018 flag.
None of these changes impact GFDL testing, since all extensions were
supported by GNU, Intel, and PGI, but at least offer some greater
assurance that the code will compile and behave more predicably on
as-yet untested platforms.
The specific changes are outlined below:
loc() == 0tests have been replaced withassociated()whereappropriate. (If field is not a pointer then it was removed, since
using loc() was already a very bad idea.)
the
dfloat()type conversion was replaced withreal().For consistency with existing MOM code, the
kindremainsunspecified. Technically this could represent an answer change, but
was only applied to nz, which is always a very small integer.
abort()is an extension, and is replaced with the compliant (andadmittedly platform-dependent)
error stopstatement.