Skip to content

Commit 39b198b

Browse files
committed
calibratable number_conc for r_eff
1 parent 7ec5f00 commit 39b198b

File tree

5 files changed

+79
-5
lines changed

5 files changed

+79
-5
lines changed

.buildkite/Manifest-v1.11.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
julia_version = "1.11.4"
44
manifest_format = "2.0"
5-
project_hash = "04945e2a7116cfacb2d57340f477dbe23e208227"
5+
project_hash = "dbb001c3c134c9962d9a283b94c060c2d2eb8b6a"
66

77
[[deps.ADTypes]]
88
git-tree-sha1 = "e2478490447631aedba0823d4d7a80b2cc8cdb32"
@@ -395,9 +395,9 @@ version = "0.2.12"
395395

396396
[[deps.ClimaParams]]
397397
deps = ["TOML"]
398-
git-tree-sha1 = "bf8fdee01cf5ea7e5e9fa00ac32367f65448484e"
398+
git-tree-sha1 = "8bf3c3ca9073ae455682eb4f011f94a86a0f88a4"
399399
uuid = "5c42b081-d73a-476f-9059-fd94b934656c"
400-
version = "0.10.23"
400+
version = "0.10.24"
401401

402402
[[deps.ClimaReproducibilityTests]]
403403
deps = ["OrderedCollections", "PrettyTables"]

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ AtmosphericProfilesLibrary = "0.1.7"
4545
ClimaComms = "0.6.6"
4646
ClimaCore = "0.14.24"
4747
ClimaDiagnostics = "0.2.12"
48-
ClimaParams = "0.10.23"
48+
ClimaParams = "0.10.24"
4949
ClimaTimeSteppers = "0.8.2"
5050
ClimaUtilities = "0.1.22"
5151
CloudMicrophysics = "0.22.9"

