Skip to content

Commit 1b253e1

Browse files
authored
Merge pull request #3880 from CliMA/aj/delete_PP_from_micro
Update 2M scheme to working fluid (CM v0.25)
2 parents 997db63 + 05418f1 commit 1b253e1

File tree

4 files changed

+32
-22
lines changed

4 files changed

+32
-22
lines changed

.buildkite/Manifest-v1.11.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,9 @@ version = "0.1.13"
452452

453453
[[deps.CloudMicrophysics]]
454454
deps = ["ClimaParams", "DocStringExtensions", "ForwardDiff", "LazyArtifacts", "LogExpFunctions", "QuadGK", "RootSolvers", "SpecialFunctions", "Thermodynamics"]
455-
git-tree-sha1 = "7bc112bf39c90925ca3856ac0fcb4c68d45c952f"
455+
git-tree-sha1 = "cfc9decc96d616ab3b8d911f843eeb2aafd7d2ad"
456456
uuid = "6a9e3e04-43cd-43ba-94b9-e8782df3c71b"
457-
version = "0.24.2"
457+
version = "0.25.0"
458458

459459
[deps.CloudMicrophysics.extensions]
460460
EmulatorModelsExt = ["DataFrames", "MLJ"]
@@ -527,9 +527,9 @@ version = "1.0.0"
527527

528528
[[deps.Compat]]
529529
deps = ["TOML", "UUIDs"]
530-
git-tree-sha1 = "8ae8d32e09f0dcf42a36b90d4e17f5dd2e4c4215"
530+
git-tree-sha1 = "3a3dfb30697e96a440e4149c8c51bf32f818c0f3"
531531
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
532-
version = "4.16.0"
532+
version = "4.17.0"
533533
weakdeps = ["Dates", "LinearAlgebra"]
534534

535535
[deps.Compat.extensions]
@@ -946,9 +946,9 @@ version = "0.2.0"
946946

