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
21 changes: 10 additions & 11 deletions src/chemistry/aerosol/aerosol_properties_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
15 changes: 11 additions & 4 deletions src/chemistry/aerosol/bulk_aerosol_properties_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
16 changes: 16 additions & 0 deletions src/chemistry/aerosol/carma_aerosol_properties_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
18 changes: 18 additions & 0 deletions src/chemistry/aerosol/modal_aerosol_properties_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions src/physics/cam/aerosol_optics_cam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down