-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2381 from CliMA/aj/one_moment_2
Add 1-moment microphysics
- Loading branch information
Showing
7 changed files
with
401 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
##### | ||
##### Precomputed quantities | ||
##### | ||
import CloudMicrophysics.Microphysics1M as CM1 | ||
|
||
""" | ||
set_precipitation_precomputed_quantities!(Y, p, t) | ||
Updates the precipitation terminal velocity stored in `p` | ||
for the 1-moment microphysics scheme | ||
""" | ||
function set_precipitation_precomputed_quantities!(Y, p, t) | ||
@assert (p.atmos.precip_model isa Microphysics1Moment) | ||
|
||
(; ᶜwᵣ, ᶜwₛ) = p.precomputed | ||
|
||
cmp = CAP.microphysics_params(p.params) | ||
|
||
# compute the precipitation terminal velocity [m/s] | ||
@. ᶜwᵣ = | ||
CM1.terminal_velocity(cmp.pr, cmp.tv.rain, Y.c.ρ, Y.c.ρq_rai / Y.c.ρ) | ||
@. ᶜwₛ = | ||
CM1.terminal_velocity(cmp.ps, cmp.tv.snow, Y.c.ρ, Y.c.ρq_sno / Y.c.ρ) | ||
return nothing | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.