-
Notifications
You must be signed in to change notification settings - Fork 0
FMS Usage in Global Workflow Infrastructure
Date: May 4, 2026
Analysis Method: MCP-RAG tool-assisted investigation (AgentCore Runtime v5, Neptune graph + OpenSearch vector)
Companion: FMS-Analysis-MCP-Tool-Effectiveness-Report
The Flexible Modeling System (FMS) is a foundational software framework developed by GFDL (Geophysical Fluid Dynamics Laboratory) that provides core infrastructure services to the UFS Weather Model and its component models within the Global Workflow. FMS is not a single executable — it is a library of Fortran modules that provides message passing (MPI), I/O, diagnostics, domain decomposition, time management, and physical constants to every model component in the coupled system.
FMS permeates the Global Workflow at multiple levels:
| Layer | FMS Role | Scope |
|---|---|---|
| UFS Model Core | Runtime initialization/finalization (fms_init/fms_end) |
188 callers / 316 callers |
| Atmosphere (FV3) | Domain decomposition, namelist I/O, climate nudging | FV3 dynamical core |
| Ocean (MOM6) | Diagnostic output, I/O infrastructure, domain management | MOM6 via FMS2 interface |
| Sea Ice (CICE) | History file conversion (cice_hist2fms) |
CICE ↔ FMS format bridge |
| Data Assimilation (JEDI/GDAS) | FMS namelist management, cube-sphere increments, state conversion | fv3-jedi, SOCA |
| Diagnostics |
diag_manager controls all ATM and MOM6 output via diag_table
|
Runtime output control |
| Build System | FMS compiled as shared library, linked by all UFS components | sorc/ufs_model.fd/ |
FMS lives within the UFS model submodule tree. The Global Workflow does not contain FMS source directly — it is pulled in transitively through the UFS model:
global-workflow/
└── sorc/
└── ufs_model.fd/ ← UFS Weather Model (git submodule)
├── FMS/ ← FMS library source (GFDL)
└── MOM6-interface/
└── MOM6/
└── config_src/
└── infra/
├── FMS1/ ← MOM6 FMS1 compatibility layer
└── FMS2/ ← MOM6 FMS2 interface (current)
MOM6 maintains its own FMS infrastructure adapters (FMS1/ and FMS2/) that abstract the FMS version differences, plus an FMS_cap/ driver for standalone MOM6 runs.
The fms_init subroutine is the entry point for the entire FMS framework. It initializes MPI communication, sets up the domain decomposition, and prepares the I/O and diagnostic subsystems. 188 Fortran subroutines across the codebase call fms_init, making it one of the most widely-used symbols in the Global Workflow.
Key callers include:
-
initialize— UFS model top-level initialization -
create,setup_domain— Domain setup routines -
set_and_fill_geometry_fields— Grid geometry initialization -
pedges2pmidlayer,getVerticalCoord— Vertical coordinate setup -
get_data,get_num_nodes_and_elements— Data access routines
Even more widely referenced than fms_init, fms_end is called by 316 Fortran subroutines. This includes MPI communication routines, domain management, halo updates, and broadcast operations — all of which need access to the FMS finalization path for clean shutdown:
-
mp_assign_gid,mp_start,mp_stop,mp_barrier— MPI management -
domain_decomp,broadcast_domains,switch_current_domain— Domain operations -
start_var_group_update_2d/3d/4d— Halo exchange operations -
complete_group_halo_update— Halo completion -
switch_current_Atm— Atmosphere grid switching
The fms_mod Fortran module provides the primary FMS API. It is used by:
-
fv_climate_nudge_nlm_mod— FV3 climate nudging -
fv_climate_nudge_init,fv_climate_nudge,fv_climate_nudge_end— Nudging lifecycle -
var_state_init,var_state_assignment,var_state_del— Variable state management -
prt_minmax_2d,prt_minmax_3d— Diagnostic print routines -
remap_coef,remap_xy_3d,remap_xy_2d,remap_ps,remap_3d— Remapping operations
The FMS2 I/O module provides the current-generation file I/O interface. It is used by:
-
fv_control_init— FV3 control initialization -
set_namelist_pointers— Namelist configuration -
read_namelist_*— Multiple namelist readers (nest, fv_nest, fv_grid, fv_core, test_case) -
setup_update_regions— Update region configuration -
fv_end— FV3 finalization -
fv3jedi_fv3_control_mod— JEDI FV3 interface -
set_eta,set_external_eta— Vertical coordinate setup -
var_les,var_gfs— Variable configuration
The FMS message passing module (mpp_mod) wraps MPI and provides domain-aware communication. Used by the same broad set of FV3 routines as fms_mod, it is the backbone of all parallel communication in the UFS model.
FMS provides standardized physical constants used across all model components:
-
med_kind_mod,ufs_const_mod— UFS mediator constants -
med_diag_mod,med_diag_init— Mediator diagnostics -
med_phases_diag_accum,med_phases_diag_atm,med_phases_diag_lnd— Component diagnostics -
diag_atm_recv,diag_atm_send— Atmosphere diagnostic exchange -
diag_lnd,diag_rof— Land and river diagnostics
The FMS diagnostic manager controls all model output. It is configured at runtime via the diag_table file and manages output for both the ATM (FV3) and ocean (MOM6) components.
Configuration files:
-
diag_table— Defines output fields, files, sampling intervals, and reduction methods -
diag_manager_nml— Namelist controlling diagnostic manager behavior (max files, fields, CMOR mode) -
field_table— Tracer registration and management
Output controlled by FMS diag_manager:
-
atmos_4xdaily.tile[1-6].nc— 4× daily atmospheric diagnostics -
atmos_static.tile[1-6].nc— Static atmospheric fields -
atmfHHH.nc— Atmospheric forecast files -
sfcfHHH.nc— Surface forecast files -
grid_spec.tile[1-6].nc— Grid specification
The diag_table field format specifies: module_name, field_name, output_name, file_name, time_sampling, reduction_method, regional_section, and packing precision.
FMS plays a critical role in the data assimilation pipeline through the FV3-JEDI interface:
-
fv3jedi_fmsnamelist_mod.f90— Manages FMS namelists for JEDI -
fmsmpp.nml— FMS MPI configuration for JEDI tests
FMS defines the "non-restart" file format used by FV3. JEDI needs to convert between FMS and restart formats:
-
convertstate_gfs_restart2fms_nonrestart.yaml— Restart → FMS format -
convertstate_gfs_fms_nonrestart2restart.yaml— FMS → Restart format -
fv3jediGeosToFms.f90— GEOS to FMS format converter
-
_add_fms_cube_sphere_increments(Python function) — Adds DA increments in FMS cube-sphere format - Called by
finalize→to_fv3time→add_incrementschain - JCB templates:
atmosphere_final_increment_fms_nonrestart.yaml.j2,atmosphere_output_ensemble_increments_fms_nonrestart.yaml.j2
-
FmsInput.h/FmsInput.cc— C++ FMS input interface for SOCA geometry -
cice_hist2fms— Converts CICE history files to FMS format for ocean DA
-
snow_final_increment_fms.yaml.j2— Snow increment in FMS format -
soil_final_increment_fms.yaml.j2— Soil increment in FMS format
MOM6 has the deepest FMS integration of any component:
-
MOM_io_infra.F90— MOM6 I/O layer built on FMS (io_infra_init,io_infra_end) -
MOM_diag_manager_infra.F90— MOM6 diagnostic manager wrapper around FMS diag_manager -
fms_diag_id— Every MOM6 diagnostic field has an underlying FMS diagnostic ID
MOM6 maintains two FMS interface layers:
-
config_src/infra/FMS1/— Legacy FMS1 compatibility -
config_src/infra/FMS2/— Current FMS2 interface (active in Global Workflow)
-
config_src/drivers/FMS_cap/— FMS-based MOM6 driver for standalone runs
MOM6 diagnostics are entirely managed through FMS:
- The
diag_tablecontrols MOM6 output fields -
mom_is_diag_mediatorprovides wrappers to FMSdiag_managerinterfaces - 2D/3D axes, masks, and conversion factors are all managed through FMS diagnostic types
The Global Workflow includes a standalone FMS utility:
-
rdbfmsua.fd/rdbfmsua.f— Reads FMS upper-air data files - Platform-specific modulefiles:
rdbfmsua_hera.intel.lua,rdbfmsua_orion.intel.lua,rdbfmsua_wcoss2.intel.lua - Located in
sorc/gfs_utils.fd/src/rdbfmsua.fd/
FMS is compiled as a shared library during the UFS model build process. The CMake build system in sorc/ufs_model.fd/ compiles FMS first, then links it into:
- FV3 atmospheric dynamical core
- MOM6 ocean model
- CICE sea ice model
- CMEPS mediator
- All JEDI/DA components that interface with FV3
The MOM6 autoconf build system also has FMS-specific configuration:
-
configure.fms.ac— FMS autoconf configuration -
Makefile.fms.in— FMS Makefile template
┌─────────────────────────────────┐
│ FMS Library │
│ (fms_mod, mpp_mod, fms2_io, │
│ diag_manager, constants_mod) │
└──────────┬──────────────────────┘
│
┌────────────────────┼─────────────────────┐
│ │ │
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ FV3 (ATM) │ │ MOM6 (OCN) │ │ CICE (ICE) │
│ fms_init: │ │ FMS2 infra │ │ hist2fms │
│ 188 callers │ │ diag_mgr │ │ format conv │
│ fms_end: │ │ io_infra │ └──────────────┘
│ 316 callers │ │ FMS_cap │
└──────┬───────┘ └──────┬───────┘
│ │
▼ ▼
┌──────────────┐ ┌──────────────┐
│ JEDI/GDAS │ │ CMEPS │
│ fv3-jedi │ │ Mediator │
│ fms nml mgr │ │ constants │
│ cube-sphere │ │ diagnostics │
│ increments │ └──────────────┘
└──────────────┘
│
▼
┌──────────────┐
│ SOCA (OCN │
│ DA) │
│ FmsInput │
│ cice_hist2 │
│ fms │
└──────────────┘
-
FMS is ubiquitous — With
fms_initcalled by 188 subroutines andfms_endby 316, FMS is the most widely-used infrastructure library in the UFS model -
FMS controls all diagnostics — The
diag_table/diag_managersystem is the sole mechanism for ATM and MOM6 output file generation - FMS bridges DA and forecast — The FMS file format (non-restart) is the interchange format between JEDI data assimilation and the FV3 forecast model
- MOM6 is deeply coupled to FMS — MOM6 maintains its own FMS1/FMS2 compatibility layers and uses FMS for all I/O and diagnostics
- FMS is a build dependency — It must be compiled first and is linked by every UFS component
Analysis performed using MDC MCP-RAG AgentCore Runtime v5 (51 tools, Neptune 148K nodes, OpenSearch 206K docs).
See FMS-Analysis-MCP-Tool-Effectiveness-Report for tool-by-tool effectiveness assessment.