Skip to content

EAMxx: add log-linear interpolation option to VerticalRemapper and FieldAtPressureLevel diagnostic#8376

Open
bartgol wants to merge 1 commit into
masterfrom
bartgol/eamxx/log-linear-vert-remap
Open

EAMxx: add log-linear interpolation option to VerticalRemapper and FieldAtPressureLevel diagnostic#8376
bartgol wants to merge 1 commit into
masterfrom
bartgol/eamxx/log-linear-vert-remap

Conversation

@bartgol
Copy link
Copy Markdown
Contributor

@bartgol bartgol commented May 8, 2026

Allows to perform interpolation w.r.t. the log of the pressure coordinate.

[non-BFB] Only for streams that used vertical remapping (via remapper or pressure-level diag).


This PR replaces #8183 and depends on #8375, so it may get rebased while we wait for that PR to be integrated.

@bartgol bartgol requested a review from Copilot May 8, 2026 03:49
@bartgol bartgol added BFB PR leaves answers BFB EAMxx C++ based E3SM atmosphere model (aka SCREAM) labels May 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a log-linear vertical interpolation option (interpolating in
log-pressure space) to EAMxx vertical remapping and the FieldAtPressureLevel
diagnostic, and wires the option through IO stream configuration and selected
data-interpolation call sites.

Changes:

  • Extend VerticalRemapper with an interpolation type (linear vs log-linear)
    and log-transform support for pressure coordinate fields.
  • Thread a vert_interpolation_type stream parameter through Scorpio output and
    create_diagnostic, enabling log-linear pressure-level diagnostics.
  • Update unit/integration tests and multi-process output configs to preserve
    existing behavior by explicitly selecting linear where needed.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
components/eamxx/tests/multi-process/physics_only/shoc_p3_nudging/output_remapped.yaml Pins stream vertical interpolation to linear for test stability.
components/eamxx/tests/multi-process/dynamics_physics/mam/homme_shoc_cld_spa_p3_rrtmgp_mam4_wetscav/output.yaml Pins stream vertical interpolation to linear.
components/eamxx/tests/multi-process/dynamics_physics/mam/homme_shoc_cld_p3_mam_optics_rrtmgp/output.yaml Pins stream vertical interpolation to linear.
components/eamxx/tests/multi-process/dynamics_physics/mam/homme_shoc_cld_mam_aci_p3_mam_optics_rrtmgp_mam_drydep/output.yaml Pins stream vertical interpolation to linear.
components/eamxx/tests/multi-process/dynamics_physics/homme_shoc_cld_spa_p3_rrtmgp/output.yaml Pins stream vertical interpolation to linear.
components/eamxx/tests/multi-process/dynamics_physics/homme_shoc_cld_spa_p3_rrtmgp_pg2_dp/output.yaml Pins stream vertical interpolation to linear.
components/eamxx/tests/multi-process/dynamics_physics/homme_shoc_cld_spa_p3_rrtmgp_128levels/output.yaml Pins stream vertical interpolation to linear.
components/eamxx/tests/multi-process/dynamics_physics/homme_shoc_cld_p3_rrtmgp_pg2/output.yaml Pins stream vertical interpolation to linear.
components/eamxx/src/share/remap/vertical_remapper.hpp Adds InterpType, log-pressure helper, and refactors pressure/coord storage by vertical tag.
components/eamxx/src/share/remap/vertical_remapper.cpp Implements log-linear coordinate handling, tag-based LinInterp setup, and per-tag remap dispatch.
components/eamxx/src/share/remap/tests/vertical_remapper_tests.cpp Updates pressure setup API usage and adds a log-linear remapper equivalence test.
components/eamxx/src/share/io/tests/io_remap_test.cpp Adds a log-linear vertical remap integration path and adjusts numeric comparisons.
components/eamxx/src/share/io/scorpio_output.hpp Stores per-stream vert_interpolation_type.
components/eamxx/src/share/io/scorpio_output.cpp Reads vert_interpolation_type, configures VerticalRemapper and forwards to diagnostics creation.
components/eamxx/src/share/io/eamxx_io_utils.hpp Extends create_diagnostic with vert_interp_type parameter.
components/eamxx/src/share/io/eamxx_io_utils.cpp Forwards vert_interpolation_type into FieldAtPressureLevel params.
components/eamxx/src/share/diagnostics/tests/field_at_pressure_level_tests.cpp Pins diagnostic interpolation to linear for existing test assumptions.
components/eamxx/src/share/diagnostics/field_at_pressure_level.hpp Adds members to support log-linear interpolation.
components/eamxx/src/share/diagnostics/field_at_pressure_level.cpp Implements log-linear interpolation branch for pressure-level diagnostic.
components/eamxx/src/share/algorithm/eamxx_data_interpolation.hpp Adds an interpolation-type string to vertical remap configuration.
components/eamxx/src/share/algorithm/eamxx_data_interpolation.cpp Creates VerticalRemapper with the requested interpolation type and updates pressure setup calls.
components/eamxx/src/physics/spc/eamxx_spc_process_interface.cpp Reads optional vert_interpolation_type and forwards to DataInterpolation.
components/eamxx/src/physics/spa/eamxx_spa_process_interface.cpp Reads optional vert_interpolation_type and forwards to DataInterpolation.
components/eamxx/src/physics/mam/readfiles/vertical_remapper_mam4.hpp Removes obsolete set_target_pressure override from the MAM4 remapper interface.
components/eamxx/src/physics/mam/readfiles/vertical_remapper_mam4.cpp Updates MAM4 remapper to the new pressure storage scheme (but currently has correctness issues).

