Skip to content

Update MCSP Momentum - #8628

Open
whannah1 wants to merge 15 commits into
masterfrom
whannah/eamxx/mcsp-momentum-update
Open

Update MCSP Momentum#8628
whannah1 wants to merge 15 commits into
masterfrom
whannah/eamxx/mcsp-momentum-update

Conversation

@whannah1

Copy link
Copy Markdown
Contributor

This updates the Mesoscale Coherent System Parameterization (MCSP) in the both EAM and EAMxx versions of ZM to generalize the treatment of of shear and momentum tendencies. It replaces separate U & V coefficients with a single coefficient and adds a new option to use the full (u,v) shear vector rather than just the zonal component. By default the momentum coefficients are zero and the new shear calculation is disabled, so this is essentially a stealth upgrade.

MCSP parameterization improvements:

  • Replaced zmconv_MCSP_uwind_coeff and zmconv_MCSP_vwind_coeff with a single zmconv_MCSP_mom_coeff parameter, and added a logical zmconv_MCSP_use_full_shear to control whether the full (u,v) shear vector is used instead of just the zonal component. This simplifies configuration and enables more flexible momentum forcing.

Fortran physics code refactoring:

  • Refactored Fortran modules to use the new mcsp_mom_coeff and mcsp_use_full_shear parameters, removing references to separate u and v coefficients throughout zm_conv_intr.F90 and zm_conv_mcsp.F90.
  • Modified the MCSP shear calculation routine to return both zonal and meridional shear components, allowing the caller to select between full vector magnitude or legacy zonal-only behavior.

Minor code cleanups:

  • Removed unused variables and simplified loop iterators in zm_conv.F90.
  • Fixed preprocessor guard alignment and public interface declarations.

These changes modernize the MCSP configuration, improve clarity for users, and enable more flexible future development.

[BFB]

@whannah1
whannah1 requested review from DJFJJA and crterai August 13, 2026 18:47
@whannah1 whannah1 added Atmosphere BFB PR leaves answers BFB Stealth PR has feature which, if turned on, could change climate. fka FCC EAMxx C++ based E3SM atmosphere model (aka SCREAM) ZM labels Aug 13, 2026
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://E3SM-Project.github.io/E3SM/pr-preview/pr-8628/

Built to branch gh-pages at 2026-08-13 19:50 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the Mesoscale Coherent System Parameterization (MCSP) in both
EAM (Fortran) and EAMxx (C++) Zhang–McFarlane implementations by replacing
separate U/V momentum coefficients with a single momentum coefficient and
adding an option to use the full (u,v) shear vector.

Changes:

  • Replace *_u_coeff/*_v_coeff with *_mom_coeff and add
    *_use_full_shear across EAM/EAMxx runtime options, namelists, and docs.
  • Refactor MCSP shear computation to return shear components (u and v), and use
    either full magnitude or legacy zonal-only shear for gating/diagnostics.
  • Update EAMxx Fortran-bridge initialization signature to pass MCSP tunables.

Reviewed changes

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

Show a summary per file
File Description
components/eamxx/src/physics/zm/zm_functions.hpp Introduces mcsp_mom_coeff and mcsp_use_full_shear; updates shear API to return (u,v) components.
components/eamxx/src/physics/zm/tests/zm_conv_mcsp_tend_tests.cpp Loosens BFB comparisons for momentum/DSE fields due to differing cos implementations.
components/eamxx/src/physics/zm/impl/zm_opts_impl.hpp Adjusts standalone-test defaults to exercise momentum/shear paths.
components/eamxx/src/physics/zm/impl/zm_conv_mcsp_tend_impl.hpp Refactors momentum tendency computation to scale with shear vector; updates KE fixer logic.
components/eamxx/src/physics/zm/impl/zm_conv_mcsp_calculate_shear_impl.hpp Computes storm-relative shear vector components and returns both.
components/eamxx/src/physics/zm/fortran_bridge/zm_eamxx_bridge.hpp Extends bridge init API to pass MCSP coefficients and shear toggle.
components/eamxx/src/physics/zm/fortran_bridge/zm_eamxx_bridge.cpp Wires new bridge init parameters through the C++ wrapper.
components/eamxx/src/physics/zm/fortran_bridge/zm_eamxx_bridge_main.F90 Accepts and assigns new MCSP parameters into zm_param.
components/eamxx/src/physics/zm/eamxx_zm_process_interface.cpp Passes MCSP tunables into the Fortran bridge during initialization.
components/eamxx/cime_config/namelist_defaults_eamxx.xml Adds new MCSP namelist defaults for mcsp_mom_coeff and mcsp_use_full_shear.
components/eam/src/physics/cam/zm/zm_conv.F90 Minor cleanup: remove unused args/iterators and simplify gather-index interface.
components/eam/src/physics/cam/zm/zm_conv_types.F90 Updates zm_param_t to new MCSP parameters; updates broadcast/print/test setup.
components/eam/src/physics/cam/zm/zm_conv_mcsp.F90 Refactors MCSP shear API to return components; updates momentum tendencies and gating.
components/eam/src/physics/cam/zm/zm_conv_intr.F90 Updates namelist parsing and ptend flags for new MCSP momentum/shear options.
components/eam/docs/user-guide/namelist_parameters.md Documents new MCSP namelist variables and defaults.
components/eam/bld/namelist_files/namelist_definition.xml Replaces old MCSP uwind/vwind namelist definitions with new options.
components/eam/bld/namelist_files/namelist_defaults_eam.xml Updates build-time default namelist entries for new MCSP options.
components/eam/bld/build-namelist Updates build-namelist to propagate new MCSP defaults into generated namelists.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread components/eam/src/physics/cam/zm/zm_conv_mcsp.F90
Comment thread components/eamxx/src/physics/zm/zm_functions.hpp Outdated
Comment thread components/eamxx/src/physics/zm/zm_functions.hpp

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 22 out of 22 changed files in this pull request and generated no new comments.

@whannah1

Copy link
Copy Markdown
Contributor Author

FYI - analysis of the effects of turning on these updates can be found here:
https://e3sm.atlassian.net/wiki/spaces/EAMXX/pages/6437928973/MCSP+Momentum+Bug+Fix

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

Labels

Atmosphere BFB PR leaves answers BFB EAMxx C++ based E3SM atmosphere model (aka SCREAM) Stealth PR has feature which, if turned on, could change climate. fka FCC ZM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants