Skip to content

cam6_4_207: merge new clubb_mf into cam6_4_203 - #1576

Merged
jtruesdal merged 75 commits into
ESCOMP:cam_developmentfrom
jtruesdal:clubbdev
Oct 9, 2026
Merged

jtruesdal merged 75 commits into
ESCOMP:cam_developmentfrom
jtruesdal:clubbdev

Conversation

@jtruesdal

@jtruesdal jtruesdal commented Jun 10, 2026 •

Copy link
Copy Markdown
Collaborator

This PR merges updated CLUBB+MF (clubb-mf) changes into CAM, extending the CLUBB interface to support the enhanced integrate_mf call, adding new EDMF diagnostics/outputs, and introducing additional namelist controls for CLUBB+MF behavior (radiation coupling, microphysics, TKE contribution, etc.).

Changes:

  • Expanded clubb_intr.F90 CLUBB+MF interface: new pbuf fields, history coords, diagnostic outputs, and enhanced MF plumbing.
  • Added new CLUBB+MF namelist entries + defaults, and wired them into build-namelist.

The majority of the code updates reside in clubb_mf.F90. In addition to the new science, clubb_mf is now agnostic to the direction of the vertical level, adjusting the looping and indexes as needed depending on the top down or bottom up nature of the input arrays. Additionally the number of vertical levels for the new mf arrays are consistent with their associated thermodynamic or momentum grid. There are order of operation differences between this update and Adam's original cam6_4_124 version of clubb_mf which cause roundoff precision differences from the base code. On top of these roundoff differences there are bug fixes which are answer changing.

This PR closes #1370
closes #1590

jtruesdal and others added 2 commits June 9, 2026 09:08
…rations on several variables with latest clubb interface and externals.

Copilot AI left a comment

Copy link
Copy Markdown

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 merges updated CLUBB+MF (clubb-mf) changes into CAM, extending the CLUBB interface to support the enhanced integrate_mf call, adding new EDMF diagnostics/outputs, and introducing additional namelist controls for CLUBB+MF behavior (radiation coupling, microphysics, TKE contribution, etc.).

Changes:

  • Expanded clubb_intr.F90 CLUBB+MF interface: new pbuf fields, history coords, diagnostic outputs, and enhanced MF plumbing.
  • Added new CLUBB+MF namelist entries + defaults, and wired them into build-namelist.
  • Updated COSP namelist documentation text (but introduced encoding issues that need correction).

Reviewed changes

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

File Description
src/physics/cam/clubb_intr.F90 Adds/updates CLUBB+MF fields, diagnostics, and MF integration interface wiring.
bld/namelist_files/namelist_definition.xml Adds new CLUBB+MF namelist definitions and edits COSP localtime documentation.
bld/namelist_files/namelist_defaults_cam.xml Adds default values for the new CLUBB+MF namelist entries.
bld/build-namelist Adds add_default(...) plumbing for (most) new CLUBB+MF namelist variables.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/physics/cam/clubb_intr.F90 Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated
Comment thread bld/namelist_files/namelist_definition.xml Outdated
Comment thread bld/namelist_files/namelist_definition.xml Outdated
Comment thread bld/namelist_files/namelist_definition.xml
Comment thread bld/namelist_files/namelist_definition.xml
Comment thread bld/namelist_files/namelist_definition.xml
Comment thread bld/namelist_files/namelist_defaults_cam.xml Outdated
Comment thread bld/build-namelist Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated
Comment thread src/physics/cam/clubb_intr.F90
Comment thread src/physics/cam/clubb_intr.F90
Comment thread src/physics/cam/clubb_mf.F90

Copilot AI left a comment

Copy link
Copy Markdown

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 4 out of 5 changed files in this pull request and generated 14 comments.

