Audience: coding agents and developers working in the GEOS_OceanGridComp repository.
Describes: the MAPL2 line, branch develop.
Verified against: GEOS_OceanGridComp @ 8d91ab7 (2026-11-05).
Placement: as in the GEOSgcm fixture (components.yaml @ 0f2e0fb).
Other fixtures (for example GEOSadas, GEOSldas) may place this repository
elsewhere; paths inside this repository do not change.
Only what is easy to see in the code now. Entries grow over time. Context:
ARCHITECTURE.md. OGCM file is
GEOSogcm_GridComp/GEOS_OgcmGridComp.F90 in the parent repository GEOSgcm_GridComp.
- Pattern:
OCEANholds exactly one active ocean child (DATASEA,MOM,MOM6orMIT), chosen in itsSetServicesfromUSE_DATASEA:andOCEAN_NAME:; every plug-in presents the same short names (TW SW UW VW ...) andOCEANre-exports them as its own withMAPL_AddExportSpec(..., CHILD_ID=OCN)(GEOS_OceanGridComp.F90,SetServices). [Verified] - Likely reason: the parent
OGCMand the sea-ice and radiation siblings are written once againstOCEAN, whichever model runs. [Inferred] - Question for maintainers: the plug-ins differ in some names (
MOM_3D_MASK,MIT_3D_MASK,MOM_2D_MASK;UWC/VWConly forMOM6;T_Freezeonly forMOM6). Which of these differences are part of theOCEANcontract?
- Pattern: each ocean model is wrapped in its own directory and gridded component (
MOM_GEOS5PlugMod,MOM6_GEOSPlug,MIT_GEOS5PlugMod); the model source is a separate nested repository cloned beneath it (components.yaml:mom,mom6,stochastic_physics,mitwithlocal:under the plug-in directory; plug-inCMakeLists.txt:SUBCOMPONENTS @mom,esma_mepo_style(mom6 ...),SET (MITGCM_ROOTDIR ... /@mit)). [Verified] - Likely reason: the models have their own upstream histories and build systems, and the plug-in is the only GEOS-specific code. [Inferred]
- Pattern:
MOMandMOM6are added withMAPL_AddChild(name, 'setservices_', parentGC=GC, sharedObj=...), library names fromMOM_GEOS5PLUGMOD:/MOM6_GEOSPLUG:;MITandDATASEAare added withSS=<SetServices>(GEOS_OceanGridComp.F90,SetServices). TheMOMandMOM6plug-ins are builtTYPE SHARED(theirCMakeLists.txt) and each ends in a freeSetServicessubroutine;MIT_GEOS5PlugModis compiled in only withBUILD_MIT_OCEAN. [Verified] - Likely reason: both FMS-based models (MOM5, MOM6) may not be linkable into one executable, so each is a library selected at run time. [Inferred;
gcm_setupsetsOCEAN_PRELOADtolibmomorlibmom6for the chosen model (src/Applications/@GEOSgcm_App/gcm_setup,OCNMODELbranches), which points the same way] - Question for maintainers: what led to a build-time switch (
BUILD_MIT_OCEAN) forMIT, which also replaces the sea-ice composite?
- Pattern: before running the child,
OCEANmultiplies fluxes byWGHT = FROCEAN/MASKand copies them into the child's import state; after running, it writes child exports back only whereWGHT > 0and advances the surface temperature of "orphan" points (ocean fraction but no child ocean point) with an explicit heat budget overOGCM_TOP_LAYER:(GEOS_OceanGridComp.F90,Run). [Verified] - Likely reason: the ocean models and the atmosphere use different land-sea masks; the wrapper makes the exchange conserve what the ocean sees and gives the atmosphere a surface temperature everywhere it has ocean. [Inferred]
- Question for maintainers: which component is meant to own the orphan-point treatment?
- Pattern: for a real ocean
OCEANcallsMAPL_TerminateImportfor the fluxes it will copy itself and fills the child's import state inRun(GEOS_OceanGridComp.F90,SetServices,Run). The parentOGCMlikewise terminates mostOCEANimports and fills them withMAPL_LocStreamTransform(OGCM file,SetServices,Run). [Verified] - Likely reason: the fluxes must be scaled by
WGHTand combined with sea-ice terms (for exampleSHFLX - FHOCN,RAIN + FRESH), which a plain connection cannot do. [Inferred]
- Pattern:
DUAL_OCEAN: 1adds a secondDATASEAchild, registers a secondRunphase onOCEAN, onOGCMand on each of theMOM,MOM6andMITplug-ins, and computes a temperature correctionDEL_TEMPfrom the difference between the data-ocean and model surface temperature (GEOS_OceanGridComp.F90,Run;MOM_GEOS5PlugMod.F90,MOM6_GEOSPlug.F90,MIT_GEOS5PlugMod.F90, eachRun2;OGCM file,Run). [Verified] - Likely reason: nudge the model ocean toward observed SST in the predictor/corrector steps of regular replay. [Inferred]
- Question for maintainers: is
DUAL_OCEANsupported for all three ocean models? The template mentions it only as aMOM5hint (@MOM5#DUAL_OCEAN: 1insrc/Applications/@GEOSgcm_App/AGCM.rc.tmpl).
- Pattern:
OCEAN,DATASEA,MOMandMOM6declare state in*_StateSpecs.rcthroughmapl_acg;MIT_GEOS5PlugModlists imports and exports in an array ofmstaterecords and callsMAPL_AddImportSpec/MAPL_AddExportSpecin a loop, mirroring every import as an export (CMakeLists.txtfiles;MIT_GEOS5PlugMod.F90,SetServices). [Verified] - Likely reason: not apparent from the code. [Inferred: the MIT plug-in may predate the use of ACG here]
- Pattern: the plug-ins keep the model's own data structures (
ocean_public_type,ice_ocean_boundary_type, the model state) in a pointer wrapper stored withESMF_UserCompSetInternalStateand restart through the model's own restart routine from theRecordentry point (MOM_GEOS5PlugMod.F90,Initialize,Record;MOM6_GEOSPlug.F90,Initialize,Record). [Verified] - Likely reason: the model's restart format and I/O belong to the model; MAPL's internal-state restart handles only the few fields declared with
MAPL_AddInternalSpec(for exampleTS_FOUND,FRACICE,VOLICE). [Inferred]