Skip to content

Commit

Permalink
Merge pull request #2524 from GEOS-ESM/feature/mathomp4/unset-achar-nag
Browse files Browse the repository at this point in the history
Remove ESMF_HAS_ACHAR_BUG CMake and cpp macro, update to ESMA_cmake v3.37.0
  • Loading branch information
tclune authored Jan 18, 2024
2 parents 4f2a429 + 4d12114 commit eea9a68
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 22 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Replaced RC=STATUS plus `_VERIFY(RC)` in `Base_Base_implementation.F90` with just `_RC` in line with our new convention.
- Updated CI to use Open MPI 5.0.0 for GNU
- Enable Ninja for CI builds of MAPL
- Removed use of `ESMF_HAS_ACHAR_BUG` CMake option and code use in `MAPL_Config.F90`. Testing has shown that with ESMF 8.6 (which is
now required), NAG no longer needs this workaround.

### Fixed

Expand Down
5 changes: 0 additions & 5 deletions base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(${this} PRIVATE OpenMP::OpenMP_Fortran)
endif ()

# Workaround for bizarre switch in ESMF
if (ESMF_HAS_ACHAR_BUG)
set_source_files_properties(MAPL_Config.F90 PROPERTIES COMPILE_DEFINITIONS ESMF_HAS_ACHAR_BUG)
endif()

if(DISABLE_GLOBAL_NAME_WARNING)
target_compile_options (${this} PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:${DISABLE_GLOBAL_NAME_WARNING}>)
endif()
Expand Down
28 changes: 12 additions & 16 deletions base/MAPL_Config.F90
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,9 @@ module MAPL_ConfigMod

character, parameter :: BLK = achar(32) ! blank (space)
character, parameter :: TAB = achar(09) ! TAB
#if defined(ESMF_HAS_ACHAR_BUG)
character, parameter :: EOL = achar(12) ! end of line mark (cr)
#else
character, parameter :: EOL = achar(10) ! end of line mark (newline)
#endif
character, parameter :: EOB = achar(00) ! end of buffer mark (null)
character, parameter :: NUL = achar(00) ! what it says
character, parameter :: EOL = achar(10) ! end of line mark (newline)
character, parameter :: EOB = achar(00) ! end of buffer mark (null)
character, parameter :: NUL = achar(00) ! what it says

contains

Expand Down Expand Up @@ -97,7 +93,7 @@ end function MAPL_ConfigCreate
!
subroutine MAPL_ConfigSetAttribute_real64( config, value, label, rc )
use, intrinsic :: iso_fortran_env, only: REAL64
!
!
type(ESMF_Config), intent(inout) :: config
real(kind=REAL64), intent(in) :: value
character(len=*), intent(in), optional :: label
Expand Down Expand Up @@ -243,7 +239,7 @@ end subroutine MAPL_ConfigSetAttribute_real64
!
subroutine MAPL_ConfigSetAttribute_real32( config, value, label, rc )
use, intrinsic :: iso_fortran_env, only: REAL32
!
!
type(ESMF_Config), intent(inout) :: config
real(kind=REAL32), intent(in) :: value
character(len=*), intent(in), optional :: label
Expand Down Expand Up @@ -376,17 +372,17 @@ subroutine MAPL_ConfigSetAttribute_real32( config, value, label, rc )
end subroutine MAPL_ConfigSetAttribute_real32

!------------------------------------------------------------------------------
!>
!>
! Set a 4-byte integer _value_ in the _config_ object.
!
!
! The arguments are:
!- **config**: Already created `ESMF_Config` object.
!- **value**: Integer value to set.
!- **label**: Identifying attribute label.
!- **rc**: Return code; equals `ESMF_SUCCESS` if there are no errors.
!
!
! **Private name**: call using ESMF_ConfigSetAttribute()`.
!
!
subroutine MAPL_ConfigSetAttribute_int32( config, value, label, rc )
use, intrinsic :: iso_fortran_env, only: INT32
!
Expand Down Expand Up @@ -600,15 +596,15 @@ subroutine MAPL_ConfigSetAttribute_reals32( config, value, label, rc )
end subroutine MAPL_ConfigSetAttribute_reals32

!------------------------------------------------------------------------------
!>
!>
! Set a string _value_ in the _config_ object.
!
!
! The arguments are:
!- **config**: Already created `ESMF_Config` object.
!- **value**: String value to set.
!- **label**: Identifying attribute label.
!- **rc**: Return code; equals `ESMF_SUCCESS` if there are no errors.
!
!
subroutine MAPL_ConfigSetAttribute_string(config, value, label, rc)
type(ESMF_Config), intent(inout) :: config
character(len=*), intent(in) :: value
Expand Down
2 changes: 1 addition & 1 deletion components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ESMA_env:
ESMA_cmake:
local: ./ESMA_cmake
remote: ../ESMA_cmake.git
tag: v3.36.0
tag: v3.37.0
develop: develop

ecbuild:
Expand Down

0 comments on commit eea9a68

Please sign in to comment.