Skip to content
Merged
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
[submodule "atmos_phys"]
path = src/atmos_phys
url = https://github.com/ESCOMP/atmospheric_physics
fxtag = atmos_phys0_21_002
fxtag = atmos_phys0_21_003
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics

Expand Down
171 changes: 171 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,174 @@
Tag name: cam6_4_173
Originator(s): pel, peverwhee, hplin
Date: 15 May 2026
One-line Summary: Fix energy bugs in physics-dynamics coupling, RRTMGP diagnostics, and ZM scheme
Github PR URL: https://github.com/ESCOMP/CAM/pull/1554

Purpose of changes (include the issue number and title text for each relevant GitHub issue):
- Closes #1551 - Bug in physics tendency scaling
- Closes #1553 - RRTMGP diagnostic net_flx bug
- Closes #1550 - ZM scheme no longer conserving energy
- Closes #1556 - rad_cnst refactor: list_idx gating in carma_aerosol_state_mod.F90 breaks radiation diagnostics

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: nusbaume, cacraig (atmos_phys)

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 .gitmodules
- Update atmos_phys external to atmos_phys0_21_003

M src/atmos_phys
- Update to atmos_phys0_21_003: fix ZM scheme factor for energy conservation

M src/physics/cam/physpkg.F90
M src/physics/cam7/physpkg.F90
M src/physics/simple/physpkg.F90
- Move cam_thermo_water_update call to after state is saved (inside the
.not.moist_mixing_ratio_dycore block) so that cp/cv is updated using
post-physics water variables for energy diagnostics only
- Save and restore cp_or_cv_dycore along with state tracers/pdel/ps so
the energy-diagnostic-only call to physics_dme_adjust does not corrupt
the cp/cv used by the dycore energy consistency adjustment

M src/physics/rrtmgp/radiation.F90
- Move zeroing of flns/flnt (longwave net flux at surface/TOA) from
before the shortwave block to before the longwave block, fixing
incorrect net_flx diagnostics

M src/utils/air_composition.F90
- Remove 'protected' attribute from cp_or_cv_dycore to allow physpkg to
save/restore it across the diagnostic physics_dme_adjust call

M src/chemistry/aerosol/carma_aerosol_state_mod.F90
- Remove erroneous endrun guards in carma aerosol state that were blocking
double radiation cases

If there were any failures reported from running test_driver.sh on any test
platform, and checkin with these failures has been OK'd by the gatekeeper,
then copy the lines from the td.*.status files for the failed tests to the
appropriate machine below. All failed tests must be justified.

derecho/intel/aux_cam:
ERC_D_Ln9.f09_f09_mt232.FHIST_BDRD.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
ERC_D_Ln9.f19_f19_mg17.QPMOZ.derecho_intel.cam-outfrq3s (Overall: DIFF) details:
ERC_D_Ln9.f19_f19_mt232.QPC6.derecho_intel.cam-outfrq3s_cosp (Overall: DIFF) details:
ERC_D_Ln9.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
ERC_D_Ln9.mpasa120_mpasa120.FHISTC_LTso.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
ERC_D_Ln9.mpasa120_mpasa120.QPC7.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
ERC_D_Ln9.ne30pg2_ne30pg2_mt232.QPC7.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
ERC_D_Ln9.ne30pg3_ne30pg3_mt232.F1850C_LTso.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
ERC_Ln9.C96_C96_mt232.F2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
ERI_D_Ln18.f09_f09_mt232.FHIST.derecho_intel.cam-outfrq3s_eri (Overall: DIFF) details:
ERI_D_Ln18.f19_f19_mt232.FHIST_C5.derecho_intel.cam-outfrq3s_eri (Overall: DIFF) details:
ERI_D_Ln18.ne16pg3_ne16pg3_mt232.FHIST_C4.derecho_intel.cam-outfrq3s_eri (Overall: DIFF) details:
ERI_D_Ln18.ne30pg3_ne30pg3_mt232.FHISTC_LTso.derecho_intel.cam-outfrq3s_eri (Overall: DIFF) details:
ERP_D_Ln9.ne30pg3_ne30pg3_mt232.F1850C_MTso.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
ERP_D_Ln9_P64x2.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
ERP_Ld3.ne16pg3_ne16pg3_mg17.FHISTC_WAt1ma.derecho_intel.cam-reduced_hist1d (Overall: DIFF) details:
ERP_Ld3.ne30pg3_ne30pg3_mt232.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa (Overall: DIFF) details:
ERP_Lh12.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h (Overall: DIFF) details:
ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
ERP_Ln9.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
ERP_Ln9.ne30pg3_ne30pg3_mg17.FCnudged.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
ERP_Ln9.ne30pg3_ne30pg3_mg17.FHISTC_WAma.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
ERR_Ln9.ne16pg3_ne16pg3_mt232.FHISTC_LTso.derecho_intel.cam-outfrq9s_bwic (Overall: DIFF) details:
ERS_Ln9.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
ERS_Ln9.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
SMS_D_Ln9.f09_f09_mg17.FCts2nudged.derecho_intel.cam-outfrq9s_leapday (Overall: DIFF) details:
SMS_D_Ln9.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
SMS_D_Ln9.f09_f09_mg17.FSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
SMS_D_Ln9.f19_f19_mg17.FCARMA2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
SMS_D_Ln9.f19_f19_mg17.FCHIST_SLH.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
SMS_D_Ln9.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
SMS_D_Ln9.f19_f19_mt232.FHIST_C5.derecho_intel.cam-mam7 (Overall: DIFF) details:
SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d (Overall: DIFF) details:
SMS_Ld1.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details:
SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h (Overall: DIFF) details:
SMS_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-nudging (Overall: DIFF) details:
SMS_Ln9.f09_f09_mg17.FW1850.derecho_intel.cam-reduced_hist3s (Overall: DIFF) details:
ERS_Ln9.ne30pg3_ne30pg3_mg17.FHISTC_WXma.derecho_intel.cam-outfrq9s_ctem (Overall: DIFF) details:
SCT_D_Ln7.ne3_ne3_mg37.QPC5.derecho_intel.cam-scm_prep (Overall: DIFF) details:
SMS_C2_D_Ln9.ne16pg3_ne16pg3_mg17.FHISTC_WXma.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
SMS_D_Ln9.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
SMS_D_Ln9.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s_amie (Overall: DIFF) details:
SMS_D_Ln9.ne30pg3_ne30pg3_mt232.1850C_CAM70%MT%CT4S2_CLM60%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
SMS_D_Ln9.ne30pg3_ne30pg3_mt232.FHISTC_MTso.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mt232.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust (Overall: DIFF) details:
SMS_Ld1.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details:
SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp (Overall: DIFF) details:
SMS_D_Ln9_P1536x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
- expected differences due to SE dycore updates + ZM bug fix.


derecho/nvhpc/aux_cam:
ERS_Ln9.ne30pg3_ne30pg3_mt232.FHISTC_LTso.derecho_nvhpc.cam-outfrq9s_gpu_default (Overall: DIFF)
- expected differences due to SE dycore updates + ZM bug fix.

izumi/nag/aux_cam:
ERC_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_nag.cam-outfrq3s_subcol (Overall: FAIL) details:
- pre-existing failure -- see https://github.com/ESCOMP/CAM/issues/1514

ERC_D_Ln27.ne3pg3_ne3pg3_mt232.FKESSLER.izumi_nag.cam-outfrq9s (Overall: DIFF) details::
ERC_D_Ln9.mpasa480_mpasa480_mt232.QPC7.izumi_nag.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHISTC_LTso.izumi_nag.cam-cosp_rad_diags (Overall: DIFF) details:
ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHISTC_LTso.izumi_nag.cam-outfrq9s_nochem (Overall: DIFF) details:
ERC_D_Ln9.ne3pg3_ne3pg3_mt232.QPC4.izumi_nag.cam-outfrq9s (Overall: DIFF) details:
SMS_D_Ln3.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
SMS_D_Ln6.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: DIFF) details:
SMS_D_Ln9.ne3pg3_ne3pg3_mt232.QPC7.izumi_nag.cam-carma_test_tracers (Overall: DIFF) details:
- expected differences due to SE dycore updates + ZM bug fix.

