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

Removal of non-standard extensions #110

Merged
merged 2 commits into from
Apr 12, 2022

Conversation

marshallward
Copy link
Member

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.

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
Copy link

codecov bot commented Apr 11, 2022

Codecov Report

Merging #110 (ba730fb) into dev/gfdl (7a147ad) will decrease coverage by 0.00%.
The diff coverage is 16.66%.

❗ Current head ba730fb differs from pull request most recent head 5725522. Consider uploading reports for the commit 5725522 to get more accurate results

@@             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     
Impacted Files Coverage Δ
src/core/MOM_open_boundary.F90 20.08% <0.00%> (ø)
src/diagnostics/MOM_diagnostics.F90 75.57% <ø> (+0.06%) ⬆️
src/user/ISOMIP_initialization.F90 0.00% <0.00%> (ø)
src/user/dumbbell_initialization.F90 0.00% <0.00%> (ø)
src/user/seamount_initialization.F90 0.00% <0.00%> (ø)
src/tracer/MOM_tracer_hor_diff.F90 35.22% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a147ad...5725522. Read the comment docs.

Copy link
Member

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

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

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.

@marshallward
Copy link
Member Author

Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/15225 ✔️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants