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

Fix non-standard declarations of 8-byte integers in ESMF in MPAS-Framework #4825

Merged
merged 1 commit into from
Mar 10, 2022

Conversation

mark-petersen
Copy link
Contributor

@mark-petersen mark-petersen commented Mar 9, 2022

This PR fixes non-standard declarations of 8-byte integers in ESMF_BaseMod.F90. See the original PR for MPAS at MPAS-Dev/MPAS-Model#959.

The ESMF_BaseMod module contains several non-standard declarations of 8-byte
integer variables. These were identified using the GNU compiler:

   ESMF_BaseMod.F90:75:20:

      75 |           integer*8 :: ptr
         |                    1
   Error: GNU Extension: Nonstandard type declaration INTEGER*8 at (1)

and also using the NAG compiler:

   Error: ESMF_BaseMod.F90, line 75: KIND value (8) does not specify a valid representation method
   Error: ESMF_BaseMod.F90, line 163: KIND value (8) does not specify a valid representation method

Since the ESMF_BaseMod module already defines a parameter for selecting 8-byte
integers, namely, ESMF_KIND_I8, all that is needed is to move the definition of
this (and related) parameters to appear earlier in the module and to then use

   integer(kind=ESMF_KIND_I8)

rather than

   integer(kind=8)

[BFB]

see MPAS-Dev/MPAS-Model#959

This PR fixes non-standard declarations of 8-byte integers in ESMF_BaseMod.F90.

The ESMF_BaseMod module contains several non-standard declarations of 8-byte
integer variables. These were identified using the GNU compiler:

   ESMF_BaseMod.F90:75:20:

      75 |           integer*8 :: ptr
         |                    1
   Error: GNU Extension: Nonstandard type declaration INTEGER*8 at (1)

and also using the NAG compiler:

   Error: ESMF_BaseMod.F90, line 75: KIND value (8) does not specify a valid representation method
   Error: ESMF_BaseMod.F90, line 163: KIND value (8) does not specify a valid representation method

Since the ESMF_BaseMod module already defines a parameter for selecting 8-byte
integers, namely, ESMF_KIND_I8, all that is needed is to move the definition of
this (and related) parameters to appear earlier in the module and to then use

   integer(kind=ESMF_KIND_I8)

rather than

   integer(kind=8)
@mark-petersen
Copy link
Contributor Author

This passes MPAS-Ocean nightly regression suite with gnu and intel, both optimized and debug, and compares bfb with master.

@mark-petersen mark-petersen added the BFB PR leaves answers BFB label Mar 9, 2022
@xylar
Copy link
Contributor

xylar commented Mar 9, 2022

This makes me wonder if it's worth trying to update the ESMF files to match the latest ESMF release at some point. Surely, these files are years and years out of date.

I guess this is probably a can of worms we don't want to open.

@rljacob
Copy link
Member

rljacob commented Mar 9, 2022

This is a standalone, Fortran implementation of ESMF alarms and time management. It was never officially part of ESMF. The alternative is to build and link against ESMF itself. There's also a version in E3SM/share/esmf_wrf_timemgr

@philipwjones
Copy link
Contributor

The ESMF time manager was probably the most expensive gold-plated time manager ever developed ;^) AFAIK, there have been no significant changes to that part of ESMF since it was first created, so this extracted standalone version should still be sufficient.

Copy link
Contributor

@philipwjones philipwjones left a comment

Choose a reason for hiding this comment

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

This is a straightforward and necessary change. Approve based on source code review and Mark's testing.

jonbob added a commit that referenced this pull request Mar 9, 2022
…#4825)

Fix non-standard declarations of 8-byte integers in ESMF in MPAS-Framework

This PR fixes non-standard declarations of 8-byte integers in
ESMF_BaseMod.F90. See the original PR for MPAS at
MPAS-Dev/MPAS-Model#959. The ESMF_BaseMod module contains several non-
standard declarations of 8-byte integer variables. These were identified
using the GNU and NAG compilers.

[BFB]
@jonbob
Copy link
Contributor

jonbob commented Mar 9, 2022

passes sanity testing on chrysalis - merged to next

@mark-petersen
Copy link
Contributor Author

FYI, also passes

SMS_D.T62_oQU120_ais20.MPAS_LISIO_TEST.cori-haswell_intel
SMS_D.T62_oQU120_ais20.MPAS_LISIO_TEST.cori-haswell_gnu

@jonbob jonbob merged commit 3af35f3 into master Mar 10, 2022
@jonbob
Copy link
Contributor

jonbob commented Mar 10, 2022

merged to master

@jonbob jonbob deleted the mark-petersen/ocn/fortran-2008-compliance branch March 10, 2022 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFB PR leaves answers BFB mpas-framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants