Skip to content

Commit 479fc6d

Browse files
committed
updating CM version
1 parent 3443adb commit 479fc6d

File tree

5 files changed

+77
-23
lines changed

5 files changed

+77
-23
lines changed

.buildkite/Manifest-v1.11.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,9 @@ version = "0.2.15"
410410

411411
[[deps.ClimaParams]]
412412
deps = ["TOML"]
413-
git-tree-sha1 = "f82183583b42d08bccad3f1f466e014b04189a2d"
413+
git-tree-sha1 = "46397777b5eb84842e90ece991603d4372eddc53"
414414
uuid = "5c42b081-d73a-476f-9059-fd94b934656c"
415-
version = "0.10.31"
415+
version = "0.10.32"
416416

417417
[[deps.ClimaReproducibilityTests]]
418418
deps = ["OrderedCollections", "PrettyTables"]
@@ -451,10 +451,10 @@ uuid = "fb6a15b2-703c-40df-9091-08a04967cfa9"
451451
version = "0.1.13"
452452

453453
[[deps.CloudMicrophysics]]
454-
deps = ["ClimaParams", "DocStringExtensions", "ForwardDiff", "HCubature", "LazyArtifacts", "LogExpFunctions", "QuadGK", "RootSolvers", "SpecialFunctions", "Thermodynamics"]
455-
git-tree-sha1 = "a1570cd66f2d389ac02b2451ce2082a4a8e8c0fe"
454+
deps = ["ClimaParams", "DocStringExtensions", "ForwardDiff", "LazyArtifacts", "LogExpFunctions", "QuadGK", "RootSolvers", "SpecialFunctions", "Thermodynamics"]
455+
git-tree-sha1 = "55810bafe2bc9e0fb9e2a5301ad5009939046690"
456456
uuid = "6a9e3e04-43cd-43ba-94b9-e8782df3c71b"
457-
version = "0.23.0"
457+
version = "0.24.1"
458458

459459
[deps.CloudMicrophysics.extensions]
460460
EmulatorModelsExt = ["DataFrames", "MLJ"]

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ClimaDiagnostics = "0.2.12"
4747
ClimaParams = "0.10.31"
4848
ClimaTimeSteppers = "0.8.2"
4949
ClimaUtilities = "0.1.22"
50-
CloudMicrophysics = "0.23.0"
50+
CloudMicrophysics = "0.24.0"
5151
Dates = "1"
5252
ForwardDiff = ">= 0.10"
5353
Insolation = "0.9.2"

src/cache/prognostic_edmf_precomputed_quantities.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,12 +655,14 @@ NVTX.@annotate function set_prognostic_edmf_precomputed_quantities_precipitation
655655
thp,
656656
ᶜtsʲs.:($$j),
657657
Y.c.sgsʲs.:($$j).q_rai,
658+
Y.c.sgsʲs.:($$j).q_sno,
658659
dt,
659660
)
660661
@. ᶜSqᵢᵖʲs.:($$j) += cloud_sources(
661662
cmc.ice,
662663
thp,
663664
ᶜtsʲs.:($$j),
665+
Y.c.sgsʲs.:($$j).q_rai,
664666
Y.c.sgsʲs.:($$j).q_sno,
665667
dt,
666668
)
@@ -701,7 +703,7 @@ NVTX.@annotate function set_prognostic_edmf_precomputed_quantities_precipitation
701703
thp,
702704
)
703705
# Cloud formation from the environment
704-
@. ᶜSqₗᵖ⁰ += cloud_sources(cmc.liquid, thp, ᶜts⁰, ᶜq_rai⁰, dt)
705-
@. ᶜSqᵢᵖ⁰ += cloud_sources(cmc.ice, thp, ᶜts⁰, ᶜq_sno⁰, dt)
706+
@. ᶜSqₗᵖ⁰ += cloud_sources(cmc.liquid, thp, ᶜts⁰, ᶜq_rai⁰, ᶜq_sno⁰, dt)
707+
@. ᶜSqᵢᵖ⁰ += cloud_sources(cmc.ice, thp, ᶜts⁰, ᶜq_rai⁰, ᶜq_sno⁰, dt)
706708
return nothing
707709
end

src/parameterized_tendencies/microphysics/cloud_condensate.jl

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,23 @@ function cloud_condensate_tendency!(
3434
cmc = CAP.microphysics_cloud_params(params)
3535

3636
@. Yₜ.c.ρq_liq +=
37-
Y.c.ρ *
38-
cloud_sources(cmc.liquid, thp, ᶜts, specific(Y.c.ρq_rai, Y.c.ρ), dt)
37+
Y.c.ρ * cloud_sources(
38+
cmc.liquid,
39+
thp,
40+
ᶜts,
41+
specific(Y.c.ρq_rai, Y.c.ρ),
42+
specific(Y.c.ρq_sno, Y.c.ρ),
43+
dt,
44+
)
3945
@. Yₜ.c.ρq_ice +=
40-
Y.c.ρ *
41-
cloud_sources(cmc.ice, thp, ᶜts, specific(Y.c.ρq_sno, Y.c.ρ), dt)
46+
Y.c.ρ * cloud_sources(
47+
cmc.ice,
48+
thp,
49+
ᶜts,
50+
specific(Y.c.ρq_rai, Y.c.ρ),
51+
specific(Y.c.ρq_sno, Y.c.ρ),
52+
dt,
53+
)
4254
end
4355

4456
function cloud_condensate_tendency!(
@@ -55,18 +67,31 @@ function cloud_condensate_tendency!(
5567
cmc = CAP.microphysics_cloud_params(params)
5668

5769
@. Yₜ.c.ρq_liq +=
58-
Y.c.ρ *
59-
cloud_sources(cmc.liquid, thp, ᶜts, specific(Y.c.ρq_rai, Y.c.ρ), dt)
70+
Y.c.ρ * cloud_sources(
71+
cmc.liquid,
72+
thp,
73+
ᶜts,
74+
specific(Y.c.ρq_rai, Y.c.ρ),
75+
specific(Y.c.ρq_sno, Y.c.ρ),
76+
dt,
77+
)
6078
@. Yₜ.c.ρq_ice +=
61-
Y.c.ρ *
62-
cloud_sources(cmc.ice, thp, ᶜts, specific(Y.c.ρq_sno, Y.c.ρ), dt)
79+
Y.c.ρ * cloud_sources(
80+
cmc.ice,
81+
thp,
82+
ᶜts,
83+
specific(Y.c.ρq_rai, Y.c.ρ),
84+
specific(Y.c.ρq_sno, Y.c.ρ),
85+
dt,
86+
)
6387

6488
@. Yₜ.c.ρn_liq +=
6589
Y.c.ρ * aerosol_activation_sources(
6690
cmc.liquid,
6791
thp,
6892
ᶜts,
6993
specific(Y.c.ρq_rai, Y.c.ρ),
94+
specific(Y.c.ρq_sno, Y.c.ρ),
7095
specific(Y.c.ρn_liq, Y.c.ρ),
7196
cmc.N_cloud_liquid_droplets,
7297
dt,

src/parameterized_tendencies/microphysics/microphysics_wrappers.jl

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ end
6969
- cm_params - CloudMicrophysics parameters struct for cloud water or ice condensate
7070
- thp - Thermodynamics parameters struct
7171
- ts - thermodynamics state
72-
- qᵣ or qₛ - rain or snow specific humidity
72+
- qᵣ - rain specific humidity
73+
- qₛ - snow specific humidity
7374
- dt - model time step
7475
7576
Returns the condensation/evaporation or deposition/sublimation rate for
@@ -80,26 +81,50 @@ function cloud_sources(
8081
thp,
8182
ts,
8283
qᵣ,
84+
qₛ,
8385
dt,
8486
) where {FT}
8587

8688
q = TD.PhasePartition(thp, ts)
8789
ρ = TD.air_density(thp, ts)
8890

89-
S = CMNe.conv_q_vap_to_q_liq_ice_MM2015(cm_params, thp, q, ρ, Tₐ(thp, ts))
91+
S = CMNe.conv_q_vap_to_q_liq_ice_MM2015(
92+
cm_params,
93+
thp,
94+
q,
95+
qᵣ,
96+
qₛ,
97+
ρ,
98+
Tₐ(thp, ts),
99+
)
90100

91101
return ifelse(
92102
S > FT(0),
93103
triangle_inequality_limiter(S, limit(qᵥ(thp, ts), dt, 2)),
94104
-triangle_inequality_limiter(abs(S), limit(qₗ(thp, ts, qₚ(qᵣ)), dt, 2)),
95105
)
96106
end
97-
function cloud_sources(cm_params::CMP.CloudIce{FT}, thp, ts, qₛ, dt) where {FT}
107+
function cloud_sources(
108+
cm_params::CMP.CloudIce{FT},
109+
thp,
110+
ts,
111+
qᵣ,
112+
qₛ,
113+
dt,
114+
) where {FT}
98115

99116
q = TD.PhasePartition(thp, ts)
100117
ρ = TD.air_density(thp, ts)
101118

102-
S = CMNe.conv_q_vap_to_q_liq_ice_MM2015(cm_params, thp, q, ρ, Tₐ(thp, ts))
119+
S = CMNe.conv_q_vap_to_q_liq_ice_MM2015(
120+
cm_params,
121+
thp,
122+
q,
123+
qᵣ,
124+
qₛ,
125+
ρ,
126+
Tₐ(thp, ts),
127+
)
103128

104129
return ifelse(
105130
S > FT(0),
@@ -342,7 +367,8 @@ end
342367
- cm_params - CloudMicrophysics parameters struct for cloud water or ice condensate
343368
- thp - Thermodynamics parameters struct
344369
- ts - thermodynamics state
345-
- qₚ - precipitation (rain or snow) specific humidity
370+
- qᵣ - rain specific humidity
371+
- qₛ - snow specific humidity
346372
- n_dp - number concentration droplets (liquid or ice) per mass
347373
_ n_dp_prescribed - prescribed number concentration of droplets (liquid or ice) per mass
348374
- dt - model time step
@@ -354,14 +380,15 @@ function aerosol_activation_sources(
354380
cm_params::CMP.CloudLiquid{FT},
355381
thp,
356382
ts,
357-
qₚ,
383+
qᵣ,
384+
qₛ,
358385
n_dp,
359386
n_dp_prescribed,
360387
dt,
361388
) where {FT}
362389
r_dp = FT(2e-6) # 2 μm
363390
m_dp = 4 / 3 * FT(π) * r_dp^3 * cm_params.ρw
364-
Sn = cloud_sources(cm_params, thp, ts, qₚ, dt) / m_dp
391+
Sn = cloud_sources(cm_params, thp, ts, qᵣ, qₛ, dt) / m_dp
365392

366393
return ifelse(
367394
Sn > FT(0),

0 commit comments

Comments
 (0)