Skip to content

Commit

Permalink
Merge branch 'mark-petersen/ocn/fortran-2008-compliance' into next (PR
Browse files Browse the repository at this point in the history
…#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]
  • Loading branch information
jonbob committed Mar 9, 2022
2 parents ef5532e + d20e5ce commit 21139b5
Showing 1 changed file with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,23 @@ module ESMF_BaseMod
ESMF_STATE_BUSY = ESMF_Status(5), &
ESMF_STATE_INVALID = ESMF_Status(6)

!------------------------------------------------------------------------------
!
integer, parameter :: &
ESMF_KIND_I1 = selected_int_kind(2), &
ESMF_KIND_I2 = selected_int_kind(4), &
ESMF_KIND_I4 = selected_int_kind(9), &
ESMF_KIND_I8 = selected_int_kind(18), &
ESMF_KIND_R4 = selected_real_kind(3,25), &
ESMF_KIND_R8 = selected_real_kind(6,45), &
ESMF_KIND_C8 = selected_real_kind(3,25), &
ESMF_KIND_C16 = selected_real_kind(6,45)

!------------------------------------------------------------------------------
!
type ESMF_Pointer
private
integer*8 :: ptr
integer(kind=ESMF_KIND_I8) :: ptr
end type

type(ESMF_Pointer), parameter :: ESMF_NULL_POINTER = ESMF_Pointer(0), &
Expand All @@ -95,18 +107,6 @@ module ESMF_BaseMod
ESMF_DATA_LOGICAL = ESMF_DataType(3), &
ESMF_DATA_CHARACTER = ESMF_DataType(4)

!------------------------------------------------------------------------------

integer, parameter :: &
ESMF_KIND_I1 = selected_int_kind(2), &
ESMF_KIND_I2 = selected_int_kind(4), &
ESMF_KIND_I4 = selected_int_kind(9), &
ESMF_KIND_I8 = selected_int_kind(18), &
ESMF_KIND_R4 = selected_real_kind(3,25), &
ESMF_KIND_R8 = selected_real_kind(6,45), &
ESMF_KIND_C8 = selected_real_kind(3,25), &
ESMF_KIND_C16 = selected_real_kind(6,45)

!------------------------------------------------------------------------------

type ESMF_DataValue
Expand Down Expand Up @@ -160,7 +160,7 @@ module ESMF_BaseMod
!
type ESMF_BasePointer
private
integer*8 :: base_ptr
integer(kind=ESMF_KIND_I8) :: base_ptr
end type

integer :: global_count = 0
Expand Down Expand Up @@ -950,7 +950,7 @@ subroutine ESMF_SetPointer(ptype, contents, rc)
!
! !ARGUMENTS:
type(ESMF_Pointer) :: ptype
integer*8, intent(in) :: contents
integer(kind=ESMF_KIND_I8), intent(in) :: contents
integer, intent(out), optional :: rc

!
Expand Down Expand Up @@ -985,7 +985,7 @@ subroutine ESMF_SetNullPointer(ptype, rc)
!
!EOP
! !REQUIREMENTS:
integer*8, parameter :: nullp = 0
integer(kind=ESMF_KIND_I8), parameter :: nullp = 0

ptype%ptr = nullp
if (present(rc)) rc = ESMF_SUCCESS
Expand All @@ -999,7 +999,7 @@ end subroutine ESMF_SetNullPointer
function ESMF_GetPointer(ptype, rc)
!
! !RETURN VALUE:
integer*8 :: ESMF_GetPointer
integer(kind=ESMF_KIND_I8) :: ESMF_GetPointer

! !ARGUMENTS:
type(ESMF_Pointer), intent(in) :: ptype
Expand Down

0 comments on commit 21139b5

Please sign in to comment.