Skip to content

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

Top-level package module for configuring and running vector adding-doubling radiative-transfer simulations.

source
vSmartMOM.CoreRT Module
julia
CoreRT

Core radiative-transfer implementation: model types, layer optical-property construction, adding-doubling kernels, surface coupling, and solver entry points.

source
vSmartMOM.IO Module
julia
IO

Input/output helpers for loading YAML, dictionary, atmospheric-profile, and NetCDF/GEOS-Chem configuration sources into vSmartMOM parameter objects.

source
vSmartMOM.InelasticScattering Module
julia
InelasticScattering

Molecular Raman and Cabannes/Rayleigh helper types and precomputations used by CoreRT inelastic-scattering modes.

source
vSmartMOM.Aerosols Module
julia
Aerosols Module

Flexible 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.

source
vSmartMOM.StandaloneSS Module
julia
StandaloneSS

Standalone 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.

source

Absorption Internals

vSmartMOM.Absorption.AbstractCrossSectionModel Type
julia
type AbstractCrossSectionModel

Abstract Cross Section Model type for generic cross section calculations Currently either a HitranModel or an InterpolationModel

source
vSmartMOM.Absorption.AbstractComplexErrorFunction Type
julia
type AbstractComplexErrorFunction

Abstract Complex Error Function type for generic complex error functions

source
vSmartMOM.Absorption.save_interpolation_model Function

Convenience function to save an InterpolationModel at a specified filepath (Using JLD2)

source
vSmartMOM.Absorption.load_interpolation_model Function

Convenience function to load an InterpolationModel from a specified filepath (Using JLD2)

source
vSmartMOM.Absorption.CIATable Type
julia
CIATable

Pre-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.

source
vSmartMOM.Absorption.MTCKDTable Type
julia
MTCKDTable

Water-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.

source
vSmartMOM.Absorption.MTCKDBand Type
julia
MTCKDBand

Per-band cache of MT_CKD coefficients pre-interpolated onto a model ν grid. Filling values outside the file's ν range with zeros.

source
vSmartMOM.Absorption.parse_cia_file Function
julia
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)

source
vSmartMOM.Absorption.build_cia_table Function
julia
build_cia_table(blocks, ν_grid) -> CIATable

Project all blocks onto ν_grid, grouping by block temperature. Outside each block's ν-range the contribution is 0. Always Float64 internally (see CIATable docstring).

source
vSmartMOM.Absorption.load_cia_table Function
julia
load_cia_table(path, ν_grid) -> CIATable

Convenience: 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).

source
vSmartMOM.Absorption.compute_τ_cia! Function
julia
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.

source
vSmartMOM.Absorption.cia_σ_at_T! Function
julia
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.

source
vSmartMOM.Absorption.load_mtckd Function
julia
load_mtckd(path) -> MTCKDTable

Read the AER-distributed absco-ref_wv-mt-ckd.nc file.

source
vSmartMOM.Absorption.build_mtckd_band Function
julia
build_mtckd_band(table, ν_grid) -> MTCKDBand

Interpolate 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).

source
vSmartMOM.Absorption.compute_τ_h2o_continuum! Function
julia
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.

source
julia
compute_τ_h2o_continuum!(τ_abs, table::MTCKDTable, ν_grid, profile, vmr_h2o)

Convenience overload that builds the per-band cache on the fly.

source

Scattering Internals

vSmartMOM.Scattering.greek_coefficients_from_scattering_matrix Function
julia
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.

source
vSmartMOM.Scattering.compute_aerosol_optical_properties_gpu Function
julia
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 computation

  • backend: KernelAbstractions backend (e.g., CPU(), CUDABackend())

  • precision_policy: NativeFloat64() for A100/V100, DSEmulated() for L40S

  • FT2: output float type (default Float64)

Returns

  • AerosolOptics with greek_coefs, SSA, extinction, truncation factor
source
vSmartMOM.Scattering.MiePrecisionPolicy Type

Abstract precision policy for Mie GPU kernels.

source
vSmartMOM.Scattering.NativeFloat64 Type

Use native Float64 for the Dn recursion (A100, V100 – full FP64 throughput).

source
vSmartMOM.Scattering.DSEmulated Type

Use DoubleSingle emulation for the Dn recursion (L40S, consumer GPUs – FP32 only).

