Sunteți pe pagina 1din 4



The FOCMEC package is separated into several files, each of which contains a compressed directory tree. The FOCMEC package minus documentation and executables (gzip/tar format: 553 KB) | (PKZIP format: 629 KB). Most recent update: January 2003. The FOCMEC package documentation (gzip/tar format: 369 KB) | (PKZIP format: 371 KB). Most recent update: September 2003. Executables and libraries built using Sun Solaris 2.8 (gzip/tar format: 3.57 MB). Most recent update: July 2002. Executables and libraries built using Linux (PC Redhat v8 using g77) (PKZIP format: 1.6 MB). Most recent update: June 2003. Executables and libraries built using Sun Sunos 4.1.4 (gzip/tar format: 2.80 MB) Most recent (and final) update: June 2000. Executables built on a PC (PKZIP format: 974 KB).) Most recent update: July 2002. Click here for an update history of the FOCMEC package. On Unix, one can both uncompress and untar a file XXX.tgz with a single command: gzip -d -c XXX.tgz | tar -xf using the GNU gzip command (included with Solaris 2.8). On Macss or PCs there are utilities which accomplish the same operations some while downloading the files. Files and/or directory trees compressed into a file named using the zip (PKZIP) utility can be uncompressed and expanded using the command unzip The zip and unzip utilities come on Sun Solaris 2.8 and are included in utilities on most PC and Mac installations. If one does not have them already, they can be found for most operating systems at The top directory in focmec_pkg is focmec/. Short descriptors for the files in this directory are as follows: bin/ exe-PC/ fmplotsub/ fmplotsub_nosac/ fmsub/ iasp91stuff/ lib/ sample_runs/ src/ src-PC/ Directory for Unix executables Directory for PC executables Plotting subroutines Plotting subroutines not using SAC subroutines All subroutines except those for plotting and iasp91 iasp91subroutines, tables, model Directory for libraries (Unix) Top directory for sample runs Unix source code and scripts for building executables Self-contained source files which compile on a PC

The ./sample_runs/ directory has two subdirectories: ./sample_runs/ETNEvent/ and ./sample_runs/sakhalin/. See the README files (links below) for further information. This README file, the FOCMEC manual, and other HTML documentation are in a single directory, focmec-doc/ at the same level as focmec/. For user convenience, all these files
1 de 4 5/11/2011 10:43


have been put into a compressed file which can be downloaded to your hard disk (links given above). In the remainder of this document and in the other README HTML files, file or directory paths are given relative to the top directory focmec/. The documentation files are: focmec.pdf input.html symbol.html symbol.pdf readme_etn-event.html readme_focmec.html readme_pc.html readme_sakhalin.html update.html FOCMEC manual FOCMEC input format Manual for symbol.f usage Output from program symdemo Discussion of Eastern Tennessee event sample runs This file Building FOCMEC on PC/Windows Discussion of Sakhalin Island event sample runs Update history for the FOCMEC package

Executables (and built libraries) can be downloaded for two Sun Microsystems operating systems: Sunos 4.1.4 and Solaris 2.8. If one has downloaded the appropriate set of executables, one need only put them somewhere so the run-time scripts can find them in directory ./bin to reproduce the runs found in ./sample_runs/. If one wants to recompile the programs, one can build all the necessary libraries except the SAC library used for the plotting program focplt. (See below for a discussion about a non-SAC alternative to producing plot files.) Programs and subroutines are coded in Fortran 77. The Fortran coding is "standard" with few Sun Fortran enhancements the coding has been changed very little from that used in earlier versions which ran on PDP 11/34, VAX/VMS and IBM/CMS platforms. The code has been compiled and linked with only a few modifications (mostly in the I/O) on PC and on other Unix platforms. Scripts for running the program are in UNIX csh format and are heavily commented. Starting in October 2001, source and executable directories have been added for programs successfully compiled and run on a PC. See readme_pc.html for details.

Building the Programs on Sun/Unix

To build focmec and any of the other non-plotting programs, the procedure on a Unix system is to build library libfm.a using the makefile in ./fmsub. Many of these routines are used as well in the plotting program focplt, but one also needs libfmplot.a, which is built using the makefile in ./fmplotsub. The makefiles put the libraries in subdirectory ./lib. To build programs used in constructing input files from raw data for program focmec, go to ./iasp91stuff and enter make, which will build the library ./lib/libiasp.a. Source codes for all programs discussed above are in the subdirectory ./src. Also included are an include file for focmec, an include file for sgfp, compile-link scripts and a script build_all for building all the programs. All executables will be put in ./bin Source codes for all programs discussed above are in the subdirectory ./src. Also included are an include file for focmec, an include file for sgfp, compile-link scripts and a script build_all for building all the programs. All executables will be put in ./bin The maximum number of input data (polarities plus ratios) is a compile-time option. The default setting is 500, but there is no upward limitation. To change it, one edits FOCMEC.INC (in both ./src/ and ./fmsub/) and changes the 500 in parameter variable MAX

2 de 4

5/11/2011 10:43


