Computational Seismology Tools


Coseis is an open-source toolkit for earthquake simulation featuring:

The primary interface is through a Python module which (for high-performance components) wraps Fortran parallelized with hybrid OpenMP and MPI.

Coseis is written by Geoffrey Ely with contributions from Steven Day, Bernard Minster, Feng Wang, Zheqiang Shi, and Jun Zhou. It is licensed under BSD terms.

WARNING: Coseis is a research code under active development. Changes are frequent and it has known bugs!


  1. If on Mac OS X, first install Xcode from the App Store. From the Xcode preferences pane, install the Command Line Tools. Then install Homebrew, followed by Git and Fortran with:

    brew install git gfortran

    OpenMP is broken in GCC 4.3 on Lion, so if you need multiprocessing speed-up, install either MPICH or a newer GCC version. Optionally, install and EPD for visualization and analysis.

  2. Clone the source code from the Coseis GitHub repository:

    git clone git://
  3. Set path variables for the Python module and executables. For bash shell, with the code located in your home directory (for example) add these lines to .bash_profile:

    export PYTHONPATH="$HOME/coseis"
    export PATH="$PATH:$HOME/coseis/bin"
  4. Run the script to test your configuration. This will display all of the configuration parameters:

  5. These parameters may be customized by creating a file cst/conf/ For example, the account for billing of service units, and email address for notifications may be specified in module with:

    account = 'your_project_name_here'
    email = ''


To run the test suite interactively:

cd cst/tests
python --run=exec

Or, submit a job for batch processing:

python --run=submit

After completion, a report is printed to the screen (or saved in run/test_suite/test_suite.output):

PASSED: doctest.testmod(cst.util)
PASSED: doctest.testmod(cst.coord)
PASSED: doctest.testmod(cst.sord)
PASSED: cst.tests.syntax.test()
PASSED: cst.tests.configure.test()
PASSED: cst.tests.hello_mpi.test()
PASSED: cst.tests.point_source.test()
PASSED: cst.tests.pml_boundary.test()
PASSED: cst.tests.kostrov.test()


CVM depth planes

../scripts/cvm/map-cvms-vs500.png ../scripts/cvm/map-cvmh-vs500.png

Extract S-wave velocity at 500 meters depth. Plot using Matplotlib

cd scripts/cvm

Source code:

CVM-S fence diagram


Build a fence diagram similar to Magistrale (2000) figure 10. Plot using Mayavi:

cd scripts/cvm

Source code:

CVM-S Basin depth


Extract 3D mesh and search for the shallowest surface of Vs = 2.5 km/s. Plot over topography using Mayavi:

cd scripts/basindepth

Source code: