DSMACC chemical box model

From Geos-chem
Revision as of 14:14, 25 July 2014 by Jmao (Talk | contribs) (Run the model)

Jump to: navigation, search

This page describes the DSMACC chemical box model (U. Leeds).


Brief description

The Dynamically Simple Model of Atmospheric Chemical Complexity (DSMACC) is designed to be a simple box model which can easily change its chemical scheme and can be used both for free running and constrained simulations. It is written in FORTRAN and uses the KPP chemical pre-processor, the TUV photolysis scheme and can use the Master Chemical Mechanism or other chemical mechanisms.

DSMACC is a useful and flexible tool. We are using it to test new GEOS-Chem chemical mechanisms.

New information on DSMACC can be found here. The code is freely available although support is limited!

Instructions for Use

Instructions for DSMACC are in the README, but are summarized below.

  1. Download the model (wget https://github.com/barronh/DSMACC/archive/master.zip)
  2. Unzip the archive (e.g., unzip master.zip)
  3. Navigate a terminal into DSMACC-master
  4. Run the test case (make check)

The test case includes a version 8 GEOS-Chem simulation that you can modify for your purposes. This test case is just a toy and is not meant for analysis.

--barronh 10:04, 25 October 2013 (EDT)

Authors and collaborators


The current version of DSMACC has been largely updated by Barron Henderson. Barron has developed all python-based parsers for GEOS-Chem and other mechanisms. Perl parser is not supported in current box model simulations.

I recently tested v9-02 with tremendous help from Barron. The current package can run both GC v8-02-03 and GC v9-02. If you have any questions, please contact Barron Henderson (University of Florida).

Model setup

First, download the code and configure

curl -kLO https://github.com/barronh/DSMACC/archive/master.zip
unzip master.zip
cd DSMACC-master/
configure (to generate Makefile.defs)

The second step is to add these two lines to your .cshrc

setenv KPP_HOME /your-home-directory/DSMACC-master/kpp
setenv PATH /your-home-directory/j1m/DSMACC-master/kpp/bin:${PATH}

The next step is to modify Makefile.defs change this line




Third step is to generate the executable for kpp

 make kpp/bin/kpp 

This will generate the executable file kpp.

Prepare the input file (This step is optional)

Using python parser (assuming you have python loaded up in your machine)

curl -kLO https://github.com/barronh/pykpp/raw/master/src/pykpp/models/prep/geoschem2kpp.py
python geoschem2kpp.py globchem.dat > globchem.eqn

This will produce globchem.eqn.

This step is not required in current package, as it is already done.

Mapping photolysis rates to TUV index

DSMACC uses TUV model to drive the photolysis reactions. You will need to modify the generated eqn for this. TUV reactions are described in usrinp.

This step is not required in current package, as it is already done.

Special treatment for special rates

You can define some special rates that not in the standard form of reaction rates. This can be done by modifying GEOSFunctions.inc.

This step is not required in current package, as it is already done.

Generate kpp files based on your mechanism

go to DSMACC-master/src folder

../kpp/bin/kpp ../test/geoschem-09-02.kpp dsmacc 

Here geoschem-09-02.kpp includes all the information for the mechanism. This will generate a series of .f90 files. To run v8-02-03 chemistry, you can just change geoschem-09-02.kpp to geos.kpp, which includes all v8-02-03 information.

Inputs and initial conditions

This section is copied from here. The model initial condition and control information are contained in a file called Init_cons.dat. It looks like a spreadsheet with columns representing different aspects of the initial conditions (time, pressure, latitude, concentrations) and the rows representing different independent simulations of the model.

1st Line

If the first line of the file contains a *positive integer* this tells the model to run forwards into for that number of seconds. The output of each independent simulation is written to the files Spec_*.dat and Rate_*.,dat where the * represents an integer value representing the simulation number.

If the first line contains -1 the model is run forwards until a diurnal steady state has been reached with output for the final timestep of all the independent simulations being output into the files Spec_1.dat and Spec_2.dat

If the first line contains -2 the model is run forwards until a diurnal steady state has been reached with output for the final 24 hours for each independent simulations being written to the files Spec_*.dat and Rate_*.dat.

2nd Line

The second row in the file should contain the parameters to be input into the model. Each parameter name is 15 characters long, separated by an space (it is read in by the FORTRAN format statement ‘100000(a15,x))’. The following parameters can be set (case sensitive).

Key Value
PRESS Pressure hPa
H2O H2O (v/v)
LAT Latitude (decimal degrees)
LON Longitude (decimal degrees)
TEMP Temperature (K)
JDAY Julian day fractional
O3COL Ozone column (Dobsons)
ALBEDO The surface albedo (fraction)
SAREA Surface area of aerosols (m^2/m^3)
RP1 Radius of particles (m)
SPECIES NAME Mixing ratio of species (v/v)

If a parameter is set which is not in the above list or is a species name as defined by the chemistry of the model the will stop (unless it starts with an X, XOH will not cause the model to crash).

3rd Line

The third line gives information about which values should be constrained and which ones allowed to run freely in the model simulations. Each parameter is 15 characters long, separated by an space (it is read in by the FORTRAN format statement ‘100000(a15,x))’. contain either a "1" or a "0", indicating whether the parameter is to be constrained in the model, with a ‘1’ indicating constraint on the parameter and a ‘0’ indicating no constraint. Subsequent rows contain the input data to the model, with concentrations in mixing ratio.

Where total NOx is to be constrained it is necessary to constrain either NO or NO2, but not both. While the parameter ‘NOx’ must be included in the Init_cons.dat file for total NOx to be constrained, its values in the file can be set to zero.

In order to constrain NOx the model will calculate a number every 24 hours by which the NO (or NO2 if NO2 is constrained in preference to NO) must be multiplied so that its modelled value remains in agreement with its observed value input into the model. All NOx species will subsequently be multiplied by this value, and hence constrained by proxy to NO (or NO2).

If neither J (O(1D)) nor J (NO2) are included in the input file, clear-sky values will be calculated at the altitude in question (determined from the pressure input) using TUV cross-sections at solar zenith angles varying between 0 and 90 degrees in 5 degree steps. The solar zenith angle (SZA) at which the observations were made is then calculated from the observed latitude, longitude and time of day, and a spline fit to the calculated J-values as a function of SZA used to determine the appropriate J-value.

If J (O(1D)) or J (NO2) are present in the input file the model will compare calculated J-values to their observed values and scale all calculated values accordingly.

Unless otherwise stated in the input file the model assigns [CH4] = 1770 ppm, [H2] = 550 ppm, and an ozone column of 260 Dobsons.

Run the model

compile the files that are generated by kpp. Type make in the DSMACC-master/src folder. This will generate the executable file dsmacc in DSMACC-master/bin folder.

To run the model, you should have a initialization file "Init_cons.dat", which describes the initial concentrations of all species.

Go to DSMACC-master/test folder,type


It is important to run this command in this folder, because this folder includes the Init_cons.dat, and a few other links to TUV (INPUTS/usrinp, DATAE1, DATAJ1, DATAS1). You can of course run this command in other folders with these files included.


  1. Emmerson, K.M., M. J. Evans, Comparison of tropospheric gas-phase chemistry schemes for use within global models, Atmos. Chem. Phys., 9, 1831-1845, 2009. PDF

Known issues

None at this time.