Skip to content

sima0_30_001: Moving-mountain GWD: tilt/precip source options and directional stress diagnostics - #448

Merged
jimmielin merged 12 commits into
ESCOMP:mainfrom
JulioTBacmeister:movmtn-tilt-precip-diagnostics
Oct 2, 2026
Merged

jimmielin merged 12 commits into
ESCOMP:mainfrom
JulioTBacmeister:movmtn-tilt-precip-diagnostics

Conversation

@JulioTBacmeister

@JulioTBacmeister JulioTBacmeister commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

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

diagnostics to moving-mountain gravity wave drag

- New opt-in movmtn_source values 3-5: tilt-layer-mean source, tilt+precip
  6-parameter fit, and tilt+precip PySR cx17 fit (existing values 1=vorticity
  and 2=PBL momentum flux unchanged; default remains 1, so no answer changes
  for existing configurations).
- Add taucd_west/east/south/north as new intent(out) diagnostics: cardinal-
  direction Reynolds stresses derived from the wave momentum-flux spectrum
  via gw_common's calc_taucd, exposed for history output.
- Reconciled against current atmos_phys0_29_000 via 3-way merge from a
  2-week-old local development branch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@jimmielin jimmielin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some initial questions and comments.

Overall this looks good but I wonder about the significant comment removal from the original GW moving mountain code in this PR. @JulioTBacmeister, can I ask if this was intentional cleanup (e.g., the comments are stale, or not needed)? The amount of removed comments appear nontrivial to me, so I wanted to confirm if it is intentional or Claude took the decision to clean things up.

Comment thread doc/ChangeLog Outdated
Comment thread schemes/gravity_wave_drag/gravity_wave_drag_moving_mountain.F90 Outdated
Comment thread schemes/gravity_wave_drag/gravity_wave_drag_moving_mountain.F90
Comment thread schemes/gravity_wave_drag/gravity_wave_drag_moving_mountain.F90
@JulioTBacmeister

JulioTBacmeister commented Sep 24, 2026 via email

Copy link
Copy Markdown
Collaborator Author

@JulioTBacmeister

JulioTBacmeister commented Sep 24, 2026 via email

Copy link
Copy Markdown
Collaborator Author

JulioTBacmeister and others added 3 commits September 25, 2026 14:54
Per reviewer feedback on PR ESCOMP#448: the 3-way merge reconciliation had
collapsed gw_movmtn_src's argument and local-variable declarations into a
denser one-per-line style, which dropped the descriptive comments that
were present upstream. Restores those comments (wording preserved where
the underlying quantity is unchanged), and adds comments for the new
arguments introduced by this PR (pmid, delp, tilt, p_steer, p_launch).
No executable code changed; verified via case.build (QPC7,
ne3pg3_ne3pg3_mt232, casper): 0 warnings/errors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… GWD

- New schemes/utilities/compute_total_precipitation_rate: prect = prec_dp + prec_sh + prec_str,
  providing lwe_precipitation_rate_at_surface for gravity_wave_drag_moving_mountain.
  Called from both CAM (gw_drag_cam) and CAM-SIMA so the summation order is identical.
- Run it before gravity_wave_drag_moving_mountain in suite_cam7 and suite_gw_cam7_se.
- Fix units of momentum_flux_source_for_moving_mountain_gravity_wave_drag in the
  moving mountain SIMA diagnostics (m2 s-2 -> Pa) to match the scheme metadata;
  capgen otherwise errors on the unsupported unit conversion.

Assisted-by: claude-opus:5.5
@jimmielin
jimmielin marked this pull request as ready for review September 30, 2026 19:50
- Add TILT_MOVMTN, PSTEER_MOVMTN, PLAUNCH_MOVMTN and MMTAUE/W/S/N,
  matching the fields added to gw_drag_cam.
- Rename UCELL/VCELL_MOVMTN to USTEER/VSTEER_MOVMTN, as in CAM.

Assisted-by: claude-opus:5.5

@peverwhee peverwhee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

a couple small cleanup requests

