From cdc12c91bf627be8a3dfea83785cbc8b4ff95af8 Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Thu, 30 Apr 2026 18:54:37 -0400 Subject: [PATCH 1/2] Port OVP.F90 off MAPL_GenericMod to MAPL3 - Replace use MAPL2 with use MAPL and use mapl3g_GridGet - Replace MAPL_MetaComp/MAPL_GetObjectFromGC/MAPL_Get with MAPL_GridCompGet + GridGetCoordinates - Change LONS from REAL(R4) to REAL(R8) pointer (ESMF grid coords are R8) - Add MAPL.geom to CMake dependencies Closes #418 --- GEOS_Shared/CMakeLists.txt | 2 +- GEOS_Shared/OVP.F90 | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/GEOS_Shared/CMakeLists.txt b/GEOS_Shared/CMakeLists.txt index 00550c2b..b0d39d1d 100644 --- a/GEOS_Shared/CMakeLists.txt +++ b/GEOS_Shared/CMakeLists.txt @@ -8,7 +8,7 @@ set (srcs getco2.F90 atmOceanIntLayer.F90 ) -esma_add_library(${this} SRCS ${srcs} DEPENDENCIES MAPL2 MAPL ESMF::ESMF NetCDF::NetCDF_Fortran) +esma_add_library(${this} SRCS ${srcs} DEPENDENCIES MAPL2 MAPL MAPL.geom ESMF::ESMF NetCDF::NetCDF_Fortran) # special cases set_source_files_properties(sphere.F PROPERTIES COMPILE_FLAGS "${FREAL8}") diff --git a/GEOS_Shared/OVP.F90 b/GEOS_Shared/OVP.F90 index d4ad0b73..a7b0091f 100644 --- a/GEOS_Shared/OVP.F90 +++ b/GEOS_Shared/OVP.F90 @@ -1,4 +1,4 @@ -#include "MAPL_Generic.h" +#include "MAPL.h" !BOP @@ -13,7 +13,8 @@ module OVP ! !USES: use ESMF - use MAPL2 + use MAPL + use mapl3g_GridGet, only: GridGetCoordinates implicit none private @@ -72,7 +73,7 @@ subroutine OVP_init ( GC, GC_DT_LABEL, LONS, RUN_DT, GC_DT, RC ) TYPE(ESMF_GridComp), INTENT(inout) :: GC ! Gridded component CHARACTER(len=*), INTENT(in) :: GC_DT_LABEL ! String to get the GridComp-specific timestep - REAL(ESMF_KIND_R4), POINTER, INTENT(out) :: LONS(:,:) ! radians + REAL(ESMF_KIND_R8), POINTER, INTENT(out) :: LONS(:,:) ! radians INTEGER, INTENT(out) :: RUN_DT ! main timestep (seconds) INTEGER, INTENT(out) :: GC_DT ! GridComp timestep (seconds) INTEGER, OPTIONAL, INTENT(out) :: RC ! Error code @@ -103,7 +104,8 @@ subroutine OVP_init ( GC, GC_DT_LABEL, LONS, RUN_DT, GC_DT, RC ) CHARACTER(len=ESMF_MAXSTR) :: IAm INTEGER :: STATUS - type (MAPL_MetaComp), pointer :: STATE + type(ESMF_Grid) :: grid + REAL(ESMF_KIND_R8), pointer :: lats(:,:) TYPE (ESMF_Config) :: CF REAL :: dt1, dt2 @@ -112,9 +114,9 @@ subroutine OVP_init ( GC, GC_DT_LABEL, LONS, RUN_DT, GC_DT, RC ) IAm = "OVP_init" - call MAPL_GetObjectFromGC ( GC, STATE, __RC__ ) ! Get MAPL state + call MAPL_GridCompGet(GC, grid=grid, _RC) - call MAPL_Get( STATE, LONS=LONS, __RC__ ) ! Get LONS + call GridGetCoordinates(grid, LONS, lats, _RC) ! Get LONS call ESMF_GridCompGet ( GC, CONFIG=CF, __RC__ ) ! Get Config @@ -142,7 +144,7 @@ subroutine OVP_mask ( LONS, DELTA_TIME, OVERPASS_HOUR, MASK ) ! !ARGUMENTS - REAL, INTENT(IN) :: LONS(:,:) ! radians + REAL(ESMF_KIND_R8), INTENT(IN) :: LONS(:,:) ! radians INTEGER, INTENT(IN) :: DELTA_TIME ! seconds INTEGER, INTENT(IN) :: OVERPASS_HOUR INTEGER, ALLOCATABLE, INTENT(OUT) :: MASK(:,:) ! timestep closest to local overpass time, packed in hr/min/sec From a0c45d4ec62c4f9dd14361cf060073fe9d3e6245 Mon Sep 17 00:00:00 2001 From: Tom Clune Date: Thu, 30 Apr 2026 19:04:52 -0400 Subject: [PATCH 2/2] Fix OVP.F90: add explicit use MAPLBase_mod for symbols not in mapl3g --- GEOS_Shared/OVP.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/GEOS_Shared/OVP.F90 b/GEOS_Shared/OVP.F90 index a7b0091f..9f41cccc 100644 --- a/GEOS_Shared/OVP.F90 +++ b/GEOS_Shared/OVP.F90 @@ -14,6 +14,7 @@ module OVP use ESMF use MAPL + use MAPLBase_mod, only: MAPL_AM_I_ROOT, MAPL_PI_R8, MAPL_PackTime use mapl3g_GridGet, only: GridGetCoordinates implicit none