Comment thread src/physics/cam/clubb_intr.F90 Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated
Comment thread bld/namelist_files/namelist_definition.xml
Comment thread bld/namelist_files/namelist_definition.xml
Comment thread bld/namelist_files/namelist_definition.xml
Comment thread bld/namelist_files/namelist_definition.xml
Comment thread src/physics/cam/clubb_intr.F90 Outdated
@cacraigucar
cacraigucar marked this pull request as ready for review June 23, 2026 16:47
Comment thread src/physics/cam/clubb_mf.F90 Outdated

@cacraigucar cacraigucar 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.

Getting closer. There are a few new things based on your edits

Comment thread src/physics/cam/clubb_mf.F90
Comment thread src/physics/cam/clubb_mf.F90 Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated
Comment thread bld/build-namelist Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated
@adamrher

adamrher commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Not sure why I can't comment directly on of Cheryl's new comments, but the 2 issues Claude identified:

relvar (clubb_intr.F90:5075/5087): CLUBB_MF uses ZM-style computed relvar (max 10) instead of CLUBB's constant 2.0. Sin ce CLUBB_MF still runs the full CLUBB SGS closure for the stratiform part, please confirm this is intended rather than matching CLUBB_SGS.

Deep-convection gravity waves / TTEND_DP (gw_drag_cam.F90:557, convect_deep.F90:127): gated on deep_scheme=='ZM' only . CLUBB_MF matches CLUBB_SGS here (neither gets it), but since CLUBB_MF now provides ZM-like deep transport, consider whether it should source convective GWs like ZM.

I am fine with using the ZM-style relvar. I am knowingly choosing not to hook up CLUBB-MF to TTEND_DP, since it's not straightforward to compute this from the MF vars.

@jtruesdal

Copy link
Copy Markdown
Collaborator Author

Here is some context to the issue with the add_hist_coordfixed call.
The interpolation feature of SE was limited to variables with at most 2 dimensions (ncol and lev). The coordinate call to add_hist_coordfixed created variable with more than 2 dimensions which weren't interpolated correctly. I fixed the issue in interp_mod.F90 which became a new modified file for this PR. Since the interface required an update to its parameters I also needed a new tag for the fv3_interface external to update the parameters for its interp_mod interface routines. I am testing the simple fix for fv3 and will add that soon. I forgot to remove the comment noting the problem and have done so now.

@jtruesdal

Copy link
Copy Markdown
Collaborator Author

Since clubb_mf is activated/deactivated via the namelist we can't use a CPP #ifdef around the problem variables. I have opened an issue #1697 to investigate and if needed minimize the memory hit from 200+ locally declared variables that are only used when clubb_mf is active.

Comment thread src/physics/cam/clubb_mf.F90 Outdated
Comment thread bld/build-namelist Outdated
@jtruesdal

Copy link
Copy Markdown
Collaborator Author

@cacraigucar @adamrher answered your recent claude question a few comments above.

Not sure why I can't comment directly on of Cheryl's new comments, but the 2 issues Claude identified:

relvar (clubb_intr.F90:5075/5087): CLUBB_MF uses ZM-style computed relvar (max 10) instead of CLUBB's constant 2.0. Sin ce CLUBB_MF still runs the full CLUBB SGS closure for the stratiform part, please confirm this is intended rather than matching CLUBB_SGS.

Deep-convection gravity waves / TTEND_DP (gw_drag_cam.F90:557, convect_deep.F90:127): gated on deep_scheme=='ZM' only . CLUBB_MF matches CLUBB_SGS here (neither gets it), but since CLUBB_MF now provides ZM-like deep transport, consider whether it should source convective GWs like ZM.

I am fine with using the ZM-style relvar. I am knowingly choosing not to hook up CLUBB-MF to TTEND_DP, since it's not straightforward to compute this from the MF vars.

@jtruesdal
jtruesdal requested a review from cacraigucar October 7, 2026 19:56

@cacraigucar cacraigucar 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.

Thanks for the extensive editing. I am now approving this!

