Skip to content

Commit

Permalink
Merge pull request #564 from CliMA/zs/ck/aerosol
Browse files Browse the repository at this point in the history
add different sizes for dust and sea salt
  • Loading branch information
szy21 authored Feb 5, 2025
2 parents 771733c + de3063a commit 9dd6755
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 14 deletions.
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

4 comments on commit 9dd6755

@szy21
Copy link
Member Author

@szy21 szy21 commented on 9dd6755 Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/124405

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.20.0 -m "<description of version>" 9dd6755b45b55fa4924daa792d113b0cf8640202
git push origin v0.20.0

@szy21
Copy link
Member Author

@szy21 szy21 commented on 9dd6755 Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

Breaking changes

  • Users now need to specify dust and sea salt aerosols for five different size bins.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/124405

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.20.0 -m "<description of version>" 9dd6755b45b55fa4924daa792d113b0cf8640202
git push origin v0.20.0

Please sign in to comment.