Skip to content

Commit

Permalink
Merge pull request #568 from CliMA/aj/effective_radius
Browse files Browse the repository at this point in the history
Clip effective radius between the values from the lookup table
  • Loading branch information
trontrytel authored Feb 11, 2025
2 parents 46ab9c1 + aae4d32 commit ed0dca5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
13 changes: 9 additions & 4 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.1
------
- Clip effective radius by the look-up table range
PR [#568](https://github.com/CliMA/RRTMGP.jl/pull/568)

v0.20.0
------
- Add five size bins of dust and sea salt aerosols.
Expand Down Expand Up @@ -31,11 +36,11 @@ updated. PR [#550](https://github.com/CliMA/RRTMGP.jl/pull/550).
#### Fix aerosol lookup table

Starting with this release, RRTGMP.jl will use an aerosol look up table that is internally stored, as opposed
to downloading it from the `rrtgmp-data` repository. The reason for this change is that the data distributed
with `rrtgmp-data` contains an an error in the array ordering for the aerosol optics lookup table for sea-salt (‘aero_salt_tbl’).
This error was fixed in the internal table. `RRTGMP.jl` will revert to using `rrtgmp-data`
to downloading it from the `rrtgmp-data` repository. The reason for this change is that the data distributed
with `rrtgmp-data` contains an an error in the array ordering for the aerosol optics lookup table for sea-salt (‘aero_salt_tbl’).
This error was fixed in the internal table. `RRTGMP.jl` will revert to using `rrtgmp-data`
once the repository updates their tables. PR [#548](https://github.com/CliMA/RRTMGP.jl/pull/548/).
This new lookup table fixes an error in the array ordering for the aerosol optics
This new lookup table fixes an error in the array ordering for the aerosol optics
lookup table for the shortwave sea-salt data (‘aero_salt_tbl’).
PR [#548](https://github.com/CliMA/RRTMGP.jl/pull/548/).

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.20.0"
version = "0.20.1"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
4 changes: 3 additions & 1 deletion src/optics/cloud_optics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ This function computes the `TwoStream` cloud liquid properties using the `LookUp
# cloud liquid particles
if cld_path_liq > eps(FT)
Δr_liq = (radliq_upr - radliq_lwr) / FT(nsize_liq - 1)
re_liq = max(min(re_liq, radliq_upr), radliq_lwr)
loc = Int(max(min(unsafe_trunc(Int, (re_liq - radliq_lwr) / Δr_liq) + 1, nsize_liq - 1), 1))
fac = (re_liq - radliq_lwr - (loc - 1) * Δr_liq) / Δr_liq
fc1 = FT(1) - fac
Expand Down Expand Up @@ -198,6 +199,7 @@ This function computes the `TwoStream` cloud ice properties using the `LookUpTab
# cloud ice particles
if cld_path_ice > eps(FT)
Δr_ice = (radice_upr - radice_lwr) / FT(nsize_ice - 1)
re_ice = max(min(re_ice, radice_upr), radice_lwr)
loc = Int(max(min(unsafe_trunc(Int, (re_ice - radice_lwr) / Δr_ice) + 1, nsize_ice - 1), 1))
fac = (re_ice - radice_lwr - (loc - 1) * Δr_ice) / Δr_ice
fc1 = FT(1) - fac
Expand Down Expand Up @@ -229,7 +231,7 @@ function build_cloud_mask!(
finish = _get_finish(cld_frac) # last cloudy layer
# set cloud mask for non-cloudy layers
_mask_outer_non_cloudy_layers!(cld_mask, start, finish)
# RRTMG uses random_arr[finish] > (FT(1) - cld_frac[finish]),
# RRTMG uses random_arr[finish] > (FT(1) - cld_frac[finish]),
# we change > to >= to address edge cases
@inbounds cld_frac_ilayplus1 = cld_frac[finish]
random_ilayplus1 = Random.rand()
Expand Down

2 comments on commit ed0dca5

@trontrytel
Copy link
Member Author

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/124849

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.1 -m "<description of version>" ed0dca55583c40f9cc4cd47c8296cee7eec12899
git push origin v0.20.1

Please sign in to comment.