Move ESMF_Interfaces.F90 to superstructure/interfaces/ (new MAPL.ESMF_Interfaces)#5176
Open
pchakraborty wants to merge 1 commit into
Open
Move ESMF_Interfaces.F90 to superstructure/interfaces/ (new MAPL.ESMF_Interfaces)#5176pchakraborty wants to merge 1 commit into
pchakraborty wants to merge 1 commit into
Conversation
…_Interfaces)
ESMF_Interfaces.F90 was living in infrastructure/esmf/ only because it
could not be placed in superstructure/generic/ -- doing so would create a
circular CMake dependency: MAPL.generic depends on MAPL.state, which in
turn already depends on MAPL.esmf, and MAPL.esmf would have needed to
depend on MAPL.generic to consume the interfaces. Breaking that cycle
requires a dedicated library that sits below both MAPL.state and
MAPL.generic in the dependency graph, with no upward dependencies of its
own.
The new MAPL.ESMF_Interfaces library (superstructure/interfaces/) fills
exactly that role: it depends only on ESMF::ESMF, so both MAPL.state and
MAPL.generic can safely list it as a dependency without introducing a
cycle.
Changes:
- infrastructure/esmf/CMakeLists.txt: remove ESMF_Interfaces.F90 from
MAPL.esmf sources
- superstructure/interfaces/: new directory with ESMF_Interfaces.F90,
API.F90, and CMakeLists.txt defining the MAPL.ESMF_Interfaces library
- superstructure/CMakeLists.txt: add add_subdirectory(interfaces) and
MAPL.ESMF_Interfaces dependency
- superstructure/state/CMakeLists.txt: add MAPL.ESMF_Interfaces dependency
- superstructure/generic/CMakeLists.txt: add MAPL.ESMF_Interfaces dependency
- superstructure/generic/API.F90: remove now-stale commented-out aliases
for UserCompGetInternalState / UserCompSetInternalState
- superstructure/API.F90: re-export mapl_esmf_interfaces_api
- superstructure/generic/{InnerMetaComponent,MAPL_Generic,OpenMP_Support,
OuterMetaComponent/*,transforms/CouplerMetaComponent}: no module-level
changes needed; mapl_ESMF_Interfaces_mod is still the same module name
tclune
reviewed
Jun 23, 2026
| set (srcs | ||
| # From esmf_utils/ | ||
| ESMF_Interfaces.F90 # cannot move to MAPL.generic, causes circular dependency | ||
| # ESMF_Interfaces.F90 moved to superstructure/interfaces/ |
Collaborator
There was a problem hiding this comment.
Shouldn't this line just be deleted - do we really care where it once was?
tclune
reviewed
Jun 23, 2026
| @@ -0,0 +1,13 @@ | |||
| ! Export umbrella for the MAPL.ESMF_Interfaces library. | |||
Collaborator
There was a problem hiding this comment.
Do we really need an entire library for not-even-exceutable code?
tclune
reviewed
Jun 23, 2026
tclune
left a comment
Collaborator
There was a problem hiding this comment.
I'd like to have just a brief discussion to see if there is a way to avoid the heavy hammer of an entire library for a file that does not even contain executable code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ESMF_Interfaces.F90was living ininfrastructure/esmf/only because it could not be placed insuperstructure/generic/— doing so would create a circular CMake dependency:MAPL.genericdepends onMAPL.state, which in turn already depends onMAPL.esmf, andMAPL.esmfwould have needed to depend onMAPL.genericto consume the interfaces. Breaking that cycle requires a dedicated library that sits below bothMAPL.stateandMAPL.genericin the dependency graph, with no upward dependencies of its own.The new
MAPL.ESMF_Interfaceslibrary (superstructure/interfaces/) fills exactly that role: it depends only onESMF::ESMF, so bothMAPL.stateandMAPL.genericcan safely list it as a dependency without introducing a cycle.Changes
infrastructure/esmf/CMakeLists.txt: removeESMF_Interfaces.F90fromMAPL.esmfsourcessuperstructure/interfaces/: new directory withESMF_Interfaces.F90,API.F90, andCMakeLists.txtdefining theMAPL.ESMF_Interfaceslibrarysuperstructure/CMakeLists.txt: addadd_subdirectory(interfaces)andMAPL.ESMF_Interfacesdependencysuperstructure/state/CMakeLists.txt: addMAPL.ESMF_Interfacesdependencysuperstructure/generic/CMakeLists.txt: addMAPL.ESMF_Interfacesdependencysuperstructure/generic/API.F90: remove now-stale commented-out aliases forUserCompGetInternalState/UserCompSetInternalStatesuperstructure/API.F90: re-exportmapl_esmf_interfaces_apisuperstructure/generic/{InnerMetaComponent,MAPL_Generic,OpenMP_Support,OuterMetaComponent/*,transforms/CouplerMetaComponent}: no module-level changes needed;mapl_ESMF_Interfaces_modis still the same module name