# BEATBOX

Background Error Analysis Testbed with BOXMOX

The Background Error Analysis Testbed with BOXMOX allows simple and fast investigation, comparison and evaluation of any system of Ordinary Differential Equations (ODE) evolving over time. By 'Background Error' we designate a general term for model error characterization. The BEATBOX framework consist of the 3 following elements:

- a forecasting tool using BOXMOX
- a synthetic observation generator
- a data assimilation tool

- A nature run (NR) considered as the “true state”. The NR uses best model representation possible considering the state of the art knowledge. Typically, the Master Chemical Mechanism (MCM; Jenkin et al., 2015) provides a good NR within BOXMOX.
- A control run (CR) is considered as the prior estimate state of the atmosphere. Compared to the NR, a simplified or degraded model should be considered as the current set of ODE that can be implemented in large scale 3D models.
- An observation simulator that generates synthetic observation by sampling the NR. Observation errors need also to be simulated.
- An assimilation run (AR) that is produced using the data assimilation tool merging the synthetic observation with the CR in order to produce the best estimate possible of the state.
- A suite of diagnostic tools that use NR, CR and AR is designed in order to be able point out with accuracy model and data assimilation technique limitations. Ultimately providing a direct feedback for model improvement can be achieved using the Flux Tool.

The BEATBOX package provides a data assimilation tool that sample observations form the NR, with possibility of tuning the observation error parameters. The system is coded in python and shell script that allows easy implementation. The system cycles the assimilation windows: each analysis obtained from data assimilation is used as initial condition for the next forecast that will be corrected by observation using data assimilation and so on (see figures below)... With assimilating observations, different sensitivity analyses can be used, such as adjoint, ensemble or hybrid sensitivity are included in this version of BEATBOX.

#### Observation generator – synthetic observations

Generating observation consists of the following steps:- Sampling values form the nature run
- Perturbing those values to simulate an observation inaccuracy otherwise observation would be perfect
- Specifying an observation error value

Because of the 0D (e.g. no latitude,longitue and altitude) nature of BOXMOX sampling the NR to simulate synthetic observations is straightforward. The observations could be assumed as perfect and hence no error has to be simulated and the observation value is exactly the same as the NR sampled value.

In case of non-perfect observation an error is simulated by perturbing the sampled NR value. In the current version of BEATBOX the observation perturbation is assumed to be gaussian, but other probability density functions (PDF) can be easily implemented.

Finally, an associated observation error is associated to the observation value. BEATBOX can simulated for bias (mean of the perturbation PDF) and/or precision (standard deviation of the PDF). Overestimating or underestimating observation error can be also tested in BEATBOX.

#### Adjoint sensitivity

To derive a sensitivity from a change to a given variable from another an adjoint model can be computed. We use the BOXMOX/KPP capability to output the Jacobian matrix of the ODE system evolution within the assimilation window and derive an adjoint sensitivity. The adjoint sensitivity uses the model equations directly.

#### Ensemble sensitivity

The ensemble method uses an ensemble of perturbed model realizations to obtain the sensitivity of the model (or the ODE system) to a change in a given variable. We need to a certain number of realization of perturbed models runs in order to have a statistically sound (i.e. reduce the sampling error) relationship between variables. Perturbations can be initially generated in the initial condition files of BOXMOX. Initial perturbations can be choosen to be on parameters of choice such as concentrations or temperature and be normal or log normal. During further assimilation cycles inflation techniques are also implemented to perturb the ensemble.

#### Ensemble of Adjoints (Hybrid)

In this framework we called hybrid sensitivity a combination of adjoint method and ensemble method to derive the sensitivity from a chemical compound to another. An ensemble of BOXMOX simulation are run in parallel and Jacobian of each ensemble members are used to calculate an ensemble adjoints. Then the analysis is computed by using the adjoint on each ensemble member. This last example of sensitivity shows what can be easily implemented in BEATBOX for exploring data assimilation techniques in reactive gas phase chemistry and highly non-linear systems in general.