Skip to content

Commit

Permalink
Merge pull request #2255 from GEOS-ESM/feature/mathomp4/update-to-bas…
Browse files Browse the repository at this point in the history
…elibs-7.14.0

Update to Baselibs 7.14.0 (ESMF 8.5.0, GFE 1.11.0)
  • Loading branch information
mathomp4 authored Jul 27, 2023
2 parents a615890 + bf2b62a commit da5be63
Show file tree
Hide file tree
Showing 17 changed files with 82 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ parameters:

# Anchors to prevent forgetting to update a version
os_version: &os_version ubuntu20
baselibs_version: &baselibs_version v7.13.0
baselibs_version: &baselibs_version v7.14.0
bcs_version: &bcs_version v11.1.0
tag_build_arg_name: &tag_build_arg_name maplversion

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Build and Test MAPL GNU
runs-on: ubuntu-latest
container:
image: gmao/ubuntu20-geos-env-mkl:v7.13.0-openmpi_4.1.4-gcc_12.1.0
image: gmao/ubuntu20-geos-env-mkl:v7.14.0-openmpi_4.1.4-gcc_12.1.0
# Per https://github.com/actions/virtual-environments/issues/1445#issuecomment-713861495
# It seems like we might not need secrets on GitHub Actions which is good for forked
# pull requests
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
name: Build and Test MAPL Intel
runs-on: ubuntu-latest
container:
image: gmao/ubuntu20-geos-env:v7.13.0-intelmpi_2021.6.0-intel_2022.1.0
image: gmao/ubuntu20-geos-env:v7.14.0-intelmpi_2021.6.0-intel_2022.1.0
# Per https://github.com/actions/virtual-environments/issues/1445#issuecomment-713861495
# It seems like we might not need secrets on GitHub Actions which is good for forked
# pull requests
Expand Down
30 changes: 19 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- sampling IODA file with trajectory sampler (step-1): make it run
- Convert ExtData to use ESMF HConfig for YAML parsing rather than YaFYAML
- Set required ESMF version to 8.5.0
- Add check in CMake to make sure ESMF version is at least 8.5.0b22 if using a beta snapshot
- Add StationSamplerMod for station sampler
- Added ReplaceMetadata message and method to replace oserver's metadata
- Added field utilities to perform basic numeric operations on fields
Expand All @@ -29,23 +28,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Updates to GFE library dependency
- Require gFTL v1.10.0
- Require gFTL-shared v1.6.1
- Require fArgParse v1.5.0
- Require pFlogger v1.9.5
- Removed yaFyaml as dependency
- Updated programs using FLAP for command line parsing to use fArgParse instead
- Updated `components.yaml` to match GEOSgcm v11.1.0
- ESMA_env v4.9.1 → v4.17.0
- Baselibs 7.13.0
- esmf v8.5.0b22
- GFE v1.10.0
- curl 8.1.1
- Updated `components.yaml` to use Baselibs 7.14.0
- ESMA_env v4.9.1 → v4.19.0
- Baselibs 7.14.0
- esmf v8.5.0
- GFE v1.11.0
- curl 8.2.1
- HDF5 1.10.10
- netCDF-C 4.9.2
- netCDF-Fortran 4.6.1
- CDO 2.2.0
- NCO 5.1.5
- CDO 2.2.1
- NCO 5.1.7
- Move to MPT 2.28 at NAS, and other various changes for TOSS4 at NAS
- ESMA_cmake v3.28.0 → v3.29.0
- Remove Haswell from `build.csh`
- ESMA_cmake v3.28.0 → v3.31.0
- Clean up for TOSS4 changes at NAS
- Add `QUIET_DEBUG` flag
- Suppress some common warnings with Intel Debug
- Make the GEOSadas CI build separate as it often fails due to race conditions in GSI
- Update CI to use BCs v11.1.0
- Update CI to use BCs v11.1.0 and Baselibs 7.14.0
- Updates to support building MAPL with spack instead of Baselibs
- Add `FindESMF.cmake` file to `cmake` directory (as it can't easily be found via spack)
- Move `CMAKE_MODULE_PATH` append statement up to find `FindESMF.cmake` before we `find_package(ESMF)`
Expand Down
64 changes: 22 additions & 42 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,38 +73,40 @@ message (STATUS "Building MAPL as ${MAPL_LIBRARY_TYPE} libraries")
# This would then populate the target already leading to find_package()
# errors.
if(NOT TARGET GFTL::gftl)
# MAPL currently requires at least GFTL 1.5.1
find_package(GFTL 1.5.1 REQUIRED)
find_package(GFTL 1.10.0 REQUIRED)
else()
if (GFTL_VERSION VERSION_LESS 1.5.1)
message(FATAL_ERROR "GFTL must be at least 1.5.1")
if (GFTL_VERSION VERSION_LESS 1.10.0)
message(FATAL_ERROR "gFTL must be at least 1.10.0")
endif ()
endif()
message (STATUS "Found gFTL: ${GFTL_DIR} (found version ${GFTL_VERSION})")

if(NOT TARGET GFTL_SHARED::gftl-shared)
find_package(GFTL_SHARED REQUIRED)
# MAPL currently requires at least gFTL-shared 1.6.1
find_package(GFTL_SHARED 1.6.1 REQUIRED)
else ()
if (GFTL_SHARED_VERSION VERSION_LESS 1.6.1)
message(FATAL_ERROR "gFTL-shared must be at least 1.6.1")
endif ()
endif()
message (STATUS "Found gFTL-shared: ${GFTL_DIR} (found version ${GFTL_SHARED_VERSION})")

option(BUILD_WITH_FARGPARSE "Use fArgParse for command line processing" ON)
if(BUILD_WITH_FARGPARSE)
if(NOT TARGET FARGPARSE::fargparse)
find_package(FARGPARSE 1.4.1 REQUIRED)
find_package(FARGPARSE 1.5.0 REQUIRED)
else()
if (FARGPARSE_VERSION VERSION_LESS 1.4.1)
message(FATAL_ERROR "fArgParse must be at least 1.4.1")
if (FARGPARSE_VERSION VERSION_LESS 1.5.0)
message(FATAL_ERROR "fArgParse must be at least 1.5.0")
endif ()
endif()
message (STATUS "Building with fArgParse")
message (STATUS "Found fArgParse: ${FARGPARSE_DIR} (found version ${FARGPARSE_VERSION})")
endif()

option(USE_EXTDATA2G "Use ExtData2G" ON)
if(USE_EXTDATA2G)
set (EXTDATA2G_TARGET "MAPL.ExtData2G" CACHE STRING "ExtData2G Target")
if(NOT TARGET YAFYAML::yafyaml)
find_package(YAFYAML 1.0.4 REQUIRED)
else()
if (YAFYAML_VERSION VERSION_LESS 1.0.4)
message(FATAL_ERROR "yaFyaml must be at least 1.0.4")
endif ()
endif()
message (STATUS "Building with ExtData2G")
else()
set (EXTDATA2G_TARGET "" CACHE STRING "ExtData2G Target")
Expand All @@ -113,12 +115,14 @@ endif()
option(BUILD_WITH_PFLOGGER "Build MAPL with pFlogger library support" ON)
if (BUILD_WITH_PFLOGGER)
if(NOT TARGET PFLOGGER::pflogger)
find_package(PFLOGGER 1.9.1 REQUIRED)
find_package(PFLOGGER 1.9.5 REQUIRED)
else()
if (PFLOGGER_VERSION VERSION_LESS 1.9.1)
message(FATAL_ERROR "pFlogger must be at least 1.9.1")
if (PFLOGGER_VERSION VERSION_LESS 1.9.5)
message(FATAL_ERROR "pFlogger must be at least 1.9.5")
endif ()
endif()
message (STATUS "Building with pFlogger")
message (STATUS "Found pFlogger: ${PFLOGGER_DIR} (found version ${PFLOGGER_VERSION})")
endif()

option(BUILD_WITH_FLAP "Use FLAP for command line processing" OFF)
Expand Down Expand Up @@ -168,30 +172,6 @@ else ()
endif ()
endif ()

# Due to use of a feature of ESMF that came in with ESMF v8.5.0b22,
# a beta version of ESMF, we need to make sure that if we are using
# ESMF 8.5.0, that we are using at least ESMF 8.5.0b22. This is
# a temporary fix until ESMF 8.5.0 final is released. Our criterion are:
# 1. ESMF version is 8.5.0 (from ESMF_VERSION)
# 2. We are using a beta snapshot of ESMF (from ESMF_BETA_RELEASE)
# 3. The ESMF version is at least v8.5.0b22 (from ESMF_BETA_SNAPSHOT)

if (ESMF_VERSION VERSION_EQUAL 8.5.0 AND ESMF_BETA_RELEASE)
# So now we are using a beta version of ESMF 8.5.0. We need to make sure
# that the version is at least 8.5.0b22. That version information
# is stored in ESMF_BETA_SNAPSHOT and is of the form "v8.5.0b22"
set (ESMF_BETA_SNAPSHOT_TARGET 22)
string(REGEX REPLACE "v8.5.0b([0-9]+)" "\\1" ESMF_BETA_SNAPSHOT_NUMBER ${ESMF_BETA_SNAPSHOT})
if (ESMF_BETA_SNAPSHOT_NUMBER LESS ESMF_BETA_SNAPSHOT_TARGET)
message(FATAL_ERROR
"ERROR! ESMF version must be at least v8.5.0b22, but you are using ${ESMF_BETA_SNAPSHOT}\n"
""
"This is due to the use of a feature of ESMF that came in with ESMF v8.5.0b22, a beta version of ESMF.\n"
"This is a temporary fix until stable ESMF 8.5.0 is released.\n"
)
endif ()
endif ()

# We wish to add extra flags when compiling as Debug. We should only
# do this if we are using esma_cmake since the flags are defined
# there. Note that some flags like STANDARD_F18 might be available on
Expand Down
1 change: 0 additions & 1 deletion Ford/docs-with-remote-esmf.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ exclude_dir: ../Ford
../build
../gFTL
../esmf
../yaFyaml
../pFUnit
../fArgParse
../pFlogger
Expand Down
1 change: 0 additions & 1 deletion Ford/docs-with-remote-esmf.public_private_protected.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ exclude_dir: ../Ford
../build
../gFTL
../esmf
../yaFyaml
../pFUnit
../fArgParse
../pFlogger
Expand Down
4 changes: 2 additions & 2 deletions components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ MAPL:
ESMA_env:
local: ./ESMA_env
remote: ../ESMA_env.git
tag: v4.17.0
tag: v4.19.0
develop: main

ESMA_cmake:
local: ./ESMA_cmake
remote: ../ESMA_cmake.git
tag: v3.29.0
tag: v3.31.0
develop: develop

ecbuild:
Expand Down
1 change: 0 additions & 1 deletion geom/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ endif ()

esma_add_library(${this}
SRCS ${srcs}
# DEPENDENCIES MAPL.oomph MAPL.shared MAPL.profiler MAPL.base YAFYAML::yafyaml PFLOGGER::pflogger GFTL_SHARED::gftl-shared-v2 GFTL::gftl-v2
DEPENDENCIES MAPL.shared PFLOGGER::pflogger
TYPE ${MAPL_LIBRARY_TYPE}
)
Expand Down
2 changes: 1 addition & 1 deletion gridcomps/ExtData2G/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set (srcs


esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL.shared MAPL.base MAPL.generic MAPL.griddedio TYPE SHARED)
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared YAFYAML::yafyaml esmf NetCDF::NetCDF_Fortran
target_link_libraries (${this} PUBLIC GFTL::gftl GFTL_SHARED::gftl-shared esmf NetCDF::NetCDF_Fortran
PRIVATE MPI::MPI_Fortran)
target_include_directories (${this} PUBLIC $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)

Expand Down
23 changes: 11 additions & 12 deletions gridcomps/ExtData2G/ExtDataAbstractFileHandler.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "unused_dummy.H"
module MAPL_ExtdataAbstractFileHandler
use ESMF
use yafYaml
use MAPL_KeywordEnforcerMod
use MAPL_ExceptionHandling
use MAPL_ExtDataBracket
Expand All @@ -28,7 +27,7 @@ module MAPL_ExtdataAbstractFileHandler
type(ESMF_Time), allocatable :: valid_range(:)
logical :: persist_closest
contains
procedure :: initialize
procedure :: initialize
procedure :: make_metadata
procedure :: get_time_on_file
procedure(get_file_bracket), deferred :: get_file_bracket
Expand All @@ -48,7 +47,7 @@ subroutine get_file_bracket(this, input_time, source_time, bracket, fail_on_miss
end subroutine get_file_bracket

end interface

contains

subroutine initialize(this,file_series,persist_closest,unusable,rc)
Expand Down Expand Up @@ -93,7 +92,7 @@ subroutine get_time_on_file(this,filename,target_time,bracketside,time_index,out
type(ESMF_Time), allocatable :: time_series(:)
logical :: in_bounds, found_time, wrap_
integer :: i,num_times

_UNUSED_DUMMY(unusable)
if (present(wrap)) then
wrap_= .true.
Expand All @@ -105,7 +104,7 @@ subroutine get_time_on_file(this,filename,target_time,bracketside,time_index,out
_RETURN(_SUCCESS)
end if

call this%make_metadata(filename,file_metadata,_RC)
call this%make_metadata(filename,file_metadata,_RC)
call file_metadata%get_time_info(timeVector=time_series,_RC)
num_times = size(time_series)
found_time = .false.
Expand All @@ -120,14 +119,14 @@ subroutine get_time_on_file(this,filename,target_time,bracketside,time_index,out
exit
end if
enddo
else
else
if (wrap_) then
output_time=time_series(num_times)
time_index = num_times
found_time = .true.
wrap = -1
wrap = -1
end if
end if
end if
else if (bracketside == 'R') then
in_bounds = .not.(target_time >= time_series(num_times))
if (in_bounds) then
Expand All @@ -139,12 +138,12 @@ subroutine get_time_on_file(this,filename,target_time,bracketside,time_index,out
exit
end if
enddo
else
else
if (wrap_) then
output_time=time_series(1)
time_index = 1
found_time = .true.
wrap = 1
wrap = 1
end if
end if
else
Expand All @@ -161,11 +160,11 @@ subroutine make_metadata(this,file,metadata,rc)
type(FileMetadataUtils), pointer, intent(inout) :: metadata
integer, optional, intent(out ) :: rc
type(MAPLDataCollection), pointer :: collection => null()

Collection => DataCollections%at(this%collection_id)
metadata => collection%find(file)
_RETURN(_SUCCESS)

end subroutine make_metadata

end module MAPL_ExtdataAbstractFileHandler
9 changes: 4 additions & 5 deletions gridcomps/ExtData2G/ExtDataConfig.F90
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "MAPL_ErrLog.h"
module MAPL_ExtDataConfig
use ESMF
use yaFyaml
use PFIO
use gFTL_StringVector
use MAPL_KeywordEnforcerMod
Expand Down Expand Up @@ -93,7 +92,7 @@ recursive subroutine new_ExtDataConfig_from_yaml(ext_config,config_file,current_
hconfigIterEnd = ESMF_HConfigIterEnd(temp_configs)
do while (ESMF_HConfigIterLoop(hconfigIter,hconfigIterBegin,hconfigIterEnd))
hconfig_key = ESMF_HConfigAsStringMapKey(hconfigIter,_RC)
single_sample = ESMF_HConfigCreateAtMapVal(hconfigIter,_RC)
single_sample = ESMF_HConfigCreateAtMapVal(hconfigIter,_RC)
ts = ExtDataTimeSample(single_sample,_RC)
call ext_config%sample_map%insert(trim(hconfig_key),ts)
enddo
Expand All @@ -108,7 +107,7 @@ recursive subroutine new_ExtDataConfig_from_yaml(ext_config,config_file,current_
hconfig_key = ESMF_HConfigAsStringMapKey(hconfigIter,_RC)
temp_ds => ext_config%file_stream_map%at(hconfig_key)
_ASSERT(.not.associated(temp_ds),"defined duplicate named collection")
single_collection = ESMF_HConfigCreateAtMapVal(hconfigIter,_RC)
single_collection = ESMF_HConfigCreateAtMapVal(hconfigIter,_RC)
ds = ExtDataFileStream(single_collection,current_time,_RC)
call ext_config%file_stream_map%insert(trim(hconfig_key),ds)
enddo
Expand All @@ -133,7 +132,7 @@ recursive subroutine new_ExtDataConfig_from_yaml(ext_config,config_file,current_
new_key = hconfig_key//rule_sep//i_char
call ext_config%add_new_rule(new_key,rule_map,multi_rule=.true.,_RC)
enddo
else
else
_FAIL("Unsupported type")
end if
enddo
Expand Down Expand Up @@ -419,7 +418,7 @@ function has_rule_for(this,base_name,rc) result(found_rule)
found_rule = (key(:rule_sep_loc-1) == base_name)
else
found_rule = (key == base_name)
end if
end if
if (found_rule) exit
call iter%next()
enddo
Expand Down
Loading

0 comments on commit da5be63

Please sign in to comment.