-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This file is included in Diagnostics.jl | ||
|
||
# Tracers | ||
|
||
### | ||
# Sulfate concentration (3d) | ||
### | ||
compute_mmrso4!(out, state, cache, time) = | ||
compute_mmrso4!(out, state, cache, time, cache.tracers) | ||
|
||
function compute_mmrso4!(out, state, cache, time, tracers) | ||
:prescribed_aerosols_field in propertynames(tracers) || | ||
error("Aerosols do not exist in the model") | ||
:SO4 in propertynames(tracers.prescribed_aerosols_field) || | ||
error("SO4 does not exist in the model") | ||
if isnothing(out) | ||
return copy(tracers.prescribed_aerosols_field.SO4) | ||
else | ||
out .= tracers.prescribed_aerosols_field.SO4 | ||
end | ||
end | ||
|
||
add_diagnostic_variable!( | ||
short_name = "mmrso4", | ||
long_name = "Aerosol Sulfate Mass Mixing Ratio", | ||
standard_name = "smass_fraction_of_sulfate_dry_aerosol_particles_in_air", | ||
units = "kg kg^-3", | ||
comments = "Prescribed dry mass of sulfate (SO4) in aerosol particles as a fraction of air mass.", | ||
compute! = compute_mmrso4!, | ||
) |