Complete CCPPization of UW shallow convection scheme (uwshcu) - #408
Complete CCPPization of UW shallow convection scheme (uwshcu)#408jimmielin wants to merge 4 commits into
Conversation
This is a combination of 13 commits and dropped 1 commits. Initial commit. Move to atmos_phys: uw_shallow Build fixes for CAM Continue work on meta Tentative draft for meta draft diags Add convect_shallow_uw draft scheme (wrong diag scheme name) add nl file Disable check_energy for now since snapshot runs have issues (same as ZM) Add clamp_number_concentrations utility scheme. Give up on using tendencies for the number concentration clamp Various cleanup (req CAM changes) Address review comments from code review agent (claude-opus-4.6) Update CAM5 and test SDF for UW shallow Update diagnostics
Automated review against project code-review rulesReviewed the diff against our 12 code-review rules. Most of the diff is well-behaved; the two large findings both live in
Findings1. 2. Old-style relational operators — Rule 5 ❌ (widespread) 3. 4. Single-output subroutine — Rule 10 5. What's clean
Extra (outside the 12 rules): Bottom line: one quick fix (remove 🤖 Generated with Claude Code |
| bogbot_arr_out(i, mkx:1:-1) = bogbot_arr(:mkx) | ||
| bogtop_arr_out(i, mkx:1:-1) = bogtop_arr(:mkx) | ||
|
|
||
| ! NOTE (hplin): when bringing this code to CAM-SIMA, it was discussed whether |
There was a problem hiding this comment.
I believe the goto 333 can be replaced with a subroutine/function call to do all of the setting of the code followed by a cycle column_loop. I think this should be synonymous with what is being done now with the goto's
There was a problem hiding this comment.
Thanks for the suggestion. There is one goto 333 that cannot be eliminated this way.
At line 2072 it sets id_exit = .false. first directly after the block that assigns all the real outputs from the *_s arrays. It jumps to mark the column as success, not error, skipping the tail reset block, so it cannot be untangled without changing answers or making a bigger contraption.
I am happy to revisit this later. Just didn't want to take the chance to mess with answers after it is bit-for-bit already.
# Conflicts: # suites/suite_cam5.xml
|
Thanks @nusbaume. This is ready for human review. A couple of notes from the AI review that I did not resolve:
|
Tag name (The PR title should also include the tag name):
Originator(s): @jimmielin
Assisted-by: claude-opus:4.6[1m]
Description (include issue title and the keyword ['closes', 'fixes', 'resolves'] and issue number):
clamp_number_concentrationsutility scheme to replicate CAMphysics_types.F90behavior that clamps num* constituents to [1e-12, 1e10] range.convect_shallow_diagnostics_after_convective_evaporationinto its own scheme file (previously inlined inconvect_shallow_diagnostics) to accommodate the fact that UW does not use ZM convective evaporation.compute_cloud_fractionandrk_stratiform(cleanup)List all namelist files that were added or changed:
List all files eliminated and why: N/A
List all files added and what they do:
List all existing files that have been modified, and describe the changes:
List all automated tests that failed, as well as an explanation for why they weren't fixed:
Is this an answer-changing PR? If so, is it a new physics package, algorithm change, tuning change, etc?
If yes to the above question, describe how this code was validated with the new/modified features: