Removal of non-standard extensions #110
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 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
kind
remainsunspecified. 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 stop
statement.