Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,76 @@

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

Tag name: cam6_4_190
Originator(s): cacraigucar, jimmielin, gold2718, duncanwp
Date: July 23, 2026
One-line Summary: Misc changes
Github PR URL: https://github.com/ESCOMP/CAM/pull/1629

Purpose of changes (include the issue number and title text for each relevant GitHub issue):
- mo_setaer.F90 not needed: https://github.com/ESCOMP/CAM/issues/1582
- physics_dme_adjust_rebuilds surface pressure inside the vertical loop, orrupting state%ps (FV/FV3/EUL):
https://github.com/ESCOMP/CAM/issues/1588
- Graupel cloud fraction averaged into cldfsnow_grid (overwrites snow, leaves CLDFGRAU empty) in micro_pumas_cam.F90:
https://github.com/ESCOMP/CAM/issues/1593
- deep_scheme_does_scav_trans is no longer needed: https://github.com/ESCOMP/CAM/issues/1598
- PM1/PM10_SRF (MAM) wrong vertical dimensions being passed into horiz_only field: https://github.com/ESCOMP/CAM/issues/1599
- qh2o in GEOS-Chem chemisty.F90 should be sized pcols - stack corruption: https://github.com/ESCOMP/CAM/issues/1604

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: jimmielin, cacraigucar

List all files eliminated:
D src/chemistry/mozart/mo_setaer.F90
- issue #1582

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

List all existing files that have been modified, and describe the changes:
M src/chemistry/geoschem/chemistry.F90
- issue #1604

M src/chemistry/utils/modal_aero_wateruptake.F90
- issue #1599

M src/physics/cam/convect_deep.F90
M src/physics/cam/physpkg.F90
M src/physics/cam7/physpkg.F90
- issue #1598

M src/physics/cam/micro_pumas_cam.F90
- issue #1593

M src/physics/cam/physics_types.F90
- issue #1588


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:
SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d (Overall: DIFF) details:
- issue #1604 expected GEOS-Chem baseline diff

derecho/nvhpc/aux_cam: all BFB

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


izumi/gnu/aux_cam: all BFB

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

Tag name: cam6_4_189
Expand Down
2 changes: 1 addition & 1 deletion src/chemistry/geoschem/chemistry.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2040,7 +2040,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o )
REAL(r8) :: relHum (state%NCOL,PVER) ! Relative humidity [0-1]
REAL(r8) :: satV (state%NCOL,PVER) ! Work arrays
REAL(r8) :: satQ (state%NCOL,PVER) ! Work arrays
REAL(r8) :: qH2O (state%NCOL,PVER) ! Specific humidity [kg/kg]
REAL(r8) :: qH2O (pcols, PVER) ! Specific humidity [kg/kg] has to be pcols for newnuc.
REAL(r8) :: h2ovmr (state%NCOL,PVER) ! H2O volume mixing ratio
REAL(r8) :: mBar (state%NCOL,PVER) ! Mean wet atmospheric mass [amu]
REAL(r8) :: invariants(state%NCOL,PVER,nfs)
Expand Down
4 changes: 2 additions & 2 deletions src/chemistry/utils/modal_aero_wateruptake.F90
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,9 @@ subroutine modal_aero_wateruptake_dr(state, pbuf, aero_props, aero_state, &
call outfld('PM25_SRF', pm25(:,pver), pcols, lchnk)
! dmleung 20 Oct 2025 added history fields below ++
call outfld('PM25_MMR', pm25_mmr(:,:), pcols, lchnk)
call outfld('PM1_SRF', pm1(:,:), pcols, lchnk)
call outfld('PM1_SRF', pm1(:,pver), pcols, lchnk)
call outfld('PM1_MMR', pm1_mmr(:,:), pcols, lchnk)
call outfld('PM10_SRF', pm10(:,:), pcols, lchnk)
call outfld('PM10_SRF', pm10(:,pver), pcols, lchnk)
call outfld('PM10_MMR', pm10_mmr(:,:), pcols, lchnk)
call outfld('PMTOT_MMR',pmtot_mmr(:,:),pcols, lchnk)
call outfld('RHO_AIR', rhoair(:,:), pcols, lchnk)
Expand Down
22 changes: 1 addition & 21 deletions src/physics/cam/convect_deep.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ module convect_deep
convect_deep_register, &! register fields in physics buffer
convect_deep_init, &! initialize donner_deep module
convect_deep_tend, &! return tendencies
convect_deep_tend_2, &! return tendencies
deep_scheme_does_scav_trans ! = .t. if scheme does scavenging and conv. transport
convect_deep_tend_2 ! return tendencies

! Private module data
character(len=16) :: deep_scheme ! default set in phys_control.F90, use namelist to change
Expand All @@ -50,25 +49,6 @@ module convect_deep
!=========================================================================================
contains

!=========================================================================================
function deep_scheme_does_scav_trans()
!
! Function called by tphysbc to determine if it needs to do scavenging and convective transport
! or if those have been done by the deep convection scheme. Each scheme could have its own
! identical query function for a less-knowledgable interface but for now, we know that KE
! does scavenging & transport, and ZM doesn't
!

logical deep_scheme_does_scav_trans

deep_scheme_does_scav_trans = .false.

if ( deep_scheme .eq. 'KE' ) deep_scheme_does_scav_trans = .true.

return

end function deep_scheme_does_scav_trans

!=========================================================================================
subroutine convect_deep_register

Expand Down
2 changes: 1 addition & 1 deletion src/physics/cam/micro_pumas_cam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2898,7 +2898,7 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)

