Skip to content

merge new clubb_mf into cam6_4_180 - #1576

Open
jtruesdal wants to merge 32 commits into
ESCOMP:cam_developmentfrom
jtruesdal:clubbdev
Open

merge new clubb_mf into cam6_4_180#1576
jtruesdal wants to merge 32 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

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
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

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

Hi John. I've completed my first round of the code review, getting about about half-way through clubb_intr. The code merge removed a lot of stuff that Gunther cleaned up in cam6_4_144, and I tried to catch all those instances. I also found about 8 or so *_macmic variables that I'd like to remove from the pbuf.

Comment thread bld/namelist_files/namelist_defaults_cam.xml Outdated
Comment thread bld/namelist_files/namelist_defaults_cam.xml Outdated
Comment thread bld/namelist_files/namelist_definition.xml Outdated
Comment thread bld/namelist_files/namelist_defaults_cam.xml Outdated
Comment thread bld/namelist_files/namelist_definition.xml 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 Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated

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

Hi John. This my part 2 review. It finishes the clubb_intr.F90 module. There will be a part 3 for clubb_mf.F90, but most of the heavy lifting is contained in a PR I've issued to your branch today.

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 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 Outdated
Comment thread src/physics/cam/clubb_intr.F90 Outdated
adamrher and others added 5 commits July 30, 2026 18:45
clean up function arguments in integrate_mf + bug fixes.  John will improve the initialization for mcape/mf_cape and correct spelling errors identified by copilot.
Comment thread src/physics/cam/clubb_intr.F90 Outdated
! with k_cam. (This differs from the legacy code, which sequence-
! associated tke_pbuf(i,:) into an nzm-sized dummy — a top_lev-1
! level misalignment whenever top_lev > 1; bit-identical for
! top_lev = 1.)

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.

Claude added this comment but it's totally unnecessary (all the state% arrays have the same caveats, so this is not a one-off). Please remove.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants