cubspl_new Function

public function cubspl_new(x, f, BC, BC_val) result(sf)

Uses

  • proc~~cubspl_new~~UsesGraph proc~cubspl_new cubspl_new module~sll_m_bsplines sll_m_bsplines proc~cubspl_new->module~sll_m_bsplines module~sll_m_bsplines_base sll_m_bsplines_base module~sll_m_bsplines->module~sll_m_bsplines_base module~sll_m_bsplines_non_uniform sll_m_bsplines_non_uniform module~sll_m_bsplines->module~sll_m_bsplines_non_uniform module~sll_m_bsplines_uniform sll_m_bsplines_uniform module~sll_m_bsplines->module~sll_m_bsplines_uniform module~sll_m_working_precision sll_m_working_precision module~sll_m_bsplines->module~sll_m_working_precision module~sll_m_bsplines_base->module~sll_m_working_precision module~sll_m_bsplines_non_uniform->module~sll_m_bsplines_base module~sll_m_bsplines_non_uniform->module~sll_m_working_precision module~sll_m_bsplines_uniform->module~sll_m_bsplines_base module~sll_m_bsplines_uniform->module~sll_m_working_precision

Interpolation of function values f(x_i)=f_i, i=1,n with a cubic spline, given left and right boundary condition types of boundary conditions: 0: not-a-knot 1: f'(x_boundary)=0 2: f''(x_boundary)=0

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x(:)

x positions

real(kind=wp), intent(in) :: f(:)

function values at x positions

integer, intent(in) :: BC(1:2)

Boundary condition at x(1)/x(n): =0: not-a-knot, =1: first der. =BC_val(1)/BC_val(2), =2: second der. =BC_val(1)/BC_val(2)

real(kind=wp), intent(in), optional :: BC_val(1:2)

Boundary value for BC(1:2) >0,

Return Value type(t_cubspl)

self


Calls

proc~~cubspl_new~~CallsGraph proc~cubspl_new cubspl_new interface~interpolate_cubic_spline interpolate_cubic_spline proc~cubspl_new->interface~interpolate_cubic_spline proc~sll_s_bsplines_new sll_s_bsplines_new proc~cubspl_new->proc~sll_s_bsplines_new interface~interpolate_cubic_spline->interface~interpolate_cubic_spline init init proc~sll_s_bsplines_new->init sll_assert sll_assert proc~sll_s_bsplines_new->sll_assert

Called by

proc~~cubspl_new~~CalledByGraph proc~cubspl_new cubspl_new interface~t_cubspl t_cubspl interface~t_cubspl->proc~cubspl_new

Source Code

  FUNCTION cubspl_new(x,f,BC,BC_val) RESULT(sf)
    ! MODULES
    USE sll_m_bsplines, ONLY: sll_s_bsplines_new
    IMPLICIT NONE
    !-----------------------------------------------------------------------------------------------------------------------------------
    ! INPUT VARIABLES
    REAL(wp) , INTENT(IN) :: x(:) !! x positions
    REAL(wp) , INTENT(IN) :: f(:) !! function values at x positions
    INTEGER  , INTENT(IN) :: BC(1:2) !! Boundary condition at x(1)/x(n): =0: not-a-knot, =1: first der. =BC_val(1)/BC_val(2), =2: second der. =BC_val(1)/BC_val(2)
    REAL(wp) , INTENT(IN),OPTIONAL :: BC_val(1:2) !! Boundary value for BC(1:2) >0,
    !-----------------------------------------------------------------------------------------------------------------------------------
    ! OUTPUT VARIABLES
    TYPE(t_cubspl) :: sf !! self
    !-----------------------------------------------------------------------------------------------------------------------------------
    ! LOCAL VARIABLES
    INTEGER, PARAMETER:: deg=3 !! degree of the spline
    INTEGER :: nbreaks
    !===================================================================================================================================

    CALL interpolate_cubic_spline(x,f,sf%coefs,sf%knots,BC,BC_val)
    nbreaks=SIZE(sf%knots)-2*deg
    CALL sll_s_bsplines_new(sf%bspl, deg, .FALSE., sf%knots(1+deg),sf%knots(nbreaks+deg),nbreaks-1,sf%knots(1+deg:nbreaks+deg))
  END FUNCTION cubspl_new