if (micro_mg_version > 2) then
call subcol_field_avg(icgrauwp, ngrdcol, lchnk, icgrauwp_grid)
call subcol_field_avg(cldfgrau, ngrdcol, lchnk, cldfsnow_grid)
call subcol_field_avg(cldfgrau, ngrdcol, lchnk, cldfgrau_grid)
end if

if (rate1_cw2pr_st_idx > 0) then
Expand Down
10 changes: 6 additions & 4 deletions src/physics/cam/physics_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1281,11 +1281,13 @@ subroutine physics_dme_adjust(state, tend, qini, liqini, iceini, dt)
! original code for backwards compatability with FV
!
if (.not.(dycore_is('MPAS') .or. dycore_is('SE'))) then
do k = 1, pver

! adjust dry mass in each layer back to input value, while conserving
! constituents, momentum, and total energy
state%ps(:ncol) = state%pint(:ncol,1)
!Initialize the surface pressure
state%ps(:ncol) = state%pint(:ncol,1)

! adjust dry mass in each layer back to input value, while conserving
! constituents, momentum, and total energy
do k = 1, pver

! adjusment factor is just change in water vapor
fdq(:ncol) = 1._r8 + state%q(:ncol,k,1) - qini(:ncol,k)
Expand Down
145 changes: 71 additions & 74 deletions src/physics/cam/physpkg.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2157,7 +2157,7 @@ subroutine tphysbc (ztodt, state, &
use constituents, only: pcnst, qmin, cnst_get_ind
use air_composition, only: thermodynamic_active_species_liq_num,thermodynamic_active_species_liq_idx
use air_composition, only: thermodynamic_active_species_ice_num,thermodynamic_active_species_ice_idx
use convect_deep, only: convect_deep_tend, convect_deep_tend_2, deep_scheme_does_scav_trans
use convect_deep, only: convect_deep_tend, convect_deep_tend_2
use time_manager, only: is_first_step, get_nstep
use convect_shallow, only: convect_shallow_tend
use check_energy, only: check_energy_timestep_init, check_energy_cam_chng
Expand Down Expand Up @@ -2946,91 +2946,88 @@ subroutine tphysbc (ztodt, state, &
snow_sed(:ncol) = snow_sed(:ncol) + snow_sed_carma(:ncol)
end if

if ( .not. deep_scheme_does_scav_trans() ) then

! -------------------------------------------------------------------------------
! 1. Wet Scavenging of Aerosols by Convective and Stratiform Precipitation.
! 2. Convective Transport of Non-Water Aerosol Species.
!
! . Aerosol wet chemistry determines scavenging fractions, and transformations
! . Then do convective transport of all trace species except qv,ql,qi.
! . We needed to do the scavenging first to determine the interstitial fraction.
! -------------------------------------------------------------------------------
! -------------------------------------------------------------------------------
! 1. Wet Scavenging of Aerosols by Convective and Stratiform Precipitation.
! 2. Convective Transport of Non-Water Aerosol Species.
!
! . Aerosol wet chemistry determines scavenging fractions, and transformations
! . Then do convective transport of all trace species except qv,ql,qi.
! . We needed to do the scavenging first to determine the interstitial fraction.
! -------------------------------------------------------------------------------

call t_startf('aerosol_wet_processes')
if (clim_modal_aero) then
! Find the modal aerosol model properties object.
do iaermod_lcl = 1, aerosol_instances_get_num_models()
aero_props => aerosol_instances_get_props(iaermod_lcl, list_idx=0)
if (associated(aero_props)) then
if (aero_props%model_is('MAM')) exit
end if
end do
!REMOVECAM - get persistent state from factory; under CAM-SIMA states will be passed as scheme inputs
aero_state_obj => aerosol_instances_get_state(iaermod_lcl, 0, state%lchnk)
!REMOVECAM_END

if (prog_modal_aero) then
call physics_ptend_init(ptend, state%psetcols, 'aero_water_uptake', lq=wetdep_lq)
! Do calculations of mode radius and water uptake if:
! 1) modal aerosols are affecting the climate, or
! 2) prognostic modal aerosols are enabled
call modal_aero_calcsize_sub(state, ptend, ztodt, pbuf, aero_props, aero_state_obj)
! for prognostic modal aerosols the transfer of mass between aitken and accumulation
! modes is done in conjunction with the dry radius calculation
call modal_aero_wateruptake_dr(state, pbuf, aero_props, aero_state_obj)
call physics_update(state, ptend, ztodt, tend)
else
call modal_aero_calcsize_diag(state, pbuf, aero_props, aero_state_obj)
call modal_aero_wateruptake_dr(state, pbuf, aero_props, aero_state_obj)
endif
call t_startf('aerosol_wet_processes')
if (clim_modal_aero) then
! Find the modal aerosol model properties object.
do iaermod_lcl = 1, aerosol_instances_get_num_models()
aero_props => aerosol_instances_get_props(iaermod_lcl, list_idx=0)
if (associated(aero_props)) then
if (aero_props%model_is('MAM')) exit
end if
end do
!REMOVECAM - get persistent state from factory; under CAM-SIMA states will be passed as scheme inputs
aero_state_obj => aerosol_instances_get_state(iaermod_lcl, 0, state%lchnk)
!REMOVECAM_END