src/callbacks/callbacks.jl

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,18 +206,53 @@ NVTX.@annotate function rrtmgp_model_callback!(integrator)
206206
max(cloud_fraction, eps(FT))
207207
@. ᶜfrac = cloud_fraction
208208
# RRTMGP needs effective radius in microns
209+
210+
seasalt_aero_conc = p.scratch.ᶜtemp_scalar
211+
dust_aero_conc = p.scratch.ᶜtemp_scalar_2
212+
SO4_aero_conc = p.scratch.ᶜtemp_scalar_3
213+
@. seasalt_aero_conc = 0
214+
@. dust_aero_conc = 0
215+
@. SO4_aero_conc = 0
216+
# Get aerosol mass concentrations if available
217+
seasalt_names = [:SSLT01, :SSLT02, :SSLT03, :SSLT04, :SSLT05]
218+
dust_names = [:DST01, :DST02, :DST03, :DST04, :DST05]
219+
SO4_names = [:SO4]
220+
if :prescribed_aerosols_field in propertynames(p.tracers)
221+
aerosol_field = p.tracers.prescribed_aerosols_field
222+
for aerosol_name in propertynames(aerosol_field)
223+
if aerosol_name in seasalt_names
224+
data = getproperty(aerosol_field, aerosol_name)
225+
@. seasalt_aero_conc += data
226+
elseif aerosol_name in dust_names
227+
data = getproperty(aerosol_field, aerosol_name)
228+
@. dust_aero_conc += data
229+
elseif aerosol_name in SO4_names
230+
data = getproperty(aerosol_field, aerosol_name)
231+
@. SO4_aero_conc += data
232+
end
233+
end
234+
end
235+
209236
@. ᶜreliq = ifelse(
210237
cloud_liquid_water_content > FT(0),
211238
CM.CloudDiagnostics.effective_radius_Liu_Hallet_97(
212239
cmc.liquid,
213240
Y.c.ρ,
214241
cloud_liquid_water_content / max(eps(FT), cloud_fraction),
215-
cmc.N_cloud_liquid_droplets,
242+
ml_N_cloud_liquid_droplets(
243+
(cmc,),
244+
dust_aero_conc,
245+
seasalt_aero_conc,
246+
SO4_aero_conc,
247+
cloud_liquid_water_content /
248+
max(eps(FT), cloud_fraction),
249+
),
216250
FT(0),
217251
FT(0),
218252
) * m_to_um_factor,
219253
FT(0),
220254
)
255+
221256
@. ᶜreice = ifelse(
222257
cloud_ice_water_content > FT(0),
223258
CM.CloudDiagnostics.effective_radius_const(cmc.ice) *

src/parameterized_tendencies/microphysics/microphysics_wrappers.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,31 @@ function limit(q, dt, n::Int)
3434
return q / float(dt) / n
3535
end
3636

37+
"""
38+
ml_N_cloud_liquid_droplets(cmc, c_dust, c_seasalt, c_SO4, q_liq)
39+
40+
- cmc - a struct with cloud and aerosol parameters
41+
- c_dust, c_seasalt, c_SO4 - dust, seasalt and ammonium sulfate mass concentrations [kg/kg]
42+
- q_liq - liquid water specific humidity
43+
44+
Returns the liquid cloud droplet number concentration diagnosed based on the
45+
aerosol loading and cloud liquid water.
46+
"""
47+
function ml_N_cloud_liquid_droplets(cmc, c_dust, c_seasalt, c_SO4, q_liq)
48+
# We can also add w, T, RH, w' ...
49+
# Also consider lookind only at around cloud base height
50+
(; α_dust, α_seasalt, α_SO4, α_q_liq) = cmc.aml
51+
(; c₀_dust, c₀_seasalt, c₀_SO4) = cmc.aml
52+
N₀ = cmc.N_cloud_liquid_droplets
53+
54+
FT = eltype(N₀)
55+
return N₀ +
56+
α_dust * log(max(c_dust, eps(FT)) / c₀_dust) +
57+
α_seasalt * log(max(c_seasalt, eps(FT)) / c₀_seasalt) +
58+
α_SO4 * log(max(c_SO4, eps(FT)) / c₀_SO4) +
59+
α_q_liq * log(max(q_liq, eps(FT)))
60+
end
61+
3762
"""
3863
cloud_sources(cm_params, thp, ts, dt)
3964

src/parameters/create_parameters.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ cloud_parameters(toml_dict::CP.AbstractTOMLDict) = (;
121121
"prescribed_cloud_droplet_number_concentration",
122122
"ClimaAtmos",
123123
).prescribed_cloud_droplet_number_concentration,
124+
aml = aerosol_ml_parameters(toml_dict),
124125
)
125126

126127
microphys_1m_parameters(::Type{FT}) where {FT <: AbstractFloat} =
@@ -147,6 +148,19 @@ function vert_diff_parameters(toml_dict)
147148
return CP.get_parameter_values(toml_dict, name_map, "ClimaAtmos")
148149
end
149150

151+
function aerosol_ml_parameters(toml_dict)
152+
name_map = (;
153+
:prescribed_cloud_droplet_number_concentration => :N₀,
154+
:dust_calibration_coefficient => :α_dust,
155+
:seasalt_calibration_coefficient => :α_seasalt,
156+
:ammonium_sulfate_calibration_coefficient => :α_SO4,
157+
:liquid_water_specific_humidity_calibration_coefficent => :α_q_liq,
158+
:reference_dust_aerosol_mass_concentration => :c₀_dust,
159+
:reference_seasalt_aerosol_mass_concentration => :c₀_seasalt,
160+
:reference_ammonium_sulfate_mass_concentration => :c₀_SO4,
161+
)
162+
return CP.get_parameter_values(toml_dict, name_map, "ClimaAtmos")
163+
end
150164

151165
to_svec(x::AbstractArray) = SA.SVector{length(x)}(x)
152166
to_svec(x) = x

0 commit comments

Comments
 (0)