interpolate Module

Interpolation Module Ref) Press, Numerical Recipes, Chap. 3. Abstract data types - Linear : linear interpolation . F Linear_create(x(N), y(N)) . F Linear_interpolate(L, x) - Spline : cubic spline interpolation . F Spline_create(x(N), y(N), yp1, ypn) : yp1 and ypn are optional. . F Spline_interpolate(S, x)

Auxiliary functions and subroutines - F locate(table(N), x) : find the right place of x in table


Uses


Interfaces

public interface spline_interpolate

spline interpolation

  • private function spline_interpolate_one(s, x) result(y)

    Arguments

    Type IntentOptional Attributes Name
    type(spline), intent(in) :: s
    real(kind=long), intent(in) :: x

    Return Value real(kind=long)

  • private function spline_interpolate_vector(s, xx) result(yy)

    Arguments

    Type IntentOptional Attributes Name
    type(spline), intent(in) :: s
    real(kind=long), intent(in) :: xx(:)

    Return Value real(kind=long), (size(xx))


Derived Types

type, public ::  linear

linear interpolation

type, public ::  spline

spline interpolation


Functions

public function linear_create(x, y) result(l)

creates linear interpolation structure

Arguments

Type IntentOptional Attributes Name
real(kind=long), intent(in), dimension(:) :: x
real(kind=long), intent(in), dimension(:) :: y

Return Value type(linear)

public function linear_interpolate(l, x) result(y)

linearly interpolate

Arguments

Type IntentOptional Attributes Name
type(linear), intent(in) :: l
real(kind=long), intent(in) :: x

Return Value real(kind=long)


Subroutines

public subroutine purge_linear(l)

removes linear interpolation structure

Arguments

Type IntentOptional Attributes Name
type(linear), intent(inout) :: l

public subroutine spline_create(x, y, s, yp1, ypn)

creates spline interpolation structure

Arguments

Type IntentOptional Attributes Name
real(kind=long), intent(in), dimension(:) :: x
real(kind=long), intent(in), dimension(:) :: y
type(spline), intent(out) :: s
real(kind=long), intent(in), optional :: yp1
real(kind=long), intent(in), optional :: ypn

public subroutine spline_reuse(s, y, yp1, ypn)

reuse spline structure and fill it with new values

Arguments

Type IntentOptional Attributes Name
type(spline), intent(inout) :: s
real(kind=long), intent(in), dimension(:) :: y
real(kind=long), intent(in), optional :: yp1
real(kind=long), intent(in), optional :: ypn

public subroutine purge_spline(s)

removes spline interpolation structure

Arguments

Type IntentOptional Attributes Name
type(spline), intent(inout) :: s