947947
[[deps.GPUCompiler]]
948948
deps = ["ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "PrecompileTools", "Preferences", "Scratch", "Serialization", "TOML", "Tracy", "UUIDs"]
949-
git-tree-sha1 = "bbb7004345fb6141989835fc9f2f9e93bba3c806"
949+
git-tree-sha1 = "71a747c7c0137222dceb799b5643440e8eb6bfce"
950950
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
951-
version = "1.5.3"
951+
version = "1.6.0"
952952

953953
[[deps.GPUToolbox]]
954954
git-tree-sha1 = "15d8b0f5a6dca9bf8c02eeaf6687660dafa638d0"
@@ -1302,9 +1302,9 @@ version = "0.4.10"
13021302

13031303
[[deps.KernelAbstractions]]
13041304
deps = ["Adapt", "Atomix", "InteractiveUtils", "MacroTools", "PrecompileTools", "Requires", "StaticArrays", "UUIDs"]
1305-
git-tree-sha1 = "602c0e9efadafb8abfe8281c3fbf9cf6f406fc03"
1305+
git-tree-sha1 = "4efa9cec6f308e0f492ea635421638bff81cf6f8"
13061306
uuid = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
1307-
version = "0.9.35"
1307+
version = "0.9.36"
13081308
weakdeps = ["EnzymeCore", "LinearAlgebra", "SparseArrays"]
13091309

13101310
[deps.KernelAbstractions.extensions]
@@ -2546,9 +2546,9 @@ weakdeps = ["FlameGraphs"]
25462546

25472547
[[deps.Tracy]]
25482548
deps = ["ExprTools", "LibTracyClient_jll", "Libdl"]
2549-
git-tree-sha1 = "16439d004690d4086da35528f0c6b4d7006d6dae"
2549+
git-tree-sha1 = "91dbaee0f50faa4357f7e9fc69442c7b6364dfe5"
25502550
uuid = "e689c965-62c8-4b79-b2c5-8359227902fd"
2551-
version = "0.1.4"
2551+
version = "0.1.5"
25522552

25532553
[deps.Tracy.extensions]
25542554
TracyProfilerExt = "TracyProfiler_jll"

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.35"
4848
ClimaTimeSteppers = "0.8.2"
4949
ClimaUtilities = "0.1.22"
50-
CloudMicrophysics = "0.24.2"
50+
CloudMicrophysics = "0.25.0"
5151
Dates = "1"
5252
ForwardDiff = "0.10.38, 1"
5353
Insolation = "0.9.2"

src/cache/precipitation_precomputed_quantities.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,6 @@ function set_precipitation_cache!(Y, p, ::Microphysics2Moment, _)
357357
(; ᶜSqₗᵖ, ᶜSqᵢᵖ, ᶜSqᵣᵖ, ᶜSqₛᵖ) = p.precomputed
358358
(; ᶜSnₗᵖ, ᶜSnᵣᵖ) = p.precomputed
359359

360-
(; q_liq, q_rai, n_liq, n_rai) = p.precomputed.ᶜspecific
361-
362360
ᶜSᵖ = p.scratch.ᶜtemp_scalar
363361
ᶜS₂ᵖ = p.scratch.ᶜtemp_scalar_2
364362

@@ -376,10 +374,13 @@ function set_precipitation_cache!(Y, p, ::Microphysics2Moment, _)
376374
ᶜSqₗᵖ,
377375
ᶜSqᵣᵖ,
378376
Y.c.ρ,
379-
n_liq,
380-
n_rai,
381-
q_liq,
382-
q_rai,
377+
lazy.(specific.(Y.c.ρn_liq, Y.c.ρ)),
378+
lazy.(specific.(Y.c.ρn_rai, Y.c.ρ)),
379+
lazy.(specific.(Y.c.ρq_tot, Y.c.ρ)),
380+
lazy.(specific.(Y.c.ρq_liq, Y.c.ρ)),
381+
lazy.(specific.(Y.c.ρq_ice, Y.c.ρ)),
382+
lazy.(specific.(Y.c.ρq_rai, Y.c.ρ)),
383+
lazy.(specific.(Y.c.ρq_sno, Y.c.ρ)),
383384
ᶜts,
384385
dt,
385386
cmp,

src/parameterized_tendencies/microphysics/microphysics_wrappers.jl

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,13 +417,13 @@ function aerosol_activation_sources(
417417
end
418418

419419
"""
420-
compute_warm_precipitation_sources_2M!(Sᵖ, S₂ᵖ, Snₗᵖ, Snᵣᵖ, Sqₗᵖ, Sqᵣᵖ, ρ, nₗ, nᵣ, qₗ, qᵣ, ts, dt, sb, thp)
420+
compute_warm_precipitation_sources_2M!(Sᵖ, S₂ᵖ, Snₗᵖ, Snᵣᵖ, Sqₗᵖ, Sqᵣᵖ, ρ, nₗ, nᵣ, qₜ, qₗ, qᵢ, qᵣ, qₛ, ts, dt, sb, thp)
421421
422422
- Sᵖ, S₂ᵖ - temporary containters to help compute precipitation source terms
423423
- Snₗᵖ, Snᵣᵖ, Sqₗᵖ, Sqᵣᵖ - cached storage for precipitation source terms
424424
- ρ - air density
425425
- nₗ, nᵣ - cloud liquid and rain number concentration per mass [1 / kg of moist air]
426-
- qₗ, qᵣ - cloud liquid and rain specific humidity
426+
- qₜ, qₗ, qᵢ, qᵣ, qₛ - total water, cloud liquid, cloud ice, rain and snow specific humidity
427427
- ts - thermodynamic state (see td package for details)
428428
- dt - model time step
429429
- thp, mp - structs with thermodynamic and microphysics parameters
@@ -441,8 +441,11 @@ function compute_warm_precipitation_sources_2M!(
441441
ρ,
442442
nₗ,
443443
nᵣ,
444+
qₜ,
444445
qₗ,
446+
qᵢ,
445447
qᵣ,
448+
qₛ,
446449
ts,
447450
dt,
448451
mp,
@@ -531,8 +534,11 @@ function compute_warm_precipitation_sources_2M!(
531534
mp.sb,
532535
mp.aps,
533536
thp,
534-
PP(thp, ts),
537+
qₜ,
538+
qₗ,
539+
qᵢ,
535540
qᵣ,
541+
qₛ,
536542
ρ,
537543
ρ * nᵣ,
538544
Tₐ(thp, ts),
@@ -548,8 +554,11 @@ function compute_warm_precipitation_sources_2M!(
548554
mp.sb,
549555
mp.aps,
550556
thp,
551-
PP(thp, ts),
557+
qₜ,
558+
qₗ,
559+
qᵢ,
552560
qᵣ,
561+
qₛ,
553562
ρ,
554563
ρ * nᵣ,
555564
Tₐ(thp, ts),
@@ -560,7 +569,7 @@ function compute_warm_precipitation_sources_2M!(
560569

561570
# cloud liquid number adjustment for mass limits
562571
# TODO: Once CCN number becomes a prognostic variable, these number adjustment tendencies
563-
# should be linked to it. Any increase in droplet number (source here) would imply
572+
# should be linked to it. Any increase in droplet number (source here) would imply
564573
# a corresponding sink in CCN, and vice versa.
565574
@. Sᵖ = CM2.number_increase_for_mass_limit(
566575
mp.sb.numadj,

0 commit comments

Comments
 (0)