Comment thread src/physics/cam/clubb_mf.F90
@cacraigucar cacraigucar changed the title merge new clubb_mf into cam6_4_203 cam6_4_207: merge new clubb_mf into cam6_4_203 Oct 7, 2026
…ed mpass interp_mod.F90 api changes to match required mods for PR1576
…ing a positive convention, I removed the -1 multiplication factor
@jtruesdal
jtruesdal merged commit bd83afc into ESCOMP:cam_development Oct 9, 2026
2 checks passed
jimmielin pushed a commit to jimmielin/CAM that referenced this pull request Oct 12, 2026
Resolve the modify/delete conflict on src/chemistry/aerosol/aero_convproc.F90
(removed on this branch) by porting the CLUBB_MF MF_WUP updraft-speed hook
(ESCOMP#1576) into aero_convproc_cam.F90; the matching optional wup_in
argument of aero_convproc_run lives in the atmos_phys hplin/mam_atmos_phys branch.

Assisted-by: claude-opus:5.5
jimmielin pushed a commit to jimmielin/atmospheric_physics that referenced this pull request Oct 12, 2026
Mirrors ESCOMP/CAM#1576 (cam6_4_207), which added an optional wup_in
argument to aero_convproc_tend so deep convective activation can use the
CLUBB_MF plume-ensemble updraft speed (MF_WUP) instead of the
mu/(rhoair*zm_areafrac) estimate. Bit-for-bit when wup_in is absent.

Assisted-by: claude-opus:5.5
jtruesdal added a commit to NCAR/StormSPEED that referenced this pull request Oct 14, 2026
Upstream merge from cam6_4_123 (recorded as base in the preceding commit) to cam6_4_211.

CLUBB-MF
- Take upstream CLUBB-MF (ESCOMP PR ESCOMP#1576, deep_scheme='CLUBB_MF'): clubb_intr.F90 and
  clubb_mf.F90 as in 211; cam7/physpkg, build-namelist, defaults and definitions follow 211.
- Remove the old stormspeed CLUBB-MF shallow-precip routing (cam/physpkg.F90 prec_sh
  accumulators and flx_cnd term, convect_shallow ICWMRSH outfld, cam7 convect_diagnostics
  ICWMRSH/PRECSH addflds).
- outfrq9s_clubbmf testmod: 211 version plus do_clubb_mf_addtke/do_clubb_mf_rhtke.

senh (HOMME) namelist defaults
- New bld/namelist_files/namelist_defaults_senh.xml, consulted by build-namelist before
  namelist_defaults_cam.xml when se_dyn_target is preqx or theta-l.
- theta-l/preqx values follow the E3SM "EAM's HOMME dycore" recommended settings, EAM
  namelist_defaults_eam.xml (E3SM 057df66), and HOMME code defaults for preqx.
- namelist_defaults_cam.xml is 211 plus ne1024 dtime/drydep and the MIDWEST refined mesh.

Build and namelist infrastructure
- configure: allow threading for HOMME targets; 211's warning for CAM SE.
- buildcpp: keep -se_dyn_target; drop -ocn (removed upstream in cam6_4_125).
- buildlib: keep Kokkos staging; take 211's env_vars make command.
- namelist_definition.xml: drop duplicate CLUBB-MF definitions, close the
  se_semi_lagrange_hv_q entry (restores se_pgf_formulation), remove the orphaned
  se_tom_sponge_start, keep one se_cubed_sphere_map.
- build-namelist: drop interpolate_* from the SE/senh add_default lists (as in 211).

Physics and utilities
- moist_mixing_ratio_dycore includes SENH in cam, cam7 and simple physpkg (follows the
  cam6_4_173 restructure).
- Keep stormspeed base-model fixes: aircraft_emit weight_by_lat only for LR; ne1024
  restart overflow fix (stormspeed #71) in cam_grid_support/cam_map_utils.
- Snapshot pbuf array sized npbuf_all+pcnst as in 211.

Externals
- ccs_config, cmeps and ctsm fork tags rebased on 211's versions with nh changes; cism
  removed as upstream.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Tag

Development

Successfully merging this pull request may close these issues.

5 participants