Documentation for module splines_methods

routines for handling splines

source: splines_methods.F
Loading...

public Subroutines/Functions:

SUBROUTINE
init_spline (spl, dx, y1a, y1b)
allocates storage for y2 table calculates y2 table and other spline parameters
SUBROUTINE
init_splinexy (spl, nn)
allocates storage for function table to be interpolated both x and y are allocated
FUNCTION
REAL(dp)
potential_s (spl_p, xxi, y1, spl_f, logger)
calculates the potential interpolated with splines value at a given point and the first derivative. Checks included to avoid just segfaulting!!
FUNCTION
REAL(dp)
spline_value (spl, xx, y1)
calculates the spline value at a given point (and possibly the first derivative) WITHOUT checks and without any funny scaling business, or weird 1/x^2 grid assumptions

SUBROUTINEinit_spline(spl, dx, y1a, y1b)

allocates storage for y2 table calculates y2 table and other spline parameters

Arguments:
POINTER
:: spl spline_data structure to be initialized spl%y() must hold the function values spl%x() must hold the absissa values in increasing order OR if dx (below) is given, spl%x(1) must hold the starting (left-most) point.
REAL(dp),
INTENT(in)
:: dx x(i) are assumed to be x(1)+dx*(i-1) (spline evaluations will also be faster) y1a : (OPTIONAL) if present, the 1-deriv of the left endpoint if not present, natural spline condition at this end (2-deriv == 0) y1b : (OPTIONAL) if present, the 1-deriv of the right endpoint if not present, natural spline condition at this end (2-deriv == 0)
REAL(dp),
INTENT(in),
OPTIONAL
:: y1a ...
REAL(dp),
INTENT(in),
OPTIONAL
:: y1b ...

SUBROUTINEinit_splinexy(spl, nn)

allocates storage for function table to be interpolated both x and y are allocated

Arguments:
POINTER
:: spl spline_data structure to be initialized
INTEGER,
INTENT(in)
:: nn integer number of datapoints, that the function table will hold

FUNCTIONpotential_s(spl_p, xxi, y1, spl_f, logger)

calculates the potential interpolated with splines value at a given point and the first derivative. Checks included to avoid just segfaulting!!

Return Value ::
REAL(dp)
Arguments:
POINTER
:: spl_p(:) spline_data structure
REAL(dp),
INTENT(in)
:: xxi absissa value
REAL(dp),
INTENT(out)
:: y1 1. derivative at xx
POINTER
:: spl_f ...
POINTER
:: logger ...

FUNCTIONspline_value(spl, xx, y1)

calculates the spline value at a given point (and possibly the first derivative) WITHOUT checks and without any funny scaling business, or weird 1/x^2 grid assumptions

Return Value ::
REAL(dp)
Arguments:
POINTER
:: spl ...
REAL(dp),
INTENT(in)
:: xx ...
REAL(dp),
INTENT(out),
OPTIONAL
:: y1 ...