source
vSmartMOM.Scattering.DoubleSingle Type
julia
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.

source
vSmartMOM.Scattering.ComplexDS Type
julia
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.

source
vSmartMOM.Scattering.NeumaierAccum Type
julia
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).

source
vSmartMOM.Scattering.neumaier_add Function

Add a value to the Neumaier accumulator.

source
vSmartMOM.Scattering.neumaier_sum Function

Extract the compensated sum.

source
vSmartMOM.Scattering.compute_Sl Function
julia
compute_Sl(l, ν₁, ν₂, ν₂_positive_flag, k, N_max, ab_pairs, an_m_bn, an_p_bn, wigner_A, wigner_B)

Evaluate for the Domke PCW Greek-coefficient formulation (Sanghavi 2014, Eq. 22).

Sums over Mie indices with Wigner d-matrix elements. Valid    pairs: (0,0), (2,2), (2,-2), (0,2). Used to compute α, β, γ, δ, ϵ, ζ via Eq. 24.

Arguments

  • l: expansion index (1-based, corresponds to   in Eq. 22)

  • ν₁, ν₂: Fourier indices; ν₂_positive_flag selects sign convention for    

  • k: wavenumber

  • N_max: maximum Mie expansion order

  • ab_pairs: precomputed etc. from compute_avg_anbns!

  • an_m_bn, an_p_bn:   and   weighted by size distribution

  • wigner_A, wigner_B: Wigner d-matrix tables for   and  

Returns

  • Complex value
source
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 angle

  • nmax max number of legendre terms (depends on size parameter; see get_n_max)

Functions returns π and τ (of size [nmax,length(μ)])

source

Core RT Internals

vSmartMOM.CoreRT.RTModelLin Type
julia
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}}

source
vSmartMOM.CoreRT.OpticalPropertyJacobian Type
julia
OpticalPropertyJacobian

Type 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.

source
vSmartMOM.CoreRT.RawAerosolJacobian Type
julia
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)

source
vSmartMOM.CoreRT.rt_run_ss Function
julia
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 from model_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 as rt_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ⱼ).

source
julia
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.

source
vSmartMOM.CoreRT.lin_added_layer_all_params! Function

Compute interaction between composite and added layers

source
vSmartMOM.CoreRT.delta_m_forward Function
julia
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⁻⁺).

source
vSmartMOM.CoreRT.delta_m_truncation_lin Function
julia
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 (currently 2:5).

  • profile_range: Indices that only affect τ via the vertical profile (currently [1, 6, 7]).

  • arr_type: Array constructor (Array or CuArray).

Returns

  • CoreScatteringOpticalProperties: Forward δ-M scaled properties.

  • CoreScatteringOpticalPropertiesLin: Linearized properties [n_aer_params × nSpec].

source

StandaloneSS Internals

vSmartMOM.StandaloneSS.ExactSSConfig Type
julia
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.

source
vSmartMOM.StandaloneSS.SSGeometry Type
julia
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.

source
vSmartMOM.StandaloneSS.LambertianSSSurface Type
julia
LambertianSSSurface(albedo)

Lambertian surface used by Phase 1 path 2. albedo may be a scalar or a per-spectral vector.

source
vSmartMOM.StandaloneSS.CoxMunkSSSurface Type
julia
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.

source
vSmartMOM.StandaloneSS.GreekCoefsSSContributor Type
julia
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.

source
vSmartMOM.StandaloneSS.TruncatedAndExactScatteringOpticalProperties Type
julia
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.

source
vSmartMOM.StandaloneSS.SSMeasurementSelector Type
julia
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.

source
vSmartMOM.StandaloneSS.run_exact_ss Function
julia
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.

source
julia
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).

source
vSmartMOM.StandaloneSS.run_exact_ss_with_jacobians Function
julia
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.

source
vSmartMOM.StandaloneSS.exact_ss_config_from_model Function
julia
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.

source
vSmartMOM.StandaloneSS.selected_measurements Function
julia
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.

source
vSmartMOM.StandaloneSS.selected_measurement_jacobian Function
julia
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.

source
vSmartMOM.StandaloneSS.surface_brdf_wind_jacobian Function
julia
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.

