bsg_interpolation_m Module

Module containing the implementation of BSG interpolations.



Interfaces

interface

  • public module function eval_lsp_equidistant(this, x, xlb, x1, dx)

    Evaluates the local starting point for equidistant grids

    Arguments

    Type IntentOptional Attributes Name
    class(bsg_interpolation_t), intent(in) :: this

    Instanse of the type

    real(kind=GP), intent(in) :: x

    Location of interpolation

    integer, intent(in) :: xlb

    Lower bound of x array

    real(kind=GP), intent(in) :: x1

    Value of x at lower bound

    real(kind=GP), intent(in) :: dx

    Grid spacing of the x array

    Return Value integer

interface

  • public module subroutine initialize(this, interp_order)

    Initializes the interpolation class

    Arguments

    Type IntentOptional Attributes Name
    class(bsg_interpolation_t), intent(inout) :: this

    Instance of the type

    integer, intent(in) :: interp_order

    Order of interpolation

interface

  • public module subroutine eval_local_index_interface(this, x, x_values, start_idx, end_idx)

    Evaluates the local start and end indices for interpolation

    Arguments

    Type IntentOptional Attributes Name
    class(bsg_interpolation_t), intent(inout) :: this

    Instance of the type

    real(kind=GP), intent(in) :: x

    Location of interpolation point

    real(kind=GP), intent(in), dimension(:) :: x_values

    Locations of data points

    integer, intent(out) :: start_idx

    Start index of xarray required for interpolation

    integer, intent(out) :: end_idx

    End index of xarray required for interpolation

interface

  • public module subroutine interpolate_interface(this, x_values, y_values, coeff, x, y_interp)

    Performs interpolation

    Arguments

    Type IntentOptional Attributes Name
    class(bsg_interpolation_t), intent(inout) :: this

    Instance of the type

    real(kind=GP), intent(in), dimension(:) :: x_values

    Locations of data points

    real(kind=GP), intent(in), dimension(:) :: y_values

    Values at the data points

    real(kind=GP), intent(in), dimension(:) :: coeff

    Coefficients of the interpolation

    real(kind=GP), intent(in) :: x

    Location of interpolation point

    real(kind=GP), intent(out) :: y_interp

    Interpolated value at x

interface

  • public module subroutine eval_coeff_interface(this, x_values, coeff)

    Evaluates the coefficients for interpolation

    Arguments

    Type IntentOptional Attributes Name
    class(bsg_interpolation_t), intent(inout) :: this

    Instance of the type

    real(kind=GP), intent(in), dimension(:) :: x_values

    Locations of data points

    real(kind=GP), intent(out), dimension(:) :: coeff

    Coefficients of the interpolation

interface

  • public module subroutine eval_local_index_equidistant(this, x, x_values, start_idx, end_idx)

    Arguments

    Type IntentOptional Attributes Name
    class(equidistant_interpolation_t), intent(inout) :: this
    real(kind=GP), intent(in) :: x
    real(kind=GP), intent(in), dimension(:) :: x_values
    integer, intent(out) :: start_idx
    integer, intent(out) :: end_idx

interface

  • public module subroutine interpolate_equidistant(this, x_values, y_values, coeff, x, y_interp)

    Arguments

    Type IntentOptional Attributes Name
    class(equidistant_interpolation_t), intent(inout) :: this
    real(kind=GP), intent(in), dimension(:) :: x_values
    real(kind=GP), intent(in), dimension(:) :: y_values
    real(kind=GP), intent(in), dimension(:) :: coeff
    real(kind=GP), intent(in) :: x
    real(kind=GP), intent(out) :: y_interp

interface

  • public module subroutine eval_coeff_equidistant(this, x_values, coeff)

    Arguments

    Type IntentOptional Attributes Name
    class(equidistant_interpolation_t), intent(inout) :: this
    real(kind=GP), intent(in), dimension(:) :: x_values
    real(kind=GP), intent(out), dimension(:) :: coeff

Derived Types

type, public, abstract ::  bsg_interpolation_t

Abstract base type for the implementation of BSG interpolation.

Type-Bound Procedures

procedure, public :: initialize
procedure, public :: eval_lsp_equidistant
procedure(eval_local_index_interface), public, deferred :: eval_local_index
procedure(eval_coeff_interface), public, deferred :: eval_coeff
procedure(interpolate_interface), public, deferred :: interpolate
procedure, public :: get_interpolation_order

type, public, extends(bsg_interpolation_t) ::  equidistant_interpolation_t

Type implementing the equidistant interpolation

Type-Bound Procedures

procedure, public :: initialize
procedure, public :: eval_lsp_equidistant
procedure, public :: get_interpolation_order
procedure, public :: eval_local_index => eval_local_index_equidistant
procedure, public :: interpolate => interpolate_equidistant
procedure, public :: eval_coeff => eval_coeff_equidistant

Functions

public pure function get_interpolation_order(this)

Returns the order of interpolation

Arguments

Type IntentOptional Attributes Name
class(bsg_interpolation_t), intent(in) :: this

Instance of the type

Return Value integer