f90 module: libsplines-0.7 (double only) -- 29 Nov. 2002
(C) Édouard CANOT -- Edouard.Canot@univ-rennes.fr -- CNRS
[may be not up-to-date, see 'splines.F90']

DESCRIPTION:

"Cubic splines routines" library, which has three entry points:


- cub_spl:

  coefficients computation over a finite or periodic interval:
	* interpolation                   (without smoothing),
	* approximation                      (with smoothing),
  with boundary conditions of the following kinds:
        * first or second derivative with prescribed value, or null third
          derivative, (but only for interpolation over a finite interval)


- int_spl

  interpolation at any point (even out of the interval):
	* computation of the function value and/or its first
          and second derivatives
        * binary or incremental search, in forward or backward direction


- som_spl

  integral of the computed spline over a sub- or an over-interval

IMPLEMENTATION:

Program written in Fortran 90

Dynamic allocation

Systematic use of generic routine names

Optional arguments

Error trap and checking

===============================================================================

INTERFACE of driver routines:
 (precision: double)

Optional arguments are placed into brackets: [ ]

Error indicator:

     if err is not present, computation is aborted in case of error
     detection;

     if err is present, the routine returns an integer value:
       - err < 0: error detected
       - err > 0: warning detected
       - err = 0: no error, no warning

_______________________________________________________________________________

"cub_spl": cubic spline computation


 call cub_spl( x, y, y_sec,

              [k_beg], [BC_beg], [k_end], [BC_end],

              [weight], [y_fit], [period], [err] )


  arguments (mandatory):
            ^^^^^^^^^^^
  (in)  x: array of abscissas

  (in)  y: array of function values

  (out) y_sec: array of second derivatives


  arguments (optional):                            [default value]
            ^^^^^^^^^^
  (in)  k_beg: type of BC on first point           [ 2 ]    (1, 2 or 3)

  (in)  BC_beg: BC value on first point            [ 0.]

  (in)  k_end: type of BC on end point             [ 2 ]    (1, 2 or 3)

  (in)  BC_end: BC value on end point              [ 0.]

  (in)  weight: array of weights (for approximation, or smoothing)

  (out) y_fit: array of smoothed values

  (in)  period: logical for periodic BC            [.false.]

  (out) err: error indicator

Checking made:             (if not: Error)
----------------

     size(x) = size(y) = size(y_sec) >= 2   (except if period: 3)

     1 <= k_beg <= 2 (general case) (not yet !)
     1 <= k_end <= 2 (general case) (not yet !)

     if k_beg = 3, BC_beg must be zero
     if k_end = 3, BC_end must be zero

     if 'y_fit' is present, then 'weight' is mandatory

_______________________________________________________________________________

"int_spl": cubic spline interpolation


 call int_spl( x, y, y_sec, t,

              [y_0], [y_1], [y_2],

              [any_t], [period], [bin_search], [backward], [err] )


  arguments (mandatory):
            ^^^^^^^^^^^
  (in)  x: array of abscissas

  (in)  y: array of function values

  (in)  y_sec: array of second derivatives

  (in)  t: abscissa for interpolation


  arguments (optional):                            [default value]
            ^^^^^^^^^^
  (out) y_0: function value at 't'

  (out) y_1: first derivative at 't'

  (out) y_2: second derivative at 't'

  (in)  any_t: t is free                           [.false.]
               (i.e. out of array 'x')

  (in)  period: logical for periodic BC            [.false.]

  (in)  bin_search: binary search used             [.false.]
                     (default: incremental search)

  (in)  backward: direction for incremental search [.false.]
                   (default: forward)

  (out) err: error indicator


Checking made:
----------------

     size(x) = size(y) = size(y_sec)    (if not: Error)

     x(1) <= t <= x(n)                  (if not: Error if any_t false)

     (Warning if nothing calculated)



_______________________________________________________________________________

"som_spl": integral of the cubic spline


res = som_spl( x, y, y_sec,

              [x_beg], [x_end],

              [any_x], [period], [err] )


  arguments (mandatory):
            ^^^^^^^^^^^
  (in)  x: array of abscissas

  (in)  y: array of function values

  (in)  y_sec: array of second derivatives


  arguments (optional):                            [default value]
            ^^^^^^^^^^
  (in)  x_beg: first bound of sommation            [ x(1) ]

  (in)  x_end: second bound of sommation           [ x(n) ]

  (in)  any_x: x_beg, x_end are free               [.false.]
                (i.e. out of array 'x')

  (in)  period: logical for periodic BC            [.false.]

  (out) err: error indicator


  returned value:
  ^^^^^^^^
  (out) som_spl: integral value

Checking made:
----------------

     size(x) = size(y) = size(y_sec)    (if not: Error)

     x(1) <= (x_beg et x_end) <= x(n)   (if not: Error, depends of any_x)

     ( x_beg and x_end may not be ordered )


________________________________________________________________________
