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

Auto GitFlow - main β†’ develop #2297

Merged
merged 7 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.40.3] - 2023-08-03

### Changed

- Update `components.yaml`
- ESMA_cmake v3.31.1 (Fixes for NAG)

### Fixed

- Undoing previous workaround for NAG + `MAPL_Config.F90` in v2.40.1 which was a workaround was not portable to Linux. Instead, this uses changes in ESMA_cmake v3.31.1 for flags with NAG.
- Updated `FindESMF.cmake` file to match that of ESMF v8.5.0

## [2.40.2] - 2023-08-01

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif ()

project (
MAPL
VERSION 2.40.2
VERSION 2.40.3
LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF

# Set the possible values of build type for cmake-gui
Expand Down
5 changes: 5 additions & 0 deletions base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ 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
119 changes: 24 additions & 95 deletions base/MAPL_Config.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,29 @@ module MAPL_ConfigMod
module procedure :: MAPL_ConfigSetAttribute_string
end interface

integer, parameter :: LSZ = max (1024,ESMF_MAXPATHLEN) ! Maximum line size
integer, parameter :: MSZ = 256 ! Used to size buffer; this is
! usually *less* than the number
! of non-blank/comment lines
! (because most lines are shorter
! then LSZ)

integer, parameter :: NBUF_MAX = MSZ*LSZ ! max size of buffer
integer, parameter :: NATT_MAX = NBUF_MAX/64 ! max # attributes;
! assumes an average line
! size of 16, the code
! will do a bound check

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

contains

function MAPL_ConfigCreate(unusable, rc) result(config)
Expand All @@ -42,7 +65,7 @@ function MAPL_ConfigCreate(unusable, rc) result(config)
integer, optional, intent(out) :: rc

character, parameter :: EOB = achar(00) !! end of buffer mark (null)
#if defined(ESMF_HAS_ACHAR_BUG) | defined(__NAG_COMPILER_BUILD)
#if defined(__NAG_COMPILER_BUILD) && defined(__DARWIN)
character, parameter :: EOL = achar(12) !! end of line mark (cr)
#else
character, parameter :: EOL = achar(10) !! end of line mark (newline)
Expand Down Expand Up @@ -79,29 +102,6 @@ subroutine MAPL_ConfigSetAttribute_real64( config, value, label, rc )
character(len=*), intent(in), optional :: label
integer, intent(out), optional :: rc
!
!integer, parameter :: LSZ = 256 ! Maximum line size
integer, parameter :: LSZ = max (1024,ESMF_MAXPATHLEN) ! Maximum line size
integer, parameter :: MSZ = 256 ! Used to size buffer; this is
! usually *less* than the number
! of non-blank/comment lines
! (because most lines are shorter
! then LSZ)

integer, parameter :: NBUF_MAX = MSZ*LSZ ! max size of buffer
integer, parameter :: NATT_MAX = NBUF_MAX/64 ! max # attributes;
! assumes an average line
! size of 16, the code
! will do a bound check

character, parameter :: BLK = achar(32) ! blank (space)
character, parameter :: TAB = achar(09) ! TAB
#if defined(ESMF_HAS_ACHAR_BUG) | defined(__NAG_COMPILER_BUILD)
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(len=ESMF_MAXSTR) :: Iam = 'MAPL_ConfigSetAttribute_int32'

Expand Down Expand Up @@ -248,29 +248,6 @@ subroutine MAPL_ConfigSetAttribute_real32( config, value, label, rc )
character(len=*), intent(in), optional :: label
integer, intent(out), optional :: rc
!
!integer, parameter :: LSZ = 256 ! Maximum line size
integer, parameter :: LSZ = max (1024,ESMF_MAXPATHLEN) ! Maximum line size
integer, parameter :: MSZ = 256 ! Used to size buffer; this is
! usually *less* than the number
! of non-blank/comment lines
! (because most lines are shorter
! then LSZ)

integer, parameter :: NBUF_MAX = MSZ*LSZ ! max size of buffer
integer, parameter :: NATT_MAX = NBUF_MAX/64 ! max # attributes;
! assumes an average line
! size of 16, the code
! will do a bound check

character, parameter :: BLK = achar(32) ! blank (space)
character, parameter :: TAB = achar(09) ! TAB
#if defined(ESMF_HAS_ACHAR_BUG) | defined(__NAG_COMPILER_BUILD)
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(len=ESMF_MAXSTR) :: Iam = 'MAPL_ConfigSetAttribute_int32'

Expand Down Expand Up @@ -417,29 +394,6 @@ subroutine MAPL_ConfigSetAttribute_int32( config, value, label, rc )
character(len=*), intent(in), optional :: label
integer, intent(out), optional :: rc
!
!integer, parameter :: LSZ = 256 ! Maximum line size
integer, parameter :: LSZ = max (1024,ESMF_MAXPATHLEN) ! Maximum line size
integer, parameter :: MSZ = 256 ! Used to size buffer; this is
! usually *less* than the number
! of non-blank/comment lines
! (because most lines are shorter
! then LSZ)

integer, parameter :: NBUF_MAX = MSZ*LSZ ! max size of buffer
integer, parameter :: NATT_MAX = NBUF_MAX/64 ! max # attributes;
! assumes an average line
! size of 16, the code
! will do a bound check

character, parameter :: BLK = achar(32) ! blank (space)
character, parameter :: TAB = achar(09) ! TAB
#if defined(ESMF_HAS_ACHAR_BUG) | defined(__NAG_COMPILER_BUILD)
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(len=ESMF_MAXSTR) :: Iam = 'MAPL_ConfigSetAttribute_int32'

Expand Down Expand Up @@ -581,7 +535,6 @@ subroutine MAPL_ConfigSetAttribute_ints32( config, value, label, rc )
! !INTERFACE:
! Private name; call using MAPL_ConfigSetAttribute()

integer, parameter :: LSZ = max (1024,ESMF_MAXPATHLEN) ! Maximum line size
character(len=LSZ) :: buffer
character(len=12) :: tmpStr, newVal
integer :: count, i, j
Expand Down Expand Up @@ -626,7 +579,6 @@ subroutine MAPL_ConfigSetAttribute_reals32( config, value, label, rc )
! 18 is needed for gfortran
! Hopefully 32 is large enough to fit-all.
#define IWSZ 32
integer, parameter :: LSZ = max (1024,ESMF_MAXPATHLEN) ! Maximum line size
character(len=LSZ) :: buffer
character(len=IWSZ) :: tmpStr, newVal
integer :: count, i, j
Expand Down Expand Up @@ -662,29 +614,6 @@ subroutine MAPL_ConfigSetAttribute_string(config, value, label, rc)
character(len=*), intent(in), optional :: label
integer, intent(out), optional :: rc
!
!integer, parameter :: LSZ = 256 ! Maximum line size
integer, parameter :: LSZ = max (1024,ESMF_MAXPATHLEN) ! Maximum line size
integer, parameter :: MSZ = 256 ! Used to size buffer; this is
! usually *less* than the number
! of non-blank/comment lines
! (because most lines are shorter
! then LSZ)

integer, parameter :: NBUF_MAX = MSZ*LSZ ! max size of buffer
integer, parameter :: NATT_MAX = NBUF_MAX/64 ! max # attributes;
! assumes an average line
! size of 16, the code
! will do a bound check

character, parameter :: BLK = achar(32) ! blank (space)
character, parameter :: TAB = achar(09) ! TAB
#if defined(ESMF_HAS_ACHAR_BUG) | defined(__NAG_COMPILER_BUILD)
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(len=ESMF_MAXSTR) :: Iam = 'MAPL_ConfigSetAttribute_string'

Expand Down
8 changes: 6 additions & 2 deletions cmake/FindESMF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,17 @@ if(EXISTS ${ESMFMKFILE})
message(WARNING "Static ESMF library (libesmf.a) not found in \
${ESMF_LIBSDIR}. Try setting USE_ESMF_STATIC_LIBS=OFF")
endif()
add_library(ESMF STATIC IMPORTED)
if(NOT TARGET ESMF)
add_library(ESMF STATIC IMPORTED)
endif()
else()
find_library(ESMF_LIBRARY_LOCATION NAMES esmf PATHS ${ESMF_LIBSDIR} NO_DEFAULT_PATH)
if(ESMF_LIBRARY_LOCATION MATCHES "ESMF_LIBRARY_LOCATION-NOTFOUND")
message(WARNING "ESMF library not found in ${ESMF_LIBSDIR}.")
endif()
add_library(ESMF UNKNOWN IMPORTED)
if(NOT TARGET ESMF)
add_library(ESMF UNKNOWN IMPORTED)
endif()
endif()

# Add ESMF include directories
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.31.0
tag: v3.31.1
develop: develop

ecbuild:
Expand Down