Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

bLSmodelR - An R package to set up and run a short-range atmospheric dispersion model


The package bLSmodelR provides functions to run a backward Lagrangian stochastic (bLS) dispersion model with the R programming language. Results from bLSmodelR are consistent with results from the freeware WindTrax.


Install package dependencies

# install required packages
install.packages(c('Rcpp', 'rlecuyer', 'snow', 'snowfall', 'data.table', 'qs'))

# install optional packages for footprint plotting
# install.packages(c('sp', 'rgeos', 'geosphere', 'RgoogleMaps', 'maptools'))

Install package from source

# install bLSmodelR
devtools::install_github('ChHaeni/bLSmodelR', dependencies = FALSE)

How to run the model

Guide to bLSmodelR:

bLS model

The model is a first-order Lagrangian stochastic model that is run in backward mode (i.e. backward in time) assuming horizontally homogeneous and vertically inhomogeneous Gaussian turbulence. The model is based on the paper published by Flesch et al. (2004). The basis of the model calculation is a generalized Langevin equation given as:

dui = ai(x, u)*dt + bij(x, u)*dξj dxi = ui*dt

where is a random increment from a Gaussian distribution N(0, dt). The indices i, j = 1, 2, 3 represent the alongwind, crosswind and vertical axis of the rotated coordinate system. xi and ui are position and velocity of the trajectory at time t. An ensemble of upwind trajectories is calculated starting from the sensor position x = (0, 0, zmeas - d) and the position and velocity of trajectory touchdowns on ground (i.e. on a horizontal plane at x3 = z0 + d, where the modelled, average wind speed equals 0 m/s.) are recorded to calculate the sensor concentration to source strength relationship as the sum of the inverse touchdown velocities, summed over all touchdowns within the source:

C/E = 2/NtrajinsideSource(1/wTD)

where C represents the sensor concentration in mass m-3 and source areas are defined as homogenously emitting sources, having emission rate E in mass m-2 s-1, since the C/E relationship is expressed in s m-1. Analogously, the flux to source strength ratios (<u'C'>/E, <v'C'>/E, <w'C'>/E) are calculated, mainly for completeness and for possible vertical flux footprint corrections. Trajectories touching ground are perfectly reflected and their velocities are reversed to maintain covariances past reflection. In the main model, no deposition is modelled when trajectory touchdown happens. Furthermore, this model is not capable of modelling chemistry, and trace gases have to be assumed to be inert within the relevant travelling time. For further details on the model and the concentration to emission rate relationship, see Flesch et al. (2004), Flesch (1996) and partly Flesch et al. (1995).


Flesch, T. K., J. D. Wilson, et al. (1995). "Backward-time Lagrangian stochastic dispersion models and their application to estimate gaseous emissions." Journal of Applied Meteorology 34(6): 1320-1332.

Flesch, T. K. (1996). "The footprint for flux measurements, from backward Lagrangian stochastic models." Boundary-Layer Meteorology 78(3-4): 399-404.

Flesch, T. K., J. D. Wilson, et al. (2004). "Deducing ground-to-air emissions from observed trace gas concentrations: A field trial." Journal of Applied Meteorology 43(3): 487-502.


R package bLSmodelR







No packages published