contents

read_jb

Called by:  read_ttime

Includes:   iscloc.h, jb_model.h, jb_tables.h

Input arguments:
Depth of current solution.
Pointer to a phase structure.

Structure members updated:   ttime, dtdh, and dtdd in the phase structure.

Calls:   ps_g, ps_star, ps_crust, ps_short, ps, pdiff, other_phase all in the same file.

Return:   0/1/2 for success/failure/warning.

This function selects which function to call to read the Jeffreys - Bullen tables for a given phase and enters the values returned by this function for travel time and derivatives into the phase structure.  For a P or S wave there are 3 possible functions: ps_short, if delta is less than 1.3 degrees, ps_crust, if the source is above the Moho and ps for anything else.  Otherwise the function used depends solely on the phase being considered.


ps

Called by:  read_jb

Includes:   iscloc.h, jb_model.h, jb_tables.h

Input arguments:
Pointer to a structure with the correct travel time table.  (Could be P, S, PKP, or SKS table)
Distance between station and source in degrees. 
Depth of current solution. 
Pointers to variables for returning travel time, dt/dh and dt/dd.

Calls:
Function fill_matrix from this file.
Functions interpol and int_diff from this file.

Return:   0 / 1 / 2  for success / failure / warning.

This function looks up the travel time table identified by its first argument.  It retrieves a 3x3 matrix of values from the table surrounding the given distance and source depth and then carries out an interpolation to get the required ttime and derivatives.


ps_crust

Called by:  read_jb

Includes:   iscloc.h, jb_model.h, jb_tables.h

Input arguments:
A single character, either P or S
Distance between station and source in degrees. 
Depth of current solution. 
Pointers to variables for returning travel time, dt/dh and dt/dd.

Calls: Functions interpol and int_diff from this file.

Return:   0/1  for success/failure.
This function looks up travel time tables for a source above the Moho.  Because Pg/Sg and Pb/Sb times are found using other functions this function is used for either Pn/Sn or P or S phases when delta is greater than 8 or 10 degrees.  Travel times are read from the tables for the 3 columns of the top row surrounding the required delta. These times are then interpolated and the resulting travel time and derivatives corrected for the real source depth.


ps_short

Called by:  read_jb

Includes:   iscloc.h, jb_model.h, jb_tables.h

Input arguments:
Pointer to a structure with the correct travel time table.  (Could be P short or S short)
Distance between station and source in degrees. 
Depth of current solution. 
Pointers to variables for returning travel time, dt/dh and dt/dd.

Calls: Functions interpol and int_diff from this file.

Return:   0/1  for success/failure.

This function looks up  the 'Short Epicentral Distances' tables to get the 9 travel times surrounding the given distance and source depth.  These values are then interpolated to get the required travel time and derivatives.


ps_g

Called by:  read_jb

Includes:   iscloc.h, jb_model.h, jb_tables.h

Input arguments:
A single character, either P or S
Distance between station and source in degrees. 
Depth of current solution. 
Pointers to variables for returning travel time, dt/dh and dt/dd.

Return:   0/1  for success/failure.

This function calculates the travel time and derivatives for a Pg or Sg phase in the upper crust using the velocities stored in jb_model.h.


ps_star

Called by:  read_jb

Includes:   iscloc.h, jb_model.h, jb_tables.h

Input arguments:
A single character, either P or S
Distance between station and source in degrees. 
Depth of current solution. 
Pointers to variables for returning travel time, dt/dh and dt/dd.

Return:   0/1  for success/failure.

This function calculates the travel time and derivatives for a Pb or Sb phase.  If the source is above the Conrad then the velocities stored in jb_model.h are used to calculate the travel time for the head wave.  If the source is in the lower crust then the point where the ray crosses the Conrad is found by iterating to find the smallest possible travel time.


pdiff

Called by:  read_jb

Includes:   iscloc.h, jb_model.h, jb_tables.h

Input arguments:
Pointer to structure with P travel time table 
Distance between station and source in degrees. 
Depth of current solution. 
Pointer to variable for returning travel time.  (no derivatives)

Return:   0/1  for success/failure.

This function calculates diffracted P travel times using the final row of the P table as a starting point and adding 4.4 seconds per degree over that.


other_phase

Called by:  read_jb

Includes:   iscloc.h, jb_model.h, jb_tables.h

Input arguments:
Pointer to structure with a surface focus travel time table.
Distance between station and source in degrees. 
Depth of current solution. 
Pointer to variable for returning travel time (no derivatives)

Return:   0/1  for success/failure.

This function is used to return a travel time for such phases as PcP, ScS, PP, SS etc.  First it looks up the surface focus table that is identified by its first argument to get a travel time as if the source were at the surface.  It then corrects for the actual depth using a depth allowance table, the pointer to which is stored in the first table structure.


jb_pP_P

Called by:  read_pP_P

Includes:   iscloc.h, jb_model.h, jb_tables.h

Input arguments:
Distance between station and source in degrees. 
Depth of current solution. 
Pointer to variables for returning difference in travel times and dt/dh

Calls: Functions interpol and int_diff from this file.

Return:   0/1  for success/failure.

This function looks up the Jeffreys - Bullen table for the difference in arrival times between P and pP.  It interpolates values either side of the given depth and delta to get the required time difference and derivative, which are passed back to the calling function using the pointers passed as arguments.


interpol

Called by:  ps, ps_crust, ps_short, jb_pP_P

Includes:   iscloc.h, jb_model.h, jb_tables.h

Input arguments:
Fraction of table interval. 
3 table entries either side of value being looked up.

Return:   Interpolated value.

This function carries out Newton Gregory interpolation from three points.


int_diff

Called by:  ps, ps_crust, ps_short, jb_pP_P

Includes:   iscloc.h, jb_model.h, jb_tables.h

Input arguments:
Fraction of table interval. 
3 table entries either side of value being looked up.

Return:   Interpolated difference.

This function carries out Newton Gregory difference interpolation from three points.