#ifndef KRAKEN_UTIL_DEF #define KRAKEN_UTIL_DEF #endif #ifndef RAM_UTIL_DEF #include "ram-util.h" #endif #define MODE_TITLE_LENGTH 81 #define DEPTH_JITTER 0.01 #define swap_long(x) \ ((unsigned long int)((((unsigned long int)(x) & 0x000000ffU) << 24) | \ (((unsigned long int)(x) & 0x0000ff00U) << 8) | \ (((unsigned long int)(x) & 0x00ff0000U) >> 8) | \ (((unsigned long int)(x) & 0xff000000U) >> 24))) typedef struct Modeheader { char *filename; int lrecl; char title[MODE_TITLE_LENGTH]; double freq; int nmedia; int ntot; int nmat; int *n; char **mater; char bctop; complex cpt, cst; float rhot, deptht; char bcbot; complex cpb, csb; float rhob, depthb; float *depth, *rho; int m; float *z; complex *ck, ktop2, kbot2, modfil; /* The following is for PRUFER */ int nfreq; double *f_array; double f_min, f_max, delta_f; double st_depth, end_depth, delta_z; } Modeheader; typedef struct Mode { int nrd; float *rd; int *ird; float *w; double freq; complex *ck; complex **phir; Modeheader *mhead; char *title; char *comp; char *filename; } Mode; void write_kraken_setup (FILE *, SVP *, double, double, double, double, double, double, double); Modeheader *read_kraken_mode_header (char *, char); int get_one_kraken_mode (int, Mode *, int *); complex read_fortran_scomplex (FILE *); int read_fortran_integer (FILE *, char); float read_fortran_float (FILE *); void extract_component (complex *, int *, char **, int, char *); complex pekrt (complex); Mode *read_all_kraken_modes (char *, float *, int, char *, char); int spline_modeshapes (int, int, double *, complex **, int, double *, complex **); void calc_greens_function (int, complex *, int, complex **, complex *, double, complex *);