if (prog_modal_aero) then
call physics_ptend_init(ptend, state%psetcols, 'aero_water_uptake', lq=wetdep_lq)
! Do calculations of mode radius and water uptake if:
! 1) modal aerosols are affecting the climate, or
! 2) prognostic modal aerosols are enabled
call modal_aero_calcsize_sub(state, ptend, ztodt, pbuf, aero_props, aero_state_obj)
! for prognostic modal aerosols the transfer of mass between aitken and accumulation
! modes is done in conjunction with the dry radius calculation
call modal_aero_wateruptake_dr(state, pbuf, aero_props, aero_state_obj)
call physics_update(state, ptend, ztodt, tend)
else
call modal_aero_calcsize_diag(state, pbuf, aero_props, aero_state_obj)
call modal_aero_wateruptake_dr(state, pbuf, aero_props, aero_state_obj)
endif
endif

if (trim(cam_take_snapshot_before) == "aero_model_wetdep") 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 carma_diags_obj%update(cam_in, state, pbuf)
if (trim(cam_take_snapshot_before) == "aero_model_wetdep") 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 aero_model_wetdep( state, ztodt, dlf, cam_out, ptend, pbuf)
if ( (trim(cam_take_snapshot_after) == "aero_model_wetdep") .and. &
(trim(cam_take_snapshot_before) == trim(cam_take_snapshot_after))) then
call cam_snapshot_ptend_outfld(ptend, lchnk)
end if
call carma_diags_obj%output(state, ptend, cam_in, "WETDEPA", ztodt, pbuf)
call physics_update(state, ptend, ztodt, tend)
call carma_diags_obj%update(cam_in, state, pbuf)

if (trim(cam_take_snapshot_after) == "aero_model_wetdep") 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 aero_model_wetdep( state, ztodt, dlf, cam_out, ptend, pbuf)
if ( (trim(cam_take_snapshot_after) == "aero_model_wetdep") .and. &
(trim(cam_take_snapshot_before) == trim(cam_take_snapshot_after))) then
call cam_snapshot_ptend_outfld(ptend, lchnk)
end if
call carma_diags_obj%output(state, ptend, cam_in, "WETDEPA", ztodt, pbuf)
call physics_update(state, ptend, ztodt, tend)

if (carma_do_wetdep) then
! CARMA wet deposition
!
! NOTE: It needs to follow aero_model_wetdep, so that cam_out%xxxwetxxx
! fields have already been set for CAM aerosols and cam_out can be added
! to for CARMA aerosols.
call t_startf ('carma_wetdep_tend')
call carma_diags_obj%update(cam_in, state, pbuf)
call carma_wetdep_tend(state, ptend, ztodt, pbuf, dlf, cam_out)
call carma_diags_obj%output(state, ptend, cam_in, "WETDEPC", ztodt, pbuf)
call physics_update(state, ptend, ztodt, tend)
call t_stopf ('carma_wetdep_tend')
end if
if (trim(cam_take_snapshot_after) == "aero_model_wetdep") 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 t_startf ('convect_deep_tend2')
call convect_deep_tend_2( state, ptend, ztodt, pbuf )
if (carma_do_wetdep) then
! CARMA wet deposition
!
! NOTE: It needs to follow aero_model_wetdep, so that cam_out%xxxwetxxx
! fields have already been set for CAM aerosols and cam_out can be added
! to for CARMA aerosols.
call t_startf ('carma_wetdep_tend')
call carma_diags_obj%update(cam_in, state, pbuf)
call carma_wetdep_tend(state, ptend, ztodt, pbuf, dlf, cam_out)
call carma_diags_obj%output(state, ptend, cam_in, "WETDEPC", ztodt, pbuf)
call physics_update(state, ptend, ztodt, tend)
call t_stopf ('convect_deep_tend2')
call t_stopf ('carma_wetdep_tend')
end if

! check tracer integrals
call check_tracers_chng(state, tracerint, "cmfmca", nstep, ztodt, zero_tracers)
call t_startf ('convect_deep_tend2')
call convect_deep_tend_2( state, ptend, ztodt, pbuf )
call physics_update(state, ptend, ztodt, tend)
call t_stopf ('convect_deep_tend2')

call t_stopf('aerosol_wet_processes')
! check tracer integrals
call check_tracers_chng(state, tracerint, "cmfmca", nstep, ztodt, zero_tracers)

endif
call t_stopf('aerosol_wet_processes')

!===================================================
! Moist physical parameteriztions complete:
Expand Down
Loading
Loading