Main Page Class Hierarchy Compound List File List Compound Members File Members

# earthworm_defs.h

Go to the documentation of this file.

    00001 /*
    00002  *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE
    00003  *   CHECKED IT OUT USING THE COMMAND CHECKOUT.
    00004  *
    00005  *    $Id: earthworm__defs_8h-source.html 2161 2006-05-19 16:55:03Z paulf $
    00006  *
    00007  *    Revision history:
    00008  *     $Log$
    00008  *     Revision 1.1  2006/05/19 16:55:01  paulf
    00008  *     first inclusion
    00008  *
    00009  *     Revision 1.2  2001/07/14 06:44:45  davidk
    00010  *     added definition for EW_WARNING.
    00011  *
    00012  *     Revision 1.1  2001/04/06 21:03:30  davidk
    00013  *     Initial revision
    00014  *
    00015  *
    00016  ************************************************************/
    00017
    00018 #ifndef EARTHWORM_DEFS_H
    00019 # define EARTHWORM_DEFS_H
    00020
    00021 /* Define unique port numbers for interprocess communications
    00022  ************************************************************/
    00023 #define WAVE_SERVER_PORT  16022    /* for requesting/receiving trace data */
    00024
    00025
    00026 /* Define error words (2-bytes; >9999) global to earthworm modules
    00027    Values 0-9999 are available for private error definitions within modules
    00028  **************************************************************************/
    00029 #define ERR_LAPPED      10000    /* data loss; overwritten in transport ring */
    00030 #define ERR_SEQGAP      10001    /* data loss; sequence gap in msgs received */
    00031 #define ERR_OVERFLOW    10002    /* data transfer failed; allocated space at */
    00032                                  /* target address exceeded                  */
    00033 #define ERR_UNTRACKED   10003    /* transport.h tracking limit exceeded      */
    00034
    00035
    00036 /* Define global error codes
    00037  ****************************/
    00038 #define     EW_SUCCESS         1
    00039 #define     EW_FAILURE         0
    00040 #define     EW_WARNING         2
    00041
    00042 #define     TRUE               1
    00043 #define     FALSE              0
    00044
    00045 /* Define other global values
    00046  ****************************/
    00047 #define     TM_YEAR_CORR    1900
    00050 /* Set limits on certain things
    00051  ******************************/
    00052
    00053 /*
    00054  * Limits on the number of phases: we want to limit the number
    00055  * of phases used in hypoinvese solutions to 250.
    00056  * Our DB can handle much larger events, so we have the second
    00057  * set of constants to accomodate the database
    00058  */
    00059 #define MAX_PHS_PER_EQ    250     /* set the maximum #phases to include */
    00060                                       /* when processing an earthquake      */
    00061                                       /* with hypoinverse                   */
    00062 #define MAX_BYTES_PER_EQ  (450+225*(MAX_PHS_PER_EQ))
    00063                                  /* generous maximum size of a Hypoinverse   */
    00064                                  /* archive message based on Fred Klein's    */
    00065                                  /* "shadow.doc" file dated March 12, 1997   */
    00066 #define MAX_TRIG_BYTES          MAX_BYTES_PER_EQ
    00067
    00068
    00069 #define DB_MAX_PHS_PER_EQ    1000    /* max # phases for any event in the DB */
    00070 #define DB_MAX_BYTES_PER_EQ  (450+225*(DB_MAX_PHS_PER_EQ))
    00071 #define DB_MAX_TRIG_BYTES       DB_MAX_BYTES_PER_EQ
    00072
    00073
    00074 #define AUTHOR_FIELD_SIZE 50    /* Used in trigger message. Alex 6/16/98 */
    00075 #define EVENTID_SIZE 50         /* Used in trigger message. Alex 1/19/00 */
    00076
    00077 #define MAX_SUBNET_LEN  10      /* Used in carlsubtrig. Carol 3/21/01 */
    00078
    00079 #define MAX_DIR_LEN 150         /* Max path length for directories, etc */
    00080
    00081 #define MAX_EMAIL_MSG_SIZE   32000
    00082 #define MAX_MSG_PREFIX_SIZE  256
    00083
    00084 /* Hardcode lengths of module, installation, type, and ring strings */
    00085 #define MAX_MOD_STR             32      /* max length of module names */
    00086 #define MAX_INST_STR            32      /* max length of installation ids */
    00087 #define MAX_RING_STR            32      /* max length of ring names */
    00088 #define MAX_TYPE_STR            32      /* max length of message types */
    00089
    00090
    00091
    00092 /* GLOBAL MAGNITUDE DEFINITIONS */
    00093
    00094 #define MAG_NULL       -1
    00095
    00096 /* Mag type integers and corresponding character string names
    00097 *************************************************************/
    00098 /*
    00099  * This is the official table of magnitude numbers and names. The
    00100  * mag message contains both the number and the name. The name is
    00101  * included for human readability purposes. The number is what counts.
    00102  * For safety purposes, 0 is not a legal name.
    00103  *
    00104  * IMPORTANT: Since the database uses the number to determine
    00105  * magnitude types, it is essential to keep constant the order of
    00106  * the magnitudes in the MagNames array, as well as the mappings
    00107  * between strings and numbers. Any new mappings should be appended
    00108  * to the end. Whenever a new mag type is added to the array, the
    00109  * corresponding update should be made to the DB population script
    00110  * SCHEMA_DIR/src/core_schema/sql_scripts/ewdb_population_scripts.sql.
    00111  *
    00112  */
    00113
    00114 #define MAGTYPE_UNDEFINED        0
    00115 #define MAGTYPE_LOCAL_PEAK2PEAK  1
    00116 #define MAGTYPE_MOMENT           2
    00117 #define MAGTYPE_BODYWAVE         3
    00118 #define MAGTYPE_SURFACEWAVE      4
    00119 #define MAGTYPE_SCALAR_MOMENT    5
    00120 #define MAGTYPE_DURATION         6
    00121 #define MAGTYPE_LOCAL_ZERO2PEAK  7
    00122 #define MAGTYPE_MBLG             8
    00123
    00124 #define MAGTYPE_COUNT            9  /* one higher that last item in prev list */
    00125
    00126 static char* MagNames[MAGTYPE_COUNT] =
    00127 {
    00128    "??"    /* 0 */
    00129  , "ML"    /* 1 -- "Utah" method for computing Mls */
    00130  , "Mw"    /* 2 */
    00131  , "Mb"    /* 3 */
    00132  , "Ms"    /* 4 */
    00133  , "Mwp"   /* 5 -- from IDPP */
    00134  , "Md"    /* 6 */
    00135  , "ML"    /* 7 -- "Richter" method for computing Mls  */
    00136  , "mblg"  /* 8 */
    00137 };
    00138
    00139 /* For backwards compatibility */
    00140
    00141 #define N_MAG_NAMES  MAGTYPE_COUNT
    00142
    00143
    00144
    00145 /* GLOBAL AMPLITUDE DEFINITIONS */
    00146
    00147 typedef short AMPLITUDE_TYPE;
    00148
    00149 #define AMPTYPE_NONE  0 /* invalid or unknown ('?') */
    00150 #define AMPTYPE_ML    1
    00151 #define AMPTYPE_MB    2
    00152 #define AMPTYPE_MBLG  3
    00153 #define AMPTYPE_MWP   4 /* from idpp */
    00154 #define AMPTYPE_MS    5
    00155
    00156 #define AMPTYPE_COUNT (AMPLITUDE_TYPE)6 /* count of valid types */
    00157
    00158
    00159 static const char * AMPLITUDE_NAMES[AMPTYPE_COUNT] =
    00160 {
    00161     "?"
    00162   , "ML"
    00163   , "mb"
    00164   , "mblg"
    00165   , "Mwp"
    00166   , "MS"
    00167 };
    00168
    00169 #endif /* EARTHWORM_DEFS_H */
    00170