Skip to content

Commit

Permalink
add different sizes for dust and sea salt
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Feb 4, 2025
1 parent 771733c commit cde4213
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
11 changes: 8 additions & 3 deletions src/optics/LookUpTables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -876,17 +876,22 @@ function LookUpAerosolMerra(ds, ::Type{FT}, ::Type{DA}) where {FT <: AbstractFlo
bnd_lims_wn = DA{FT}(Array(ds["bnd_limits_wavenumber"]))
# map aerosol name to aerosol idx
idx_aerosol = Dict(
"dust" => 1,
"sea_salt" => 2,
"dust1" => 1,
"sea_salt1" => 2,
"sulfate" => 3,
"black_carbon_rh" => 4,
"black_carbon" => 5,
"organic_carbon_rh" => 6,
"organic_carbon" => 7,
map(i -> Pair("dust$i", i + 6), 2:5)...,
map(i -> Pair("sea_salt$i", i + 10), 2:5)...,
)
# map aerosol idx to its aeromass idx
# please note that only "dust" and "sea salt" need aerosol sizes
idx_aerosize = Dict(1 => 1, 2 => 2)
idx_aerosol_keys = filter(collect(keys(idx_aerosol))) do k
occursin("dust", k) || occursin("sea_salt", k)
end
idx_aerosize = Dict(map(k -> Pair(idx_aerosol[k], idx_aerosol[k]), idx_aerosol_keys))
return LookUpAerosolMerra(
dims,
size_bin_limits,
Expand Down
31 changes: 21 additions & 10 deletions src/optics/aerosol_optics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,29 @@ band number (`ibnd`), aerosol mass (`aeromass`), aerosol size (`aerosize`), and
function compute_lookup_aerosol(lkp_aero, ibnd::Int, aero_mass, aero_size, rh::FT, glay) where {FT}
τ_cum, τ_ssa_cum, τ_ssag_cum = FT(0), FT(0), FT(0)

if aero_mass[1, glay] > FT(0)
τ, τ_ssa, τ_ssag = compute_lookup_dust_props(lkp_aero, ibnd, aero_mass[1, glay], aero_size[1, glay])
τ_cum += τ
τ_ssa_cum += τ_ssa
τ_ssag_cum += τ_ssag
for i_aero_size in (1, 8, 9, 10, 11)
if aero_mass[i_aero_size, glay] > FT(0)
τ, τ_ssa, τ_ssag =
compute_lookup_dust_props(lkp_aero, ibnd, aero_mass[i_aero_size, glay], aero_size[i_aero_size, glay])
τ_cum += τ
τ_ssa_cum += τ_ssa
τ_ssag_cum += τ_ssag
end
end

if aero_mass[2, glay] > FT(0)
τ, τ_ssa, τ_ssag = compute_lookup_sea_salt_props(lkp_aero, ibnd, aero_mass[2, glay], aero_size[2, glay], rh)
τ_cum += τ
τ_ssa_cum += τ_ssa
τ_ssag_cum += τ_ssag
for i_aero_size in (2, 12, 13, 14, 15)
if aero_mass[i_aero_size, glay] > FT(0)
τ, τ_ssa, τ_ssag = compute_lookup_sea_salt_props(
lkp_aero,
ibnd,
aero_mass[i_aero_size, glay],
aero_size[i_aero_size, glay],
rh,
)
τ_cum += τ
τ_ssa_cum += τ_ssa
τ_ssag_cum += τ_ssag
end
end

if aero_mass[3, glay] > FT(0)
Expand Down

0 comments on commit cde4213

Please sign in to comment.