Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

cesm_hawc.constituents

cesm_hawc.constituents

source

Build the sasktran2 constituents that represent a WACCM column.

hawcsimulator’s default atmosphere contains Rayleigh scattering, MIPAS climatological ozone, solar irradiance and a Lambertian surface with albedo 0.3. build_waccm_constituents() returns WACCM ozone (replacing the MIPAS ozone), WACCM NO2 and the two MAM4 sulfate modes, to be passed to simulator.run() under the constituents key:

constituents = build_waccm_constituents(profiles, alt_grid_m)
data = simulator.run(products, {**sim_input, "constituents": constituents})

Do not wrap the dict in Atmosphere(constituents=...): that bypasses the simulator’s atmosphere step and the aerosol is silently dropped.

Each sulfate mode is an ExtinctionScatterer backed by its own Mie database, built for a lognormal size distribution with that mode’s width (sigma_g = 1.6 for accumulation, 1.2 for coarse) and the H2SO4 refractive index. sasktran2 integrates over the size distribution, and the same database supplies extinction and phase function at every wavelength. The L2 retrieval separately assumes a single mode with sigma_g = 1.6, via aliprocessing.l2.optical.aerosol_median_radius_db.

Requires the [sim] extra.

get_mode_mie_database

def get_mode_mie_database(mode_width: float)

source

Return the Mie database for one sulfate mode.

Use this to rebuild an sk.constituent.ExtinctionScatterer yourself from a saved column’s {mode}_reference_extinction_per_m and {mode}_median_radius_nm (see cesm_hawc.save_inputs).

Parameters

Returns

warm_mode_databases

def warm_mode_databases() -> None

source

Build both sulfate-mode Mie databases.

Call this in the main process before starting worker processes, so the databases are built once rather than concurrently by every worker.

build_waccm_constituents

def build_waccm_constituents(
    profiles: dict,
    alt_m: np.ndarray,
    return_extinction: bool = False,
    truth_wavelengths_nm=None,
)

source

Build the sasktran2 constituents for one WACCM column.

Parameters

Returns

Notes

Median radii are clipped to the Mie database range (10–590 nm), and extinction is set to zero where the radius is below 10 nm.