From d9380e064c13064b0e3241b7fbe2169950b818e2 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Sat, 18 Jul 2026 11:19:03 -0400 Subject: [PATCH 1/3] Pop stash{0} --- schemes/sima_diagnostics/sima_state_diagnostics.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schemes/sima_diagnostics/sima_state_diagnostics.F90 b/schemes/sima_diagnostics/sima_state_diagnostics.F90 index 40cdf3872..cc022aada 100644 --- a/schemes/sima_diagnostics/sima_state_diagnostics.F90 +++ b/schemes/sima_diagnostics/sima_state_diagnostics.F90 @@ -227,11 +227,11 @@ subroutine sima_state_diagnostics_run(ps, psdry, phis, T, u, v, dse, omega, & ! Capture all other constituent fields do const_idx = 1, size(const_props) if (.not. const_found(const_idx)) then - call const_props(const_idx)%standard_name(standard_name, errflg, errmsg) + ! Must match the name registered in sima_state_diagnostics_init. + call const_props(const_idx)%diagnostic_name(diagnostic_name, errflg, errmsg) if (errflg /= 0) then return end if - diagnostic_name = standard_name call history_out_field(trim(diagnostic_name), const_array(:,:,const_idx)) end if end do From 32d1dd04725fdf9409ef86d936f59e6fbe5f11f9 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Sat, 18 Jul 2026 11:30:15 -0400 Subject: [PATCH 2/3] Use ccpp_scheme_utils for chemistry prescribed modules. --- schemes/chemistry/prescribed_aerosols.F90 | 23 +++++++++++----------- schemes/chemistry/prescribed_aerosols.meta | 6 ------ schemes/chemistry/prescribed_ozone.F90 | 15 ++++---------- schemes/chemistry/prescribed_ozone.meta | 6 ------ 4 files changed, 16 insertions(+), 34 deletions(-) diff --git a/schemes/chemistry/prescribed_aerosols.F90 b/schemes/chemistry/prescribed_aerosols.F90 index ccb72c8cc..f88681311 100644 --- a/schemes/chemistry/prescribed_aerosols.F90 +++ b/schemes/chemistry/prescribed_aerosols.F90 @@ -457,7 +457,6 @@ end subroutine prescribed_aerosols_init !! \htmlinclude prescribed_aerosols_run.html subroutine prescribed_aerosols_run( & ncol, pver, pcnst, & - const_props, & pi, & pmid, pint, phis, zi, & ! necessary fields for trcdata read. constituents, & @@ -469,17 +468,12 @@ subroutine prescribed_aerosols_run( & ! host model dependency for history output use cam_history, only: history_out_field - ! framework dependency for const_props - use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t - - ! dependency to get constituent index - use ccpp_const_utils, only: ccpp_const_get_idx + ! framework dependency to get constituent index + use ccpp_scheme_utils, only: ccpp_constituent_index integer, intent(in) :: ncol integer, intent(in) :: pver integer, intent(in) :: pcnst ! # of CCPP constituents [count] - type(ccpp_constituent_prop_ptr_t), & - intent(in) :: const_props(:) ! CCPP constituent properties pointer real(kind_phys), intent(in) :: pi real(kind_phys), intent(in) :: pmid(:,:) ! air pressure [Pa] real(kind_phys), intent(in) :: pint(:,:) ! air pressure at interfaces [Pa] @@ -513,11 +507,18 @@ subroutine prescribed_aerosols_run( & ! the logv and logm values read from tracer_data (port of rand_sample_prescribed_aero) do i = 1, aero_count ! Get constituent index - call ccpp_const_get_idx(const_props, & - trim(aero_map_list(i)%constituent_name), & - const_idx, errmsg, errflg) + call ccpp_constituent_index(trim(aero_map_list(i)%constituent_name), & + const_idx, errmsg=errmsg, errcode=errflg) if (errflg /= 0) return + ! Guard against an unresolved constituent index, which would otherwise be + ! used as a negative array subscript below. + if (const_idx < 0) then + errflg = 1 + errmsg = subname // ': could not find constituent ' // trim(aero_map_list(i)%constituent_name) + return + end if + if (.not. aero_map_list(i)%is_modal_aero_interstitial) then ! For non-interstitial species (cloud-borne or bulk aerosols), ! directly copy field data from tracer_data container diff --git a/schemes/chemistry/prescribed_aerosols.meta b/schemes/chemistry/prescribed_aerosols.meta index 6e4ba68d2..6d240b360 100644 --- a/schemes/chemistry/prescribed_aerosols.meta +++ b/schemes/chemistry/prescribed_aerosols.meta @@ -190,12 +190,6 @@ type = integer dimensions = () intent = in -[ const_props ] - standard_name = ccpp_constituent_properties - units = none - type = ccpp_constituent_prop_ptr_t - dimensions = (number_of_ccpp_constituents) - intent = in [ pi ] standard_name = pi_constant units = 1 diff --git a/schemes/chemistry/prescribed_ozone.F90 b/schemes/chemistry/prescribed_ozone.F90 index ff0dd0e97..1180541d3 100644 --- a/schemes/chemistry/prescribed_ozone.F90 +++ b/schemes/chemistry/prescribed_ozone.F90 @@ -153,7 +153,6 @@ end subroutine prescribed_ozone_init !! \htmlinclude prescribed_ozone_run.html subroutine prescribed_ozone_run( & ncol, pver, & - const_props, & mwdry, boltz, & t, pmiddry, & pmid, pint, phis, zi, & ! necessary fields for trcdata read. @@ -166,16 +165,11 @@ subroutine prescribed_ozone_run( & ! host model dependency for history output use cam_history, only: history_out_field - ! framework dependency for const_props - use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t - - ! dependency to get constituent index - use ccpp_const_utils, only: ccpp_const_get_idx + ! framework dependency to get constituent index + use ccpp_scheme_utils, only: ccpp_constituent_index integer, intent(in) :: ncol integer, intent(in) :: pver - type(ccpp_constituent_prop_ptr_t), & - intent(in) :: const_props(:) ! CCPP constituent properties pointer real(kind_phys), intent(in) :: mwdry ! molecular_weight_of_dry_air [g mol-1] real(kind_phys), intent(in) :: boltz ! boltzmann_constant [J K-1] real(kind_phys), intent(in) :: t(:,:) ! air temperature [K] @@ -210,9 +204,8 @@ subroutine prescribed_ozone_run( & ! check for 'O3' constituent where prescribed ozone will be written to ! which will be read by radiation. - call ccpp_const_get_idx(const_props, & - trim(ozone_name), & - id_o3, errmsg, errflg) + call ccpp_constituent_index(trim(ozone_name), & + id_o3, errmsg=errmsg, errcode=errflg) if (errflg /= 0) return ! could not find the constituent, but the specifier is active. diff --git a/schemes/chemistry/prescribed_ozone.meta b/schemes/chemistry/prescribed_ozone.meta index 3e0b9d849..6247bc598 100644 --- a/schemes/chemistry/prescribed_ozone.meta +++ b/schemes/chemistry/prescribed_ozone.meta @@ -136,12 +136,6 @@ type = integer dimensions = () intent = in -[ const_props ] - standard_name = ccpp_constituent_properties - units = none - type = ccpp_constituent_prop_ptr_t - dimensions = (number_of_ccpp_constituents) - intent = in [ mwdry ] standard_name = molecular_weight_of_dry_air units = g mol-1 From 2df18e8b0d9a5935f78a26b6c465d7292c7710ac Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Mon, 20 Jul 2026 11:38:56 -0400 Subject: [PATCH 3/3] Update schemes/chemistry/prescribed_aerosols.F90 Co-authored-by: Jesse Nusbaumer --- schemes/chemistry/prescribed_aerosols.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemes/chemistry/prescribed_aerosols.F90 b/schemes/chemistry/prescribed_aerosols.F90 index f88681311..1206df9a8 100644 --- a/schemes/chemistry/prescribed_aerosols.F90 +++ b/schemes/chemistry/prescribed_aerosols.F90 @@ -515,7 +515,7 @@ subroutine prescribed_aerosols_run( & ! used as a negative array subscript below. if (const_idx < 0) then errflg = 1 - errmsg = subname // ': could not find constituent ' // trim(aero_map_list(i)%constituent_name) + errmsg = subname // ': could not find constituent "' // trim(aero_map_list(i)%constituent_name)//'"' return end if