CAABA/MECCA Box Model
A zero-dimensional photochemical model for studying how trace gases react in an isolated air parcel, and how I use it to interpret aircraft measurements.
What is a box model?
A box model treats a chunk of air as a single well-mixed "box" with no transport, mixing or dilution. Given starting concentrations, temperature, pressure and sunlight, it follows only the chemistry through time. This makes it a clean laboratory for asking "what do these molecules do to each other?", with every reaction visible, something a 3-D global model cannot easily offer.
CAABA and MECCA
CAABA (Chemistry As A Box model Application) is the framework that runs the box. MECCA (Module Efficiently Calculating the Chemistry of the Atmosphere) supplies the chemistry. Together they are part of the MESSy modelling system. I used version 4.7.5.
Pairing the model with aircraft data
In my work, the box is initialised with trace-gas mixing ratios measured on research aircraft, for example VOCs from PTR-ToF-MS and GC-MS together with NO, CO, ozone and others. The model then runs the day forward, so the observed air mass can be examined chemically: which species produce the radicals (OH, HO2) that drive oxidation, and how do they interact?
How it works, in detail (click to open)
1. The core idea: a set of coupled rate equations
Every species in the mechanism gets one equation describing how its concentration changes with time. Chemistry adds or removes molecules through reactions; the box adds nothing else (no transport):
A reaction such as A + B → C proceeds at a rate k · [A] · [B]. The rate constant k depends on temperature and pressure; photolysis reactions use a photolysis frequency J instead, which depends on sunlight. With hundreds to thousands of species and reactions, this becomes a large system of equations that must be solved numerically.
2. From a reaction list to running code (KPP)
MECCA stores the chemistry as a plain-text list of reactions with rate expressions. A tool called KPP (Kinetic PreProcessor) turns that list into efficient Fortran code for the equations above, including a solver suited to stiff systems, where some reactions are millions of times faster than others (radicals such as OH live for about a second, ozone for weeks).
3. What happens in each time step
- Update the physical state. Temperature, pressure and humidity are prescribed (fixed or from a given profile); the model does not compute them.
- Update photolysis. The JVAL module calculates photolysis frequencies from the solar zenith angle at the chosen latitude, longitude and date, so the Sun rises and sets in the simulation.
- Update rate constants for the current temperature and pressure.
- Integrate the chemistry over the step with the stiff solver to get the new concentrations of all species.
- Write output (concentrations, reaction rates, photolysis rates) to a file, then repeat until the end time.
4. What you must supply, and what you get
| Input | Examples |
|---|---|
| Starting concentrations | Measured VOCs, NO, CO, O3, H2O2 and so on |
| Physical conditions | Temperature, pressure, humidity |
| Place and time | Latitude, longitude, date, start time (sets sunlight) |
| Chemistry choice | Which mechanism and which species are included |
Output: time series of every species (for example OH and HO2 over the day) and of each reaction's rate, which is what allows production and loss budgets to be built.
5. Important modelling choices
- Constant or relaxing species. Species can be held fixed at measured values (representing a continuous source) or left free to react away. This choice changes results and should be justified.
- Spin-up. Radicals and short-lived intermediates need some time to reach a realistic state before the output is interpreted.
- Mechanism size. A detailed organic mechanism is more realistic but slower and harder to analyse; a reduced one is faster but may miss pathways.
Sensitivity experiments
The central idea is to switch groups of species off and compare. Each run isolates one contribution:
| Run | What is included | Purpose |
|---|---|---|
| Reference | All measured species | Full scenario |
| Single-VOC + NO runs | NO plus one VOC at a time (the others set to zero) | Isolate each VOC's contribution |
| NO only | NO, CO, O3, H2O2, no organics | Effect of NO alone |
| Background | Values measured away from the event | Baseline without the input being studied |
Attributing radical production
To find how much each compound matters, I remove it from the full simulation and compare the daytime-integrated gross HOx production:
Some effects are non-linear: two ingredients together can give more (or less) than the sum of each alone. This is captured by a synergy term:
A positive synergy means the interaction amplifies production; zero means the effects simply add; negative means competition.
Step-by-step guide to get started (click to open)
This is a general outline of a first project. Exact file names, options and commands change between versions, so always follow the manual that comes with your version of CAABA/MECCA.
- Get comfortable with the prerequisites. You will need a Linux or Unix-like system, a Fortran compiler, the netCDF library, and basic comfort with the command line. Python or Ferret/ncview helps for plotting.
- Obtain the model. CAABA/MECCA is distributed as part of the MESSy system. Check the MESSy website (messy-interface.org) for the current licence terms and how to download it.
- Read the model description. Sander et al. (2019) in Geoscientific Model Development explains the design and is the best single introduction; the manual covers installation.
- Pick or create a configuration. MECCA comes with ready-made chemistry setups, for example methane-only or full tropospheric chemistry. Start with a small one so that runs finish in seconds and you can understand every reaction.
- Generate the chemistry code. A helper tool (
xmeccain the standard distribution) lets you choose the mechanism and generate the code with KPP. Compile the model. - Set up the experiment. Edit the model's settings file: start date and time, latitude and longitude, temperature, pressure, humidity, run length, and initial concentrations. First run a "do-nothing" test: default values, to confirm it works.
- Run it and look at the output. Plot a few species against time, such as O3, NO, NO2, OH, HO2. Check that OH is zero at night and peaks near midday. If not, something is mis-set.
- Change one thing at a time. Double NO, or remove one VOC, and compare with the base run. This is the sensitivity approach described above and is how most insight is gained.
- Move to real data. Initialise the model with measured values from an aircraft or ground site, check the unit conversions (ppbv, pptv, mol/mol), and run reference and sensitivity cases.
- Check and document. Compare modelled species with any you did not use as input, run perturbation tests for measurement uncertainty, and record every setting so the run can be reproduced.
Common first-time pitfalls
- Mixing up units for initial concentrations (ppbv vs. pptv vs. molecules cm-3).
- Forgetting that the box has no sinks other than chemistry, so long runs drift away from reality.
- Reading results from the first hours of a run before radicals have settled.
- Changing several inputs at once, so the cause of a change cannot be identified.
Where to learn more
- Sander et al. (2019), GMD, 12, 1365–1385: model description.
- The MESSy and KPP documentation for installation and options.
- Textbook background: Jacob, Introduction to Atmospheric Chemistry (free online), for HOx, NOx and ozone chemistry.
Limitations
- The box has no mixing, dilution, continued transport, heterogeneous loss or deposition, so results describe the chemical evolution of one air parcel, not the whole atmosphere.
- The answer depends on the quality of the input measurements and their uncertainties; this is why sensitivity tests with perturbed inputs are run.
- Natural next step: couple box-model insight with a chemical transport model that includes transport.
Key references
- Sander, R. et al. (2019). The community atmospheric chemistry box model CAABA/MECCA-4.0. Geosci. Model Dev., 12, 1365–1385. doi:10.5194/gmd-12-1365-2019
- Pozzer, A. et al. (2022). Simulation of organics in the atmosphere: evaluation of EMACv2.54 with the Mainz Organic Mechanism (MOM). Geosci. Model Dev., 15, 2673–2710. doi:10.5194/gmd-15-2673-2022
- Sander, R. et al. (2014). The photolysis module JVAL-14. Geosci. Model Dev., 7, 2653–2662. doi:10.5194/gmd-7-2653-2014
This page describes the model and method. Results from my application of it to aircraft data (CAFE-Pacific) are in a manuscript currently under review and are not shown here.