Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add different sizes for dust and sea salt #564

Merged
merged 1 commit into from
Feb 5, 2025
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
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ RRTMGP.jl Release Notes
main
------

v0.20.0
------
- Add five size bins of dust and sea salt aerosols.
PR [#564](https://github.com/CliMA/RRTMGP.jl/pull/564)

v0.19.2
-----
- Update cloud optics to the latest version of rrtmgp-data.
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RRTMGP"
uuid = "a01a1ee8-cea4-48fc-987c-fc7878d79da1"
authors = ["Climate Modeling Alliance"]
version = "0.19.2"
version = "0.20.0"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
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
Loading