A program and library for calculating seismomagnetic field, i.e. geomagnetic field change caused by earthquake due to piezomagnetic effect.
This package contains library for calculating seismomagnetic field due to a vertical or inclined rectangular fault located inside magnetized perfectly-elastic half space. Using this library, you can calculate seismomagnetic field easily, and any fault strike angle, dip angle and all types of fault motion, strike-slip, dip-slip and tensile-opening are available for this library.
Run the following commands on the top source directry:
$ ./autogen.sh
$ ./configure
$ make
$ make install
By above, shared library (libpiezomag.so) is installed in your system. By default, this library and relevant files, such as include files, are installed under /usr/local. To change this, specify prefix as follows:
$ ./configure --prefix=hoge
This library provides the following public functions:
bool
fread_params (FILE *fp, fault_params *fault, magnetic_params *mag);
This function reads parameter file and store user-defined parameters to the following pre-allocated structures:
fault_params *fault:
structure which stores fault parameters.
magnetic_params *mag:
structure which stores crustal magnetic properties.
For the details of the members of above structures, see "include/piezomag.h", and for the details of the parameter file, see "work/example_params.data" (an example of parameter file).
These structures are allocated by the following functions, respectivly:
fault_params *fault_params_alloc (void)
magnetic_params *magnetic_params_alloc (void)
bool
seismomagnetic_field_term (MagComp component, SeismoMagTerm term,
const fault_params *fault, const magnetic_params *mag,
double xobs, double yobs, double zobs, double *val);
This function calculates the seismomagnetic field on obervation point
(xobs(NS), yobs(EW), zobs(DownUp))
.
MagComp component
specifies the output magnetic component
and it takes the following values:
typedef enum {
MAG_COMP_F = 0, // total force
MAG_COMP_X = 1, // x(NS) component
MAG_COMP_Y = 2, // y(EW) component
MAG_COMP_Z = 3, // z(DownUp) component
} MagComp;
SeismoMagTerm term
specifies the output seismomagnetic term:
typedef enum {
SEISMO_MAG_MAIN = 1 << 0, // main term (0)
SEISMO_MAG_MIRROR = 1 << 1, // mirror image (H0)
SEISMO_MAG_SUBMIRROR = 1 << 2, // sub-mirror image(HI, HIII or HII)
// total seismomagnetic field (0 + H0 + (HI, HIII or HII))
SEISMO_MAG_TOTAL = SEISMO_MAG_MAIN | SEISMO_MAG_MIRROR | SEISMO_MAG_SUBMIRROR
} SeismoMagTerm;
If obervation point is on the singular point, this function returns false
.
void
fprintf_seismomagnetic_field_term (FILE *stream,
MagComp component, SeismoMagTerm term,
const fault_params *fault, const magnetic_params *mag,
double xobs1, double xobs2, double dx,
double yobs1, double yobs2, double dy, double zobs);
This function calculates the seismomagnetic field on the grid x=[xobs1:dx:xobs2]
,
y=[yobs1:dy:yobs2]
and z=zobs
. If observation point is singular point,
result is not printed out. Output format is X(NS) Y(EW) VAL
.
bool
seismomagnetic_field (MagComp component,
const fault_params *fault, const magnetic_params *mag,
double xobs, double yobs, double zobs, double *val);
void
fprintf_seismomagnetic_field (FILE *stream,
MagComp component,
const fault_params *fault, const magnetic_params *mag,
double xobs1, double xobs2, double dx,
double yobs1, double yobs2, double dy, double zobs);
These are equivalent to the followings, respectively:
seismomagnetic_field_term (component, SEISMO_MAG_TOTAL, fault, mag,
xobs, yobs, zobs, &val);
fprintf_seismomagnetic_field_term (component, SEISMO_MAG_TOTAL, fault, mag,
xobs1, xobs2, dx, yobs1, yobs2, dy, zobs);
An example program "main/piez" is also contained in this package.
This prograrm calls the function fprintf_seismomagnetic_field ()
and outputs
seismomagnetic field on the grid of x=[xobs1:dx:xobs2]
, y=[yobs1:dy:yobs2]
and z=zobs
.
To run this program, do
$ ./main/piez -f <parameter file name> -r <xobs1/xobs2/yobs1/yobs2> -i <dx/dy>
-z <zobs> -o <output component: 0 = total force, 1 = X, 2 = Y and 3 = Z>
For more details, see "work/calcomp.sh" (an example script to run main/piez).
LGPL
M. Utsugi, Y. Nishida and Y. Sasai, Piezomagnetic potentials due to an inclined rectangular fault in a semi-infinite medium, Geophysical Journal International, Vol. 140, Issue 3, pp.479–492, 2000. DOI: 10.1046/j.1365-246X.2000.00953.x