Comment thread schemes/gravity_wave_drag/gravity_wave_drag_moving_mountain.F90 Outdated
Comment thread schemes/gravity_wave_drag/gravity_wave_drag_moving_mountain.F90 Outdated
Comment thread schemes/gravity_wave_drag/gravity_wave_drag_moving_mountain.F90 Outdated
Comment thread schemes/gravity_wave_drag/gravity_wave_drag_moving_mountain.F90 Outdated
- Drop unused locals tau0 and hdmm_idx from gw_movmtn_src.
- Compute CS directly instead of through the CS1 temporary (same expression, bit-for-bit).
- Drop the unused z_steer/z_launch outputs of vorticity_centroid_levels.

Assisted-by: claude-opus:5.5
@jimmielin
jimmielin requested a review from peverwhee September 30, 2026 21:55

@peverwhee peverwhee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

sorry two more little things

Comment thread schemes/gravity_wave_drag/gravity_wave_drag_moving_mountain.F90 Outdated
Comment thread schemes/gravity_wave_drag/gravity_wave_drag_moving_mountain.F90
Both are set for every source_type, not only 3-5.

Assisted-by: claude-opus:5.5
@jimmielin
jimmielin requested a review from peverwhee September 30, 2026 22:53
@jimmielin jimmielin changed the title Moving-mountain GWD: tilt/precip source options and directional stress diagnostics sima0_30_001: Moving-mountain GWD: tilt/precip source options and directional stress diagnostics Oct 1, 2026
@jimmielin

Copy link
Copy Markdown
Collaborator

dry run of regression tests passed

aux_cam_intel_20261001134716  2026-10-01T13:47  movmtn-mmtau-diagnostics@cc385f9*   PASS 54/54                     cam6_4_204_intel
aux_cam_gnu_20261001134727  2026-10-01T13:47  movmtn-mmtau-diagnostics@cc385f9*  PASS 25/25                     cam6_4_204_gnu
aux_cam_nag_20261001134530  2026-10-01T13:46  movmtn-mmtau-diagnostics@cc385f9*  FAIL 15/16 (1 FAIL)            cam6_4_204_nag

### Regression test provenance: aux_cam_nag_20261001134530

- suite: `aux_cam` on izumi/nag, submitted 2026-10-01T13:46
- baseline compared: `/fs/cgd/csm/models/atm/cam/pretag_bl/cam6_4_204_nag`
- result: **FAIL 15/16 (1 FAIL)**
  - FAIL ERC_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_nag.cam-outfrq3s_subcol (COMPARE_base_rest)

