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

changes after updating 2-moment distribution parameters #394

Merged
merged 1 commit into from
May 10, 2024

Conversation

crocicc
Copy link
Contributor

@crocicc crocicc commented May 9, 2024

Purpose

To-do

Content


  • I have read and checked the items on the review checklist.

@crocicc crocicc added documentation Improvements or additions to documentation tests parameters 🧱 needs review labels May 9, 2024
@crocicc crocicc requested a review from trontrytel May 9, 2024 20:58
@crocicc crocicc closed this May 9, 2024
@crocicc crocicc reopened this May 9, 2024
@@ -116,7 +116,7 @@ The default free parameter values are:
|``\nu`` | ``2`` |
|``A`` | ``400`` |
|``a`` | ``0.7`` |
|``c`` | ``3`` |
|``b`` | ``3`` |
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need to define c that is used in autoconversion? (line 106?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was an error in the documentation. Following the SB2006 paper and ClimaParams, c=4 is the accretion parameter, while in the autoconversion formula we have two parameters a and b, which are equal to 0.7 and 3. In the formula in line 106, b and c must be replaced with a and b respectively. I just change it in the last commit.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you!

- `q_rai` - rain water specific humidity
- `N_liq` - cloud droplet number density
- `N_rai` - rain droplet number density
- `N_liq` - cloud droplet number density
Copy link
Member

Choose a reason for hiding this comment

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

Looks like during rebasing we accepted both lines. We only need one N_liq etc :)

- `q_rai` - rain water specific humidity
- `N_liq` - cloud droplet number density
- `N_rai` - rain droplet number density
- `N_liq` - cloud droplet number density
Copy link
Member

Choose a reason for hiding this comment

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

Same here, the arguments are repeated

Br =
(xr == 0) ? FT(0) :
((SF.gamma(FT(νr + 1) / μr) * xr / SF.gamma(FT(νr + 2) / μr))^(-μr))
Ac = (N_liq * Bc^(FT(νc + 1))) / SF.gamma(FT(νc + 1))
Ac = (μc * N_liq * Bc^(FT(νc + 1) / μc)) / SF.gamma(FT(νc + 1) / μc)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Ac = (μc * N_liq * Bc^(FT(νc + 1) / μc)) / SF.gamma(FT(νc + 1) / μc)
Ac = μc * N_liq * Bc^(FT(νc + 1) / μc) / SF.gamma(FT(νc + 1) / μc)

xc = (N_liq < τ_N) ? FT(0) : ((q_liq * ρ_air) / N_liq)
xr = (N_rai < τ_N) ? FT(0) : ((q_rai * ρ_air) / N_rai)
C = FT((4 / 3) * π * ρ_w)

Bc =
(xc == 0) ? FT(0) :
(SF.gamma(FT(νc + 1)) * xc / SF.gamma(FT(νc + 2)))^(-1)
((SF.gamma(FT(νc + 1) / μc) * xc / SF.gamma(FT(νc + 2) / μc))^(-μc))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
((SF.gamma(FT(νc + 1) / μc) * xc / SF.gamma(FT(νc + 2) / μc))^(-μc))
(SF.gamma(FT(νc + 1) / μc) * xc / SF.gamma(FT(νc + 2) / μc))^(-μc)

- `q_liq` - cloud water specific humidity
- `q_rai` - rain water specific humidity
- `N_liq` - cloud droplet number density
- `N_rai` - rain droplet number density
- `N_liq` - cloud droplet number density
Copy link
Member

Choose a reason for hiding this comment

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

same here

$(DocStringExtensions.FIELDS)
"""
Base.@kwdef struct CloudParticlePDF_SB2006{FT} <: ParametersType{FT}
"Raindrop size distribution coefficient νc"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Raindrop size distribution coefficient νc"
"Cloud droplet size distribution coefficient νc"

Base.@kwdef struct CloudParticlePDF_SB2006{FT} <: ParametersType{FT}
"Raindrop size distribution coefficient νc"
νc::FT
"Raindrop size distribution coefficient μc"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Raindrop size distribution coefficient μc"
"Cloud droplet size distribution coefficient μc"

xc = (N_liq < τ_N) ? FT(0) : ((q_liq * ρ_air) / N_liq)
xr = (N_rai < τ_N) ? FT(0) : ((q_rai * ρ_air) / N_rai)
C = FT(4 / 3 * π * ρ_w)
Z₀ = FT(1e-18)

Bc =
(xc == 0) ? FT(0) :
(SF.gamma(FT(νc + 1)) * xc / SF.gamma(FT(νc + 2)))^FT(-1)
((SF.gamma(FT(νc + 1) / μc) * xc / SF.gamma(FT(νc + 2) / μc))^(-μc))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
((SF.gamma(FT(νc + 1) / μc) * xc / SF.gamma(FT(νc + 2) / μc))^(-μc))
(SF.gamma(FT(νc + 1) / μc) * xc / SF.gamma(FT(νc + 2) / μc))^(-μc)

Copy link

codecov bot commented May 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.99%. Comparing base (64f64b4) to head (58d5728).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #394      +/-   ##
==========================================
+ Coverage   94.87%   96.99%   +2.11%     
==========================================
  Files          36       35       -1     
  Lines        1386     1363      -23     
==========================================
+ Hits         1315     1322       +7     
+ Misses         71       41      -30     
Components Coverage Δ
src 98.89% <100.00%> (+<0.01%) ⬆️
ext 71.27% <ø> (+17.24%) ⬆️

@crocicc crocicc merged commit c156fb3 into main May 10, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation parameters 🧱 tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants