Aerosols API
The aerosol input layer is available, but its high-level API is still being stabilized after the unified-branch merge.
Schemes and Data Containers
vSmartMOM.Aerosols.AerosolScheme Type
AerosolSchemeAbstract base type for different aerosol schemes. Concrete implementations: TOMAS15Scheme, TwoMomentScheme, etc.
sourcevSmartMOM.Aerosols.TOMAS15Scheme Type
TOMAS15Scheme{FT} <: AerosolSchemeTOMAS microphysics with 15 size bins. Size-resolved aerosol concentrations in logarithmically-spaced diameter bins.
Fields
species::Vector{String}: Aerosol species names (e.g., ["DUST", "SS", "SF", ...])n_bins::Int: Number of size bins (15)diam_min::FT: Minimum dry diameter (nm)diam_max::FT: Maximum dry diameter (nm)bin_edges::Vector{FT}: Bin edge diameters (nm), length n_bins+1bin_centers::Vector{FT}: Bin center diameters (nm), length n_binsrefractive_indices::Dict{String, String}: Species → RI database keydensities::Dict{String, FT}: Species → density (kg/m³)molar_masses::Dict{String, FT}: Species → molar mass (kg/mol)
vSmartMOM.Aerosols.TwoMomentScheme Type
TwoMomentScheme{FT} <: AerosolSchemeTwo-moment aerosol scheme with lognormal distributions. Each species characterized by AOD, effective radius, and fixed σ_g.
Fields
species::Vector{String}: Aerosol species names (e.g., ["so4", "ocpi", ...])sigma_g::Dict{String, FT}: Geometric standard deviation per speciesaod_wavelength::Dict{String, FT}: Reference wavelength for AOD (μm)refractive_indices::Dict{String, String}: Species → RI database key
vSmartMOM.Aerosols.AerosolSpeciesData Type
AerosolSpeciesDataData for a single aerosol species. Structure varies by scheme type.
Fields
data::Dict{String, Array}: Variable name → array dataTOMAS15: "concentration" → Array{Float64, 2} (n_bins × n_levels)
TOMAS15 NK: may also include nested species-fraction dictionaries
TwoMoment: "aod" → Vector{Float64}, "radius" → Vector
units::Dict{String, String}: Variable name → unitsdescription::String: Human-readable description
vSmartMOM.Aerosols.AerosolData Type
AerosolData{T<:AerosolScheme}Container for all aerosol data from a given scheme.
Fields
scheme::T: The aerosol scheme specificationspecies_data::Dict{String, AerosolSpeciesData}: Species name → datacoordinates::Dict{String, Array}: Coordinate arrays (lon, lat, lev, time)metadata::Dict{String, Any}: Additional metadata from NetCDF
Refractive-Index Tables
vSmartMOM.Aerosols.RefractiveIndexLUT Type
RefractiveIndexLUT{FT}Lookup table for wavelength-dependent refractive index.
Fields
species::String: Species identifierwavelengths::Vector{FT}: Wavelength values (μm)n_real::Vector{FT}: Real part of refractive indexn_imag::Vector{FT}: Imaginary part of refractive indexsource::String: Data source/referencedescription::String: Human-readable description
vSmartMOM.Aerosols.RefractiveIndexDatabase Type
RefractiveIndexDatabase{FT}Database of refractive indices for multiple aerosol species.
Fields
data::Dict{String, RefractiveIndexLUT{FT}}: Species key → LUT
vSmartMOM.Aerosols.read_aerosol_data Function
read_aerosol_data(config_file::String, netcdf_file::String, FT=Float64)Read aerosol data from NetCDF file using YAML configuration.
Dispatches to scheme-specific reader based on configuration.
Arguments
config_file::String: Path to YAML configuration filenetcdf_file::String: Path to NetCDF data fileFT: Floating point type (default: Float64)
Returns
AerosolData{T}: Aerosol data container with scheme-specific type
Example
# TOMAS-15 scheme
data = read_aerosol_data(
"examples/aerosol_config_tomas15.yaml",
"GEOSChem.Custom.20190702_0000z.nc4"
)
# Two-moment scheme
data = read_aerosol_data(
"examples/aerosol_config_two_moment.yaml",
"GEOSChem.Aerosols.20190702_0000z.nc4"
)vSmartMOM.Aerosols.load_refractive_index_database Function
load_refractive_index_database(yaml_file::String, FT=Float64)Load refractive index database from YAML file.
Arguments
yaml_file::String: Path to YAML database fileFT: Floating point type (default: Float64)
Returns
RefractiveIndexDatabase{FT}: Database with refractive indices for all species
vSmartMOM.Aerosols.get_refractive_index Function
get_refractive_index(db::RefractiveIndexDatabase{FT}, species::String, λ::Real) where FTGet complex refractive index at specified wavelength via linear interpolation.
Arguments
db::RefractiveIndexDatabase{FT}: Database with refractive indicesspecies::String: Species key (e.g., "sulfate_suso", "organic_carbon")λ::Real: Wavelength in micrometers (μm)
Returns
Complex{FT}: Complex refractive index n = n_real + i*n_imag
Throws
KeyError: If species not found in databaseArgumentError: If wavelength outside database range
Example
db = load_refractive_index_database("data/refractive_indices_database.yaml")
n = get_refractive_index(db, "sulfate_suso", 0.55) # At 550 nmget_refractive_index(db::RefractiveIndexDatabase{FT}, species::String, λ::AbstractVector) where FTGet complex refractive indices at multiple wavelengths.
Arguments
db::RefractiveIndexDatabase{FT}: Database with refractive indicesspecies::String: Species keyλ::AbstractVector: Wavelengths in micrometers (μm)
Returns
Vector{Complex{FT}}: Complex refractive indices at each wavelength
vSmartMOM.Aerosols.list_species Function
list_species(db::RefractiveIndexDatabase{FT}) where FTList all available species in the refractive index database.
Returns
Vector{String}: Species keys
vSmartMOM.Aerosols.wavelength_range Function
wavelength_range(db::RefractiveIndexDatabase{FT}, species::String) where FTGet the wavelength range for a given species.
Returns
Tuple{FT, FT}: (λ_min, λ_max) in micrometers