How mpas-dev/mpas-model works
Main Components
a. Central “Atmosphere Core” – at the heart of the atmosphere code are files such as mpas_atm_core.F and its corresponding interface routines (e.g., mpas_atm_core_interface.F) that coordinate the simulation.
c. Physics Module – include the parameterizations for physical processes such as convection, radiation, microphysics, boundary layer processes, and surface exchanges. These are maintained in files under “src/core_atmosphere/physics”.
d. Diagnostics Module – represent the diagnostics routines responsible for computing and outputting meteorological and derived fields, which might include assembling diagnostic registries and managing observational output, generally found under “src/core_atmosphere/diagnostics”.
e. Supporting Utilities – highlight any common build options, registry files (like Registry.xml) that provide metadata definitions for variables and field information, and any shared routines (I/O or parallel utilities) that support the atmospheric core.
Relationships and Data Flow
a. That the Atmosphere Core is driven by a higher‐level driver that calls the core’s initialization, dynamics update, physics routines, and diagnostics.
c. That there is integration between the dynamics and physics – each module calls subroutines within the other to ensure that the computed tendencies and state updates are consistent.
d. That the registry files serve as a contract between configuration tools (and build scripts) and the runtime code, ensuring that data fields generated by physical parameterizations are clearly defined.
Architectural Patterns and Design Principles
a. Modularity – each module (dynamics, physics, diagnostics) is developed as an independent unit but with well-defined interfaces. Represent each unit as a separate block.
b. Separation of Concerns – dynamics and physics modules are conceptually separate (one handles fluid motion; the other manages microphysical and radiative effects) yet collaborate via common data structures.
c. Reusability and Extensibility – show that common routines (shared with the MPAS framework) are invoked as services (for I/O, parallel communications, etc.). These can be represented in a supporting “Utilities” or “Framework Support” block.
d. Build and Configuration – include configuration/build interactions (e.g., CMakeLists.txt and Makefiles within “src/core_atmosphere”) that help compile and link these modules; these influence and enforce dependencies.