Skip to content

Commit

Permalink
Merge pull request #2429 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
GitFlow: Merge develop into main for 2.42.0 release
  • Loading branch information
mathomp4 authored Oct 27, 2023
2 parents 5a5eafb + 5ffa5ea commit 236aec5
Show file tree
Hide file tree
Showing 61 changed files with 3,497 additions and 1,102 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ workflows:
baselibs_version: *baselibs_version
repo: GEOSadas
checkout_fixture: true
#fixture_branch: feature/mathomp4/ignore-heldsuarez
fixture_branch: feature/mathomp4/mapldevelop
checkout_mapl_branch: true
mepodevelop: false
rebuild_procs: 1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
OMPI_MCA_btl_vader_single_copy_mechanism: none
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
uses: styfle/cancel-workflow-action@0.12.0
with:
access_token: ${{ github.token }}
- name: Checkout
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
#password: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
uses: styfle/cancel-workflow-action@0.12.0
with:
access_token: ${{ github.token }}
- name: Checkout
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.42.0] - 2023-10-27

### Added

- Various workarounds for building MAPL with MPICH
- Non-support for `C_PTR` in `MPI_Alloc_Mem` ((MPICH Issue #6691)[https://github.com/pmodels/mpich/issues/6691])
- Non-support for `ierror` keyword arguments with `use mpi` ((MPICH Issue #6693)[https://github.com/pmodels/mpich/issues/6693])
- Add new benchmark to simulation writing a cubed-sphere file using various tunable strategies

### Changed

- Modified fpp macro `_UNUSED_DUMMY(x)` to use ASSOCIATE instead of PRINT. With this change it can be used in PURE procedures.
- Make error handling in Plain_netCDF_Time consistent with MAPL standard error handling
- Extend unit tests for FileSystemUtilities.
- Updated handling of NetCDF time values
- Update `components.yaml`
- ESMA_cmake v3.36.0 (Support for SLES15 at NCCS, support for Intel 2021.10)
- ESMA_env v4.20.5 (Support for SLES15 at NCCS)

### Fixed

- Introduced workaround for Intel 2021.10 bug in generic layer.
- Updated write_by_oserver logic so that the decision to write by the oserver is based on whether the output server client is passed in
- Updated CI GEOSadas build to use special branch (as stock ADAS at the moment is too far behind GEOSgcm main)
- Fix incorrect History print during runtime

## [2.41.2] - 2023-10-27

### Fixed
Expand Down Expand Up @@ -163,6 +189,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- 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
- Update MAPL_NetCDF public subroutine returns and support for real time
- 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
12 changes: 11 additions & 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.41.2
VERSION 2.42.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 @@ -211,6 +211,16 @@ add_definitions(-Dsys${CMAKE_SYSTEM_NAME})
add_subdirectory (MAPL_cfio MAPL_cfio_r4)
add_subdirectory (MAPL_cfio MAPL_cfio_r8)

# This tests for various capabilities of the compiler
# We mainly use it for MPICH issues
include(CheckCompilerCapabilities)

# 1. The first workaround is in pfio for https://github.com/pmodels/mpich/issues/6691
# 2. Below is to workaround https://github.com/pmodels/mpich/issues/6693
if(SUPPORT_FOR_MPI_IERROR_KEYWORD)
add_compile_definitions(SUPPORT_FOR_MPI_IERROR_KEYWORD)
endif()

add_subdirectory (pfio)
add_subdirectory (profiler)
add_subdirectory (generic)
Expand Down
24 changes: 19 additions & 5 deletions MAPL_cfio/ESMF_CFIOMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,16 @@ subroutine ESMF_CFIOVarWrite3D_(cfio, vName, field, date, curTime, &
integer :: rtcode
integer :: myDate, myCurTime
character(len=16) :: format
#if defined(HDFEOS)
logical :: do_comp, do_chunk

#endif
#if defined(HDFEOS)
do_chunk = .false.
do_comp = .false.
if ( present(doComp) ) do_comp = doComp
if ( present(doChunk) ) do_chunk = doChunk
#endif

if ( present(date) ) myDate = date
if ( present(curTime) ) myCurTime = curTime
if ( present(timeString) ) call strToInt(timeString,myDate,myCurTime)
Expand Down Expand Up @@ -562,7 +566,11 @@ subroutine ESMF_CFIOVarWrite3D_(cfio, vName, field, date, curTime, &
print *, "CFIO%FORMAT is not known"
if (present(rc)) rc = -54
return
end subroutine ESMF_CFIOVarWrite3D_
#if !defined(HDFEOS)
associate(q => dochunk); end associate
associate(q => docomp); end associate
#endif
end subroutine ESMF_CFIOVarWrite3D_

!------------------------------------------------------------------------------
!>
Expand Down Expand Up @@ -618,13 +626,15 @@ subroutine ESMF_CFIOVarWrite2D_(cfio, vName, field, date, curTime, &
integer :: rtcode
integer :: myDate, myCurTime
character(len=16) :: format
#if defined(HDFEOS)
logical :: do_comp, do_chunk

#endif
#if defined(HDFEOS)
do_chunk = .false.
do_comp = .false.
if ( present(doComp) ) do_comp = doComp
if ( present(doChunk) ) do_chunk = doChunk

#endif
if ( present(date) ) myDate = date
if ( present(curTime) ) myCurTime = curTime
if ( present(timeString) ) call strToInt(timeString,myDate,myCurTime)
Expand Down Expand Up @@ -666,7 +676,11 @@ subroutine ESMF_CFIOVarWrite2D_(cfio, vName, field, date, curTime, &
print *, "CFIO%FORMAT is not known"
if (present(rc)) rc = -54
return
end subroutine ESMF_CFIOVarWrite2D_
#if !defined(HDFEOS)
associate(q => dochunk); end associate
associate(q => docomp); end associate
#endif
end subroutine ESMF_CFIOVarWrite2D_
!------------------------------------------------------------------------------
!>
! `ESMF_CFIOVarWrite1D_` -- Write a variable to a output file
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ MAPL also has a variety of other auxiliary directories:
9. **docs** - documentation

## Using MAPL

You can find simple examples on how to use MAPL components in ESMF applications at:

[MAPL Tutorial](https://github.com/GEOS-ESM/MAPL/blob/main/docs/tutorial/README.md)
Expand Down
10 changes: 0 additions & 10 deletions Tests/ExtDataRoot_GridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,7 @@ SUBROUTINE Initialize_ ( GC, IMPORT, EXPORT, CLOCK, rc )
integer :: status
character(len=ESMF_MAXSTR) :: comp_name

!real(REAL64) :: ptop, pint
!real(REAL64), allocatable :: ak(:),bk(:)
integer :: nrows, ncolumn,i
!integer :: ls
type(ESMF_Grid) :: grid
type(ESMF_Time) :: currTime
type(SyntheticFieldSupportWrapper) :: synthWrap
Expand Down Expand Up @@ -198,13 +195,6 @@ SUBROUTINE Initialize_ ( GC, IMPORT, EXPORT, CLOCK, rc )
call MAPL_GridCreate(GC, _RC)
call ESMF_GridCompGet(GC, grid=grid, _RC)
call set_locstream(_RC)
!allocate(ak(lm+1),stat=status)
!allocate(bk(lm+1),stat=status)
!call set_eta(lm,ls,ptop,pint,ak,bk)
!call ESMF_AttributeSet(grid,name='GridAK', itemCount=LM+1, &
!valuelist=ak,_RC)
!call ESMF_AttributeSet(grid,name='GridBK', itemCount=LM+1, &
!valuelist=bk,_RC)

call MAPL_GenericInitialize ( GC, IMPORT, EXPORT, clock, _RC)
call ForceAllocation(Export,_RC)
Expand Down
1 change: 1 addition & 0 deletions base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ set (srcs
MAPL_Resource.F90
MAPL_XYGridFactory.F90
MAPL_NetCDF.F90 Plain_netCDF_Time.F90
MAPL_DateTime_Parsing_ESMF.F90
# Orphaned program: should not be in this library.
# tstqsat.F90
)
Expand Down
5 changes: 4 additions & 1 deletion base/ESMFL_Mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1981,7 +1981,7 @@ subroutine Bundle_Prep_ (srcBUN, dstBUN, only_vars)

! locals

type(ESMF_Array) :: srcArr, dstArr
type(ESMF_Array) :: srcArr
type(ESMF_Field) :: srcFld, dstFld
integer :: rank
integer :: sCPD(3), dCPD(3) ! src and dst counts per dimension (local)
Expand Down Expand Up @@ -3137,6 +3137,9 @@ subroutine stats_ (lu,mx,my,k,a1,&

endif

_UNUSED_DUMMY(ATYPE)
_UNUSED_DUMMY(HTYPE)
_UNUSED_DUMMY(INC)
end subroutine stats_

end subroutine BundleDiff
Expand Down
1 change: 0 additions & 1 deletion base/HorizontalFluxRegridder.F90
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ end function supports
subroutine initialize_subclass(this, unusable, rc)
use MAPL_KeywordEnforcerMod
use MAPL_RegridderSpec
use MAPL_BaseMod, only: MAPL_grid_interior
class (HorizontalFluxRegridder), intent(inout) :: this
class (KeywordEnforcer), optional, intent(in) :: unusable
integer, optional, intent(out) :: rc
Expand Down
75 changes: 75 additions & 0 deletions base/MAPL_DateTime_Parsing_ESMF.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#include "MAPL_Exceptions.h"
#include "MAPL_ErrLog.h"
module MAPL_DateTime_Parsing_ESMF
use MAPL_KeywordEnforcerMod
use MAPL_ExceptionHandling
use MAPL_DateTime_Parsing
use ESMF

implicit none

public :: set_ESMF_TimeInterval, set_ESMF_Time_from_ISO8601

interface set_ESMF_TimeInterval
module procedure :: set_ESMF_TimeInterval_from_datetime_duration
end interface set_ESMF_TimeInterval

contains

subroutine set_ESMF_TimeInterval_from_datetime_duration(interval, duration, rc)
type(ESMF_TimeInterval), intent(inout) :: interval
class(datetime_duration), intent(in) :: duration
integer, optional, intent(out) :: rc
integer :: status

! Get duration(s) from datetime_duration

! Set ESMF_TimeInterval

if(duration % year_is_set()) then
call ESMF_TimeIntervalSet(interval, yy = duration % year, _RC)
end if

if(duration % month_is_set()) then
call ESMF_TimeIntervalSet(interval, yy = duration % month, _RC)
end if

if(duration % day_is_set()) then
call ESMF_TimeIntervalSet(interval, yy = duration % day, _RC)
end if

if(duration % hour_is_real()) then
call ESMF_TimeIntervalSet(interval, h_r8 = duration % hour_real, _RC)
else if(duration % hour_is_set()) then
call ESMF_TimeIntervalSet(interval, h = duration % hour, _RC)
end if

if(duration % minute_is_real()) then
call ESMF_TimeIntervalSet(interval, m_r8 = duration % minute_real, _RC)
else if(duration % minute_is_set()) then
call ESMF_TimeIntervalSet(interval, m = duration % minute, _RC)
end if

if(duration % second_is_real()) then
call ESMF_TimeIntervalSet(interval, s_r8 = duration % second_real, _RC)
else if(duration % second_is_set()) then
call ESMF_TimeIntervalSet(interval, s = duration % second, _RC)
end if

_RETURN(_SUCCESS)

end subroutine set_ESMF_TimeInterval_from_datetime_duration

subroutine set_ESMF_Time_from_ISO8601(time, isostring, rc)
type(ESMF_Time), intent(inout) :: time
character(len=*), intent(in) :: isostring
integer, optional, intent(out) :: rc
integer :: status

call ESMF_TimeSet(time, isostring, _RC)

_RETURN(_SUCCESS)

end subroutine set_ESMF_Time_from_ISO8601

end module MAPL_DateTime_Parsing_ESMF
1 change: 1 addition & 0 deletions base/MAPL_ISO8601_DateTime_ESMF.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module MAPL_ISO8601_DateTime_ESMF
use MAPL_KeywordEnforcerMod
use MAPL_ExceptionHandling
use MAPL_ISO8601_DateTime
use MAPL_DateTime_Parsing
use ESMF
implicit none

Expand Down
2 changes: 0 additions & 2 deletions base/MAPL_IdentityRegridder.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module MAPL_IdentityRegridderMod
use ESMF

use, intrinsic :: iso_fortran_env, only: REAL32
use, intrinsic :: iso_fortran_env, only: REAL64
implicit none
private

Expand Down Expand Up @@ -165,7 +164,6 @@ end subroutine regrid_vector_3d_real32
subroutine initialize_subclass(this, unusable, rc)
use MAPL_KeywordEnforcerMod
use MAPL_RegridderSpec
use MAPL_BaseMod, only: MAPL_GridGet
class (IdentityRegridder), intent(inout) :: this
class (KeywordEnforcer), optional, intent(in) :: unusable
integer, optional, intent(out) :: rc
Expand Down
Loading

0 comments on commit 236aec5

Please sign in to comment.