**** NOTE ******
This package reqires the NETCDF package which may be obtained from:

http://www.unidata.ucar.edu/packages/netcdf/

it also uses Ncview to view the resulting data files

http://meteora.ucsd.edu/~pierce/ncview_home_page.html

The library files (ar archives) originally in netcdf/lib have not
been included in line with the policy that CALGO does not provide
machine specific implementations of software.

All files of the form Test*.nc are binary and probably won't travel to a
Pc, even if the NETCDF packages were available on such platforms!! They
also screw up the shar file format used for public distribution -- they
have all been uuencoded.
****************

The C++ version, QSEHP5D, of Renka's Fortran interpolation code, QSHEPMD,
has been included along with a DATA file, netcdf include and lib 
subdirectories, netcdf files, and a Makefile.  This README file 
includes a description of changes made to the original code due to language 
differences and added enhancements. It also includes instructions on how 
to compile and run the code.  
The software, Ncview, is needed to view the resulting data files which are
in netcdf format (files are *.nc).  Ncview is public domain and can 
be downloaded from the following webpage:  
     http://meteora.ucsd.edu/~pierce/ncview_home_page.html

FILES INCLUDED:
  Makefile
  main.cc
  Interp.cc
  Interp.h
  Net.cc
  Net.h
  Time.h
  resource.h
  netcdf/include/*  - needed for netcdf file production from code.
  netcdf/lib/*      _   "     "    "     "        "       "    "
  input.5d - input file for doing real interpolation
  input.3d.test - input file for doing Test interpolation
  DATA.c - DATA file for real interpolation of 5D example.
  DATA.test - DATA file for TEST interpolation - 3D.
  Test11.nc - sample output netcdf binary file of true data set 
          for test function #1.
  Test12.nc - sample output netcdf binary file of interpolation 
          of test function #1
  Test21.nc - sample output netcdf binary file of true data set 
          for test function #2.
  Test22.nc - sample output netcdf binary file of interpolation 
          of test function #2
  Test31.nc - sample output netcdf binary file of true data set 
          for test function #3.
  Test32.nc - sample output netcdf binary file of interpolation 
          of test function #3
  Test41.nc - sample output netcdf binary file of true data set 
          for test function #4.
  Test42.nc - sample output netcdf binary file of interpolation 
          of test function #4
  Test51.nc - sample output netcdf binary file of true data set 
          for test function #5.
  Test52.nc - sample output netcdf binary file of interpolation 
          of test function #5

  Interp_view.4000.nc - output netcdf binary file of interpolation
          of 5D example using 4000 known nodes.
  Interp_view.complete.nc - netcdf file containing true data set of 
          5D example.  Used to compare to the interpolated set.

ENHANCEMENTS:
  1.  The C++ code allows the user to choose between the TEST interpolation (3D only)
      or not.  If not using Test functions, then the user can select the
      dimensions of interpolation (2D - 5D) and length and range of axes.
  2.  The C++ code creates a netcdf file where interpolation results can be
      stored and later viewed with Ncview.


CHANGES:
  1.  The Fortran code uses a lot of parameter passing with long lists of
      variables.  To help eliminate so many parameters, the C++ code declared
      most of those parameters along with global variables as class
      variables.
  2.  The subroutine, QSMTST3, in the Fortran code was used as the main driver for
      the subroutine, QSHEPM.  In the C++ version, the main duties of QSMTST3
      along with new duties are found in main(), Interpolation::Interpolation, and
      Interpolation::QSMTST3.
  3.  Vectors of 2D arrays are often passed as parameters in the Fortran code.
      Most of the arrays are class variables in the C++ version, so the index 
      of the start of the vector is passed, and pointers are then used to 
      access the array.
  4.  In order to preserve the Fortran array indexing, most arrays in the C++ code
      are indexed similarly (1->N vs. 0->N-1).  Therefore, the C++ arrays are
      always defined to be of length N+1.
  5.  Many arrays in Fortran were statically  declared as maximum size.  In C++
      the arrays were dynamically allocated whenever possible.
  6.  In C++, whenever the POW function was used for squaring, the code was changed
      as simple multiplication for efficiency.
  7.  Used the function, getrusage, for timing purpose in the C++ code.  Therefore,
      the include files, Time.h, and Resource.h, are included.
  8.  The Fortran code uses a lot of GO TO statements to break out of loops.  In
      order to avoid GO TO statements in the C++ code, conditional statements are
      used to determine if do-while and for-loops need to end prematurely.  If
      so, break is used in the for-loops, and the loop conditional variable is
      changed in the do-while loops.
  9.  Included only 5 of the original 6 Test functions in the C++ code.

DATA FILES:
  1.  To create the DATA files, a perl script was created to randomly select nodes
      to be used and assign coordinates to those nodes as well as the relevant 
      functional value of those nodes if the functional values can be determined. 
  
COMPILING and RUNNING:
  1.  The Makefile is included.  
      It uses local pathnames to needed netcdf include and lib files.
      The pathnames, INCDIRS and LIBDIRS,  need to be changed according 
      to the area where you install the interpolation software.  
      The netcdf/include and netcdf/lib are in this subdirectory.

  2.  To compile, just type make.

  3.  To run:
      a.  To run with direct input from user type, interpo.
      b.  To run using an input file type, interpo < inputfile
      c.  The DATA file must be included as well, and the DATA files will differ
          depending on whether true interpolation or test interpolation is
          being executed.  Examples of each are included.  DATA.c contains data
          for 5D interpolation using 4000 known nodes.  DATA.test contains data
          for 3D TEST interpolation starting with 4000 known nodes.  Note:
          the number of known nodes is the first number in the DATA files.
  4.  Upon completion:
      a. Test fxns - output goes to stdout.  Two netcdf files are created
         per test function (one file containing complete data set for that
         function and the other file containing the interpolated results).
         Test.11.nc is a true data set for function #1.  Test12.nc is the
         interpolated data set for function #1 using DATA.test.
      b. Real interpolation - output goes to stdout.  One netcdf file is
         created (interpolated results).  The file name is Interp_view.nc.
      c. The output includes echoing input parameters, dimensions, axes sizes,
         timings, and in the case of the TEST funs, errors found between
         the true sets and the interpolated sets.
