-
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.
- Loading branch information
1 parent
7eb481f
commit 4425bf4
Showing
8 changed files
with
80 additions
and
9 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
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,38 @@ | ||
##### | ||
##### Precomputed quantities | ||
##### | ||
import CloudMicrophysics.MicrophysicsNonEq as CMNe | ||
|
||
# TODO - duplicated with precip, should be moved to some common helper module | ||
# helper function to safely get precipitation from state | ||
function q_cc(ρq::FT, ρ::FT) where {FT} | ||
return max(FT(0), ρq / ρ) | ||
end | ||
|
||
""" | ||
set_sedimentation_precomputed_quantities!(Y, p, t) | ||
Updates the sedimentation terminal velocity stored in `p` | ||
for the non-equilibrium microphysics scheme | ||
""" | ||
function set_sedimentation_precomputed_quantities!(Y, p, t) | ||
@assert (p.atmos.moisture_model isa NonEquilMoistModel) | ||
|
||
(; ᶜwₗ, ᶜwᵢ) = p.precomputed | ||
cmc = CAP.microphysics_cloud_params(p.params) | ||
|
||
# compute the precipitation terminal velocity [m/s] | ||
@. ᶜwₗ = CMNe.terminal_velocity( | ||
cmc.liquid, | ||
cmc.Ch2022.rain, | ||
Y.c.ρ, | ||
q_cc(Y.c.ρq_liq, Y.c.ρ), | ||
) | ||
@. ᶜwᵢ = CMNe.terminal_velocity( | ||
cmc.ice, | ||
cmc.Ch2022.small_ice, | ||
Y.c.ρ, | ||
q_cc(Y.c.ρq_ice, 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
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