ERC_D_Ln9.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
ERC_D_Ln9.f10_f10_mt232.FHIST.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details
SMS_D_Ln9.f10_f10_mt232.F1850.izumi_nag.cam-outfrq9s (Overall: DIFF) details:
TMC_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_nag.cam-mc_ttrac (Overall: DIFF) details:
- expected differences due to ZM bug fix.

izumi/gnu/aux_cam:
ERC_D_Ln9.C48_C48_mg17.QPC6.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
ERC_D_Ln9.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags (Overall: DIFF) details:
ERC_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_gnu.cam-rad_diag (Overall: DIFF) details:
ERC_D_Ln9.f19_f19_mt232.FHIST.izumi_gnu.cam-lonlat_fv_diags (Overall: DIFF) details:
ERC_D_Ln9.mpasa480_mpasa480_mt232.FHISTC_LTso.izumi_gnu.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
ERC_D_Ln9.ne3pg3_ne3pg3_mt232.F1850_C4.izumi_gnu.cam-co2rmp (Overall: DIFF) details:
ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FGRAYRAD.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHIST_C5.izumi_gnu.cam-carma_cosp_rad_diag_mam (Overall: DIFF) details:
ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHISTC_LTso.izumi_gnu.cam-sat_lcltod (Overall: DIFF) details:
ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHIST.izumi_gnu.cam-nochem_clubbmf (Overall: DIFF) details:
ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FTJ16.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
ERC_D_Ln9.ne3pg3_ne3pg3_mt232.QPC5.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
ERC_D_Ln9.ne3pg3_ne3pg3_mt232.QPC7.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
ERC_D_Ln9.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 (Overall: DIFF) details:
ERS_Ln9_P24x1.mpasa480_mpasa480.F2000climo.izumi_gnu.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
PLB_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_gnu.cam-ttrac_loadbal0 (Overall: DIFF) details:
PLB_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_gnu.cam-ttrac_loadbal1 (Overall: DIFF) details:
PLB_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_gnu.cam-ttrac_loadbal3 (Overall: DIFF) details:
SCT_D_Ln7.ne3_ne3_mg37.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: DIFF) details:
SMS_D_Ln3.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc (Overall: DIFF) details:
SMS_D_Ln9.f10_f10_mg37.FWmaHIST.izumi_gnu.cam-outfrq9s_mee_fluxes (Overall: DIFF) details:
SMS_D_Ln9.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee (Overall: DIFF) details:
SMS_D_Ln9.f19_f19_mt232.FW4madSD.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
SUB_D_Ln9.ne3pg3_ne3pg3_mt232.FHIST.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
- expected failures due to SE dycore updates + ZM bug fix

Summarize any changes to answers:
Expecting failures against baseline for all tests using SE dycore
(only tests without moisture should not fail)

===============================================================

Tag name: cam6_4_172
Expand Down
16 changes: 0 additions & 16 deletions src/chemistry/aerosol/carma_aerosol_state_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,6 @@ subroutine hygroscopicity(self, bin_ndx, kappa)
character(len=aero_name_len) :: bin_name, shortname
integer :: igroup, ibin, rc, nchr, ncol

if (self%list_idx_ /= 0) then
call endrun('carma_aerosol_state::hygroscopicity: only valid for climate list (list_idx=0)')
end if

call rad_aer_get_info_by_bin(0, bin_ndx, bin_name=bin_name)

nchr = len_trim(bin_name)-2
Expand Down Expand Up @@ -476,10 +472,6 @@ function dry_volume(self, aero_props, bin_idx, ncol, nlev) result(vol)
character(len=aero_name_len) :: bin_name, shortname
integer :: igroup, ibin, rc, nchr

if (self%list_idx_ /= 0) then
call endrun('carma_aerosol_state::dry_volume: only valid for climate list (list_idx=0)')
end if

