Saint Louis University Earthquake Center

Computer Programs in Seismology


With the installation of a PDP 11/70 minicomputer in 1981 for use in seismic network analysis, a persistent effort was made to use that tool for research. Because of the uniqueness of a dedicated minicimputer for research at that time as well as a desire to do something for the world wide seismological community, a set of documented computer programs emerged. The programs developed actually reflect research interests of the department as well as a desire to look at data in the manner of other investigators. In doing so, the hope is that these tools will permit research to progress rapidly.

This programming effort led to the development of COMPUTER PROGRAMS IN SEISMOLOGY which continues to be distributed. The package contains its own graphics package, and is relatively easy to install.

  • Version 2.0 emphasized the development of algorithms.
  • Version 3.0 (NEW) emphasizes ease of use. Version 3.30 is the latest release.

Computer Programs in Seismology

These programs focus on the understanding and interpretation of seismic wave propagation in the crust and upper mantle of the Earth. Synthetic seismograph code is provided for sources and receivers at arbitrary positions in the plane layered media. Programs are provided for determination of crustal structure through the inversion of surface-wave dispersion and teleseismic P-wave receiver functions. Inversion of broadband recordings of regional earthquakes for source depth, focal mechanism and seismic moment is also provided. Finally, a new tool, gsac, is provided to permit interactive and script based manipulation of seismic traces. The entire package is well integrated in that the same Earth velocity model, waveform and graphics formats are used by all programs. A complete interactive graphics package is also provided.

Since this package of programs continues to develop and be refined  to keep current with increasing volumes of digital might wish to  return to this page every few months.


The reference to this set of codes is as follows:

Herrmann, R. B. (2013) Computer programs in seismology: An evolving tool for instruction and research, Seism. Res. Lettr. 84, 1081-1088, doi:10.1785/0220110096


The present code requires the use of the gcc/gfortran compilers that are available for all platforms. Interactive graphics requires X11 graphics.

PC Versions Currently support for PC's running windows requires the CYGWIN environment ( The source codes and installation procedure are the same as for the UNIX/LINUX/OSX versions. NOTE: This has not been tested for a long time

UNIX/LINUX/OSX Versions Source codes and install scripts are available. C and FORTRAN compilers are required - gcc and gfortran are available for free. Programs are distributed as gzip'd tar files (.tgz). Documentation in PostScript is provided. NOTE: I have only recently tested using LINUX Mint which should be similar to Ubuntu.

Ubuntu Linux and Mint

You can use the program download page, or open a terminal window and enter the following commands:

   sudo apt-get install make
   sudo apt-get install gcc
   sudo apt-get install gfortran
   sudo apt-get install xorg-dev
   sudo apt-get install libncurses5-dev
   sudo apt-get install gawk

the following programs are useful:

   sudo apt-get install gv
   sudo apt-get install ImageMagick

Note that there may be permission problems in creating PNG files from EPS files with ImageMagick. To be able do this,

   As superuser,  edit /etc/ImageMagick-6/policy.xml 
   e.g., sudo vi /etc/ImageMagick-6/policy.xml 
   or sudo xed /etc/ImageMagick-6/policy.xml
   Change  the lines
   <policy domain="coder" rights="none" pattern="PS" />
   <policy domain="coder" rights="none" pattern="EPS" />
   <policy domain="coder" rights="none" pattern="PDF" />
   <policy domain="coder" rights="none" pattern="XPS" />
   to this:
   <policy domain="coder" rights="read|write" pattern="PS" />
   <policy domain="coder" rights="read|write" pattern="EPS" />
   <policy domain="coder" rights="read|write" pattern="PDF" />
   <policy domain="coder" rights="read|write" pattern="XPS" />

RHEL 6.3 Linux, CENTOS (perhaps Fedora)

You can use the Add/Remove Softare tab, or open a terminal window and enter the following commands:

   yum install gfortran
   yum install libX11-devel
   yum install ncurses-devel

the following programs are useful:

   yum install gv
   yum install ImageMagick

OpenSUSE 13.1

Applications -> SystemLizard Button -> Computer -> Install/Remove Softares , or invoke /sbin/YaST2 directly


LINUX distribution under VirtualBox

This document shows how to install VirtualBox on your Windows, Mac or Linux system, and then install a version of LINUX with required compilers, and finally Computer Programs in Seismology. CPS_VirtualBoxInstall.pdf. The advantage of this approach is that the computer disk does not have to be partitioned in the presence of a Windows operating system, and that all compilers are easily obtained.


NOTE: The current version of the MacOS is much newer than these steps, You may have to carefully adjust the commands accordingly.

NOTE: The installation procedure has not been tested on the new M1 platform. One may try going to and then download the gcc-m1-bin.tar.gz which should have both the gcc and gfortran.

  1. Determine the version of the operating system: Top menu bar AppleLogo -> About This Mac will give the version, e.g., OSX Version 10.9.4 It also gives processor.
  2. Determine whether the CPU is 64 or 32 bit: In a terminal window, enter uname -a. Mine gives
    Darwin quake 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64
    the x86_64 indicates a 64 bit processor. If you see i386/i586 it is 32 bot.
  3. Install xcode on your Mac, since you will need command line tools. Click on AppStore and then search for Xcode. You will need your password to download from the Apple Store.
    When Xcode in installed, the Icon in AppStore will now exhibit "Open", so open it and Agree (password again).
  4. Install Xquartz to get X11 graphic support. You can get this at . This will also set up the links required to compile X11 programs.
  5. Install MacPorts Select the version for your operating system, e.g. if running El Capitan, OS X 10.11 El Capitan
    Clicking on the install will place a package in your downloads. Just click, icons will appear, and then click on the MacPorts...pkg icon. Answer the questions and enter your password.
    MacPorts gives libraries and LINUX like tools that will be useful for productivity. I have bzip2, gawk, ghostscript, gv, ImageMagick, ncurses, xfig and xv among others:
    sudo port install ncurses
    sudo port install ghostscript
    sudo port install gv
    sudo port install xv
    sudo port install gawk
    sudo port install ImageMagick
    sudo port install wget
    or perhaps,
    sudo port install latex  and sudo port install gmt4

    See what you have by doing an ls /opt/local/bin. To determine if these are in your PATH, just enter on a terminal command line which gv and you will see the following output /opt/local/bin/gv

  6. Install the gcc compilers. There are two options:
    • . Read the instructions in the first paragraph under the heading GCC 4, 5, 6 (auto-vectorizing with OpenMP).
      Download the gcc distribution which includes the gfortran. You will need both. For example, if running El Capitan, click on gcc-6.1-bin.tar.gz updated May 2016 (El Capitan). for my version of MacOS. This will also provide gfortran. Then in Downloads, gunzip gcc-6.1-bin.tar.gz ; sudo tar xvf - gcc-6.1-bin.tar -C /
    • Using MacPorts
    • sudo port install gcc6
      cd /usr/local/bin
      sudo ln -s  /opt/local/bin/gcc-mp-6 gcc
      sudo ln -s  /opt/local/bin/gfortran-mp-6 gfortran

      ( the mp-6 means MacPosts gcc6 was installed. This how MacPorts keeps distinguishes the different versions)

  7. Define the correct PATH so that the shell can find the sources. Carefully edit the .profile in your login directory to add lines such as
    export PATH=/usr/local/bin:$PATH
         (This assumes that you installed CPS in your login directory)

    You will see that MacPorts has already changed the .profile by adding the lines

    # MacPorts Installer addition on 2016-05-19_at_10:51:18: adding an appropriate PATH variable for use with MacPorts.
    export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
    # Finished adapting your PATH environment variable for use with MacPorts.


to the package, please Email

You can find more information about the Center, seismology, and many other earthquake-related topics by visiting the Center's homepage, or by contacting Dr. Robert Herrmann.

Higher purpose. Greater good.
© 1818 - 2016 SAINT LOUIS UNIVERSITY | Disclaimer | Mobile Site
St. Louis | Madrid