Skip to content

Commit

Permalink
Merge pull request #1446 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
GitFlow: Merge develop into main for 2.19.0 release
  • Loading branch information
tclune authored Mar 18, 2022
2 parents 8ed631a + ebee177 commit 8edb2d0
Show file tree
Hide file tree
Showing 38 changed files with 5,118 additions and 240 deletions.
11 changes: 3 additions & 8 deletions Apps/MAPL_GridCompSpecs_ACG.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,11 @@ def get_rank(self):

@staticmethod
def internal_name(name):
if name[-1] == '*':
return name[:-1]
else:
return name
return name.replace('*','')

@staticmethod
def mangled_name(name):
if name[-1] == '*':
return "'" + name[:-1] + "'//trim(comp_name)"
else:
return "'" + name + "'"
return "'" + name.replace("*","'//trim(comp_name)//'") + "'"

# Pointers must be declared regardless of COND status. Deactivated
# pointers should not be _referenced_ but such sections should still
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.19.0] - 2022-03-18

### Fixed

- Fixed duration of the clock to be the smaller of the user specified duration and (END_DATE - currTime)
- Fixes for compiling on M1 Macs (remove REAL128)
- Fix for CMake when `esmf` is already a target

### Added

- New cmake option USE_EXTDATA2G to enable the next generation of ExtData for development, by default uses 1st generation ExtData
- MAPL_ESMFFieldBundleRead/Write modules are now available in when using MAPL

### Changed

- Replaced a wild card "*" in any position of a string in MAPL_GridCompSpecs_ACG.py
- Updated `MAPL_SunGetSolarConstantFromNRLFile` to open NRL Solar Table file only on root and broadcast the tables to all processes. Now all processes do interpolation.
- Add voting interpolation method as optional argument to SimpleBundleRead method

## [2.18.3] - 2022-03-15

### Fixed
Expand Down Expand Up @@ -54,6 +73,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updates to CircleCI
- Added GEOSadas CI ifort build test
- Add "like-UFS" build to CI. This is no FLAP and pFlogger, and static build
- Added new `_STAT` and `_IOSTAT` macros a la `_RC`

### Changed

Expand All @@ -66,6 +86,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated `components.yaml`. These changes are to support using Spack to build MAPL
- ESMA_cmake v3.10.0 (add `FindESMF.cmake` from NOAA-EMC)
- ecbuild geos/v1.2.0 (updat `FindNetCDF.cmake` to that from NOAA-EMC)
- Improved file-not-found error handling in ExtData for non-templated filenames

## [2.17.2] - 2022-02-16

Expand Down
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_policy (SET CMP0054 NEW)

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

# Set the default build type to release
Expand Down Expand Up @@ -84,8 +84,16 @@ endif()
if(NOT TARGET FARGPARSE::fargparse)
find_package(FARGPARSE QUIET)
endif()
if(NOT TARGET YAFYAML::yafyaml)
find_package(YAFYAML QUIET)

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 REQUIRED)
endif()
message (STATUS "Building with ExtData2G")
else()
set (EXTDATA2G_TARGET "" CACHE STRING "ExtData2G Target")
endif()

option(BUILD_WITH_PFLOGGER "Build MAPL with pFlogger library support" ON)
Expand Down Expand Up @@ -114,7 +122,9 @@ if (NOT Baselibs_FOUND)
add_definitions(-DH5_HAVE_PARALLEL)
endif()

find_package(ESMF MODULE REQUIRED)
if (NOT TARGET esmf)
find_package(ESMF MODULE REQUIRED)
endif ()
endif ()

if (BUILD_WITH_PFLOGGER)
Expand Down
4 changes: 3 additions & 1 deletion MAPL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ 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
DEPENDENCIES MAPL.base MAPL.generic MAPL.pfio MAPL_cfio_r4 MAPL.gridcomps MAPL.orbit MAPL.griddedio ${EXTDATA_TARGET}
esmf NetCDF::NetCDF_Fortran MPI::MPI_Fortran
$<$<BOOL:${BUILD_WITH_FLAP}>:FLAP::FLAP>
TYPE ${MAPL_LIBRARY_TYPE}
)

target_compile_definitions (${this} PRIVATE $<$<BOOL:${USE_EXTDATA2G}>:BUILD_WITH_EXTDATA2G>)

target_include_directories (${this} PUBLIC
$<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
3 changes: 2 additions & 1 deletion MAPL/MAPL.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ module MAPL
use MAPLBase_mod
use MAPL_GenericMod
use MAPL_VarSpecMiscMod
use MAPL_ExtDataGridCompMod, only: T_EXTDATA_STATE, EXTDATA_WRAP
use ESMF_CFIOMod
use pFIO
use MAPL_GridCompsMod
use mapl_StubComponent
use MAPL_ESMFFieldBundleRead
use MAPL_ESMFFieldBundleWrite
implicit none
end module MAPL

Expand Down
1 change: 1 addition & 0 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if (BUILD_WITH_FLAP)
target_link_libraries(ExtDataDriver.x PRIVATE OpenMP::OpenMP_Fortran)
endif ()
set_target_properties(ExtDataDriver.x PROPERTIES Fortran_MODULE_DIRECTORY ${MODULE_DIRECTORY})
target_compile_definitions (ExtDataDriver.x PRIVATE $<$<BOOL:${USE_EXTDATA2G}>:BUILD_WITH_EXTDATA2G>)

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)
Expand Down
21 changes: 16 additions & 5 deletions Tests/ExtDataDriverGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
module ExtData_DriverGridCompMod
use ESMF
use MAPL
use MAPL_ExtDataGridCompMod, only : ExtData_SetServices => SetServices
#if defined(BUILD_WITH_EXTDATA2G)
use MAPL_ExtDataGridComp2G, only : ExtData2G_SetServices => SetServices
#endif
use MAPL_ExtDataGridCompMod, only : ExtData1G_SetServices => SetServices
use MAPL_HistoryGridCompMod, only : Hist_SetServices => SetServices
use MAPL_Profiler, only : get_global_time_profiler, BaseProfiler

Expand Down Expand Up @@ -140,6 +143,7 @@ subroutine initialize_gc(gc, import_state, export_state, clock, rc)
procedure(), pointer :: root_set_services
type(ExtData_DriverGridComp), pointer :: cap
class(BaseProfiler), pointer :: t_p
logical :: use_extdata2g

_UNUSED_DUMMY(import_state)
_UNUSED_DUMMY(export_state)
Expand Down Expand Up @@ -212,6 +216,7 @@ subroutine initialize_gc(gc, import_state, export_state, clock, rc)
!EOR
enableTimers = ESMF_UtilStringUpperCase(enableTimers, rc = status)
_VERIFY(status)
call MAPL_GetResource(maplobj,use_extdata2g,"USE_EXTDATA2G:",default=.false.,_RC)

if (enableTimers /= 'YES') then
call MAPL_ProfDisable(rc = status)
Expand Down Expand Up @@ -319,10 +324,16 @@ subroutine initialize_gc(gc, import_state, export_state, clock, rc)

call MAPL_Set(MAPLOBJ, CF=CAP%CF_EXT, RC=STATUS)
_VERIFY(STATUS)

cap%extdata_id = MAPL_AddChild (MAPLOBJ, name = 'EXTDATA', SS = ExtData_SetServices, rc = status)
_VERIFY(status)

if (use_extdata2g) then
#if defined(BUILD_WITH_EXTDATA2G)
cap%extdata_id = MAPL_AddChild (MAPLOBJ, name = 'EXTDATA', SS = ExtData2G_SetServices, _RC)
#else
_FAIL('ExtData2G requested but not built')
#endif
else
cap%extdata_id = MAPL_AddChild (MAPLOBJ, name = 'EXTDATA', SS = ExtData1G_SetServices, _RC)
end if

end if

! Query MAPL for the the children's for GCS, IMPORTS, EXPORTS
Expand Down
2 changes: 2 additions & 0 deletions base/FileMetadataUtilities.F90
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ subroutine get_time_info(this,startTime,startyear,startmonth,startday,starthour,
allocate(timeVector,source=tVec,stat=status)
_VERIFY(status)
end if
_RETURN(_SUCCESS)

end subroutine get_time_info

Expand Down Expand Up @@ -516,6 +517,7 @@ subroutine get_coordinate_info(this,coordinate_name,coordSize,coordUnits,coords,
_ASSERT(.false.,"unsupported coordel variable type")
end select
end if
_RETURN(_SUCCESS)

end subroutine get_coordinate_info

Expand Down
7 changes: 5 additions & 2 deletions base/MAPL_SimpleBundleMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,8 @@ end subroutine MAPL_SimpleBundleDestroy
!

Function MAPL_SimpleBundleRead (filename, bundle_name, grid, time, verbose, &
only_vars, expid, rc ) result (self)
only_vars, expid, voting, unusable, rc ) result (self)
use mapl_KeywordEnforcerMod

! !ARGUMENTS:

Expand All @@ -762,6 +763,8 @@ Function MAPL_SimpleBundleRead (filename, bundle_name, grid, time, verbose, &
logical, OPTIONAL, intent(in) :: verbose
character(len=*), optional, intent(IN) :: only_vars
character(len=*), optional, intent(IN) :: expid
class(KeywordEnforcer), optional, intent(in) :: unusable
logical, optional, intent(in) :: voting
integer, OPTIONAL, intent(out) :: rc

! !DESCRIPTION:
Expand All @@ -781,7 +784,7 @@ Function MAPL_SimpleBundleRead (filename, bundle_name, grid, time, verbose, &
Bundle = ESMF_FieldBundleCreate ( name=bundle_name, __RC__ )
call ESMF_FieldBundleSet ( bundle, grid=Grid, __RC__ )
call MAPL_CFIORead ( filename, Time, Bundle, verbose=verbose, &
ONLY_VARS=only_vars, expid=expid, __RC__ )
ONLY_VARS=only_vars, expid=expid, voting=voting, __RC__ )
self = MAPL_SimpleBundleCreate ( Bundle, __RC__ )
self%bundleAlloc = .true.

Expand Down
Loading

0 comments on commit 8edb2d0

Please sign in to comment.