diff --git a/src/chemistry/aerosol/aerosol_properties_mod.F90 b/src/chemistry/aerosol/aerosol_properties_mod.F90 index 127a8758dc..b2bc986fba 100644 --- a/src/chemistry/aerosol/aerosol_properties_mod.F90 +++ b/src/chemistry/aerosol/aerosol_properties_mod.F90 @@ -74,7 +74,7 @@ module aerosol_properties_mod procedure(aero_resuspension_resize), deferred :: resuspension_resize procedure(aero_rebin_bulk_fluxes), deferred :: rebin_bulk_fluxes procedure(aero_hydrophilic), deferred :: hydrophilic - procedure :: is_bulk + procedure(aero_id_query), deferred :: model_is procedure :: final=>aero_props_final end type aerosol_properties @@ -457,6 +457,15 @@ logical function aero_hydrophilic(self, bin_ndx) integer, intent(in) :: bin_ndx ! bin number end function aero_hydrophilic + !------------------------------------------------------------------------------ + ! Returns TRUE if the aerosol model matches the query, otherwise FALSE + !------------------------------------------------------------------------------ + logical function aero_id_query(self, query) + import :: aerosol_properties + class(aerosol_properties), intent(in) :: self + character(len=*), intent(in) :: query + end function aero_id_query + end interface contains @@ -733,14 +742,4 @@ pure real(r8) function pom_equivso4_factor(self) end function pom_equivso4_factor - !------------------------------------------------------------------------------ - ! returns TRUE if bulk aerosol representation - !------------------------------------------------------------------------------ - pure logical function is_bulk(self) - class(aerosol_properties), intent(in) :: self - - is_bulk = .false. - - end function is_bulk - end module aerosol_properties_mod diff --git a/src/chemistry/aerosol/bulk_aerosol_properties_mod.F90 b/src/chemistry/aerosol/bulk_aerosol_properties_mod.F90 index c5f6304b20..3033851289 100644 --- a/src/chemistry/aerosol/bulk_aerosol_properties_mod.F90 +++ b/src/chemistry/aerosol/bulk_aerosol_properties_mod.F90 @@ -48,7 +48,7 @@ module bulk_aerosol_properties_mod procedure :: resuspension_resize procedure :: rebin_bulk_fluxes procedure :: hydrophilic - procedure :: is_bulk + procedure :: model_is final :: destructor @@ -712,11 +712,18 @@ end function hydrophilic !------------------------------------------------------------------------------ ! returns TRUE if bulk aerosol representation !------------------------------------------------------------------------------ - pure logical function is_bulk(self) + pure logical function model_is(self, query) class(bulk_aerosol_properties), intent(in) :: self + character(len=*), intent(in) :: query - is_bulk = .true. + if (trim(query) == 'BAM' .or. trim(query) == 'bam') then + model_is = .true. + else if (trim(query) == 'bulk_model') then + model_is = .true. + else + model_is = .false. + end if - end function is_bulk + end function model_is end module bulk_aerosol_properties_mod diff --git a/src/chemistry/aerosol/carma_aerosol_properties_mod.F90 b/src/chemistry/aerosol/carma_aerosol_properties_mod.F90 index 1f0c4d9287..e00c807257 100644 --- a/src/chemistry/aerosol/carma_aerosol_properties_mod.F90 +++ b/src/chemistry/aerosol/carma_aerosol_properties_mod.F90 @@ -40,6 +40,7 @@ module carma_aerosol_properties_mod procedure :: resuspension_resize procedure :: rebin_bulk_fluxes procedure :: hydrophilic + procedure :: model_is final :: destructor end type carma_aerosol_properties @@ -944,4 +945,19 @@ logical function hydrophilic(self, bin_ndx) end function hydrophilic + !------------------------------------------------------------------------------ + ! returns TRUE if CARMA aerosol representation + !------------------------------------------------------------------------------ + pure logical function model_is(self, query) + class(carma_aerosol_properties), intent(in) :: self + character(len=*), intent(in) :: query + + if (trim(query) == 'CARMA' .or. trim(query) == 'carma') then + model_is = .true. + else + model_is = .false. + end if + + end function model_is + end module carma_aerosol_properties_mod diff --git a/src/chemistry/aerosol/modal_aerosol_properties_mod.F90 b/src/chemistry/aerosol/modal_aerosol_properties_mod.F90 index 5a92b8df5a..e255be91da 100644 --- a/src/chemistry/aerosol/modal_aerosol_properties_mod.F90 +++ b/src/chemistry/aerosol/modal_aerosol_properties_mod.F90 @@ -52,6 +52,7 @@ module modal_aerosol_properties_mod procedure :: resuspension_resize procedure :: rebin_bulk_fluxes procedure :: hydrophilic + procedure :: model_is final :: destructor end type modal_aerosol_properties @@ -1108,4 +1109,21 @@ logical function hydrophilic(self, bin_ndx) end function hydrophilic + !------------------------------------------------------------------------------ + ! returns TRUE if modal aerosol representation + !------------------------------------------------------------------------------ + pure logical function model_is(self, query) + class(modal_aerosol_properties), intent(in) :: self + character(len=*), intent(in) :: query + + if (trim(query) == 'MAM' .or. trim(query) == 'mam') then + model_is = .true. + else if (trim(query) == 'modal') then + model_is = .true. + else + model_is = .false. + end if + + end function model_is + end module modal_aerosol_properties_mod diff --git a/src/physics/cam/aerosol_optics_cam.F90 b/src/physics/cam/aerosol_optics_cam.F90 index 1c5b7b201f..b701b908de 100644 --- a/src/physics/cam/aerosol_optics_cam.F90 +++ b/src/physics/cam/aerosol_optics_cam.F90 @@ -874,13 +874,13 @@ subroutine aerosol_optics_cam_sw(list_idx, state, pbuf, nnite, idxnite, tauxar, ga(icol,ilev,iwav) = ga(icol,ilev,iwav) + dopaer(icol)*palb(icol)*pasm(icol) fa(icol,ilev,iwav) = fa(icol,ilev,iwav) + dopaer(icol)*palb(icol)*pasm(icol)*pasm(icol) - if (.not.aeroprops%is_bulk()) then + if (.not.aeroprops%model_is('BAM')) then call update_diags() end if end do column - if (aeroprops%is_bulk().and.iwav==idx_sw_diag) then + if (aeroprops%model_is('BAM').and.iwav==idx_sw_diag) then taubam(:ncol,ilev) = dopaer(:ncol) end if @@ -895,7 +895,7 @@ subroutine aerosol_optics_cam_sw(list_idx, state, pbuf, nnite, idxnite, tauxar, deallocate(aero_optics) nullify(aero_optics) - if (aeroprops%is_bulk()) then + if (aeroprops%model_is('BAM')) then bam_cnt = bam_cnt+1 call aer_vis_diag_out(lchnk, ncol, nnite, idxnite, bam_cnt, taubam, & list_idx, troplev)