Developer API Coverage
This page makes exported developer-facing helpers canonical for Documenter. Most users should start from the Library, task pages, or module overview pages instead.
Package Modules
vSmartMOM Module
vSmartMOMTop-level package module for configuring and running vector adding-doubling radiative-transfer simulations.
sourcevSmartMOM.CoreRT Module
CoreRTCore radiative-transfer implementation: model types, layer optical-property construction, adding-doubling kernels, surface coupling, and solver entry points.
sourcevSmartMOM.IO Module
IOInput/output helpers for loading YAML, dictionary, atmospheric-profile, and NetCDF/GEOS-Chem configuration sources into vSmartMOM parameter objects.
sourcevSmartMOM.InelasticScattering Module
InelasticScatteringMolecular Raman and Cabannes/Rayleigh helper types and precomputations used by CoreRT inelastic-scattering modes.
sourcevSmartMOM.Aerosols Module
Aerosols ModuleFlexible aerosol framework supporting multiple schemes:
TOMAS-15: Size-resolved aerosol microphysics (15 bins)
Two-Moment: Bulk aerosol properties (AOD + effective radius)
Future: MAAM, custom schemes, etc.
Includes wavelength-dependent refractive index database and optical property calculations.
sourcevSmartMOM.StandaloneSS Module
StandaloneSSStandalone exact single-scattering tools. Phase 1 implements scalar, plane-parallel exact paths with vector-Stokes support for atmospheric Rayleigh single scatter and direct-beam surface reflection.
sourceAbsorption Internals
vSmartMOM.Absorption.AbstractCrossSectionModel Type
type AbstractCrossSectionModelAbstract Cross Section Model type for generic cross section calculations Currently either a HitranModel or an InterpolationModel
sourcevSmartMOM.Absorption.AbstractComplexErrorFunction Type
type AbstractComplexErrorFunctionAbstract Complex Error Function type for generic complex error functions
sourcevSmartMOM.Absorption.save_interpolation_model Function
Convenience function to save an InterpolationModel at a specified filepath (Using JLD2)
sourcevSmartMOM.Absorption.load_interpolation_model Function
Convenience function to load an InterpolationModel from a specified filepath (Using JLD2)
sourcevSmartMOM.Absorption.CIATable Type
CIATablePre-interpolated CIA cross-section table keyed by (ν_model_grid, T_block). Stored in Float64 because σ values are ~1e-44 to 1e-46 cm⁵/molec² — well below Float32's smallest normal (~1.18e-38). Built once per band at model construction time; cheap T-interpolation per layer at runtime.
sourcevSmartMOM.Absorption.MTCKDTable Type
MTCKDTableWater-vapor continuum reference table from MT_CKD's absco-ref_wv-mt-ckd.nc. Stored at the file's native ν grid (uniform 10 cm⁻¹); per-band tables are built on demand bybuild_mtckd_band_table.
vSmartMOM.Absorption.MTCKDBand Type
MTCKDBandPer-band cache of MT_CKD coefficients pre-interpolated onto a model ν grid. Filling values outside the file's ν range with zeros.
sourcevSmartMOM.Absorption.parse_cia_file Function
parse_cia_file(path) -> Vector{CIABlock{Float64}}Read a HITRAN .cia file. Each block is a single header line followed by n_pts lines of (ν σ) pairs. Header layout (fixed-width, 100 cols): cols 1–20 formula (e.g. "O2-O2") cols 21–30 ν_min (f10.3) cols 31–40 ν_max (f10.3) cols 41–47 n_pts (i7) cols 48–54 T (f7.1, K) cols 55–64 σ_max (e10.3)
sourcevSmartMOM.Absorption.build_cia_table Function
build_cia_table(blocks, ν_grid) -> CIATableProject all blocks onto ν_grid, grouping by block temperature. Outside each block's ν-range the contribution is 0. Always Float64 internally (see CIATable docstring).
vSmartMOM.Absorption.load_cia_table Function
load_cia_table(path, ν_grid) -> CIATableConvenience: parse a .cia file and build the model-grid table in one call. The FT keyword is accepted for back-compat but ignored — the table is always Float64 (see CIATable docstring).
vSmartMOM.Absorption.compute_τ_cia! Function
compute_τ_cia!(τ_abs, table, profile, vmr_dict)Add the CIA contribution σ(ν, T) · n_A · n_B · Δz to τ_abs[ν, layer] for every layer of profile. vmr_dict provides per-layer (or scalar) mixing ratios; O2/N2 fall back to USS defaults if absent.
All intermediate arithmetic is Float64 to avoid Float32 underflow on σ (~1e-45) and overflow on n²·Δz (~1e41); the result is converted to eltype(τ_abs) only at accumulation.
vSmartMOM.Absorption.cia_σ_at_T! Function
cia_σ_at_T!(σ_out, table, T_layer)Fill σ_out[k] = σ(ν_grid[k], T_layer) by linear interpolation in T. Constant extrapolation outside the block-temperature range. σ_out must be a Float64 vector matching the table's ν grid.
vSmartMOM.Absorption.load_mtckd Function
load_mtckd(path) -> MTCKDTableRead the AER-distributed absco-ref_wv-mt-ckd.nc file.
vSmartMOM.Absorption.build_mtckd_band Function
build_mtckd_band(table, ν_grid) -> MTCKDBandInterpolate the table's coefficients onto ν_grid. Outside the table's ν range (typically [-20, 20000] cm⁻¹), all coefficients are set to 0 so τ_continuum vanishes there (UV/Vis above 500 nm has no MT_CKD contribution).
vSmartMOM.Absorption.compute_τ_h2o_continuum! Function
compute_τ_h2o_continuum!(τ_abs, band, ν_grid, profile, vmr_h2o)Add the MT_CKD H₂O self+foreign continuum optical depth to τ_abs[ν, layer].
vmr_h2o is per-layer or scalar. profile.p_full is in hPa, profile.T in K, profile.Δz in m. All intermediate arithmetic is Float64; the result is converted to eltype(τ_abs) only at accumulation.
compute_τ_h2o_continuum!(τ_abs, table::MTCKDTable, ν_grid, profile, vmr_h2o)Convenience overload that builds the per-band cache on the fly.
sourceScattering Internals
vSmartMOM.Scattering.greek_coefficients_from_scattering_matrix Function
greek_coefficients_from_scattering_matrix(μ, w, matrix)Convert angle-space scattering-matrix elements sampled at quadrature nodes μ with weights w into Sanghavi Greek coefficients. This is the same coefficient projection used by the Mie/NAI2 path, factored for analytic phase functions.
vSmartMOM.Scattering.compute_aerosol_optical_properties_gpu Function
compute_aerosol_optical_properties_gpu(model::MieModel{<:NAI2}, backend;
precision_policy=NativeFloat64(),
FT2=Float64)GPU-accelerated version of compute_aerosol_optical_properties for the NAI2 method.
Arguments
model: MieModel configured for NAI2 computationbackend: KernelAbstractions backend (e.g.,CPU(),CUDABackend())precision_policy:NativeFloat64()for A100/V100,DSEmulated()for L40SFT2: output float type (default Float64)
Returns
AerosolOpticswith greek_coefs, SSA, extinction, truncation factor
vSmartMOM.Scattering.NativeFloat64 Type
Use native Float64 for the Dn recursion (A100, V100 – full FP64 throughput).
sourcevSmartMOM.Scattering.DSEmulated Type
Use DoubleSingle emulation for the Dn recursion (L40S, consumer GPUs – FP32 only).
sourcevSmartMOM.Scattering.DoubleSingle Type
DoubleSingle{T}Unevaluated sum of two floating-point numbers hi + lo where |lo| <= ulp(hi)/2. Provides ~2p mantissa bits (48 bits for T=Float32).
All operations are branchless and use only +, -, *, fma.
vSmartMOM.Scattering.ComplexDS Type
ComplexDS{T}Complex number with DoubleSingle real and imaginary parts (4 floats of type T). Used for the Dn recursion where complex division has catastrophic cancellation.
sourcevSmartMOM.Scattering.NeumaierAccum Type
NeumaierAccum{T}Neumaier's improved Kahan summation. Maintains a running sum s and a compensation variable c. Unlike plain Kahan, this handles the case where |addend| > |s| correctly.
Cost: ~7 FLOPs per addition (vs 1 for naive sum).
sourcevSmartMOM.Scattering.compute_Sl Function
compute_Sl(l, ν₁, ν₂, ν₂_positive_flag, k, N_max, ab_pairs, an_m_bn, an_p_bn, wigner_A, wigner_B)Evaluate
Sums over Mie indices
Arguments
l: expansion index (1-based, corresponds to in Eq. 22)ν₁,ν₂: Fourier indices;ν₂_positive_flagselects sign convention fork: wavenumberN_max: maximum Mie expansion orderab_pairs: precomputedetc. from compute_avg_anbns!an_m_bn,an_p_bn: and weighted by size distributionwigner_A,wigner_B: Wigner d-matrix tables for and
Returns
- Complex
value
vSmartMOM.Scattering.compute_mie_π_τ Function
compute_mie_π_τ(μ, nmax, π, τ) Computes the associated Legendre functions amplitude functions π and τ in Mie theory (stored internally). See eq 6 in Sanghavi 2014
μcosine of the scattering anglenmaxmax number of legendre terms (depends on size parameter; seeget_n_max)
Functions returns π and τ (of size [nmax,length(μ)])
Core RT Internals
vSmartMOM.CoreRT.RTModelLin Type
struct RTModelLin{A,B,C}Holds linearized (Jacobian) model parameters: derivatives of optical depths and aerosol properties w.r.t. physical state-vector elements.
Fields
τ̇_abs: ∂τ_abs/∂x per band: Vector of arrays [NGas × nSpec × nLayers]τ̇_aer: ∂τ_aer/∂x per band: Vector of arrays [NAer × 7 × nSpec × nLayers]lin_aerosol_optics: Linearized aerosol optics per band per aerosol: Vector{Vector{linAerosolOptics}}
vSmartMOM.CoreRT.OpticalPropertyJacobian Type
OpticalPropertyJacobianType alias for CoreScatteringOpticalPropertiesLin. Use this name in new code to emphasise the physical meaning: the Jacobian of the four core optical properties (τ, ϖ, Z⁺⁺, Z⁻⁺) w.r.t. the state vector.
vSmartMOM.CoreRT.RawAerosolJacobian Type
RawAerosolJacobian{T}Holds the un-truncated derivatives of single-aerosol optical properties with respect to the aerosol sub-parameters [τ_ref, nᵣ, nᵢ, rₘ, σ_g, p₀, σ_p].
This struct is the AD boundary for aerosols: everything upstream (Mie code, aerosol profile code, or ForwardDiff) produces these raw derivatives. The delta_m_truncation_lin function then maps them through the δ-M truncation chain rule to produce the CoreScatteringOpticalPropertiesLin that the RT kernel expects.
Fields
τ̇_aer:∂τ_aer/∂x [Nparams_aer × nSpec]— optical depth derivativesω̃̇:∂ω̃/∂x [Nparams_mie × nSpec]— SSA derivatives (Mie params only)ḟᵗ:∂fᵗ/∂x [Nparams_mie × nSpec]— truncation factor derivatives (Mie params only)Ż⁺⁺:∂Z⁺⁺/∂x [Nparams_mie × nμ × nμ]— phase matrix derivatives (Mie params only)Ż⁻⁺:∂Z⁻⁺/∂x [Nparams_mie × nμ × nμ]— phase matrix derivatives (Mie params only)
vSmartMOM.CoreRT.rt_run_ss Function
rt_run_ss(model::RTModel; i_band=1) -> (R_SFI, T_SFI, ieR_SFI, ieT_SFI, hem_R, hem_T)Run the single-scatter approximation forward RT solver for one or more bands.
Computes only the single-scattering component of the TOA reflectance / BOA transmittance by replacing the layer-doubling kernel with rt_kernel_ss! and using interaction_ss! for the final surface coupling. Useful as a fast/debug reference path; not a physically complete RT solution (multiple scattering is dropped).
Equivalent to rt_run_ss(noRS(), model, i_band).
Ported from sanghavi-branch rt_run_ss (see plans/IMPLEMENTATION_PLAN_v2.md Phase 1c).
Arguments
model::RTModel: Pre-built model frommodel_from_parameters.i_band::Integer=1: Spectral band index (or vector of indices).
Returns
6-tuple (R_SFI, T_SFI, ieR_SFI, ieT_SFI, hem_R, hem_T):
R_SFI,T_SFI,ieR_SFI,ieT_SFI: shape(nVza, nStokes, nSpec)— same per-direction outputs asrt_run.hem_R,hem_T: hemispherical-integrated TOA reflectance / BOA transmittance, shape(nSpec,). Computed from the m=0 Fourier coefficient of the Stokes-I source function over the full upper hemisphere (Σⱼ J₀[j, 1, λ] · μⱼ · wⱼ).
rt_run_ss(RS_type, model::RTModel, iBand)Single-scatter approximation driver with explicit Raman type. See rt_run_ss for the user-facing entry point.
vSmartMOM.CoreRT.lin_added_layer_all_params! Function
Compute interaction between composite and added layers
sourcevSmartMOM.CoreRT.delta_m_forward Function
delta_m_forward(τ_aer, ω̃, fᵗ, Z⁺⁺, Z⁻⁺)Apply δ-M truncation (Nakajima & Tanaka 1988) to raw aerosol optical properties.
Phase matrices Z⁺⁺, Z⁻⁺ pass through unchanged (truncation is already applied to the Greek coefficients during Mie computation).
Returns
CoreScatteringOpticalProperties with δ-M scaled (τ_mod, ϖ_mod, Z⁺⁺, Z⁻⁺).
vSmartMOM.CoreRT.delta_m_truncation_lin Function
delta_m_truncation_lin(τ_aer, fᵗ, ω̃, τ̇_aer, ω̃̇, ḟᵗ, Ż⁺⁺, Ż⁻⁺, Z⁺⁺, Z⁻⁺,
n_aer_params, mie_range, profile_range, arr_type)Apply the δ-M truncation chain rule analytically to map raw (un-truncated) aerosol derivatives to δ-M modified derivatives.
The 4 raw variables (τ_aer, ω̃, fᵗ, Z) are mapped to 3 modified variables (τ_mod, ϖ_mod, Z) via:
For profile-only parameters (p₀, σ_p), ω̃̇ = ḟᵗ = Ż = 0, so only the τ chain contributes.
Arguments
n_aer_params::Int: Total aerosol sub-parameters (currently 7).mie_range: Indices within the 7-param block that have Mie sensitivity (currently2:5).profile_range: Indices that only affect τ via the vertical profile (currently[1, 6, 7]).arr_type: Array constructor (ArrayorCuArray).
Returns
CoreScatteringOpticalProperties: Forward δ-M scaled properties.CoreScatteringOpticalPropertiesLin: Linearized properties[n_aer_params × nSpec].
StandaloneSS Internals
vSmartMOM.StandaloneSS.ExactSSConfig Type
ExactSSConfig(; geometry, surface, contributors, I0, n_stokes=1,
polarization_type=nothing, architecture=CPU())Configuration for the Phase 1 standalone exact single-scatter solver. Outputs have shape (nGeom, nStokes, nSpec). polarization_type, when provided, determines the Stokes count for the currently supported vector paths: Rayleigh or Greek-coefficient atmospheric single scatter and direct-beam surface reflection.
vSmartMOM.StandaloneSS.SSGeometry Type
SSGeometry(μ₀, μv, Δϕ)Solar and viewing geometry for the standalone single-scatter solver. μ₀ is the positive solar cosine, μv are positive upward viewing cosines, and Δϕ is the view-sun relative azimuth in radians for each view.
vSmartMOM.StandaloneSS.LambertianSSSurface Type
LambertianSSSurface(albedo)Lambertian surface used by Phase 1 path 2. albedo may be a scalar or a per-spectral vector.
vSmartMOM.StandaloneSS.CoxMunkSSSurface Type
CoxMunkSSSurface(; wind_speed, n_water=nothing, whitecap_albedo=0.22,
include_whitecaps=true, shadowing=true)Scalar Cox-Munk ocean surface for standalone exact path 2. wind_speed is the 10-m wind speed in m/s. n_water may be nothing, a scalar complex refractive index, or a per-spectral vector of complex refractive indices. The nothing fallback uses a fixed visible-water refractive index for this standalone path.
vSmartMOM.StandaloneSS.GreekCoefsSSContributor Type
GreekCoefsSSContributor(; greek_coefs, ϖ, τ)Standalone exact-angle scattering contributor backed by the same Scattering.GreekCoefs used by the full MOM solver. This is the preferred bridge for vector aerosol single scattering in StandaloneSS.
vSmartMOM.StandaloneSS.TruncatedAndExactScatteringOpticalProperties Type
TruncatedAndExactScatteringOpticalProperties(truncated, exact, truncfac)Dual-form optical-property container used by the broader exact-SFI design. Phase 1 defines the type for API alignment but does not wire it into rt_run.
vSmartMOM.StandaloneSS.SSMeasurementSelector Type
SSMeasurementSelector(; paths=(:total,), geometry_indices=:,
spectral_indices=:, stokes_indices=:)Select and flatten StandaloneSS radiance outputs into a retrieval measurement vector. Multiple paths are concatenated in the order provided. All Stokes components are selected by default so future polarized outputs are not silently reduced to Stokes I; pass stokes_indices=1 for I-only retrieval vectors.
vSmartMOM.StandaloneSS.run_exact_ss Function
run_exact_ss(model::RTModel; i_band=1, paths=:paths_1_2, I0=nothing)Convenience wrapper that builds an ExactSSConfig from model via exact_ss_config_from_model and runs the standalone exact single-scattering solver.
run_exact_ss(config::ExactSSConfig; paths=:paths_1_2)Run standalone exact single-scattering for selected paths. Stokes-vector path 1 currently supports Rayleigh and Greek-coefficient scattering; path 2 supports Lambertian and Cox-Munk direct-beam reflection. Paths 3 and 4 currently support scalar Lambertian surfaces. Radiance arrays have shape (nGeom, nStokes, nSpec).
vSmartMOM.StandaloneSS.run_exact_ss_with_jacobians Function
run_exact_ss_with_jacobians(config; paths=:paths_1_2,
selector=SSMeasurementSelector())Run the standalone solver and return handcoded f₂ Jacobians for paths 1 and 2. The Jacobians are with respect to the solver seam variables τ_layer, ϖ_eff, P_eff, and surface_brdf, holding the other seam variables fixed. The returned NamedTuple also includes measurements, the selected retrieval measurement vector from selected_measurements(result, selector). This Phase 5a prototype is CPU-only.
vSmartMOM.StandaloneSS.exact_ss_config_from_model Function
exact_ss_config_from_model(model::RTModel; i_band=1, I0=nothing)Build a standalone exact single-scattering configuration from a precomputed CoreRT model. The adapter is intentionally conservative: it reuses the model's Rayleigh Greek coefficients, absorption optical depths, supported surface types, and any aerosol optics whose truncation factor is zero.
If aerosol optics have already been δ-M/δ-BGE truncated (fᵗ != 0), the adapter throws instead of silently mixing truncated phase matrices with unmodified optical-depth state.
vSmartMOM.StandaloneSS.selected_measurements Function
selected_measurements(result, selector=SSMeasurementSelector())Return the selected StandaloneSS radiances as a one-dimensional measurement vector. The vector order is geometry, then Stokes, then spectral point within each selected path, with geometry varying fastest; multiple paths are concatenated in selector order.
sourcevSmartMOM.StandaloneSS.selected_measurement_jacobian Function
selected_measurement_jacobian(dL_dp, selector=SSMeasurementSelector())Flatten a StandaloneSS Jacobian array with shape (nGeom, nStokes, nSpec, nParam) into a retrieval Jacobian matrix with shape (nMeasurement, nParam), using the same measurement ordering as selected_measurements.
vSmartMOM.StandaloneSS.surface_brdf_wind_jacobian Function
surface_brdf_wind_jacobian(config)
surface_brdf_wind_jacobian(surface, geometry, n_spec; polarization_type=nothing)Return the StandaloneSS seam derivative of Cox-Munk direct-beam surface BRDF with respect to wind speed. For scalar Stokes it returns an array with shape (nGeom, nSpec, 1). For vector Stokes it returns (nGeom, nStokes, nSpec, 1), matching chain_rule_combine_surface_brdf's dρ_dp input.
vSmartMOM.StandaloneSS.truncated_ss_path1 Function
truncated_ss_path1(config, l_trunc)Run standalone atmospheric single-scatter path 1 with scattering phase functions reconstructed from only the first l_trunc Greek/Legendre moments. Optical depths and single-scattering albedos are unchanged. This is the post-hoc first-order analogue of the MOM angular truncation, not a full δ-M or δ-BGE optical-depth rescaling.
vSmartMOM.StandaloneSS.truncated_ss_path2 Function
truncated_ss_path2(config, max_m)Run standalone direct-beam surface path 2 with the surface BRDF reconstructed from Fourier moments m = 0:max_m-1. Lambertian surfaces are exactly represented by m = 0; Cox-Munk surfaces use the same direct-beam Fourier coefficient convention as the CoreRT surface correction.
vSmartMOM.StandaloneSS.apply_back_correction! Function
apply_back_correction!(R_SFI, config; l_trunc, max_m)
apply_back_correction!(R_SFI, model; i_band=1, l_trunc=nothing, max_m=nothing, I0=nothing)Apply the standalone first-order back-correction in place: exact(path1+path2) - truncated(path1+path2). This is a diagnostic/post-hoc single-scattering correction and does not propagate a corrected source through the multiple-scattering operator.
vSmartMOM.StandaloneSS.determine_required_l_aerosol Function
determine_required_l_aerosol(contributor; target_relative_error=1e-4)Return the required phase-function moment order for a Phase 1 contributor. Rayleigh is exact through l=2; pure absorption contributes no phase series. For the Henyey-Greenstein contributor, the estimate uses the closed-form asymptotic g^l decay.
vSmartMOM.StandaloneSS.determine_required_l_from_moments Function
determine_required_l_from_moments(β; target_relative_error=1e-4)Estimate the highest Greek/Legendre moment needed from a supplied coefficient series by comparing the squared tail energy to the requested relative error. The input is indexed as Julia arrays are: β[1] is the l=0 coefficient.
vSmartMOM.StandaloneSS.determine_required_nbrdf Function
determine_required_nbrdf(surface; target_relative_error=1e-4)Return the required BRDF Fourier moment count for a surface. Lambertian surfaces only need m=0, represented as a count of 1.
vSmartMOM.StandaloneSS.determine_required_nbrdf_coxmunk Function
determine_required_nbrdf_coxmunk(wind_speed_ms; target_relative_error=1e-4)Heuristic Cox-Munk BRDF Fourier moment count from the capillary-slope width. This helper is standalone and does not depend on the CoreRT CoxMunk type.
sourcevSmartMOM.StandaloneSS.determine_required_nquad Function
determine_required_nquad(config; target_relative_error=1e-4)Combined Phase 2 diagnostic for the standalone solver: stream count, surface Fourier count, and later paths-3+4 inner quadrature estimate.
sourcevSmartMOM.StandaloneSS.determine_required_nquad_inner Function
determine_required_nquad_inner(τ_total, contributors; target_relative_error=1e-4)Estimate the smooth inner quadrature order needed by later paths 3+4. Phase 1 does not use inner quadrature, but this diagnostic is part of the standalone solver API for the next path slice.
sourcevSmartMOM.StandaloneSS.determine_required_nstreams Function
determine_required_nstreams(contributors, surface; target_relative_error=1e-4)Return a diagnostic record for the discrete-ordinate stream count implied by Phase 1 contributors and the surface BRDF.
sourcevSmartMOM.StandaloneSS.chain_rule_combine_dτ Function
chain_rule_combine_dτ(dL_dτ, dτ_dp)Contract f₂ Jacobians with parameter derivatives of layer optical depth. dL_dτ has shape (nGeom, nStokes, nSpec, nLayers) and dτ_dp has shape (nLayers, nSpec, nParam). The returned array has shape (nGeom, nStokes, nSpec, nParam).
vSmartMOM.StandaloneSS.chain_rule_combine_dϖ Function
chain_rule_combine_dϖ(dL_dϖ, dϖ_dp)Contract f₂ Jacobians with parameter derivatives of effective single-scattering albedo. dL_dϖ has shape (nGeom, nStokes, nSpec, nLayers) and dϖ_dp has shape (nLayers, nSpec, nParam). The returned array has shape (nGeom, nStokes, nSpec, nParam).
vSmartMOM.StandaloneSS.chain_rule_combine_dP Function
chain_rule_combine_dP(dL_dP, dP_dp)Contract f₂ Jacobians with parameter derivatives of geometry-dependent effective phase values. dL_dP has shape (nGeom, nStokes, nSpec, nLayers). For scalar phase derivatives, dP_dp has shape (nGeom, nLayers, nSpec, nParam). For vector-Stokes phase derivatives, dP_dp has shape (nGeom, nStokes, nLayers, nSpec, nParam). The returned array has shape (nGeom, nStokes, nSpec, nParam).
vSmartMOM.StandaloneSS.chain_rule_combine_surface_brdf Function
chain_rule_combine_surface_brdf(dL_dρ, dρ_dp)Contract f₂ Jacobians with parameter derivatives of surface BRDF. dL_dρ has shape (nGeom, nStokes, nSpec). For scalar BRDF derivatives, dρ_dp has shape (nGeom, nSpec, nParam). For vector-Stokes BRDF derivatives, dρ_dp has shape (nGeom, nStokes, nSpec, nParam). The returned array has shape (nGeom, nStokes, nSpec, nParam).
Inelastic Internals
vSmartMOM.InelasticScattering.get_greek_raman_VS Function
get_greek_raman_VS(rs, molecule)Return vibrational Raman phase-function Greek coefficients for one molecular species.
sourcevSmartMOM.InelasticScattering.has_inelastic Function
has_inelastic(rs::AbstractRamanType) -> BoolReturn whether rs represents a Raman-aware mode that carries inelastic source/scattering state. This is the public trait used by CoreRT boundary code instead of spelling out isa noRS checks at each call site.
vSmartMOM.InelasticScattering.uses_cabannes_phase Function
uses_cabannes_phase(rs::AbstractRamanType) -> BoolReturn whether the elastic Rayleigh path should use Cabannes phase coefficients because Raman redistribution is handled explicitly by rs.
vSmartMOM.InelasticScattering.needs_interaction_workspace Function
needs_interaction_workspace(rs::AbstractRamanType) -> BoolReturn whether CoreRT should allocate the staged inelastic interaction workspace for this Raman mode.
sourcevSmartMOM.InelasticScattering.needs_rayleigh_expansion Function
needs_rayleigh_expansion(rs::AbstractRamanType) -> BoolReturn whether per-layer Rayleigh scattering fractions must be expanded onto the active Raman spectral grid before entering the core kernel.
sourcevSmartMOM.InelasticScattering.normalize_raman_weights! Function
normalize_raman_weights!(rs, model, iBand)Normalize Raman redistribution weights for modes whose ϖ_λ₁λ₀ represents a rotational Raman fraction. Modes that do not require this normalization are left unchanged.
vSmartMOM.InelasticScattering.compute_effective_coefficents! Function
compute_effective_coefficents!(ν_eff, T, mol)Update molecular effective polarizability, anisotropy, depolarization, and Greek-coefficient factors at effective wavenumber ν_eff and temperature T.
vSmartMOM.InelasticScattering.compute_σ_RoVibRaman_coeff! Function
compute_σ_RoVibRaman_coeff!(T, mol; vmax=2, Jmax=30)Update rotational and rovibrational Raman transition prefactors for mol at temperature T.
vSmartMOM.InelasticScattering.get_n₀_n₁ Function
get_n₀_n₁(arr, Δ)Return destination and source spectral index ranges for a Raman offset Δ against the third dimension of arr.
vSmartMOM.InelasticScattering.getRamanSSProp! Function
getRamanSSProp!(rs, args...)Populate Raman single-scattering properties on rs for the supplied reference wavelength and spectral grid.
vSmartMOM.InelasticScattering.sol_RRS Type
sol_RRS{FT}Stellar/solar rotational Raman-scattering mode for H₂-dominated atmospheres.
sourcevSmartMOM.InelasticScattering.sol_VS_0to1 Type
struct RRS{FT<:AbstractFloat}A struct which defines Rotational Raman Scattering parameters
Fields
h2: Molecular Constant for H2greek_raman: Greek coefs in Raman calculationsfscattRayl: Pre-computed optical propertiesϖ_Cabannesϖ_λ₁λ₀i_λ₁λ₀Z⁻⁺_λ₁λ₀Z⁺⁺_λ₁λ₀dτ₀dτ₀_λk_Rayl_scattn_RamanF₀
vSmartMOM.InelasticScattering.sol_VS_1to0 Type
struct RRS{FT<:AbstractFloat}A struct which defines Rotational Raman Scattering parameters
Fields
h2: Molecular Constant for H2greek_raman: Greek coefs in Raman calculationsfscattRayl: Pre-computed optical propertiesϖ_Cabannesϖ_λ₁λ₀i_λ₁λ₀Z⁻⁺_λ₁λ₀Z⁺⁺_λ₁λ₀dτ₀dτ₀_λk_Rayl_scattn_RamanF₀
vSmartMOM.InelasticScattering.sol_VS_0to1_plus Type
struct RRS{FT<:AbstractFloat}A struct which defines Rotational Raman Scattering parameters
Fields
bandSpecLim: Concatenated indices of band limitsiBandgrid_inh2: Molecular Constant for H2greek_raman: Greek coefs in Raman calculationsgreek_raman_VSfscattRayl: Pre-computed optical propertiesϖ_Cabannesϖ_λ₁λ₀i_λ₁λ₀Z⁻⁺_λ₁λ₀Z⁺⁺_λ₁λ₀ϖ_λ₁λ₀_VSi_λ₁λ₀_VSZ⁻⁺_λ₁λ₀_VSZ⁺⁺_λ₁λ₀_VSi_λ₁λ₀_alli_refn_RamanF₀
vSmartMOM.InelasticScattering.sol_VS_1to0_plus Type
struct RRS{FT<:AbstractFloat}A struct which defines Rotational Raman Scattering parameters
Fields
bandSpecLim: Concatenated indices of band limitsiBandgrid_inh2: Molecular Constant for H2greek_raman: Greek coefs in Raman calculationsgreek_raman_VSfscattRayl: Pre-computed optical propertiesϖ_Cabannesϖ_λ₁λ₀i_λ₁λ₀Z⁻⁺_λ₁λ₀Z⁺⁺_λ₁λ₀ϖ_λ₁λ₀_VSi_λ₁λ₀_VSZ⁻⁺_λ₁λ₀_VSZ⁺⁺_λ₁λ₀_VSi_λ₁λ₀_alli_refn_RamanF₀
Aerosol Internals
vSmartMOM.Aerosols.compute_optical_properties Function
compute_optical_properties(data::AerosolData{TOMAS15Scheme{FT}},
wavelengths::AbstractVector,
ri_database::RefractiveIndexDatabase{FT}) where FTCompute optical properties for TOMAS-15 size-resolved aerosols.
Uses Mie theory for each size bin, then integrates over all bins.
Arguments
data::AerosolData{TOMAS15Scheme{FT}}: TOMAS-15 aerosol datawavelengths::AbstractVector: Wavelengths (μm) for calculationsri_database::RefractiveIndexDatabase{FT}: Refractive index database
Returns
Dict: Optical properties with keys:"extinction": Extinction coefficient (km⁻¹) [n_levels, n_wavelengths]
"scattering": Scattering coefficient (km⁻¹) [n_levels, n_wavelengths]
"absorption": Absorption coefficient (km⁻¹) [n_levels, n_wavelengths]
"ssa": Single scattering albedo [n_levels, n_wavelengths]
"asymmetry_parameter": Asymmetry parameter g [n_levels, n_wavelengths]
Method
For each species and size bin:
Get refractive index at wavelength
Compute Mie Q_ext, Q_sca, Q_abs, g using particle size and n
Convert concentrations to cross-sections
Sum over all bins and species
compute_optical_properties(data::AerosolData{TwoMomentScheme{FT}},
wavelengths::AbstractVector,
ri_database::RefractiveIndexDatabase{FT}) where FTCompute optical properties for two-moment bulk aerosols.
Scales AOD from reference wavelength and computes other properties assuming lognormal distributions.
Arguments
data::AerosolData{TwoMomentScheme{FT}}: Two-moment aerosol datawavelengths::AbstractVector: Wavelengths (μm) for calculationsri_database::RefractiveIndexDatabase{FT}: Refractive index database
Returns
Dict: Same structure as TOMAS-15 version
Architecture Internals
vSmartMOM.Architectures.AbstractArchitecture Type
AbstractArchitectureAbstract supertype for compute architectures supported by vSmartMOM.
sourcevSmartMOM.Architectures.@hascuda Macro
@hascuda exprA macro to compile and execute expr only if CUDA is installed and available. Generally used to wrap expressions that can only be compiled if CuArrays and CUDAnative can be loaded.