FOCMEC: Update HistoryJune 28, 2003: Added a .zip file with the libraries and executables for Red Hat Linux. Most recent small changes were made in sgf2ps.c. For creating postscript plot files one needs ghostscript and epstool. The iasp91 .hed and .tbl files are in the `/lib subdirectory. I have also made an executable for Hypoellipse which works on Linux. March 12, 2003: The author recently gained access to a PC running Red Hat Linux 8.0 and used the GNU g77 Fortran compiler to build the FOCMEC programs. For the graphics programs the SAC Linux Fortran library was used, and the libX11.a lives in a different directory. Small changes were made in a couple of subroutines -- mostly in the iasp91 parts -- to make the same code work on both systems. (Program dsretc has to have its OPEN statement changed to work on Linux right now.) January 6, 2003: Plot files without needing the SAC graphics package: I have written and tested (on Sun Solaris only) a modified set of subroutines which can produce an SGF-format plot file without using the SAC library, and the executables will be more portable as they can be built with the -Bstatic switch. Unlike the SAC routines, one gets only a disk file -- no terminal display. The output file is still in the unformatted SGF format, but the conversion programs to postscript which are based on sgf2ps.c look like they should not be system dependent. I will try to test this on PC/Linux, but have not done it as of this writing. To use this feature, go to subroutine fmplotsub_nosac and enter "make" (no quotes). To build program focplt, go to subdirectory src and enter "clp_nosac focplt" which should create a focplt binary and put it in subdirectory bin. The scripts for running focplt must be modified as one is not asked for choices for the plot output (screen, named disk file, temp.sgf disk file) as the program is hard wired to create a disk file named temp.sgf. September 12, 2002: The comment lines in fmecprep.f implied that files were read in the opposite order from the way they are so I fixed that. (the first file read in is the output from fileprep, the second is a stripped-down Focmec input file. Also, in the Appendix in focmec.pdf describing the input polarity format, there were questions about the directions which is hopefully cleared up with some rewording. The biggest problem comes from the fact that "C" stands for "Compression" which means up on the vertical which in fact corresponds to dilatation at the source. September 10, 2002: Corrected some typos in focmec.pdf and added a "beachball" figure and discussion in Appendix B. late July 2002: I had not paid adequate attention to the problems of using SV polarities and amplitudes near or above the critical emergence angle. I have added an appendix in focmec.pdf and put in caveats in programs fmecprep and freesurf to address this. The bottom line is that one should use SV near or above the critical angle only with great care. 5 July 2002: Some compilers do not like the way I had used CVALUE -- CVALUE(1:NFILE) with NFILE defined on the right-hand side. I also made other I/O routines less compiler dependent. 30 May 2002: Bug fix: I had forgotten to modify a subroutine for program focplt (solplt.f) taking into account a change in subroutine fmreps.f made in March. Only program focplt was affected. March 2002: Emergent polarity picks can now be used in Focmec if the user so chooses. Previously they could only be displayed in Focplt plots. March 2002: Added an option to program dsretc so that one could use moment-tensor input (CMT convention). It is an adaptation of Bob Herrmann's programs mteig and mtdec. Instead of using Numerical Recipes subroutine, I used the original EISPACK versions. October 2001: Code was changed slightly in several subroutines to increase compatibility among various compilers. September 2001: Using Microsoft Fortran 4.0 Powerstation, I was able to create the unformatted sequential file iasp91.hed and direct access iasp91.tbl whcih could then be read by a revised version of fileprepL.f. (I found that the unformatted, sequential access file could be read only by programs built using the same PC compiler as was used to create the file.) All this was done using Virtual PC v3 on a Mac G4 running OS9.) August 2001: Alexey A. Lyubushin, Dr.Sci., United Institute of the Physics of the Earth, Russian Academy of Sciences, Moscow, created PC executables of all but the plotting program focplt and program fileprep in the FOCMEC programs. The programs compiled and ran on both Digital Visual Fortran under MS Windows-98 and GNU g77 under PC Solaris 5.8. These have not been exhaustively tested. 3 August 2001: When building the fmsub library, one user reported that FOCMEC.INC was empty. It had been a soft link to ../src/FOCMEC.INC. I replaced the link with a direct copy. 28 July 2001: Added source and (Solaris) executable for a program to create a Focmec input file from Hypoellipse output. (hypo2foc) 21 July 2001: Program radiat wrote out the wrong SH sign convention as a comment to output. Now it says positive is left, back to source (not station). Only comment was wrong. The radiation figure in Appendix B of focmec.pdf had arrows pointing the wrong way for the SH polarity. That has been fixed. No code was affected. 26 May 2001: Some had problems with Fortran function value.f, so changed it slightly. Also took out PARAMETER(tab,char(9)) in two functions as that was not recognized by some compilers. December 2000: The author no longer has a machine running sunos, so the executables for that platform will not be updated after this date. April 2000: Replaced the examples from previous versions with two new examples: one for a P polarities only from a regionally recorded event in eastern Tennessee, and the other for the teleseismically recorded 1990 deep-focus Sakhalin Island deep-focus event. These can be found in directory sample_runs. This was part of a preparation of the package to appear as a subchapter in the IASPEI centennial handbook. 28 July 1998: For solaris 2 I had not been able to create or overwrite plot files. Found the problem: subroutine zopenc.c in the SAC library. Not clear why it ever worked. Patch is described in file sacfix.html. 27 July 1998: In test_runs/blaeqk.dat, the comments part of the entries for the ratios input data imply ratois which are not corrent. These are not used, but they are misleading. The similar comments in test_runs/e393.dat are okay in that they lead to ratios which are consistent with the entries. 19 July 1997: Compiled/linked programs for solaris 2.5.1 (sun). Only changes required were in the compile-link scripts -- leaving out the -Bstatic switch and, in ~/src/cl_plot_src, leaving out three plot libraries which do not exist in solaris 2. Used the sac solaris 2 library (gotten by ftp from LLNL). 27 February 1997: If numerator is near nodal surface, now returns correct sign in TOP. Change is in subroutine lratio.f 7 January 1997: Corrected an error in lratio.f for solutions near a nodal surface for either the numerator or the denominator but not both. Previously the ratio returned was not updated for such cases, so was what had been found in the previous call. 3 August 1993: Changed rules for nodal surfaces with ratios. Now have separate CUTP and CUTS for lower bounds of radiation factors. No more "FACTOR". If numberator or denominator is near the nodal surface, use cutoff value when calculating ratio. If both are near, still treat it as indeterminate and do not count towards error total. Some changes in output format. See oksol.f for details. 20 June 1993: Corrected an error in focinp.f which kept the option for separate P and S polarity error limits from working correctly. Also put in a "belts and braces" addition so that if one use the V, H, or S key for ratios bu did not put in the S angle, it would not come out as zero. Made cosmetic changes to a couple of other subroutines. 15 May 1992: Corrected an error in OKSOL, changed name of listing file from lp.lst to focmec.lst 28 August 1991: sun version including SV polarities and SV/SH ratios 9 July 1990: Put in limits for the range of ratios to be tested to allow for near-nodal solutions. Routines affected are FOCINP, OKSOL, OKRAT, LSPRAT, and FOCMEC.INC. Also, took out the fancy calculating for 0/0 in ratios. It's nice theoretically, but not for comparisons with data. Also, took out Kisslinger's last-squares adjustment for the solution involving ratios as, as written, it did not take into account polarities and tended to confuse more than help. In FOCPLT (the companion plotting program), the ratio ranges required a change in the input for SOLPLT. PRPLOT also had cosmetic changes. 22 February 1990: Changed an2dsr, v2trpl, oksol to include "weird" cases correctly (although there were no errors before). Replaced DPSTRK with AN2DSR in OKSOL. COMMENTS UPDATE 16 OCTOBER 1989 Code was originally written in Fortran 77 for a PDP 11/34 operating under RSX version 4.1. The version here is in Fortran 77 for a VAX (VMS) In addition to the include file FOCMEC.INC, subroutines from two source libraries are used, FMLIB.OLB and GENSUB.OLB. To build these libraries and to link FOCMEC along with the other programs in the package, use the command file BUILD.COM Subroutines in GENSUB used in FOCMEC are BELL, CVALUE, IYESNO, LENC, PRINT, PRINTX, TIMDAT, TRUTH, and VALUE (entries RVALUE and IVALUE) Subroutines in FMLIB used in FOCMEC are ANTPIN, AN2DSR, AN2MOM, DPSTRK, DSRIN, FLTSOL, FMLSQ, FMREPS, FOCINP, GMPRD, LSPRAT, OKPOL, OKRAT, OKSOL, SRCHFM, STTIST, TA2XY, TRPL2V, and V2TRPL Digital F77 routines include: SECNDS, OPEN, ASSIGN, CLOSE, TIME, DATE END OF COMMENTS UPDATE 16 OCTOBER 1989 12 October 1989: Cleaned up code to make a little less dependent on VAX. The subroutines are now in three large files, FMLIB.FOR, GENSUB.FOR, and PLOTSUB.FOR. FMLIB contains all subroutines which have little or no system dependence - including a large SYMBOL routine. Not all subroutines are for FOCMEC, which has no plotting, for example. The subroutines are for FMECPREP, FOCPLT, SOLSORT and SVPRAT as well. GENSUB has some "primitives" which may have some system dependence. One new feature here is that if the program is run from a command file, such as RUNFOCMEC.COM, one can put a comment on the same line as the entry if a tab is used as a delimiter or a space is used if the input is not character data. The convention for defaults in prompted input is to use [] to enclose the entry. Default means one responds with a carriage return from a terminal or a null entry or tab from a command file. PLOTSUB contains my versions of PLOTS and PLOT, which, while calcomp compatible in calling arguments, are tailored to my personal conventions for disk file formats and a restricted set of terminals. If your own plot library is linked BEFORE the other files, you should be able to use FOCPLT with little modification. To build the programs, simply enter @BUILD. The command file makes libraries and links all the programs. If you want only a subset of the programs, you can edit BUILD.COM accordingly. 2 September 1986: Changed SRCHFM so that sort of focal sphere is more nearly equal area (thanks to Tim Long and Rick Williams for noting that it was not). Also tried to make things more standard FORTRAN 77 by getting rid of BYTE variables and replacing READ and WRITE to unit 5 with ACCEPT and TYPE. 10 June 1986: in LSPRAT fixed case for when both numerator and denominator in S/P ratio are zero 16 January 1986: Tidied up FOCINP. Introduced the interactive functions RVALUE and IVALUE, which are now entries in VALUE. 6 October 1985: For the V and H S/P ratio input lines in FOCINP, added the S take-off angle as a separate entry. Previously just assumed it to be the same as the P angle. This results in a change in the input format so that old input files will not work. The R format (simple SV input) remains unchanged. 27 September 1985: Added a relative weighting option for polarities. If chosen, the total number of error is entered as before but as a real variable and a threshold weight is asked for. Each polarity error is weighted by the absolute value of the radiation factor or the threshold, whichever is larger. 12 August 1985: Added option of a total number of polarity errors rather than simply choosing numbers of P and S errors separately. Increased COMMENT field for ratio input to 20 and changed format statements accordingly. Replaced a DO loop in FOCINP with a GOTO loop so that emergent polarities do not count against total possible. 27 JULY 1985: Added SH polarity. For the key one enters < ir > (for left or right respectively) for first motion (back event). Also, added moment tensor representation to output in listing file (Dziewonski & Woodhouse convention, unit scalar moment) $ December 1984: Eliminated double solutions when plunge of B is 0 degrees. (Only allowed trend to vary between 0 and 180 degrees. This could affect searches for small parts of the focal sphere.) 23 October 1984: Added the possibility for using SH amplitudes instead of only SV on the vertical. Also, if the input line key is V (for SV) or H (for SH), the program expects to find a polarity for the S and a comment following the log(ratio). Entering R for the key will work as before: assumes the ratio is for SV on vertical and there is no polarity or comment. The output now includes the theoretical S polarity, but it does not use it in the search. Another small change which only acts to speed up the search is that for a B axis plunge of 90 degrees there is only one trend tried. The SH amplitude case has not been checked yet. Arthur Snoke Virginia Tech |