@@ -305,6 +305,28 @@ function compute_precipitation_sources2M!(
305
305
# @. S₁ = limit(q_liq, dt, CM2.autoconversion(sb2006.acnv, q_liq, q_rai, ρ, N_liq).dq_rai_dt)
306
306
# @. aux.precip_sources += to_sources(-S₁, -S₁, S₁, 0, 0, 0)
307
307
308
+
309
+
310
+ # TODO - only do activation at cloud base
311
+ # FT = eltype(q_tot)
312
+ # S_Nl::FT = FT(0)
313
+
314
+ # q = TD.PhasePartition(q_tot, q_liq, q_ice)
315
+ # S::FT = TD.supersaturation(thermo_params, q, ρ, T, TD.Liquid())
316
+
317
+ # (; r_dry, std_dry, κ) = kid_params
318
+ # w = ρw / ρ
319
+
320
+ # aerosol_distribution =
321
+ # CMAM.AerosolDistribution((CMAM.Mode_κ(r_dry, std_dry, N_aer, (FT(1),), (FT(1),), (FT(0),), (κ,)),))
322
+ # N_act = CMAA.total_N_activated(activation_params, aerosol_distribution, air_params, thermo_params, T, p, w, q)
323
+
324
+ # # Convert the total activated number to tendency
325
+ # S_Nl = ifelse(S < 0 || isnan(N_act), FT(0), max(FT(0), N_act - N_liq) / dt)
326
+
327
+
328
+
329
+
308
330
# # autoconversion liquid to rain (number)
309
331
# @. S₂ = limit(N_liq, dt, CM2.autoconversion(sb2006.acnv, q_liq, q_rai, ρ, N_liq).dN_rai_dt, 2)
310
332
# @. aux.precip_sources += to_sources(0, 0, 0, 0, -2 * S₂, S₂)
@@ -501,7 +523,7 @@ function compute_precipitation_sinks2M!(
501
523
@. Sqᵣᵖ += Sᵖ
502
524
@. Seₜᵖ -= Sᵖ * (Iₗ (thp, ts) + Φ)
503
525
504
- # evaporation: q_rai -> q_vap (mass )
526
+ # evaporation: q_rai -> q_vap (number )
505
527
@. Sᵖ = - min (
506
528
limit (Nᵣ, dt, 5 ),
507
529
- CM2. rain_evaporation (rps... , PP (thp, ts), qᵣ, ρ, Nᵣ, Tₐ (thp. ts)). evap_rate_0,
0 commit comments