call rad_aer_get_info_by_bin(0, bin_idx, bin_name=bin_name)

nchr = len_trim(bin_name)-2
Expand Down Expand Up @@ -519,10 +511,6 @@ function wet_volume(self, aero_props, bin_idx, ncol, nlev) result(vol)
character(len=aero_name_len) :: bin_name, shortname
integer :: igroup, ibin, rc, nchr

if (self%list_idx_ /= 0) then
call endrun('carma_aerosol_state::wet_volume: only valid for climate list (list_idx=0)')
end if

call rad_aer_get_info_by_bin(0, bin_idx, bin_name=bin_name)

nchr = len_trim(bin_name)-2
Expand Down Expand Up @@ -586,10 +574,6 @@ function wet_diameter(self, bin_idx, ncol, nlev) result(diam)
character(len=aero_name_len) :: bin_name, shortname
integer :: igroup, ibin, rc, nchr

if (self%list_idx_ /= 0) then
call endrun('carma_aerosol_state::wet_diameter: only valid for climate list (list_idx=0)')
end if

call rad_aer_get_info_by_bin(0, bin_idx, bin_name=bin_name)

nchr = len_trim(bin_name)-2
Expand Down
16 changes: 10 additions & 6 deletions src/physics/cam/physpkg.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,7 @@ subroutine tphysac (ztodt, cam_in, &
real(r8) :: tmp_trac (pcols,pver,pcnst) ! tmp space
real(r8) :: tmp_pdel (pcols,pver) ! tmp space
real(r8) :: tmp_ps (pcols) ! tmp space
real(r8) :: tmp_cpcv (pcols,pver) ! tmp space
real(r8) :: scaling(pcols,pver)
logical :: moist_mixing_ratio_dycore

Expand Down Expand Up @@ -1987,11 +1988,6 @@ subroutine tphysac (ztodt, cam_in, &
! FV: convert dry-type mixing ratios to moist here because physics_dme_adjust
! assumes moist. This is done in p_d_coupling for other dynamics. Bundy, Feb 2004.
moist_mixing_ratio_dycore = dycore_is('LR').or. dycore_is('FV3')
!
! update cp/cv for energy computation based in updated water variables
!
call cam_thermo_water_update(state%q(:ncol,:,:), lchnk, ncol, vc_dycore,&
to_dry_factor=state%pdel(:ncol,:)/state%pdeldry(:ncol,:))

! for dry mixing ratio dycore, physics_dme_adjust is called for energy diagnostic purposes only.
! So, save off tracers
Expand All @@ -2005,10 +2001,17 @@ subroutine tphysac (ztodt, cam_in, &
tmp_trac(:ncol,:pver,:pcnst) = state%q(:ncol,:pver,:pcnst)
tmp_pdel(:ncol,:pver) = state%pdel(:ncol,:pver)
tmp_ps(:ncol) = state%ps(:ncol)
tmp_cpcv(:ncol,:pver) = cp_or_cv_dycore(:ncol,:pver,lchnk)
if (trim(cam_take_snapshot_before) == "physics_dme_adjust") then
call cam_snapshot_all_outfld_tphysac(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf,&
fh2o, surfric, obklen, flx_heat)
end if
end if
!
! update cp/cv for energy computation based in updated water variables
!
call cam_thermo_water_update(state%q(:ncol,:,:), lchnk, ncol, vc_dycore,&
to_dry_factor=state%pdel(:ncol,:)/state%pdeldry(:ncol,:))

call physics_dme_adjust(state, tend, qini, totliqini, toticeini, ztodt)
if (trim(cam_take_snapshot_after) == "physics_dme_adjust") then
call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf,&
Expand All @@ -2020,6 +2023,7 @@ subroutine tphysac (ztodt, cam_in, &
state%q(:ncol,:pver,:pcnst) = tmp_trac(:ncol,:pver,:pcnst)
state%pdel(:ncol,:pver) = tmp_pdel(:ncol,:pver)
state%ps(:ncol) = tmp_ps(:ncol)
cp_or_cv_dycore(:ncol,:pver,lchnk) = tmp_cpcv(:ncol,:pver)
end if
else
!
Expand Down
15 changes: 9 additions & 6 deletions src/physics/cam7/physpkg.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,7 @@ subroutine tphysac (ztodt, cam_in, &
real(r8) :: tmp_trac (pcols,pver,pcnst) ! tmp space
real(r8) :: tmp_pdel (pcols,pver) ! tmp space
real(r8) :: tmp_ps (pcols) ! tmp space
real(r8) :: tmp_cpcv (pcols,pver) ! tmp space
real(r8) :: scaling(pcols,pver)
logical :: moist_mixing_ratio_dycore

Expand Down Expand Up @@ -2497,12 +2498,6 @@ subroutine tphysac (ztodt, cam_in, &
! FV: convert dry-type mixing ratios to moist here because physics_dme_adjust
! assumes moist. This is done in p_d_coupling for other dynamics. Bundy, Feb 2004.
moist_mixing_ratio_dycore = dycore_is('LR').or. dycore_is('FV3')
!
! update cp/cv for energy computation based in updated water variables
!
call cam_thermo_water_update(state%q(:ncol,:,:), lchnk, ncol, vc_dycore,&
to_dry_factor=state%pdel(:ncol,:)/state%pdeldry(:ncol,:))

! for dry mixing ratio dycore, physics_dme_adjust is called for energy diagnostic purposes only.
! So, save off tracers
if (.not.moist_mixing_ratio_dycore) then
Expand All @@ -2515,10 +2510,17 @@ subroutine tphysac (ztodt, cam_in, &
tmp_trac(:ncol,:pver,:pcnst) = state%q(:ncol,:pver,:pcnst)
tmp_pdel(:ncol,:pver) = state%pdel(:ncol,:pver)
tmp_ps(:ncol) = state%ps(:ncol)
tmp_cpcv(:ncol,:pver) = cp_or_cv_dycore(:ncol,:pver,lchnk)
if (trim(cam_take_snapshot_before) == "physics_dme_adjust") 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
!
! update cp/cv for energy computation based in updated water variables
!
call cam_thermo_water_update(state%q(:ncol,:,:), lchnk, ncol, vc_dycore,&
to_dry_factor=state%pdel(:ncol,:)/state%pdeldry(:ncol,:))

call physics_dme_adjust(state, tend, qini, totliqini, toticeini, ztodt)
if (trim(cam_take_snapshot_after) == "physics_dme_adjust") then
call cam_snapshot_all_outfld_tphysac(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf,&
Expand All @@ -2530,6 +2532,7 @@ subroutine tphysac (ztodt, cam_in, &
state%q(:ncol,:pver,:pcnst) = tmp_trac(:ncol,:pver,:pcnst)
state%pdel(:ncol,:pver) = tmp_pdel(:ncol,:pver)
state%ps(:ncol) = tmp_ps(:ncol)
cp_or_cv_dycore(:ncol,:pver,lchnk) = tmp_cpcv(:ncol,:pver)
end if
else
!
Expand Down
10 changes: 5 additions & 5 deletions src/physics/rrtmgp/radiation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1124,11 +1124,6 @@ subroutine radiation_tend( &
end do
end if

!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
flns(:) = 0._r8
flnt(:) = 0._r8
!REMOVECAM_END

! Find tropopause height if needed for diagnostic output
if (hist_fld_active('FSNR') .or. hist_fld_active('FLNR')) then
!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
Expand Down Expand Up @@ -1336,6 +1331,11 @@ subroutine radiation_tend( &

if (dolw) then

!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists
flns(:) = 0._r8
flnt(:) = 0._r8
!REMOVECAM_END

! Set cloud optical properties in cloud_lw object.
call rrtmgp_lw_cloud_optics_run(dolw, ncol, nlay, cld(:ncol,:), cldfsnow_in, &
cldfgrau_in, cldfprime(:ncol,:), kdist_lw, lambda(:ncol,:), mu(:ncol,:), &
Expand Down
Loading
Loading