Repository navigation
cam6_4_206: Moving-mountain GWD: MMTAUE/W/S/N diagnostics and atmos_phys bump for tilt/precip source options - #1684
Merged
jimmielin merged 7 commits intoOct 4, 2026
Conversation
- 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>
… PRECT - Sum PREC_DP + PREC_SH + PREC_STR through the atmos_phys interstitial compute_total_precipitation_rate_run, the same routine CAM-SIMA runs, so the summation order matches between the two hosts. - PREC_STR replaces PREC_SED + PREC_PCW (PREC_STR = PREC_PCW + PREC_SED in physpkg). - Drop the errcode/index guards: all three fields always exist wherever gw_drag_cam runs (moist physics only), so a missing field should abort. Assisted-by: claude-opus:5.5
jimmielin
marked this pull request as ready for review
September 30, 2026 19:53
jimmielin
self-requested a review
October 1, 2026 21:12
jimmielin
pushed a commit
to ESCOMP/atmospheric_physics
that referenced
this pull request
Oct 2, 2026
…ectional stress diagnostics (#448) ## Summary Adds flow-dependent tilt/precipitation source options to the moving-mountain gravity wave drag scheme, plus new cardinal-direction Reynolds-stress diagnostics. This is a companion PR to ESCOMP/CAM#1684, which adds the corresponding `MMTAUE/W/S/N` history outputs and namelist documentation. - New opt-in `movmtn_source` values 3-5 (tilt-layer-mean; tilt+precip 6-parameter fit; tilt+precip PySR cx17 fit). Existing values 1 (vorticity, default) and 2 (PBL momentum flux) are unchanged. - New diagnostic-only outputs threaded through as `intent(out)`: `taucd_west/east/south/north` (directional Reynolds stresses from `gw_common`'s `calc_taucd`), plus `tilt`, `p_steer`, `p_launch`. - New `prect` input, used only by the new precip-dependent source options. - None of the new pathways are reached unless a user explicitly sets `movmtn_source` to 3/4/5; default behavior and answers are unchanged. ## 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 `main` via 3-way merge, diagnosing and fixing a merge-introduced compile error via an actual test build, adding the new diagnostic outputs, 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. - No answer changes expected for any existing configuration, since `movmtn_source` defaults to 1. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Haipeng Lin <hplin@ucar.edu>
jimmielin
approved these changes
Oct 2, 2026
jimmielin
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @JulioTBacmeister
Ready for tagging.
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
Adds directional (E/W/S/N) Reynolds-stress history diagnostics
(
MMTAUE/MMTAUW/MMTAUS/MMTAUN) for the moving-mountain gravity wavesource, and bumps
src/atmos_physto pick up new opt-in flow-dependenttilt/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_physsubmodule pointer here currently points at the tip ofthat 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 newtaucd_west/east/south/northoutputs into 4 new history fields (
MMTAUE/W/S/N, interface levels,units Pa), named by direct analogy to the existing Beres
BTAUE/W/S/Ndiagnostics but with a plain
MMprefix, manually added rather thanrouted 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_MOVMTNdiagnostics and threads a new
prectinput to the scheme.outfldcalls that passedncolinstead of
pcolsas 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 formovmtn_sourcedescribing the new valid values 3-5; default (1) and
valid_valuesunchanged.
movmtn_sourcedefaults to 1, which exercises only the pre-existing, unchanged
vorticity_flux_srcpath; 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_developmentvia 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
ne3pg3_ne3pg3_mt232grid, caspermachine): 0 warnings/errors in the modified files.
aux_camregression 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.
git merge-file3-way merge against the true upstreambase; confirmed the only real upstream drift was two cosmetic/
precision-suffix changes unrelated to this branch.
🤖 Generated with Claude Code