source
vSmartMOM.StandaloneSS.truncated_ss_path1 Function
julia
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.

source
vSmartMOM.StandaloneSS.truncated_ss_path2 Function
julia
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.

source
vSmartMOM.StandaloneSS.apply_back_correction! Function
julia
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.

source
vSmartMOM.StandaloneSS.determine_required_l_aerosol Function
julia
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.

source
vSmartMOM.StandaloneSS.determine_required_l_from_moments Function
julia
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.

source
vSmartMOM.StandaloneSS.determine_required_nbrdf Function
julia
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.

source
vSmartMOM.StandaloneSS.determine_required_nbrdf_coxmunk Function
julia
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.

source
vSmartMOM.StandaloneSS.determine_required_nquad Function
julia
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.

source
vSmartMOM.StandaloneSS.determine_required_nquad_inner Function
julia
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.

source
vSmartMOM.StandaloneSS.determine_required_nstreams Function
julia
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.

source
vSmartMOM.StandaloneSS.chain_rule_combine_dτ Function
julia
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).

source
vSmartMOM.StandaloneSS.chain_rule_combine_dϖ Function
julia
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).

source
vSmartMOM.StandaloneSS.chain_rule_combine_dP Function
julia
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).

source
vSmartMOM.StandaloneSS.chain_rule_combine_surface_brdf Function
julia
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).

source

Inelastic Internals

vSmartMOM.InelasticScattering.get_greek_raman_VS Function
julia
get_greek_raman_VS(rs, molecule)

Return vibrational Raman phase-function Greek coefficients for one molecular species.

source
vSmartMOM.InelasticScattering.has_inelastic Function
julia
has_inelastic(rs::AbstractRamanType) -> Bool

Return 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.

source
vSmartMOM.InelasticScattering.uses_cabannes_phase Function
julia
uses_cabannes_phase(rs::AbstractRamanType) -> Bool

Return whether the elastic Rayleigh path should use Cabannes phase coefficients because Raman redistribution is handled explicitly by rs.

source
vSmartMOM.InelasticScattering.needs_interaction_workspace Function
julia
needs_interaction_workspace(rs::AbstractRamanType) -> Bool

Return whether CoreRT should allocate the staged inelastic interaction workspace for this Raman mode.

source
vSmartMOM.InelasticScattering.needs_rayleigh_expansion Function
julia
needs_rayleigh_expansion(rs::AbstractRamanType) -> Bool

Return whether per-layer Rayleigh scattering fractions must be expanded onto the active Raman spectral grid before entering the core kernel.

source
vSmartMOM.InelasticScattering.normalize_raman_weights! Function
julia
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.

source
vSmartMOM.InelasticScattering.compute_effective_coefficents! Function
julia
compute_effective_coefficents!(ν_eff, T, mol)

Update molecular effective polarizability, anisotropy, depolarization, and Greek-coefficient factors at effective wavenumber ν_eff and temperature T.

source
vSmartMOM.InelasticScattering.compute_σ_RoVibRaman_coeff! Function
julia
compute_σ_RoVibRaman_coeff!(T, mol; vmax=2, Jmax=30)

Update rotational and rovibrational Raman transition prefactors for mol at temperature T.

source
vSmartMOM.InelasticScattering.get_n₀_n₁ Function
julia
get_n₀_n₁(arr, Δ)

Return destination and source spectral index ranges for a Raman offset Δ against the third dimension of arr.

source
vSmartMOM.InelasticScattering.getRamanSSProp! Function
julia
getRamanSSProp!(rs, args...)

Populate Raman single-scattering properties on rs for the supplied reference wavelength and spectral grid.

source
vSmartMOM.InelasticScattering.sol_RRS Type
julia
sol_RRS{FT}

Stellar/solar rotational Raman-scattering mode for H₂-dominated atmospheres.

source
vSmartMOM.InelasticScattering.sol_VS_0to1 Type
julia
struct RRS{FT<:AbstractFloat}

A struct which defines Rotational Raman Scattering parameters

Fields

  • h2: Molecular Constant for H2

  • greek_raman: Greek coefs in Raman calculations

  • fscattRayl: Pre-computed optical properties

  • ϖ_Cabannes

  • ϖ_λ₁λ₀

  • i_λ₁λ₀

  • Z⁻⁺_λ₁λ₀

  • Z⁺⁺_λ₁λ₀

  • dτ₀

  • dτ₀_λ

  • k_Rayl_scatt

  • n_Raman

  • F₀