to whatever is desired. The binlib.tgz files on the FOCMEC web site contain two subdirectories: a ./bin/ directory with all the executables, and ./lib/, which contains the libraries for that operating system (including the SAC fortran library). The Solaris executable for focplt was built with dynamic linking (static linking is not possible when X11 subroutines are involved) which has the advantage of a smaller executable. However, if one moves the focplt executable to an operating system with older versions of the X11 window system or F77 libraries, the program might not run. In that case, with the libraries which are provided, they can be relinked and it should run. The Sunos focplt executable is statically linked and can be run on most Solaris systems using compatibility mode. The Sunos executable can, of course, only be rebuilt on a Sunos system. If one has Sun Solaris and just wants to run the programs without rebuilding but has problems, we suggest trying the pre-built Sunos versions as the static-built Sunos programs are more portable. To build a single non-plotting program in the package: If the libraries are built, go to ./src/ and enter cl progname (where progname could be focmec, for example). To build focplt, enter clp focplt. To build all programs in the distribution in one step, enter build_all. As of December 2000, the author no longer has a machine with a Sunos operating system, so executables created and put on the FOCMEC web site after that date will be available in only Solaris format. If Sunos 4.1.x is what the user has, it is recommended to download the Sunos libraries and binaries compressed tar file and use the scripts and the included SAC library to rebuild the other libraries and the executables. SAC2000 graphical output can go either to the screen or to disk files, and that is true for program focplt built using the SAC library. The disk files are in Sac Graphics Format (SGF). The ./utils subdirectory in the SAC2000 distribution contains sources for programs which can be built to manipulate SGF files or convert them to other formats my sgfp and sgf2ps are based on earleir versions of these programs. As is described in the Graphics Output section on the SAC2000 Web site, one can also use calls to subroutines in the library to create SGF-format files, which is what I have done. The required library can be obtained from the SAC2000 authors, and I have included the Sun Solaris library and Sun Sunos libraries in the executables packages. I have written a set of subroutines which can produce plot files in SGF (SAC) format which do not require the SAC library. The subrountines are in subdirectory ./fmplotsub_nosac/ and (on a UNIX system) can be built using the Makefile in that directory. The library is put in .lib. To compile focplt, one goes to subdirectory ./src/ and enters the command clp_nosac focplt which should produce an executable in ./bin/. The objective is to make a program which is platform independent, so it cannot produce screen images directly (which the SAC-based routines can do). The output plot file has the default name temp.sgf. Program sgf2ps can be built (hopefully on most operating systems) to produce a PostScript file. If the user has ghostscript and epstool, he or she can run sgf2eps to produce an EPS file. See the event README files for further discussion about the plot creating, conversion, and display programs. If one wants to do anything fancy with the title or labels in plots, one has to know how to create the appropriate fonts or symbols. Instructions are included in file symbol.html. Program symdemo creates a plot which demonstrates the capabilities of the symbol subroutine. Click here for a PDF version of this plot. (Program symdemo is also good for testing the plot library.)

The iasp91 Velocity Model and Travel-time Tables

3 de 4

5/11/2011 10:43


For calculating focal mechanisms from polarities, one needs station-based azimuths and take-off angles for each phase from the source, and if one uses amplitude ratio data, one needs in addition the emergence angles to do free surface corrections, and, if a correction for attenuation is to be used, the travel times for the phases used. These data are generally provided along with the event locations from a program such as hypoellipse. Program hypo2foc, which is included, can convert hypoellipse output into focmec input. Alternatively, one could enter the data by hand, using the focmec input-file format. This package contains three additional programs to assist in the preparation of focmec input files. The first, fileprep, takes as its input a hypocenter plus a list of stations for which it calculates epicentral distances and azimuths. Using the iasp91 velocity model and travel-time tables (Kennett & Engdahl, 1991), it calculates take-off and emergence angles for both P and S as well as first-arrival P and S arrival times. (For information only, the iasp91 v-z model is provided. In August 2001, the author learned that this file was not needed to get the take-off and emergence angles.) The output file is one line per station, which is then read by the companion program fmecprep. Program fmecprep also reads an event-specific file with one line for each polarity or ratio. For polarities, it reads in the station name and the polarity-ratio key. For a ratio, the line has the station, the key, and either two or six numbers separated by commas the numerator and denominator amplitudes plus (if used) attenuation data in the form Qnum, Qden, freqnum, freqden, where the freq terms are the frequencies at which the amplitudes were determined. (If an amplitude for SV is used, fmecprep assumes it is from the radial component. If it was measured on the vertical, it must be converted: program freesurf is one way to calculate the correction term.) The output of fmecprep is a file which can be used as the data input file for program focmec. For an example, see the scripts and files in directory ./sample_runs/sakhalin/. Another program, used for the eastern Tennessee event sample runs in ./sample_runs/ETNEvent/, is program hypo2foc, which takes input from a hypoellipse (earthquake location program) output file for P-wave polarities for a set of events and makes FOCMEC input files for each event. Directory ./iasp91stuff/ has a makefile and the sources needed to create the library libiasp.a which contains the needed routines to read the travel-time tables. These subroutines are also used to create the binary files, but the source code for those programs is not included, just the binary files: ./iasp91stuff/IASP91.hed and ./iasp91stuff/IASP91.tbl. The library is placed in directory ./lib/. These are binary files written using the Unix convention for byte order and unformatted sequential file format. One cannot use these files on a PC, one must build them on a PC using the same compiler as used to build fileprep. For a more complete discussion on the iasp91 package, look at my write-up on program hypotable.

4 de 4

5/11/2011 10:43