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
23 changes: 12 additions & 11 deletions schemes/chemistry/prescribed_aerosols.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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, &
Expand All @@ -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]
Expand Down Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions schemes/chemistry/prescribed_aerosols.meta
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 4 additions & 11 deletions schemes/chemistry/prescribed_ozone.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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]
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 0 additions & 6 deletions schemes/chemistry/prescribed_ozone.meta
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions schemes/sima_diagnostics/sima_state_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading