Package overview¶
BLDFM provides a modular framework for modelling atmospheric dispersion and flux footprints in the planetary boundary layer (PBL). It numerically solves the three-dimensional steady-state advection-diffusion equation and computes Green’s function footprints for flux tower networks.
Core modules¶
bldfm.pbl_modelComputes vertical profiles of horizontal wind and eddy diffusivity using Monin-Obukhov Similarity Theory (MOST).
bldfm.solverSolves the steady-state advection-diffusion equation using FFT-based methods with linear shooting for the vertical boundary value problem.
- Key functions:
bldfm.solver.ivp_solver()
bldfm.utilsUtility functions for wind field construction, source generation, and diagnostics.
Configuration and interface¶
bldfm.config_parserYAML-based configuration with dataclass schema. Defines
BLDFMConfig,TowerConfig,DomainConfig,MetConfig, and related classes.
bldfm.interfaceHigh-level functions that encapsulate the full workflow:
run_bldfm_single()– single tower, single timesteprun_bldfm_timeseries()– single tower, all timestepsrun_bldfm_multitower()– all towers, all timestepsrun_bldfm_parallel()– parallel execution over towers, time, or both
bldfm.cliCommand-line interface:
bldfm run config.yaml [--dry-run].
Data and I/O¶
bldfm.syntheticGenerates synthetic meteorological timeseries and tower configurations for testing and prototyping.
bldfm.cacheDisk-based cache for Green’s function results using SHA-256 keyed
.npzfiles.
Plotting¶
Plotting functions (footprint fields, geospatial map overlays, wind roses, temporal footprint evolution) are provided by abl-tk. Import them from
abltk.plotting(see Shared infrastructure below).
Pipeline architecture¶
The solver pipeline proceeds in four stages. The high-level interface
(bldfm.interface) runs all four automatically; the low-level API lets
you call each stage individually.
YAML file / dict
│
load_config / parse_config_dict
│
▼
BLDFMConfig
│
┌───────────────┼────────────────┐
│ High-level │
│ run_bldfm_single/timeseries │
│ run_bldfm_multitower │
│ run_bldfm_parallel │
└───────────────┬────────────────┘
│ internally calls ▼
┌─────────────┼─────────────────┐
│ │
▼ │
compute_wind_fields() [utils] │
│ │
▼ │
vertical_profiles() [pbl_model] │
│ │
▼ │
ideal_source() [utils] │
│ (if no flux given)│
▼ │
steady_state_transport_solver() [solver]│
│ │
└───────────────┬───────────────┘
▼
result dict {grid, conc, flx, …}
│
┌─────────────┼──────────────────┐
│ │ │
▼ ▼ ▼
GreensFunctionCache save_netcdf() plot_*()
[cache] [abltk.io] [abltk.plotting]
Design philosophy: high-level vs. low-level API¶
BLDFM exposes two tiers of API, each targeting a different use case.
- High-level API —
bldfm.interface The four
run_bldfm_*functions accept aBLDFMConfigobject and return result dictionaries. Configuration objects carry every parameter (domain, towers, meteorology, solver options), making runs reproducible from a single YAML file. Use this tier for production science workflows, batch runs, and the CLI.- Low-level API — individual modules
The core functions
vertical_profiles(),steady_state_transport_solver(),compute_wind_fields(), andideal_source()can be called directly with plain NumPy arrays and scalars. This gives full control over intermediate results and is suited for custom parameter sweeps, debugging, or building new wrappers. Note thatvertical_profiles()is intentionally not re-exported in the top-level__all__; import it explicitly frombldfm.pbl_modelwhen working at this level.
Choosing a tier. Start with the high-level API. Drop to the low-level API when you need to inspect or modify intermediate quantities (e.g. vertical profiles), run the solver with non-standard inputs, or integrate BLDFM into a larger modelling framework.
API reference¶
For detailed information on functions and usage, refer to the API Documentation.