Skip to content

Add a 2D plotfile diagnostic catalog#3372

Merged
asalmgren merged 2 commits into
erf-model:developmentfrom
pressel:add-2d-plotfile-catalog
Jun 30, 2026
Merged

Add a 2D plotfile diagnostic catalog#3372
asalmgren merged 2 commits into
erf-model:developmentfrom
pressel:add-2d-plotfile-catalog

Conversation

@pressel

@pressel pressel commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

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_1 or erf.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:

    • diagnostic ID,
    • output name,
    • long name,
    • units,
    • category,
    • missing-value policy.
  • Updated setPlotVariables2D to use catalog names as the available 2D variable list.

  • Removed the old independent derived_names_2d list from ERF.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_flux availability guard so it checks SFS_q1fx3_lev[lev] before reading SFS_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 -999 if 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.

@pressel pressel requested review from AMLattanzi and asalmgren June 30, 2026 06:08
@asalmgren asalmgren merged commit 0c746f0 into erf-model:development Jun 30, 2026
41 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants