This page documents Fortran-90
routines for calculating smoothing splines and propagating data uncertainties
to obtain uncertainty ranges for the spline fits. A description of the algorithm is
given in a paper by Enting et al. . This code
(a) fits smoothing splines
(b) evaluates splines, derivates and specified liner combinations of these (e.g. for
trace gas budgets)
(c) propagates specified data uncertainty to give uncertainty ranges for
the various quanties that are calculated.
The code is designed to be used with 3 files (a) the core routines from de Boor,
(b) the MASCOS extension to implement error propagation. (c) a driver program
for specific applications. This file need to `include' the other two files and the
make the requisite subroutine calls.
The core of the code is routines for fitting smoothing splines to a set of data points
and evaulating the resulting spline at specified values. These routines are taken
from the 1978 book by de Boor , with modifications by J. V. Mansbridge. The main
difference in function is that the regularisation parameter is specified, rather than being
fitted a requisite smoothness. This involved removing a loop from de Boor's routine.
Other changes are associated with index ordering. The 2006 changes involved the use of the !
as a comment character, to compile the routines under fortran-95.
These routines are collected as file splinecd.f90. The originals are listed in 
and availbble electronically from netlib.
The new procudures (for propagating uncertainty) use the fortran-90 module
construct to have the various subroutines share a data strucutre. The
subroutines are contained in module sp_spline. This makes use of
module sp_size that can be changed to meet the needs of particular calculations.
The module sp_spline also makes use of module sp_sep, that contains
separators for output. This comes in various versions for LaTeX, html, and postscript,
to enable output to be written directly for various applications. (See  for an indication
of how a PostScript-compatible output might be used).
These are development versions whihc are placed on-line as documentation for reference  and
are supplied as is. Ensuring the correctness and the appropriateness for any particular purpose remains the
responsibility of the user.
The following points should be noted:
- As variously noted [1,3,5], the de Boor algorithm becomes unstable when the number of nodes is too large.
CSIRO experience suggests that with 32-bit arithmetic this occurs for N in the range 1000 to 2000.
Alternative approaches are given in [1,5].
- The uncertainty calculations give the uncertainty in the spline, i.e. a smoothed fit to
an unknown function. This uncertainty is not a measure of the uncertainty in the original functions.
See [3,4] for further discussion.
N.B. These are development versions. They are placed on-line as documentation for reference  and
are supplied as is. Ensuring the correctness and the appropriateness for any particular purpose reamins the
responsibility of the user.
1: * C de Boor. A Practical Guide to Splines, 1978.
2: * C de Boor. A Practical Guide to Splines, 200x?
3. I. Enting, C. Trudinger and D. Etheridge. Propagating data uncertainty through smoothing spline fits.
Tellus (in press)
4. * I. Enting. Characterising the variability of the global carbon cycle.
CSIRO Atmospheric Research, Technical Paper 40.
5. * H. Granek, J. Geophys Res
6. * I. Enting 2006. Book review. Aust Math Soc Gazette.
This page, its contents and style, are the responsibility of the author and do not represent the
views, policies or opinions of The University of Melbourne. The code is distributed "as is" and
represents a development version.
Ian Enting: last change 29/5/06.