Skip to content

Moving-mountain GWD: MMTAUE/W/S/N diagnostics and atmos_phys bump for tilt/precip source options - #1684

Draft
JulioTBacmeister wants to merge 2 commits into
ESCOMP:cam_developmentfrom
JulioTBacmeister:movmtn-mmtau-diagnostics
Draft

JulioTBacmeister wants to merge 2 commits into
ESCOMP:cam_developmentfrom
JulioTBacmeister:movmtn-mmtau-diagnostics

Conversation

@JulioTBacmeister

Copy link
Copy Markdown
Collaborator

Summary

Adds directional (E/W/S/N) Reynolds-stress history diagnostics
(MMTAUE/MMTAUW/MMTAUS/MMTAUN) for the moving-mountain gravity wave
source, and bumps src/atmos_phys to pick up new opt-in flow-dependent
tilt/precipitation source formulations for that scheme.

This PR is blocked on, and must not be merged before, the companion
atmos_phys PR: ESCOMP/atmospheric_physics#448
The src/atmos_phys submodule pointer here currently points at the tip of
that PR's branch on my personal fork (a temporary placeholder) rather than
a real upstream commit, since that PR hasn't merged yet. It will be
updated to the real, tagged upstream commit once #448 merges.

  • gw_drag_cam.F90: wires the scheme's new taucd_west/east/south/north
    outputs into 4 new history fields (MMTAUE/W/S/N, interface levels,
    units Pa), named by direct analogy to the existing Beres BTAUE/W/S/N
    diagnostics but with a plain MM prefix, manually added rather than
    routed through the generic scheme-prefix infrastructure (per author
    preference — the existing infra was judged more general than needed
    here). Also adds TILT_MOVMTN/PSTEER_MOVMTN/PLAUNCH_MOVMTN
    diagnostics and threads a new prect input to the scheme.
  • Also fixes several pre-existing outfld calls that passed ncol
    instead of pcols as the array-bound argument (CAM convention);
    affects only fill values in unused padding columns of those diagnostic
    fields, not the prognostic state.
  • namelist_definition.xml: doc-string-only update for movmtn_source
    describing the new valid values 3-5; default (1) and valid_values
    unchanged.
  • No answer changes for any existing configuration: movmtn_source
    defaults to 1, which exercises only the pre-existing, unchanged
    vorticity_flux_src path; new outputs are write-only diagnostics.

AI involvement disclosure

This PR was produced through heavy, sustained collaboration with Claude
(Anthropic's Claude Code), across every stage: reconciling two weeks of
local development against current cam_development via 3-way merge,
diagnosing and fixing a merge-introduced compile error via an actual test
build, adding the new diagnostics, and drafting this PR/ChangeLog text.
All changes were reviewed and directed by the human author (Julio
Bacmeister) throughout, but the mechanical and drafting work was
substantially done by Claude, not just lightly assisted.

Test plan

  • Compiled successfully (QPC7 compset, ne3pg3_ne3pg3_mt232 grid, casper
    machine): 0 warnings/errors in the modified files.
  • Full aux_cam regression suite (derecho/intel, derecho/nvhpc,
    izumi/nag, izumi/gnu) has not yet been run against this branch —
    opening as draft pending that and pending part of cam6_3_033: Increase default number of tasks on cheyenne for WACCMX #448.
  • Reconciled via git merge-file 3-way merge against the true upstream
    base; confirmed the only real upstream drift was two cosmetic/
    precision-suffix changes unrelated to this branch.

🤖 Generated with Claude Code

JulioTBacmeister and others added 2 commits September 24, 2026 11:18
- Add local arrays and outfld/addfld calls for MMTAUE, MMTAUW, MMTAUS,
  MMTAUN: cardinal-direction Reynolds stresses for the moving-mountain
  gravity wave source, named by direct analogy to Beres's existing
  'B'-prefixed outputs (manually named, not routed through the generic
  scheme-prefix infrastructure).
- Wire the 4 new taucd_west/east/south/north intent(out) args from
  gravity_wave_drag_moving_mountain_run into gw_drag_cam.F90.
- Update namelist_definition.xml doc string for movmtn_source to describe
  all 5 valid values (1=vorticity, 2=PBL momentum flux, 3=tilt-layer-mean,
  4/5=tilt+precip fits); default and valid_values unchanged.
- Bump src/atmos_phys submodule pointer to the branch tip on
  JulioTBacmeister/atmospheric_physics as a temporary placeholder,
  pending merge of the companion atmos_phys PR:
  ESCOMP/atmospheric_physics#448

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
gw_drag_cam_init requested the TTEND_DP pbuf index whenever
(use_gw_convect_dp .or. use_gw_movmtn_pbl), but convect_deep.F90 only
ever registers that field when use_gw_convect_dp .and. deep_scheme=='ZM'.
Running with the moving-mountain source on and use_gw_convect_dp=.false.
therefore failed at init looking up a field that was never added to
pbuf.

gravity_wave_drag_moving_mountain.F90 confirms ttend_dp/netdt is only
read in the use_gw_movmtn_pbl=.false. (legacy, non-PBL) branch of
gw_movmtn_src; every currently-supported movmtn_source path requires
use_gw_movmtn_pbl=.true. and never touches it. So the fix is simply to
stop requesting the index unless the actual producer (deep convection
GW) is enabled; the existing "if (ttend_dp_idx > 0)" fallback already
zero-fills the array otherwise.

Verified: case.build (0 warnings/errors) and a 5-day case.submit run
with use_gw_convect_dp=.false. + use_gw_movmtn_pbl=.true. completed
successfully (CaseStatus: "model execution success"), where it
previously failed at init.

Also bumps the src/atmos_phys submodule pointer to 2a5b2df (the
comment-restoration commit already pushed to atmospheric_physics#448),
which had been left stale after that push.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant