Skip to content

cam6_4_183: Complete CCPPization of cloud fraction for two-moment microphys (cldfrc2m)#1522

Merged
jimmielin merged 14 commits into
ESCOMP:cam_developmentfrom
jimmielin:hplin/cldfrc2m
Jun 22, 2026
Merged

cam6_4_183: Complete CCPPization of cloud fraction for two-moment microphys (cldfrc2m)#1522
jimmielin merged 14 commits into
ESCOMP:cam_developmentfrom
jimmielin:hplin/cldfrc2m

Conversation

@jimmielin

Copy link
Copy Markdown
Member

Companion PR: ESCOMP/atmospheric_physics#380

Changes are all b4b

Needs the ccpp_constituent_properties_ptr_t shim update in CAM so if UW PBL goes in first this won't need it, otherwise this will need to bring that file change in

Purpose of changes (include the issue number and title text for each relevant GitHub issue):

  • Closes Convert cldfrc2m.F90 to CCPP (mostly namelist read), shim for public USEs in CAM, move subroutines to atmos_phys #1521 - Move two-moment cloud fraction scheme (cldfrc2m) to atmos_phys as compute_cloud_fraction_two_moment.
  • cldfrc2m is used broadly across CAM physics (cldwat2m_macro, clubb_intr, CARMA cirrus models) and its namelist parameters are pulled in via USE statements in many places. Moving the computational routines to atmos_phys and making cldfrc2m a thin CAM shim for namelist I/O and parameter distribution facilitates CCPP port of CLUBB, PUMAS, etc. as these namelist parameters will cleanly flow via standard names
  • Added keyword arguments calling into cldfrc for rh threshold etc. for clarity

Describe any changes made to build system: N/A

Describe any changes made to the namelist: N/A

List any changes to the defaults for the boundary datasets: N/A

Describe any substantial timing or memory changes: N/A

Code reviewed by:

List all files eliminated: N/A

List all files added and what they do: N/A

List all existing files that have been modified, and describe the changes:

M       src/physics/cam/cldfrc2m.F90
  - Move computational subroutines (astG_PDF, astG_RHU, astG_PDF_single,
    astG_RHU_single, aist_single, aist_vector) to atmos_phys
    compute_cloud_fraction_two_moment.
  - Keep readnl, init, and public namelist-derived constants
    (rhmini_const, rhmaxi_const, rhminis_const, rhmaxis_const,
    rhminl_const, rhminl_adj_land_const, rhminh_const).
  - init now calls compute_cloud_fraction_two_moment_init and
    cldfrc_getparams to distribute parameters.
  - Newly exposes rhminl_const, rhminl_adj_land_const, rhminh_const
    (previously internal) so callers can pass them in explicitly.

M       src/physics/cam/cldwat2m_macro.F90
  - USE compute_cloud_fraction_two_moment directly for subroutines;
    USE cldfrc2m shim only for rh constants.

M       src/physics/cam/clubb_intr.F90
  - USE compute_cloud_fraction_two_moment for aist_vector;
    USE cldfrc2m shim for rh constants including newly-exposed rhminl_const,
    rhminl_adj_land_const, rhminh_const.

M       src/physics/carma/models/cirrus/carma_cloudfraction.F90
M       src/physics/carma/models/cirrus_dust/carma_cloudfraction.F90
  - USE compute_cloud_fraction_two_moment for subroutines;
    USE cldfrc2m shim for rh constants.

@nusbaume nusbaume 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 @jimmielin! I just had a few small requests, but none of them require a re-review.

Comment thread src/physics/cam/cldfrc2m.F90 Outdated
real(r8) :: rhminl_const ! Critical RH for low-level liquid stratus clouds
real(r8) :: rhminl_adj_land_const ! rhminl adjustment for snowfree land
real(r8) :: rhminh_const ! Critical RH for high-level liquid stratus clouds
real(r8), protected :: rhminl_const ! Critical RH for low-level liquid stratus clouds

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.

Extra space here?

Suggested change
real(r8), protected :: rhminl_const ! Critical RH for low-level liquid stratus clouds
real(r8), protected :: rhminl_const ! Critical RH for low-level liquid stratus clouds

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, removed!

Comment on lines +1364 to +1365
al0_st_nc_in(:) = 0._r8
G0_nc_in(:) = 0._r8

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.

Should this have the REMOVECAM comment (i.e. is this just a pcols->ncols issue)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think so, yes. But this file will be completely gone after CAM5 Park is CCPPized (it will be entirely merged with the rest of macrop_driver.F90 that handles Park into a clean new scheme) so I'm inclined to not add further comments to it.

endif
call aist_vector(qv0_in(:),T0_in(:),p_in(:),qi0_in(:),ni0_in(:),landfrac(:),snowh(:),ai0_st_nc_in(:),ncol,&
rhmaxi_in(:), rhmini_in(:), rhminl_in(:), rhminl_adj_land_in(:), rhminh_in(:))
ai0_st_nc_in(:) = 0._r8

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.

Does there need to be a REMOVECAM comment here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for pointing this out, same as above.

@cacraigucar cacraigucar changed the title Complete CCPPization of cloud fraction for two-moment microphys (cldfrc2m) cam6_4_183: Complete CCPPization of cloud fraction for two-moment microphys (cldfrc2m) Jun 22, 2026
@jimmielin jimmielin merged commit a1dcf88 into ESCOMP:cam_development Jun 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Tag

Development

Successfully merging this pull request may close these issues.

2 participants