Add a 2D plotfile diagnostic catalog#3372
Merged
asalmgren merged 2 commits intoJun 30, 2026
Merged
Conversation
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
This PR adds a small catalog for built-in 2D plotfile diagnostics. The catalog defines each 2D output name, long name, units, category, and missing-value policy. It also defines the canonical 2D output order used when users request variables through
erf.plot2d_vars_1orerf.plot2d_vars_2.This change keeps the 2D plotfile writer as an I/O assembly layer. It does not add new diagnostics or move science calculations into the plotfile code.
Motivation
The 2D plotfile path is growing beyond simple geometry fields. It now includes surface-layer diagnostics, selected surface fluxes, surface pressure, radiation output, and column-integrated water vapor. A catalog gives these fields one source of truth for names and metadata before we add more diagnostics.
The catalog also helps future developers and AI coding agents keep documentation, tests, and output order synchronized.
What changed
Added
ERF_Plotfile2DCatalog.H/.cpp.Defined typed metadata for built-in 2D diagnostics:
Updated
setPlotVariables2Dto use catalog names as the available 2D variable list.Removed the old independent
derived_names_2dlist fromERF.H.Documented the contract that the catalog order must stay synchronized with the 2D fill order until fill logic moves into dedicated diagnostic modules.
Fixed the
laten_fluxavailability guard so it checksSFS_q1fx3_lev[lev]before readingSFS_q1fx3_lev[lev].Updated Sphinx documentation to identify the 2D output table as the built-in 2D diagnostic catalog.
Added unit tests for catalog order, uniqueness, metadata completeness, lookup behavior, and selection order.
Updated Make and CMake source lists for the new catalog file.
User-visible behavior
The 2D output names and canonical component order are preserved.
The only intended output behavior change is an I/O guard fix for
laten_flux: ERF now fills-999if the vertical water-vapor flux field is unavailable, instead of checking the heat-flux field before reading the water-vapor flux field.Scientific impact
None expected.
This PR does not change model equations, physics parameterizations, tendencies, boundary conditions, time stepping, or state evolution. It changes I/O metadata, 2D plotfile variable selection, documentation, and tests.
Testing
Added focused GoogleTest coverage for the 2D catalog and selection contracts.
Notes for reviewers
The catalog is metadata only. It should not become the home for diagnostic science.