Skip to content

Commit

Permalink
Merge pull request #3503 from CliMA/zs/sea_salt_size
Browse files Browse the repository at this point in the history
change the default size of sea salt aerosols
  • Loading branch information
szy21 authored Jan 3, 2025
2 parents c555c8d + 294c1d6 commit b421913
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ diagnostics:
period: "12hours"
prescribe_ozone: true
aerosol_radiation: true
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT01"]
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT03", "SSLT04"]
2 changes: 1 addition & 1 deletion config/gpu_configs/gpu_aquaplanet_dyamond_ss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ t_end: "1days"
toml: [toml/longrun_aquaplanet.toml]
prescribe_ozone: true
aerosol_radiation: true
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT01"]
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT03", "SSLT04"]
2 changes: 1 addition & 1 deletion config/gpu_configs/gpu_aquaplanet_dyamond_summer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ t_end: "1hours"
toml: [toml/longrun_aquaplanet.toml]
prescribe_ozone: true
aerosol_radiation: true
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT01"]
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT03", "SSLT04"]
start_date: "20160801"
initial_condition: "artifact\"DYAMOND_SUMMER_ICS_p98deg\"/DYAMOND_SUMMER_ICS_p98deg.nc"
topography: "Earth"
2 changes: 1 addition & 1 deletion config/gpu_configs/gpu_aquaplanet_dyamond_ws_1process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ t_end: "1days"
toml: [toml/longrun_aquaplanet.toml]
prescribe_ozone: true
aerosol_radiation: true
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT01"]
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT03", "SSLT04"]
2 changes: 1 addition & 1 deletion config/gpu_configs/gpu_aquaplanet_dyamond_ws_2process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ t_end: "1days"
toml: [toml/longrun_aquaplanet.toml]
prescribe_ozone: true
aerosol_radiation: true
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT01"]
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT03", "SSLT04"]
2 changes: 1 addition & 1 deletion config/gpu_configs/gpu_aquaplanet_dyamond_ws_4process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ t_end: "1days"
toml: [toml/longrun_aquaplanet.toml]
prescribe_ozone: true
aerosol_radiation: true
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT01"]
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT03", "SSLT04"]
4 changes: 2 additions & 2 deletions config/longrun_configs/amip_target_diagedmf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dt_cloud_fraction: "1hours"
insolation: "timevarying"
prescribe_ozone: true
aerosol_radiation: true
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT01"]
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT03", "SSLT04"]
surface_setup: "DefaultMoninObukhov"
turbconv: "diagnostic_edmfx"
ode_algo: ARS343
Expand All @@ -33,7 +33,7 @@ t_end: "120days"
toml: [toml/longrun_aquaplanet_diagedmf.toml]
netcdf_output_at_levels: true
diagnostics:
- short_name: [mmrso4, o3]
- short_name: [mmrso4, mmrdust, mmrss, o3]
reduction_time: average
period: "1months"

84 changes: 80 additions & 4 deletions src/diagnostics/tracer_diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,82 @@ function compute_aerosol!(out, state, cache, time, aerosol_name)
end
end

function compute_dust!(out, state, cache, time)
:prescribed_aerosols_field in propertynames(cache.tracers) ||
error("Aerosols do not exist in the model")
any(
x -> x in propertynames(cache.tracers.prescribed_aerosols_field),
[:DST01, :DST02, :DST03, :DST04],
) || error("Dust does not exist in the model")
if isnothing(out)
aero_conc = cache.scratch.ᶜtemp_scalar
@. aero_conc = 0
for prescribed_aerosol_name in [:DST01, :DST02, :DST03, :DST04]
if prescribed_aerosol_name in
propertynames(cache.tracers.prescribed_aerosols_field)
aerosol_field = getproperty(
cache.tracers.prescribed_aerosols_field,
prescribed_aerosol_name,
)
@. aero_conc += aerosol_field
end
end
return aero_conc
else
aero_conc = cache.scratch.ᶜtemp_scalar
@. aero_conc = 0
for prescribed_aerosol_name in [:DST01, :DST02, :DST03, :DST04]
if prescribed_aerosol_name in
propertynames(cache.tracers.prescribed_aerosols_field)
aerosol_field = getproperty(
cache.tracers.prescribed_aerosols_field,
prescribed_aerosol_name,
)
@. aero_conc += aerosol_field
end
end
out .= aero_conc
end
end

function compute_sea_salt!(out, state, cache, time)
:prescribed_aerosols_field in propertynames(cache.tracers) ||
error("Aerosols do not exist in the model")
any(
x -> x in propertynames(cache.tracers.prescribed_aerosols_field),
[:SSLT01, :SSLT02, :SSLT03, :SSLT04],
) || error("Sea salt does not exist in the model")
if isnothing(out)
aero_conc = cache.scratch.ᶜtemp_scalar
@. aero_conc = 0
for prescribed_aerosol_name in [:SSLT01, :SSLT02, :SSLT03, :SSLT04]
if prescribed_aerosol_name in
propertynames(cache.tracers.prescribed_aerosols_field)
aerosol_field = getproperty(
cache.tracers.prescribed_aerosols_field,
prescribed_aerosol_name,
)
@. aero_conc += aerosol_field
end
end
return aero_conc
else
aero_conc = cache.scratch.ᶜtemp_scalar
@. aero_conc = 0
for prescribed_aerosol_name in [:SSLT01, :SSLT02, :SSLT03, :SSLT04]
if prescribed_aerosol_name in
propertynames(cache.tracers.prescribed_aerosols_field)
aerosol_field = getproperty(
cache.tracers.prescribed_aerosols_field,
prescribed_aerosol_name,
)
@. aero_conc += aerosol_field
end
end
out .= aero_conc
end
end

###
# Ozone concentration (3d)
###
Expand All @@ -46,8 +122,8 @@ add_diagnostic_variable!(
long_name = "Dust Aerosol Mass Mixing Ratio",
standard_name = "mass_fraction_of_dust_dry_aerosol_particles_in_air",
units = "kg kg^-1",
comments = "Prescribed dry mass fraction of dust aerosol particles in air. Only the smallest size is included.",
compute! = (out, u, p, t) -> compute_aerosol!(out, u, p, t, :DST01),
comments = "Prescribed dry mass fraction of dust aerosol particles in air.",
compute! = (out, u, p, t) -> compute_dust!(out, u, p, t),
)

###
Expand All @@ -58,8 +134,8 @@ add_diagnostic_variable!(
long_name = "Sea-Salt Aerosol Mass Mixing Ratio",
standard_name = "mass_fraction_of_sea_salt_dry_aerosol_particles_in_air",
units = "kg kg^-1",
comments = "Prescribed dry mass fraction of sea salt aerosol particles in air. Only the smallest size is included.",
compute! = (out, u, p, t) -> compute_aerosol!(out, u, p, t, :SSLT01),
comments = "Prescribed dry mass fraction of sea salt aerosol particles in air.",
compute! = (out, u, p, t) -> compute_sea_salt!(out, u, p, t),
)

###
Expand Down
18 changes: 16 additions & 2 deletions src/parameterized_tendencies/radiation/radiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,21 @@ function radiation_model_cache(
(; aerosol_radiation) = radiation_mode
if aerosol_radiation && !(any(
x -> x in aerosol_names,
["DST01", "SSLT01", "SO4", "CB1", "CB2", "OC1", "OC2"],
[
"DST01",
"DST02",
"DST03",
"DST04",
"SSLT01",
"SSLT02",
"SSLT03",
"SSLT04",
"SO4",
"CB1",
"CB2",
"OC1",
"OC2",
],
))
error(
"Need at least one aerosol type when aerosol radiation is turned on",
Expand Down Expand Up @@ -218,7 +232,7 @@ function radiation_model_cache(
kwargs...,
# assuming fixed aerosol radius
center_dust_radius = 0.2,
center_ss_radius = 0.2,
center_ss_radius = 11.5,
center_dust_column_mass_density = NaN, # initialized in callback
center_ss_column_mass_density = NaN, # initialized in callback
center_so4_column_mass_density = NaN, # initialized in callback
Expand Down

0 comments on commit b421913

Please sign in to comment.