TRABOX is a driver program for tracing rays through a 3-D mesh of velocities in Cartesian co-ordinates. All Two-point ray tracing is performed by calling the routine trac3d. One two-point ray is traced for each call to trac3d. The program was not originally designed for general distribution and is rather ugly in parts (especially the driver program trabox). The aim was to be versatile in the number and type of ray-tracing problems that could be dealt with from a simple input. The program has been added to and modified many times and some features of the code are obsolete (even some input parameters are ignored !). The following is a reasonably complete description all its features. The distribution also contains some example sets of input files to demonstrate the various modes of the program. The routine trac3d which performs all the actual ray tracing could, if necessary, be incorporated into another more problem specific program (if you are willing to try !). TRABOX is based on the algorithm described in Sambridge & Kennett (1990).

Left figure: Rays shot out at equal intervals in azimuth through a high contrast velocity model shown by colour shading. Right figure: Wavefronts determined by placing markers at equal travel

Velocity models

The velocity model is represented by a 3-D mesh of knots and uses a Cardinal spline interpolation (from Martin Smith). There are two options for the velocity model, either using two independent 3-D meshes of velocities separated by an irregular interface which can contain a velocity discontinuity or a single 3-D mesh with no interfaces.

Illustration of nodal mesh used in TRABOX. The interface is only used between mesh 1 and 2. As an alternative mesh 3 can be used without an interface. times along the rays in the previous figure.

Tracing rays

The driver program trabox is designed for a range of initial value and two-point ray tracing problems. The subroutine that does all the work (trac3d) always performs two point ray tracing until the desired target has been hit or some other termination criteria have been reached. The algorithm is of a shooting type which is not as efficient as most bending methods but far more versatile. While the program is designes to ray trace through a 3-D volume it can also be used for the 2-D case. An option is included to shoot rays at specific (regular) intervals in azimuth and declination.

For an alternative code which tracks seismic wavefronts throug heterogeneous velocity models and also calculates rays see the 3D Fast Marching package, also available through ilab.


The TRABOX code is written in FORTRAN 77, and should run on most computers that have access to a fortran compiler such as g77. The complete source code, a detailed manual and example input files, can be downloaded here. You will need to register with iEarth prior to download. The manual can be viewed separately here. Enquires should be directed to the author.


    Boundary value ray-tracing in a heterogeneous medium: a simple and versatile algorithm , Sambridge, M.S. and Kennett, B.L.N Geophys. J. Int., 101 , 157-168, 1990. doi:10.1111/j.1365-246X.1990.tb00765.x