Skip to content

Commit 3bee8a5

Browse files
authored
Port Python bridge off MAPL.generic to compile with MAPL3 (#4728)
* Port Python bridge off MAPL.generic to compile with MAPL3 - Replace MAPL.generic link dep with MAPL.generic3g in CMakeLists.txt - Drop use MAPL_GenericMod in PythonBridge.F90 and python_fortran_bridge.F90 - MAPL_MetaComp -> ESMF_GridComp in all argument declarations - MAPL_GetPointer (preprocessor macro, gone in MAPL3) -> MAPL_StateGetPointer - MAPL_GetResource -> MAPL_GridCompGetResource (reordered args) - MAPL_Get(state, LM=) -> MAPL_GridCompGet(state, num_levels=) - MAPL_Get(state, IM/JM/NX/NY=) -> _FAIL() with explanatory message; these were already no-op stubs in MAPL2 and have no direct MAPL3 equivalent yet (requires geom API, tracked in MAPL#4724) Closes #4724 * Complete variable renames and replace ESMF_AttributeGet with ESMF_Info API - Rename esmf_state_c_ptr -> state_c_ptr in State-taking functions - Rename state_c_ptr/mapl_metacomp_c_ptr -> gridcomp_c_ptr in GridComp-taking functions - Rename c_mapl_state -> c_gridcomp in MAPL_Get* functions - Rename time_state_c_ptr -> time_interval_c_ptr, state -> time_interval in TimeIntervalGet - Replace deprecated ESMF_AttributeGet with ESMF_InfoGetFromHost + ESMF_InfoGet * Fix Python bridge CMake deps: MAPL.generic -> MAPL.generic3g only * Add MAPL (mapl3g) back to python bridge deps for PythonBridge.F90 * Simplify python bridge deps to just MAPL (generic3g comes transitively) * Move MAPL.python_bridge ownership from MAPL2 to MAPL (mapl3g) * Fix bridge: use Generic3g not MAPL, use MAPL.generic3g not MAPL in deps
1 parent 28c48f6 commit 3bee8a5

7 files changed

Lines changed: 120 additions & 154 deletions

File tree

MAPL/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ esma_set_this(OVERRIDE MAPL2)
22

33
esma_add_library (${this}
44
SRCS MAPL.F90
5-
DEPENDENCIES MAPL MAPL.base MAPL.pfio MAPL.gridcomps MAPL.orbit MAPL.field MAPL.python_bridge ${EXTDATA_TARGET}
5+
DEPENDENCIES MAPL MAPL.base MAPL.generic MAPL.pfio MAPL.gridcomps MAPL.orbit MAPL.field ${EXTDATA_TARGET}
66
ESMF::ESMF NetCDF::NetCDF_Fortran MPI::MPI_Fortran
77
TYPE SHARED
88
)

MAPL/MAPL.F90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ module MAPL2
1313
use MAPL_Profiler, initialize_profiler => initialize, finalize_profiler => finalize
1414
use MAPL_FieldUtils
1515
use MAPL_StateUtils
16-
use MAPL_PythonBridge
1716
implicit none
1817
end module MAPL2

Python/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ if (BUILD_PYTHONBRIDGE)
8787
endif ()
8888

8989
if (BUILD_PYTHONBRIDGE)
90-
set(dependencies MAPL.base MAPL.generic MAPL.shared ESMF::ESMF PythonBridge_interface_py )
90+
set(dependencies MAPL.base MAPL.generic3g MAPL.shared ESMF::ESMF PythonBridge_interface_py )
9191
else ()
92-
set(dependencies MAPL.base MAPL.generic MAPL.shared ESMF::ESMF)
92+
set(dependencies MAPL.base MAPL.generic3g MAPL.shared ESMF::ESMF)
9393
endif()
9494

9595
# Install the Python/MAPL directory

0 commit comments

Comments
 (0)