source
vSmartMOM.InelasticScattering.sol_VS_1to0 Type
julia
struct RRS{FT<:AbstractFloat}

A struct which defines Rotational Raman Scattering parameters

Fields

  • h2: Molecular Constant for H2

  • greek_raman: Greek coefs in Raman calculations

  • fscattRayl: Pre-computed optical properties

  • ϖ_Cabannes

  • ϖ_λ₁λ₀

  • i_λ₁λ₀

  • Z⁻⁺_λ₁λ₀

  • Z⁺⁺_λ₁λ₀

  • dτ₀

  • dτ₀_λ

  • k_Rayl_scatt

  • n_Raman

  • F₀

source
vSmartMOM.InelasticScattering.sol_VS_0to1_plus Type
julia
struct RRS{FT<:AbstractFloat}

A struct which defines Rotational Raman Scattering parameters

Fields

  • bandSpecLim: Concatenated indices of band limits

  • iBand

  • grid_in

  • h2: Molecular Constant for H2

  • greek_raman: Greek coefs in Raman calculations

  • greek_raman_VS

  • fscattRayl: Pre-computed optical properties

  • ϖ_Cabannes

  • ϖ_λ₁λ₀

  • i_λ₁λ₀

  • Z⁻⁺_λ₁λ₀

  • Z⁺⁺_λ₁λ₀

  • ϖ_λ₁λ₀_VS

  • i_λ₁λ₀_VS

  • Z⁻⁺_λ₁λ₀_VS

  • Z⁺⁺_λ₁λ₀_VS

  • i_λ₁λ₀_all

  • i_ref

  • n_Raman

  • F₀

source
vSmartMOM.InelasticScattering.sol_VS_1to0_plus Type
julia
struct RRS{FT<:AbstractFloat}

A struct which defines Rotational Raman Scattering parameters

Fields

  • bandSpecLim: Concatenated indices of band limits

  • iBand

  • grid_in

  • h2: Molecular Constant for H2

  • greek_raman: Greek coefs in Raman calculations

  • greek_raman_VS

  • fscattRayl: Pre-computed optical properties

  • ϖ_Cabannes

  • ϖ_λ₁λ₀

  • i_λ₁λ₀

  • Z⁻⁺_λ₁λ₀

  • Z⁺⁺_λ₁λ₀

  • ϖ_λ₁λ₀_VS

  • i_λ₁λ₀_VS

  • Z⁻⁺_λ₁λ₀_VS

  • Z⁺⁺_λ₁λ₀_VS

  • i_λ₁λ₀_all

  • i_ref

  • n_Raman

  • F₀

source

Aerosol Internals

vSmartMOM.Aerosols.compute_optical_properties Function
julia
compute_optical_properties(data::AerosolData{TOMAS15Scheme{FT}}, 
                           wavelengths::AbstractVector,
                           ri_database::RefractiveIndexDatabase{FT}) where FT

Compute 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 data

  • wavelengths::AbstractVector: Wavelengths (μm) for calculations

  • ri_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:

  1. Get refractive index at wavelength

  2. Compute Mie Q_ext, Q_sca, Q_abs, g using particle size and n

  3. Convert concentrations to cross-sections

  4. Sum over all bins and species

source
julia
compute_optical_properties(data::AerosolData{TwoMomentScheme{FT}},
                           wavelengths::AbstractVector,
                           ri_database::RefractiveIndexDatabase{FT}) where FT

Compute 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 data

  • wavelengths::AbstractVector: Wavelengths (μm) for calculations

  • ri_database::RefractiveIndexDatabase{FT}: Refractive index database

Returns

  • Dict: Same structure as TOMAS-15 version
source

Architecture Internals

vSmartMOM.Architectures.AbstractArchitecture Type
julia
AbstractArchitecture

Abstract supertype for compute architectures supported by vSmartMOM.

source
vSmartMOM.Architectures.@hascuda Macro
julia
@hascuda expr

A 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.

source

IO Internals

vSmartMOM.IO.Formats.load_config Function

Load a configuration Dict from a source

source