Search:
wiki:hyp2000_mgr
Last modified 15 months ago Last modified on 06/04/12 13:18:08

# Earthworm Module: hyp2000_mgr

Contributed by: Fred Klein, at USGS Menlo Park

## Function

Relocates earthquakes using Hypoinverse (tail of mega-module)

## Details

Hyp2000_mgr is an Earthworm program which calls an encapsulated version of hypoinverse (hyp2000), written by Fred Klein, at USGS Menlo Park. Hyp2000_mgr gets "arc messages", containing associated picks, via a pipe from another program. Hyp2000_mgr call hyp2000 with the contents of the "arc message". Hyp2000 locates the event. Hyp2000_mgr then creates a new "arc message" with the location results from hyp2000 and sends that arc message to an Earthworm transport ring.

Hyp2000_mgr is written in C, but most calculations are performed in FORTRAN subroutines, taken from the standard release of hypoinverse. Minor changes to the source code are required for the program to run on different operating systems.

Be sure and look at the command web page for details about how Location codes are now used.

Official hypoinverse, version 1.3, code and documentation are available here: ​ftp://ehzftp.wr.usgs.gov/klein/hyp1.3 The older hypoinverse version 1.2 code and documentation are available here: ​ftp://ehzftp.wr.usgs.gov/klein/hyp2000

### IMPORTANT NOTE ON LOCATION CODES

(EW v7.0 or greater):

Here is a very important change for hyp2000 for Earthworm v7.0 and greater. With Location codes, you need to provide 5 values for the LET command! If you only provide 3 in windows, the program will crash:

Here's what hyp2000 does now with LET:

    ncss3> hyp2000
     HYPOINVERSE 2000 STARTING
     9/2005 VERSION (DUAL LOCATION CODES)
     COMMAND? let
     NUMBER OF LETTERS TO CHECK IN STATION SITE CODE (2-5) [cr = 4]?
     NUMBER OF LETTERS TO CHECK IN STATION NET CODE (0-2) [cr = 0]?
     NO. OF LETTERS TO CHECK IN STATION COMPONENT CODE (0-3) [cr = 0]?
     NO. OF LETS TO CHECK IN LOCATION CODE IN PHASE FILES (0-2) [cr = 0]?
     NO. OF LETS TO CHECK IN LOCATION CODE IN OTHER FILES (0-2) [cr = 0]?

So some good LET commands would be:

    LET 5 2 3 2 2    # if you're using location codes
    LET 5 2 3 0 0    # if you're NOT using location codes

## Configuration File Commands

### EXAMPLE CONFIGURATION FILE

     #
    #               hypo_mgr's Configuration File
    #
    MyModuleId MOD_EQPROC   # module id to label outgoing messages with.
                            # Note: hypo_mgr is part of a mega-module which is
                            # ultimately started by the program eqproc.  All
                            # child processes of this mega-module need to use the
                            # same module id (thus use eqproc's module id).
    RingName   HYPO_RING    # The transport ring to write output to,
    LogFile    2            # 0=no log; 1=errors; 2=errors & hypocenters
    SourceCode W            # character to label summary cards with to
                            # identify them as coming from Earthworm

### HYPO_MGR COMMAND LINE ARGUMENTS

An example command line to start hypo_mgr may look like this:

    	hypo_mgr hypo_mgr.d ncal.hyp
    	argv[0]  argv[1]    argv[2]

     * argv[0] is the name of the executable.

     * argv[1] is the name of hypo_mgr's own configuration file which it reads on startup.
    In this file, lines may begin with a valid hypo_mgr command, described later in this
    document, or with one of 2 special characters:

    #  marks the line as a comment (example: # This is a comment).

    @  allows control files to be nested; one control file can be
       accessed from another with the command "@" followed by
       a string representing the path name of the next control file
       (example: @model.d).

    Command names must be typed in the control file exactly as shown in this document (upper/lower case matters!).

     * argv[2] is the name of Hypoinverse's startup command file. hyp2000_mgr passes this file name to hyp2000,
    the fortran program which encapsulates the subroutine version of Hypoinverse. For a description of valid commands
    for this file, please see the following Hypoinverse documentation:

     Klein, F.W., 1989, User's guide to HYPOINVERSE, a program for VAX computers to solve for earthquake locations and
    magnitudes, U.S. Geological Survey Open-File Report 89-314, 58 pp.

### FUNCTIONAL COMMAND LISTING

Below are the commands recognized by hypo_mgr, grouped by the function they influence. All of the commands are required; they must be specified in the configuration file in order for hypo_mgr to operate.

    	Earthworm system setup:
     		MyModuleId	required
    		RingName	required

    	Output Control:
    		LogFile		required

    	Miscellaneous:
    		SourceCode	required

### ALPHABETIC COMMAND LISTING & DESCRIPTION

In the following section, all configuration file commands are listed in alphabetical order. Listed along with the command (bold-type) are its arguments (in red), the name of the subroutine that processes the command, and the function within the module that the command influences. A detailed description of the command and is also given. Default values and the values used by Calnet are listed after each command description.

The following list is organized by:

command [argument here]

LogFile [switch]
Processed by: hypo_mgr_config
Function: output

Sets the on-off switch for writing a log file to disk. If switch is 0, no log file will be written. If switch is non-zero, hypo_mgr will write daily log file(s) called hypo_mgrxx.log_yymmdd where xx is hypo_mgr's module id (set with "MyModuleId" command) and yymmdd is the current UTC date (ex: 960123) on the system clock. The file(s) will be written in the EW_LOG directory (environment variable). The level of output written to the file is controlled by the value of switch:

> switch = 0 no log file is written

> > 1 write errors to log file
> > 2 write errors and hypocenters to log file

> >     Default:  none

MyModuleId [mod_id]
Processed by: hypo_mgr_config
Function: Earthworm setup

Sets the module id for labeling all outgoing messages. mod_id is a character string (valid strings are listed in earthworm.d) that relates (in earthworm.d) to a unique single-byte number.

NOTE: hypo_mgr is part of a mega-module which is ultimately started by the program eqproc. All sub-modules of this megamodule should be given the same module id.

    Default:  none				Calnet:  MyModuleId MOD_EQPROC

RingName [ring]
Processed by: hypo_mgr_config
Function: Earthworm setup

Tells hypo_mgr which shared memory region to use for output. ring is a character string (valid strings are listed in earthworm.d) that relates (in earthworm.d) to a unique number for the key to the shared memory region.

    Default:  none				Calnet:  RingName HYPO_RING

SourceCode [label]
Processed by: hypo_mgr_config
Function: miscellaneous

Reads in a single character label to write in column 80 of the hypo71-format summary messages output by hypo_mgr. This label identifies the source of the hypocenter as the Earthworm system. These summary messages are placed on the output shared memory region.

    Default:  none				Calnet:  SourceCode W

## Helpful Hints

### Download in other formats:

- Plain Text