Skip to content

AtChem/AtChem2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AtChem2 CI codecov

AtChem2 is a modelling tool for atmospheric chemistry. It is primarily designed to use the Master Chemical Mechanism (MCM), but it can be used with any general set of chemical reactions. The MCM is a near-explicit chemical mechanism which describes the gas-phase oxidation of volatile organic compounds (VOC) in the lower atmosphere. The MCM is available at http:https://mcm.leeds.ac.uk/. The latest stable version of AtChem2 can be downloaded here.

AtChem2 is open source, under the MIT license.

Please see CITATION.md for information on how to cite the model in publications.

Directory structure

  • build/ contains the Python and shell scripts used to compile AtChem2.
  • doc/ contains the AtChem2 user manual, with the LaTeX source files, and the poster presented at the ACM 2018 conference.
  • mcm/ contains data files related to specific versions of the MCM and an example chemical mechanism (in FACSIMILE format).
  • model/ contains the the chemical mechanism, and the model configuration, constraints and output.
  • obj/ contains the files generated by the Fortran compiler.
  • src/ contains the Fortran source files.
  • test/ contains the Test Suite scripts and files.
  • tools/ contains shell scripts to install AtChem2 and its dependencies, plotting scripts in various languages, and other utilities.

Installation, Setup and Execution

AtChem2 requires a Fortran compiler (GNU gfortran or Intel ifort), the CVODE library (part of SUNDIALS), openlibm and Python. Compilation of CVODE also requires cmake, and the Fortran libraries BLAS and LAPACK. Optionally, numdiff, FRUIT, and Ruby are required to run the Test Suite.

AtChem2 compiles and runs on Unix/Linux and macOS systems. From the Main Directory, copy and rename the file tools/install/Makefile.skel to ./Makefile. Edit ./Makefile to set the variables CVODELIB, OPENLIBMDIR and FRUITDIR to the paths of CVODE, openlibm and (if installed) FRUIT. A working knowledge of the unix shell is required to install and use AtChem2.

From the Main Directory, execute the command:

./build/build_atchem2.sh mcm/mechanism_test.fac

to compile AtChem2 using the example chemical mechanism and the default model configuration. The build script converts the chemical mechanism from the FACSIMILE format (.fac) to a Fortran compatible format, and generates the shared library mechanism.so and other related files in the model/configuration/ directory. At completion of the build process, an executable file called atchem2 is created in the Main Directory.

Set the initial conditions, the required outputs and the other model parameters by editing the files in the model/configuration/ directory. If required, copy the constraint files to the relevant subdirectory in model/constraints/. To run the model, execute the command: ./atchem2

The build script and the atchem2 executable accept several command line arguments to customize the location of the configuration, input and output directories, and of the shared library. More information on AtChem2, and detailed instructions on its installation, configuration and use can be found in the manual (doc/AtChem2-Manual.pdf). A summary of the main commands, and additional information, is available on the AtChem2 wiki.