Comment thread components/eamxx/src/share/algorithm/eamxx_data_interpolation.cpp Outdated
Comment thread components/eamxx/src/share/remap/vertical_remapper.cpp
Comment thread components/eamxx/src/share/remap/vertical_remapper.cpp Outdated
Comment thread components/eamxx/src/share/remap/vertical_remapper.cpp Outdated
Comment thread components/eamxx/src/share/remap/vertical_remapper.hpp Outdated
Comment thread components/eamxx/src/share/io/tests/io_remap_test.cpp Outdated
@bartgol bartgol force-pushed the bartgol/eamxx/log-linear-vert-remap branch 2 times, most recently from 4335f8d to f9741ac Compare May 11, 2026 23:59
@bartgol bartgol requested a review from Copilot May 11, 2026 23:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.

Comment thread components/eamxx/src/share/remap/vertical_remapper.cpp
Comment thread components/eamxx/src/share/diagnostics/field_at_pressure_level.cpp Outdated
Comment thread components/eamxx/src/share/diagnostics/field_at_pressure_level.cpp
@bartgol bartgol force-pushed the bartgol/eamxx/log-linear-vert-remap branch from f9741ac to b4846ce Compare May 12, 2026 22:22
@bartgol bartgol requested review from AaronDonahue and crterai May 13, 2026 15:06
@bartgol
Copy link
Copy Markdown
Contributor Author

bartgol commented May 13, 2026

OK, I think this is now ready for a review, since the 3 v1 diffs are expected. @crterai , you can also do a quick run to check if the output does look as expected. Recall that you don't need to do anything to get log-linear interpolation, as it is now the default. If you want to revert back to linear, you need to add vert_interpolation_type: linear at the top-level of your YAML file.

One thing to notice: the FieldAtPressureLevel diagnostic uses the same v interp type that the whole stream uses. This has a couple of implications:

  1. Even if no vertical remapper is used in the stream, in order to move away from log-linear interp for the blah_at_XhPa diags, one has to set vert_interpolation_type: linear in the yaml file, which seems a bit counterintuitive
  2. Given that the diag uses the vert interp set at the yaml file top level, we cannot mix linear and log-linear interpolation for 2+ FieldAtPressureLevel diagnostics

I believe the implications are mild, and we can live with that. Still, tagging other diags folks that may have an opinion: @mahf708 @jeff-cohere @AaronDonahue .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BFB PR leaves answers BFB EAMxx C++ based E3SM atmosphere model (aka SCREAM)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants