Skip to content

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
julia
AerosolScheme

Abstract base type for different aerosol schemes. Concrete implementations: TOMAS15Scheme, TwoMomentScheme, etc.

source
vSmartMOM.Aerosols.TOMAS15Scheme Type
julia
TOMAS15Scheme{FT} <: AerosolScheme

TOMAS 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+1

  • bin_centers::Vector{FT}: Bin center diameters (nm), length n_bins

  • refractive_indices::Dict{String, String}: Species → RI database key

  • densities::Dict{String, FT}: Species → density (kg/m³)

  • molar_masses::Dict{String, FT}: Species → molar mass (kg/mol)

source
vSmartMOM.Aerosols.TwoMomentScheme Type
julia
TwoMomentScheme{FT} <: AerosolScheme

Two-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 species

  • aod_wavelength::Dict{String, FT}: Reference wavelength for AOD (μm)

  • refractive_indices::Dict{String, String}: Species → RI database key

source
vSmartMOM.Aerosols.AerosolSpeciesData Type
julia
AerosolSpeciesData

Data for a single aerosol species. Structure varies by scheme type.

Fields

  • data::Dict{String, Array}: Variable name → array data

    • TOMAS15: "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 → units

  • description::String: Human-readable description

source
vSmartMOM.Aerosols.AerosolData Type
julia
AerosolData{T<:AerosolScheme}

Container for all aerosol data from a given scheme.

Fields

  • scheme::T: The aerosol scheme specification

  • species_data::Dict{String, AerosolSpeciesData}: Species name → data

  • coordinates::Dict{String, Array}: Coordinate arrays (lon, lat, lev, time)

  • metadata::Dict{String, Any}: Additional metadata from NetCDF

source

Refractive-Index Tables

vSmartMOM.Aerosols.RefractiveIndexLUT Type
julia
RefractiveIndexLUT{FT}

Lookup table for wavelength-dependent refractive index.

Fields

  • species::String: Species identifier

  • wavelengths::Vector{FT}: Wavelength values (μm)

  • n_real::Vector{FT}: Real part of refractive index

  • n_imag::Vector{FT}: Imaginary part of refractive index

  • source::String: Data source/reference

  • description::String: Human-readable description

source
vSmartMOM.Aerosols.RefractiveIndexDatabase Type
julia
RefractiveIndexDatabase{FT}

Database of refractive indices for multiple aerosol species.

Fields

  • data::Dict{String, RefractiveIndexLUT{FT}}: Species key → LUT
source
vSmartMOM.Aerosols.read_aerosol_data Function
julia
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 file

  • netcdf_file::String: Path to NetCDF data file

  • FT: Floating point type (default: Float64)

Returns

  • AerosolData{T}: Aerosol data container with scheme-specific type

Example

julia
# 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"
)
source
vSmartMOM.Aerosols.load_refractive_index_database Function
julia
load_refractive_index_database(yaml_file::String, FT=Float64)

Load refractive index database from YAML file.

Arguments

  • yaml_file::String: Path to YAML database file

  • FT: Floating point type (default: Float64)

Returns

  • RefractiveIndexDatabase{FT}: Database with refractive indices for all species
source
vSmartMOM.Aerosols.get_refractive_index Function
julia
get_refractive_index(db::RefractiveIndexDatabase{FT}, species::String, λ::Real) where FT

Get complex refractive index at specified wavelength via linear interpolation.

Arguments

  • db::RefractiveIndexDatabase{FT}: Database with refractive indices

  • species::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 database

  • ArgumentError: If wavelength outside database range

Example

julia
db = load_refractive_index_database("data/refractive_indices_database.yaml")
n = get_refractive_index(db, "sulfate_suso", 0.55)  # At 550 nm
source
julia
get_refractive_index(db::RefractiveIndexDatabase{FT}, species::String, λ::AbstractVector) where FT

Get complex refractive indices at multiple wavelengths.

Arguments

  • db::RefractiveIndexDatabase{FT}: Database with refractive indices

  • species::String: Species key

  • λ::AbstractVector: Wavelengths in micrometers (μm)

Returns

  • Vector{Complex{FT}}: Complex refractive indices at each wavelength
source
vSmartMOM.Aerosols.list_species Function
julia
list_species(db::RefractiveIndexDatabase{FT}) where FT

List all available species in the refractive index database.

Returns

  • Vector{String}: Species keys
source
vSmartMOM.Aerosols.wavelength_range Function
julia
wavelength_range(db::RefractiveIndexDatabase{FT}, species::String) where FT

Get the wavelength range for a given species.

Returns

  • Tuple{FT, FT}: (λ_min, λ_max) in micrometers
source