Skip to content

Commit

Permalink
Merge pull request #2258 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
GitFlow: Merge develop into main
  • Loading branch information
mathomp4 authored Jul 28, 2023
2 parents e05c1f8 + 43b5633 commit 25ab1d3
Show file tree
Hide file tree
Showing 79 changed files with 3,793 additions and 1,920 deletions.
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ parameters:

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

orbs:
Expand Down Expand Up @@ -217,6 +217,7 @@ workflows:
checkout_mapl_branch: true
mepodevelop: false
rebuild_procs: 1
extra_cmake_options: "-DBUILD_WITH_FLAP=ON"

build-and-publish-docker:
when:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/enforce-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
require-label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v4
- uses: mheap/github-action-required-labels@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -21,7 +21,7 @@ jobs:
blocking-label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v4
- uses: mheap/github-action-required-labels@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/push-to-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ jobs:
target_branch: release/MAPL-v3
label: automatic,MAPL3,Skip Changelog
template: .github/PULL_REQUEST_TEMPLATE/auto_pr_to_mapl3.md
get_diff: true
# Turning this to false until the action can get a fix for
# https://github.com/devops-infra/action-pull-request/issues/126
#get_diff: true
get_diff: false
assignee: ${{ github.actor }}
old_string: "<!-- Write your description here -->"
new_string: ${{ github.event.commits[0].message }}
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
65 changes: 65 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,71 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.40.0] - 2023-07-29

### Added

