### TABLE OF CONTENTS

- 1. /cl_splines
- 1.1. cl_splines/tspline
- 1.2. cl_splines/cl_initSpline
- 1.3. cl_splines/cl_cleanupSpline
- 1.4. cl_splines/cl_spline
- 1.5. cl_splines/cl_error

## /cl_splines [ Modules ]

NAME

module **cl_splines**

PURPOSE

This module implements cubic splines according to cernlib (E211). See also Documentation for the routine "E211" in cernlib documentation.

## cl_splines/tspline [ Types ]

[ Top ] [ cl_splines ] [ Types ]

PURPOSE

Type which contains all information of the splines.

SOURCE

typetsplinereal, dimension(:) , Allocatable :: X real, dimension(:,:), Allocatable :: Y real, dimension(:,:), Allocatable :: A,B,C,D integer :: splineMode=1 logical :: isInitialized=.false. end typetspline

## cl_splines/cl_initSpline [ Functions ]

[ Top ] [ cl_splines ] [ Functions ]

NAME

function **cl_initSpline**(x,y,splineMode) result(s)

PURPOSE

INPUTS

- real, dimension(:),intent(in) :: x,y -- x and y values of the data points. X and y must have same size!
- integer,intent(in), optional :: splineMode -- 1=second derivative of spline vanishes at end-points, 2=second derivative is constant in between first (last) and second (last but one) point

OUTPUT

## cl_splines/cl_cleanupSpline [ Functions ]

[ Top ] [ cl_splines ] [ Functions ]

NAME

subroutine **cl_cleanupSpline**(s)

PURPOSE

Deallocates all the memory that the spline occupied.

INPUTS

## cl_splines/cl_spline [ Functions ]

[ Top ] [ cl_splines ] [ Functions ]

NAME

real function **cl_spline**(s,x,successFlag,errorCode)

PURPOSE

Evaluates the function value of a spline "s" at position "x" .

INPUTS

- type(tspline) :: s -- initialized spline
- real , intent(in) :: x -- position at which the spline shall be evaluated

OUTPUT

- real :: value of the spline at x

* logical, intent(out) :: successFlag !.true. if spline was evaluated within bounds

* integer, intent(out) :: errorCode

NOTES

- errorCode= 0 -> no error
- errorCode=-1 -> x is lower than any data point used for the spline
- errorCode= 1 -> x is greater than any data point used for the spline

## cl_splines/cl_error [ Subroutines ]

[ Top ] [ cl_splines ] [ Subroutines ]

NAME

subroutine **cl_error**(error,name,x)

PURPOSE

Implements output of error messages

INPUTS

- integer , intent(in) :: error -- type of error
- character(*), intent(in) :: name -- identifier (Where did the error happen)
- real , intent(in) :: x -- value where spline should be evaluated

NOTES