| repo | branch | HEAD | working tree |
|-|-|-|-|
| . | movmtn-mmtau-diagnostics | cc385f90b6fa | 43043f139738 (dirty) |
| ccs_config | HEAD | 7888a464847b | ffebf6b23fc5 |
| chem_proc | HEAD | fecf661b50ac | 7523d82338a1 |
| cime | HEAD | 738e6e8338f3 | c2c56b78b7c6 |
| cime/CIME/non_py/cprnc | HEAD | 19bbb1ebb787 | 8628dae9a4f1 |
| components/cdeps | HEAD | 1c8d00e4c3ff | d166d6291add |
| components/cdeps/fox | HEAD | 7775cc392d13 | a7ddb0039796 |
| components/cdeps/share/genf90 | HEAD | 4816965ba946 | b4ba09e238be |
| components/cice | HEAD | 18512e6a9971 | 92ba3c9bddef |
| components/cice/src | HEAD | f37a952e5cdd | adb2323f9e52 |
| components/cice/src/icepack | HEAD | e13a9771670a | 9a61fb4023e3 |
| components/clm | HEAD | 7731d83c7fdb | 85913f0414ff |
| components/clm/src/fates | HEAD | 37c28ce7e947 | fd535e36cdf7 |
| components/clm/src/fates/tools/landusedata | HEAD | fb0cbf254448 | aad4e945ee86 |
| components/clm/src/fates/tools/xarray-functions | HEAD | b62d9333b542 | 433cb8475890 |
| components/cmeps | HEAD | f621f772a7fe | 4a6ecf64dd18 |
| components/mizuRoute | HEAD | 28514dea3fd2 | a7ed57416b40 |
| components/mosart | HEAD | a6f6e90606e3 | 12f04e24495f |
| components/rtm | HEAD | 1165b4ff0c01 | 635f44c99626 |
| libraries/FMS | HEAD | e1ef2091398e | 1db114c99089 |
| libraries/FMS/src | HEAD | ed23b8f155ef | 04c4d212a870 |
| libraries/parallelio | HEAD | 39e558441197 | 81e3a5b431d1 |
| libraries/tuv-x | HEAD | 5fdf789255aa | a89f9a57d6cc |
| share | HEAD | 5aa721c839b6 | e786a4ddb8e8 |
| src/atmos_phys | HEAD | c795bc2e6f89 | ff1309e74976 |
| src/atmos_phys/schemes/mmm/mmm_physics | HEAD | 6cb29bc8f17b | 3fdc77ce0ecf |
| src/atmos_phys/schemes/pumas/pumas | HEAD | e7377aeeff15 | 5e2ef383a993 |
| src/atmos_phys/schemes/rrtmgp/ext | HEAD | 77ff83ccf645 | e81c0f0641cf |
| src/atmos_phys/schemes/tempo/tempo | HEAD | 2856696dc259 | 0663569f9828 |
| src/chemistry/cloud_j | HEAD | f8a2b7f964bd | 1298df1d7cdc |
| src/chemistry/geoschem/geoschem_src | HEAD | 86cd586260e4 | f153b6ea66bc |
| src/chemistry/geoschem/geoschem_src/KPP/standalone | HEAD | eeee8951f03c | d5fca7e90795 |
| src/chemistry/hetp | HEAD | 2a99b24625ed | 6a2adf966dba |
| src/dynamics/fv3 | HEAD | 66227690a9fb | 324ad3547527 |
| src/dynamics/fv3/atmos_cubed_sphere | HEAD | 2fcff2eb0e14 | eb6ac639f045 |
| src/dynamics/mpas/dycore | HEAD | 515e5203d8dc | ab5644627d04 |
| src/hemco | HEAD | fce4bb79f184 | 327d8e821c98 |
| src/hemco/HEMCO | HEAD | b2d9d7e1c636 | ab0669feea2e |
| src/hemco/HEMCO/docs/source/geos-chem-shared-docs | HEAD | c769e0007cc0 | 97c2ab659cb9 |
| src/physics/ali_arms | HEAD | b24e4346e273 | b4954b257bd9 |
| src/physics/carma/base | HEAD | 7b12e0cce0f8 | c7599ed63ba4 |
| src/physics/clubb | HEAD | ddf511025f2b | f5ea905789b3 |
| src/physics/cosp2/src | HEAD | 5eb05e51187d | a27dd15a5700 |
| src/physics/ext_co2_cooling | HEAD | 5e2b23605f1a | 34589b99b24c |
| src/physics/pumas-frozen | HEAD | be3cad3a12d2 | 29f5baf66b00 |
| src/physics/rrtmgp/data | HEAD | df02975ab931 | 530693b5200b |
| src/utils/cam-sima | HEAD | 0aaee1d39067 | 918a41f186d0 |
| tools/CUPiD | HEAD | e6e62cb4f51f | 57b9784be761 |
| tools/CUPiD/externals/ADF | HEAD | 6aff7b626158 | 740e618b01d9 |
| tools/CUPiD/externals/ILAMB | HEAD | a16fa0843f5f | 3ceaba0cda06 |
| tools/CUPiD/externals/LDF | HEAD | df65f0efa474 | 14f087fa7a3d |
| tools/CUPiD/externals/mom6-tools | HEAD | 49eeefce3747 | f60dee26b069 |

@jimmielin
jimmielin merged commit 9d7754f into ESCOMP:main Oct 2, 2026
5 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.

4 participants