You need 3 files: testmodel3D.cc, model3Dlib.cc and model3Dlib.h. Given a model type and its model name (produced by Harvard), this program calculate its velocity perturbation (including 1st, 2nd partial derivatives) for given locations (latitude, longitude, and depth). Most people ask Harvard seismology group a program to calculate the velocity perturbation at given locations. Although this program meets this purpose, it "over-kills" everything. In fact, it can also calculate 1st, 2nd partial derivativs with respect to r, theta and phi which you need to calculate synthetic seismograms based on classic ray theory or Maslov theory. It is much more complicated to calculate 1st and 2nd order partial derivatives than velocity perturbations. It can also rotate the 3-D model to arbitrary Euler angles. This explains why the program is over 7,000 lines. If you only want to calculate velocity perturbations, you only need to call: dv2vonly(...). If you only want to calculate velocity perturbations and their 1st order derivatives, you only need to call: dv2v(...). If you only want to calculate velocity pertubations, their 1st order derivatives and their 2nd derivatives, you only need to call alldv2v(...). The 3-D model must be produced by Harvard seismology group. It supports only the following models: 8-Harvard S12WM13 or SKS12WM13 (file s12wm13.dat or sks12wm13.dat) 9-Harvard Spherical Spline Model (file s12wm13.XBS or sks12wm13.XBS, starting at Moho discontinuity) 10-Harvard Spline-Harmonics Mixed Whole Mantle Model (S16VB14) (s16vb14.dat) 11-Harvard Spline-Harmonics Mixed Split Model (S16U6L8) (s16u6l8.dat) 12-Harvard Chebchev Split mantle model (S20U7L5) (s20u7l5.dat). 13-Harvard Spherical Spline Model (reversed order in radial direction of type-9 model, starting at CMB): At this time (Feb., 1998), type-9 and type-13 models (they are equivalent) are not born yet. I expand the degree 12 models in terms of these kinds of models. I am sure that Harvard is going to publish this kind of model in the near future. You can distribute and modify this program as long as you keep the original comments made by Harvard seismology group. Very Technical: the program is written using C++ which is still the industry standard at this time. It has been tested by Sun C++ compiler 4.0. and GNU C++ compiler 2.6.3. Due to the incompatibility of GNU C++ 2.6.x and 2.7.x, you may have trouble compiling the code in GNU C++ 2.7.x. The orginal author has no access to the 2.7.x version which is the ANSI C++ standard. You need 3 files: this file, model3Dlib.cc and model3Dlib.h. To compile this command, type "CC testmodel3D.cc model3Dlib.cc -lm" in a UNIX platform. If you use GNU C++ compiler, try "g++ testmodel3D.cc model3Dlib.cc -lm" instead. IMPORTANT. As an industry convention, I disclaim that: No Liability. IN NO EVENT WILL HARVARD SEISMOLOGY GROUP OR THE ORIGINAL AUTHOR BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES HOWEVER CAUSED AND REGARDLESS OF THEORY OF LIABILITY ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF HARVARD SEISMOLOGY OR THE ORGINAL AUTHOR HAS BEEN ADVISED OF THE POSSIBLITY OF SUCH DAMAGES. X.-F. Liu, 1998. Any comments or feedback should be sent to Harvard seismology group, instead to the original author who has left Academia to make a living in the Street. ^_^ I recommend that you should contact either Yu Gu (gu@seismology.harvard.edu) or Professor Dziewonski (dziewons@seismology.harvard.edu).