From b8c1e0111e49d820e7d1722a8fd94249fcf89a43 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 25 Jun 2026 12:14:56 -0600 Subject: [PATCH 1/4] Mod to update PUMAS round3 in CAM --- .gitmodules | 6 +++--- src/physics/cam/physpkg.F90 | 2 -- src/physics/cam7/micro_pumas_cam.F90 | 4 +++- src/physics/cam7/physpkg.F90 | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.gitmodules b/.gitmodules index 43ca2f80db..7d98afecfd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,10 +28,10 @@ [submodule "atmos_phys"] path = src/atmos_phys - url = https://github.com/ESCOMP/atmospheric_physics - fxtag = atmos_phys0_21_002 + url = https://github.com/nusbaume/atmospheric_physics + fxtag = 489806a fxrequired = AlwaysRequired - fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics + fxDONOTUSEurl = https://github.com/nusbaume/atmospheric_physics [submodule "cam-sima"] path = src/utils/cam-sima diff --git a/src/physics/cam/physpkg.F90 b/src/physics/cam/physpkg.F90 index 27790526e5..8d676258e0 100644 --- a/src/physics/cam/physpkg.F90 +++ b/src/physics/cam/physpkg.F90 @@ -932,8 +932,6 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out ) if (.not. do_clubb_sgs) call macrop_driver_init(pbuf2d) call microp_aero_init(phys_state,pbuf2d) call microp_driver_init(pbuf2d) - call conv_water_init - end if ! initiate CLUBB within CAM if (do_clubb_sgs) call clubb_ini_cam(pbuf2d) diff --git a/src/physics/cam7/micro_pumas_cam.F90 b/src/physics/cam7/micro_pumas_cam.F90 index 00731a3ef5..83ec67c6c5 100644 --- a/src/physics/cam7/micro_pumas_cam.F90 +++ b/src/physics/cam7/micro_pumas_cam.F90 @@ -2474,7 +2474,9 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf) tnd_qsnow(:ncol,top_lev:), tnd_nsnow(:ncol,top_lev:), & re_ice(:ncol,top_lev:), & frzimm(:ncol,top_lev:), frzcnt(:ncol,top_lev:), & - frzdep(:ncol,top_lev:), rate1cld(:ncol,top_lev:), & + frzdep(:ncol,top_lev:), & + micro_mg_warm_rain, & + rate1cld(:ncol,top_lev:), & tlat(:ncol,top_lev:), qvlat(:ncol,top_lev:), & qcten(:ncol,top_lev:), qiten(:ncol,top_lev:), & ncten(:ncol,top_lev:), niten(:ncol,top_lev:), & diff --git a/src/physics/cam7/physpkg.F90 b/src/physics/cam7/physpkg.F90 index ae1620787a..f363238bc0 100644 --- a/src/physics/cam7/physpkg.F90 +++ b/src/physics/cam7/physpkg.F90 @@ -1837,17 +1837,17 @@ subroutine tphysac (ztodt, cam_in, & call check_energy_timestep_init(state_sc, tend_sc, pbuf, col_type_subcol) end if - if (trim(cam_take_snapshot_before) == "microp_section") then - call cam_snapshot_all_outfld_tphysac(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & - fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx) - end if - call t_startf('microp_aero_run') call microp_aero_run(state, ptend_aero, cld_macmic_ztodt, pbuf) call t_stopf('microp_aero_run') call t_startf('microp_tend') + if (trim(cam_take_snapshot_before) == "microp_section") then + call cam_snapshot_all_outfld_tphysac(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & + fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx) + end if + if (use_subcol_microp) then if (trim(cam_take_snapshot_before) == "microp_driver_tend_subcol") then From bba10bd27c254e13231ed65a017bdfe07d2e834b Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 25 Jun 2026 14:21:11 -0600 Subject: [PATCH 2/4] Update atmos_phys hash --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 7d98afecfd..047ef89334 100644 --- a/.gitmodules +++ b/.gitmodules @@ -29,7 +29,7 @@ [submodule "atmos_phys"] path = src/atmos_phys url = https://github.com/nusbaume/atmospheric_physics - fxtag = 489806a + fxtag = 2b7ecfa3 fxrequired = AlwaysRequired fxDONOTUSEurl = https://github.com/nusbaume/atmospheric_physics From 07fefb04dd9c59ce628f7366f2704c2dcad78e1a Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 26 Jun 2026 17:08:44 -0600 Subject: [PATCH 3/4] Fix indavertent commit and add pumas_tend snapshot --- bld/build-namelist | 6 ++++-- bld/namelist_files/namelist_definition.xml | 10 +++++----- src/physics/cam/physpkg.F90 | 14 +++++++++++++ src/physics/cam7/physpkg.F90 | 23 +++++++++++++++++++++- 4 files changed, 45 insertions(+), 8 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index d23e72cfc9..6a0410704b 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -5313,7 +5313,8 @@ sub check_snapshot_settings { # cam7 physpkg push(@validList_ac, ("'chem_emissions'", "'clubb_tend_cam'", - "'microp_section'")); + "'microp_section'", + "'pumas_tend'")); if ($use_subcol_microp =~ /$TRUE/io) { push (@validList_bc, ("'microp_driver_tend_subcol'")); } @@ -5354,7 +5355,8 @@ sub check_snapshot_settings { } else { push (@validList_bc, ("'macrop_driver_tend'")); } - push (@validList_bc, ("'microp_section'")); + push (@validList_bc, ("'microp_section'", + "'pumas_tend'")); if ($use_subcol_microp =~ /$TRUE/io) { push (@validList_bc, ("'microp_driver_tend_subcol'")); } diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 284e89793a..d697a0ff47 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -3699,7 +3699,7 @@ the dynamics core. Very experimental. Causes advance_clubb_core to run in ascending mode, where the surface is at k=1, which is opposite -of the descending cam grid. This is mainly a testing/debugging option - it requires an expensive +of the descending cam grid. This is mainly a testing/debugging option - it requires an expensive data flipping step and should not change answers significantly. @@ -3979,7 +3979,7 @@ Valid values: 0 (no grid adaptation), 1 (use Lscale and wp2) -Selects which algorithm the fill_holes routine uses to correct +Selects which algorithm the fill_holes routine uses to correct below threshold values in field solutions. 0: off - Skip the mass conservative hole filling step, rely on blunt clipping 1: global - Fast but minimally local, most methods use this as a fallback step @@ -4211,7 +4211,7 @@ calculated by down-gradient diffusion. -Flag to implement the nontraditional Coriolis terms in the +Flag to implement the nontraditional Coriolis terms in the prognostic equations of w'w', u'w', and u'u. @@ -5735,7 +5735,7 @@ Default: + group="phys_ctl_nl" valid_values="pumas_tend","chem_emissions,aoa_tracers_timestep_tend,co2_cycle_set_ptend,chem_timestep_tend,orographic_form_drag_stress,vertical_diffusion_section,aero_model_drydep,gw_tend,qbo_relax,iondrag_calc_section,physics_dme_adjust,physics_dme_adjust,dadadj_tend,convect_deep_tend,convect_shallow_tend,convect_diagnostics_calc,macrop_driver_tend,clubb_tend_cam,microp_section,microp_driver_tend_subcol,aero_model_wetdep,radiation_tend,held_suarez_tend,kessler_tend,thatcher_jablonowski_precip_tend,rk_stratiform_tend,rayleigh_friction_tend,user_set" > Name of parameterization to take snapshot before running user_set is used when a user inserts a call to cam_snapshot_all_outfld using cam_snapshot_before_num as the first argument. @@ -5743,7 +5743,7 @@ Default: Unused + group="phys_ctl_nl" valid_values="pumas_tend","chem_emissions,aoa_tracers_timestep_tend,co2_cycle_set_ptend,chem_timestep_tend,orographic_form_drag_stress,vertical_diffusion_section,aero_model_drydep,gw_tend,qbo_relax,iondrag_calc_section,physics_dme_adjust,physics_dme_adjust,dadadj_tend,convect_deep_tend,convect_shallow_tend,convect_diagnostics_calc,macrop_driver_tend,clubb_tend_cam,microp_section,microp_driver_tend_subcol,aero_model_wetdep,radiation_tend,held_suarez_tend,kessler_tend,thatcher_jablonowski_precip_tend,rk_stratiform_tend,rayleigh_friction_tend,user_set" > Name of parameterization to take snapshot after running user_set is used when a user inserts a call to cam_snapshot_all_outfld using cam_snapshot_after_num as the first argument. diff --git a/src/physics/cam/physpkg.F90 b/src/physics/cam/physpkg.F90 index 8d676258e0..77e1990da4 100644 --- a/src/physics/cam/physpkg.F90 +++ b/src/physics/cam/physpkg.F90 @@ -932,6 +932,8 @@ subroutine phys_init( phys_state, phys_tend, pbuf2d, cam_in, cam_out ) if (.not. do_clubb_sgs) call macrop_driver_init(pbuf2d) call microp_aero_init(phys_state,pbuf2d) call microp_driver_init(pbuf2d) + call conv_water_init + end if ! initiate CLUBB within CAM if (do_clubb_sgs) call clubb_ini_cam(pbuf2d) @@ -2811,6 +2813,10 @@ subroutine tphysbc (ztodt, state, & call microp_aero_run(state, ptend_aero, cld_macmic_ztodt, pbuf) call t_stopf('microp_aero_run') + if (trim(cam_take_snapshot_before) == "pumas_tend") then + call cam_snapshot_all_outfld_tphysbc(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & + flx_heat, cmfmc, cmfcme, zdu, rliq, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + end if call t_startf('microp_tend') if (use_subcol_microp) then @@ -2902,12 +2908,20 @@ subroutine tphysbc (ztodt, state, & (trim(cam_take_snapshot_before) == trim(cam_take_snapshot_after))) then call cam_snapshot_ptend_outfld(ptend, lchnk) end if + if ( (trim(cam_take_snapshot_after) == "pumas_tend") .and. & + (trim(cam_take_snapshot_before) == trim(cam_take_snapshot_after))) then + call cam_snapshot_ptend_outfld(ptend, lchnk) + end if call physics_update (state, ptend, ztodt, tend) if (trim(cam_take_snapshot_after) == "microp_section") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf, & flx_heat, cmfmc, cmfcme, zdu, rliq, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if + if (trim(cam_take_snapshot_after) == "pumas_tend") then + call cam_snapshot_all_outfld_tphysbc(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf, & + flx_heat, cmfmc, cmfcme, zdu, rliq, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + end if call check_energy_cam_chng(state, tend, "microp_tend", nstep, ztodt, & zero, prec_str(:ncol)/cld_macmic_num_steps, & diff --git a/src/physics/cam7/physpkg.F90 b/src/physics/cam7/physpkg.F90 index f363238bc0..db3330d456 100644 --- a/src/physics/cam7/physpkg.F90 +++ b/src/physics/cam7/physpkg.F90 @@ -1837,17 +1837,22 @@ subroutine tphysac (ztodt, cam_in, & call check_energy_timestep_init(state_sc, tend_sc, pbuf, col_type_subcol) end if + if (trim(cam_take_snapshot_before) == "microp_section") then + call cam_snapshot_all_outfld_tphysac(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & + fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx) + end if call t_startf('microp_aero_run') call microp_aero_run(state, ptend_aero, cld_macmic_ztodt, pbuf) call t_stopf('microp_aero_run') call t_startf('microp_tend') - if (trim(cam_take_snapshot_before) == "microp_section") then + if (trim(cam_take_snapshot_before) == "pumas_tend") then call cam_snapshot_all_outfld_tphysac(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx) end if + if (use_subcol_microp) then if (trim(cam_take_snapshot_before) == "microp_driver_tend_subcol") then @@ -1900,12 +1905,20 @@ subroutine tphysac (ztodt, cam_in, & (trim(cam_take_snapshot_before) == trim(cam_take_snapshot_after))) then call cam_snapshot_ptend_outfld(ptend, lchnk) end if + if ( (trim(cam_take_snapshot_after) == "pumas") .and. & + (trim(cam_take_snapshot_before) == trim(cam_take_snapshot_after))) then + call cam_snapshot_ptend_outfld(ptend, lchnk) + end if call physics_update (state_sc, ptend_sc, ztodt, tend_sc) if (trim(cam_take_snapshot_after) == "microp_driver_tend_subcol") then call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state_sc, tend_sc, cam_in, cam_out, pbuf, & fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx) end if + if (trim(cam_take_snapshot_after) == "pumas") then + call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state_sc, tend_sc, cam_in, cam_out, pbuf, & + fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx) + end if call check_energy_cam_chng(state_sc, tend_sc, "microp_tend_subcol", & nstep, ztodt, zero_sc, & @@ -1932,12 +1945,20 @@ subroutine tphysac (ztodt, cam_in, & (trim(cam_take_snapshot_before) == trim(cam_take_snapshot_after))) then call cam_snapshot_ptend_outfld(ptend, lchnk) end if + if ( (trim(cam_take_snapshot_after) == "pumas_tend") .and. & + (trim(cam_take_snapshot_before) == trim(cam_take_snapshot_after))) then + call cam_snapshot_ptend_outfld(ptend, lchnk) + end if call physics_update (state, ptend, ztodt, tend) if (trim(cam_take_snapshot_after) == "microp_section") then call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf, & fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx) end if + if (trim(cam_take_snapshot_after) == "pumas_tend") then + call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf, & + fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx) + end if call check_energy_cam_chng(state, tend, "microp_tend", nstep, ztodt, & zero, prec_str(:ncol)/cld_macmic_num_steps, & From a201ea4b8819d8b5fd7f76bb9c61b9c76f9a891d Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Mon, 29 Jun 2026 14:08:48 -0600 Subject: [PATCH 4/4] Address review comments --- bld/namelist_files/namelist_definition.xml | 4 ++-- src/physics/cam7/physpkg.F90 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index d697a0ff47..d0c982cd73 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -5735,7 +5735,7 @@ Default: + group="phys_ctl_nl" valid_values="pumas_tend,chem_emissions,aoa_tracers_timestep_tend,co2_cycle_set_ptend,chem_timestep_tend,orographic_form_drag_stress,vertical_diffusion_section,aero_model_drydep,gw_tend,qbo_relax,iondrag_calc_section,physics_dme_adjust,physics_dme_adjust,dadadj_tend,convect_deep_tend,convect_shallow_tend,convect_diagnostics_calc,macrop_driver_tend,clubb_tend_cam,microp_section,microp_driver_tend_subcol,aero_model_wetdep,radiation_tend,held_suarez_tend,kessler_tend,thatcher_jablonowski_precip_tend,rk_stratiform_tend,rayleigh_friction_tend,user_set" > Name of parameterization to take snapshot before running user_set is used when a user inserts a call to cam_snapshot_all_outfld using cam_snapshot_before_num as the first argument. @@ -5743,7 +5743,7 @@ Default: Unused + group="phys_ctl_nl" valid_values="pumas_tend,chem_emissions,aoa_tracers_timestep_tend,co2_cycle_set_ptend,chem_timestep_tend,orographic_form_drag_stress,vertical_diffusion_section,aero_model_drydep,gw_tend,qbo_relax,iondrag_calc_section,physics_dme_adjust,physics_dme_adjust,dadadj_tend,convect_deep_tend,convect_shallow_tend,convect_diagnostics_calc,macrop_driver_tend,clubb_tend_cam,microp_section,microp_driver_tend_subcol,aero_model_wetdep,radiation_tend,held_suarez_tend,kessler_tend,thatcher_jablonowski_precip_tend,rk_stratiform_tend,rayleigh_friction_tend,user_set" > Name of parameterization to take snapshot after running user_set is used when a user inserts a call to cam_snapshot_all_outfld using cam_snapshot_after_num as the first argument. diff --git a/src/physics/cam7/physpkg.F90 b/src/physics/cam7/physpkg.F90 index db3330d456..f0eaf1a519 100644 --- a/src/physics/cam7/physpkg.F90 +++ b/src/physics/cam7/physpkg.F90 @@ -1905,7 +1905,7 @@ subroutine tphysac (ztodt, cam_in, & (trim(cam_take_snapshot_before) == trim(cam_take_snapshot_after))) then call cam_snapshot_ptend_outfld(ptend, lchnk) end if - if ( (trim(cam_take_snapshot_after) == "pumas") .and. & + if ( (trim(cam_take_snapshot_after) == "pumas_tend") .and. & (trim(cam_take_snapshot_before) == trim(cam_take_snapshot_after))) then call cam_snapshot_ptend_outfld(ptend, lchnk) end if @@ -1915,7 +1915,7 @@ subroutine tphysac (ztodt, cam_in, & call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state_sc, tend_sc, cam_in, cam_out, pbuf, & fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx) end if - if (trim(cam_take_snapshot_after) == "pumas") then + if (trim(cam_take_snapshot_after) == "pumas_tend") then call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state_sc, tend_sc, cam_in, cam_out, pbuf, & fh2o, surfric, obklen, flx_heat, cmfmc, dlf, det_s, det_ice, net_flx) end if