contents

read_ttime

Called by:
calc_resid for each phase it decides to calculate a residual for.
Phase identification function [ id_jb ]
mark_duplicates

Includes:   iscloc.h,  model header file [ jb_model.h ]

External:  max_depth set here to communicate table specific value back to calc_resid

Input arguments:
Pointer to solution structure.
Pointer to phase structure.

Calls:
Appropriate function for model in use [ read_jb ]
correct_ttime
add_to_error from utils

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

This function is a wrapper designed to separate the model dependent function that looks up the relevant travel time tables, or whatever, from functions that need to know travel times.  It allows the Earth model in use to be changed without editing all such functions and, if need be, acts as the interface with functions in a different language such as Fortran.  It passes each phase it is given on to the appropriate function and passes back the return status (which in the case of read_jb includes a warning status.)  It also calls correct_ttime for each phase and would probably need to do this whatever the travel time function in use was.

The header file specific to the Earth model in use is included by this function so that it can set an external variable max_depth to be read by calc_resid and other functions.  This informs those functions of the greatest depth allowed for in the model in use and allows them to avoid error messages by not calling read_ttime if the current solution is too deep.