ModulesRun Model

run_model module

This module provides the single entry point for running the BioSNICAR forward model. It handles the full pipeline (setup, optical properties, impurity mixing, radiative transfer) in a single call and accepts keyword overrides for any model parameter.

run_model

Run the BioSNICAR forward model and return outputs.

Builds model objects from the input file, applies any keyword overrides to ice/illumination/impurity parameters, then runs the full pipeline.

Args

  • input_file: path to a YAML configuration file, or "default" to use the built-in inputs.yaml
  • solver: "adding-doubling" (default) or "toon"
  • validate: if True, run input validation before the forward model
  • plot: if True, display a spectral albedo plot after the run
  • **overrides: parameter overrides applied before running the model (see supported keys below)

Returns

  • outputs: instance of Outputs class with albedo, BBA, absorbed fluxes, etc.

Raises

  • ValueError if solver is not recognised or an override key is unknown

Supported override keys

KeyApplies toBehaviour
solzenillumination.solzenScalar, triggers calculate_irradiance()
directillumination.directScalar, triggers calculate_irradiance()
incomingillumination.incomingScalar, triggers calculate_irradiance()
rdsice.rdsBroadcast to all layers if scalar
rhoice.rhoBroadcast to all layers if scalar
dzice.dzBroadcast to all layers if scalar, or pass a list
lwcice.lwcBroadcast to all layers if scalar
layer_typeice.layer_typeBroadcast to all layers if scalar
impurity_{i}_concimpurities[i].concScalar: applied to first layer only (rest zeroed); list: applied directly

Examples

from biosnicar.drivers.run_model import run_model
 
# Run with all defaults
outputs = run_model()
print(outputs.BBA)
 
# Override specific parameters
outputs = run_model(solzen=50, rds=1000)
print(outputs.albedo)
 
# With validation and plotting
outputs = run_model(solver="adding-doubling", validate=True, plot=True)
 
# Set impurity concentration (black carbon in first layer)
outputs = run_model(impurity_0_conc=500)
 
# Use as top-level convenience
import biosnicar
outputs = biosnicar.run_model(solzen=60, rds=200)