contents

id_jb

Called by:   id_pha each iteration unless no_reid_phase set.

Includes:   iscloc.h, jb_model.h

External:   max_resid  set in read_config

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

Calls:
read_ttime
handle_error and add_to_error from utils

Structure members updated:  phase in phase structure.

Return:   0/1 for success/failure.

If the phase code given to an arrival is based purely on the reporters code for that arrival then it is likely that it will not be possible to calculate a residual for it using the required earth model.  This could either be because the reporter misidentified it or that they are using a different naming convention.  As the solution moves from iteration to iteration it is necessary to retest that the value of phase given to an arrival in id_pha is still consistent with delta, source depth and the earth model in use.

The distance limits of the JB tables for each type of phase are stored as macros in jb_model.h.  For non-crustal P type arrivals phase is chosen from P, Pdiff, and PKP depending on the value of delta and an S phase can be renamed SKS or vice versa.  If delta and source depth show that a phase is crustal then it can be more complicated.  If  phase is already a possible crustal phase (i.e. rep_phase is a possible crustal phase) then it will be left unchanged but if phase is P or S or an impossible crustal phase then read_ttime is called to find the travel times for all possible phases and the first arriving phase is assumed to be the correct one.