- Add ability of ExtData to fill variables on MAPL "tile" grids.
- Added print of regrid method during History initialization
- Added ability to use an `ESMF.rc` file to pass in pre-`ESMF_Initialize` options to ESMF (see [ESMF Docs](https://earthsystemmodeling.org/docs/release/latest/ESMF_refdoc/node4.html#SECTION04024000000000000000) for allowed flags.
- NOTE: File *must* be called `ESMF.rc`
- Added ability to run ExtDataDriver.x on a MAPL "tile" grid
- Add ability to introduce a time-step delay in ExtDataDriver.x to simulate the timestep latency of a real model
- Added a MAPL\_Sleep function, equivalent to some vendor supplied but non-standard sleep function
- 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 StationSamplerMod for station sampler
- Added ReplaceMetadata message and method to replace oserver's metadata
- Added field utilities to perform basic numeric operations on fields
- Update arithemetic parser to work with any rank and type of ESMF fields
- For ExtDataDriver.x only, added logging config to Tests/ExtDataDriverMod.F90 to enable Logger there
- Added new fill option and run mode for ExtDataDriver.x

### 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 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.1
- NCO 5.1.7
- Move to MPT 2.28 at NAS, and other various changes for TOSS4 at NAS
- 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 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)`
- Default `BUILD_WITH_FLAP` to `OFF` as we don't build it in spack
- Explicitly build GEOSadas in CI with `-DBUILD_WITH_FLAP=ON` as GEOSadas is still behind in moving to use fArgParse

### Fixed

- Created cubed-sphere grid factory with files split by face
- Removed unneeded and confusing default in History Grid Comp (see #2081)
- Fixes in CMake for fArgParse transition

### Deprecated

- Deprecate the use of FLAP for command line parsing in favor of fArgParse. FLAP support will be removed in MAPL 3

## [2.39.7] - 2023-07-18

### Fixed
Expand Down
58 changes: 35 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif ()

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

# Set the possible values of build type for cmake-gui
Expand Down Expand Up @@ -58,6 +58,8 @@ if (NOT COMMAND esma)

endif ()

list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

option (BUILD_SHARED_MAPL "Build shared MAPL libraries" ON)
if (BUILD_SHARED_MAPL)
set (MAPL_LIBRARY_TYPE SHARED)
Expand All @@ -71,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 @@ -111,15 +115,17 @@ 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" ON)
option(BUILD_WITH_FLAP "Use FLAP for command line processing" OFF)
if (BUILD_WITH_FLAP)
find_package(FLAP REQUIRED)
endif ()
Expand All @@ -142,7 +148,7 @@ if (NOT Baselibs_FOUND)
endif()

if (NOT TARGET esmf)
find_package(ESMF 8.4.0 MODULE REQUIRED)
find_package(ESMF 8.5.0 MODULE REQUIRED)

# ESMF as used in MAPL requires MPI
# NOTE: This looks odd because some versions of FindESMF.cmake out in the
Expand All @@ -157,6 +163,13 @@ if (NOT Baselibs_FOUND)
add_library(esmf ALIAS ESMF)
endif()
endif ()
else ()
# This is an ESMF version test when using Baselibs which doesn't use the
# same find_package internally in ESMA_cmake as used above (with a version
# number) so this lets us at least trap use of old Baselibs here.
if (ESMF_VERSION VERSION_LESS 8.5.0)
message(FATAL_ERROR "ESMF must be at least 8.5.0")
endif ()
endif ()

# We wish to add extra flags when compiling as Debug. We should only
Expand Down Expand Up @@ -209,7 +222,7 @@ add_subdirectory (base)
add_subdirectory (MAPL)
add_subdirectory (gridcomps)
add_subdirectory (griddedio)
if (BUILD_WITH_FLAP)
if (BUILD_WITH_FARGPARSE)
add_subdirectory (tutorial)
endif()

Expand All @@ -219,7 +232,6 @@ if (PFUNIT_FOUND)
endif ()

# Support for automated code generation
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(mapl_acg)
include(mapl_create_stub_component)
add_subdirectory (Apps)
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
2 changes: 1 addition & 1 deletion MAPL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ esma_set_this()

esma_add_library (${this}
SRCS MAPL.F90
DEPENDENCIES MAPL.base MAPL.generic MAPL.pfio MAPL_cfio_r4 MAPL.gridcomps MAPL.orbit MAPL.griddedio ${EXTDATA_TARGET}
DEPENDENCIES MAPL.base MAPL.generic MAPL.pfio MAPL_cfio_r4 MAPL.gridcomps MAPL.orbit MAPL.griddedio MAPL.geom ${EXTDATA_TARGET}
esmf NetCDF::NetCDF_Fortran MPI::MPI_Fortran
$<$<BOOL:${BUILD_WITH_FLAP}>:FLAP::FLAP>
TYPE ${MAPL_LIBRARY_TYPE}
Expand Down
1 change: 1 addition & 0 deletions MAPL/MAPL.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module MAPL
use MAPL_OpenMP_Support, only : MAPL_find_bounds => find_bounds
use MAPL_OpenMP_Support, only : MAPL_Interval => Interval
use MAPL_Profiler, initialize_profiler =>initialize, finalize_profiler =>finalize
use MAPL_Geom
implicit none
end module MAPL

Expand Down
11 changes: 3 additions & 8 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ set (srcs
VarspecDescription.F90
)

if (BUILD_WITH_FLAP)
if (BUILD_WITH_FARGPARSE)

ecbuild_add_executable (TARGET ExtDataDriver.x SOURCES ${srcs})
target_link_libraries (ExtDataDriver.x PRIVATE MAPL FLAP::FLAP esmf)
target_link_libraries (ExtDataDriver.x PRIVATE MAPL FARGPARSE::fargparse esmf)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(ExtDataDriver.x PRIVATE OpenMP::OpenMP_Fortran)
Expand All @@ -21,17 +21,12 @@ if (BUILD_WITH_FLAP)
add_subdirectory(ExtData_Testing_Framework EXCLUDE_FROM_ALL)

ecbuild_add_executable (TARGET pfio_MAPL_demo.x SOURCES pfio_MAPL_demo.F90)
target_link_libraries (pfio_MAPL_demo.x PRIVATE MAPL FLAP::FLAP esmf)
target_link_libraries (pfio_MAPL_demo.x PRIVATE MAPL FARGPARSE::fargparse esmf)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(pfio_MAPL_demo.x PRIVATE OpenMP::OpenMP_Fortran)
endif ()
set_target_properties(pfio_MAPL_demo.x PROPERTIES Fortran_MODULE_DIRECTORY ${MODULE_DIRECTORY})

endif ()

if (BUILD_WITH_FARGPARSE)

ecbuild_add_executable (TARGET MAPL_demo_fargparse.x SOURCES MAPL_demo_fargparse.F90)
target_link_libraries (MAPL_demo_fargparse.x PRIVATE MAPL FARGPARSE::fargparse esmf)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
Expand Down
4 changes: 2 additions & 2 deletions Tests/ExtDataDriver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ program ExtData_Driver
character(len=*), parameter :: Iam="ExtData_Driver"
type(ExtDataDriver) :: Driver
type (MAPL_CapOptions) :: cap_options
type (MAPL_FlapCLI) :: cli
type (MAPL_FargparseCLI) :: cli

cli = MAPL_FlapCLI(description='extdata driver',authors='gmao')
cli = MAPL_FargparseCLI()
cap_options=MAPL_CapOptions(cli)

driver = ExtDataDriver('ExtDataApp',Root_SetServices,cap_options=cap_options,_RC)
Expand Down
4 changes: 3 additions & 1 deletion Tests/ExtDataDriverMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ function newExtDataDriver(name,set_services, unusable, cap_options, rc) result(d
driver%cap_options = MAPL_CapOptions()
endif
call driver%initialize_mpi()
call MAPL_Initialize(comm=MPI_COMM_WORLD,rc=status)
call MAPL_Initialize(comm=MPI_COMM_WORLD, &
logging_config=driver%cap_options%logging_config, &
rc=status)
_VERIFY(status)
_RETURN(_SUCCESS)
end function newExtDataDriver
Expand Down
Loading

0 comments on commit 25ab1d3

Please sign in to comment.