Last updated May 12, 2023
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.
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
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 (http://www.cygwin.com). 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.
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
First beware of ImageMAgick 7.1.1-8. See the discussion below under MacOS. 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" />
yum install gfortran yum install libX11-devel yum install ncurses-devel
the following programs are useful:
yum install gv yum install ImageMagick
gcc gcc-fortran xorg-x11-devel ncurses-devel ImageMagick gv java make perl
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.
These notes apply to the installation on April 23,
2023 under the latest MacOS Version Ventura
13.2.1. The test machine was a MacBook Air with
the M2 Apple Silicon chip.
Next we need the compilers and other software. We will get these using both homebrew and macports
sudo port install gv sudo port install xv sudo port install ImageMagick
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Now install the following packages:
brew install wget brew install gcc brew install xfig brew install gawk brew install ghostscript brew install ffmpeg brew install gmt brew install graphicsmagick brew install --cask mactex
The reason for downloading from the two sources is that a program may be missing from one but is in the other. The other, less obvious reason, is that distribution may not work as desired. For example, I use the ImageMagick convert program to convert the Computer Programs in Seismology (CPS) EPS files to PNG for display on the web. The CPS program plotnps -EPS determines the boundingbox, but places it at the end, by placing the line %%BoundingBox: (atend) at the top of the EPS file and then placing at the second last line, for example %%BoundingBox: 47 45 585 321. I found that the Imagemagick 7.1.1-8 downloaded from homebrew did not recognize this but that the ImageMagick 6.9.11-60 downloaded from MacPorts did recognize this. The effect was that the 7.1.1-8 version yielded a cropped image, which was not desired. Note: homebrew does have a link to download a Version 6 of ImageMagick.
Not all packages are required to compile CPS. I have selected the items in order to be productive:
convert -trim t.eps -background white -alpha remove -alpha off t.png
All of these instalations will create an entry in the .zprofile in the login directory to point to the location of these executables
sudo ln -s /opt/homebrew/bin/gcc-12 /opt/homebrew/bin/gccYou could also have installed the compiler using MacPorts. You may have to do something like
sudo ln -s /opt/local/bin/gcc-mp-11 gcc
sudo ln -s /opt/local/bin/gfortran-mp-11 gfortran
( the mp-11 means MacPosts gcc6 was installed. This how MacPorts keeps distinguishes the different versions)
OPATH=$PATH PATH=:.:$HOME/bin:$HOME/PROGRAMS.330/bin:$OPATH (This assumes that you installed CPS in your login directory)
cd PROGRAMS.330 ./Setup OSX40 ./C 2>&1 C.txtThe file C.txt provides a record fo the compile. To test the compile resutls, do
ls bin/* | wcIf you do not see on the order of 150 programs, then examine the C.txt to determine what failed. This is the file to send to the Email address below if there are problems.
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.