m_spline Module

Implements various routines for cubic spline interpolation.


Used by

  • module~~m_spline~~UsedByGraph module~m_spline m_spline module~m_ia_angle m_ia_angle module~m_ia_angle->module~m_spline module~m_ia_bond m_ia_bond module~m_ia_bond->module~m_spline module~m_ia_vdw m_ia_vdw module~m_ia_vdw->module~m_spline module~m_interaction m_interaction module~m_interaction->module~m_ia_angle module~m_interaction->module~m_ia_bond module~m_interaction->module~m_ia_vdw module~m_mc_moves m_mc_moves module~m_mc_moves->module~m_interaction module~m_mc_solver m_mc_solver module~m_mc_solver->module~m_interaction module~m_mc_solver->module~m_mc_moves module~m_setup m_setup module~m_setup->module~m_interaction module~m_setup->module~m_mc_solver program~main main program~main->module~m_mc_solver program~main->module~m_setup

Functions

public function bez_val(n, x, a, b, y)

BEZ_VAL evaluates an N-th degree Bezier function at a point.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: x
real(kind=8) :: a
real(kind=8) :: b
real(kind=8) :: y(0:n)

Return Value real(kind=8)

public function pchst(arg1, arg2)

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: arg1
real(kind=8) :: arg2

Return Value real(kind=8)

public function r8_uniform_01(seed)

R8_UNIFORM_01 is a portable pseudorandom number generator.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: seed

Return Value real(kind=8)

public function r8vec_distinct(n, x)

R8VEC_DISTINCT is true if the entries in an R8VEC are distinct.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: x(n)

Return Value logical


Subroutines

public subroutine basis_function_b_val(tdata, tval, yval)

BASIS_FUNCTION_B_VAL evaluates the B spline basis function.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: tdata(ndata)
real(kind=8) :: tval
real(kind=8) :: yval

public subroutine basis_function_beta_val(beta1, beta2, tdata, tval, yval)

BASIS_FUNCTION_BETA_VAL evaluates the beta spline basis function.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: beta1
real(kind=8) :: beta2
real(kind=8) :: tdata(ndata)
real(kind=8) :: tval
real(kind=8) :: yval

public subroutine basis_matrix_b_uni(mbasis)

BASIS_MATRIX_B_UNI sets up the uniform B spline basis matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: mbasis(4,4)

public subroutine basis_matrix_beta_uni(beta1, beta2, mbasis)

BASIS_MATRIX_BETA_UNI sets up the uniform beta spline basis matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: beta1
real(kind=8) :: beta2
real(kind=8) :: mbasis(4,4)

public subroutine basis_matrix_bezier(mbasis)

BASIS_MATRIX_BEZIER sets up the cubic Bezier spline basis matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: mbasis(4,4)

public subroutine basis_matrix_hermite(mbasis)

BASIS_MATRIX_HERMITE sets up the Hermite spline basis matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: mbasis(4,4)

public subroutine basis_matrix_overhauser_nonuni(alpha, beta, mbasis)

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: alpha
real(kind=8) :: beta
real(kind=8) :: mbasis(4,4)

public subroutine basis_matrix_overhauser_nul(alpha, mbasis)

BASIS_MATRIX_OVERHAUSER_NUL sets the nonuniform left Overhauser basis matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: alpha
real(kind=8) :: mbasis(3,3)

public subroutine basis_matrix_overhauser_nur(beta, mbasis)

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: beta
real(kind=8) :: mbasis(3,3)

public subroutine basis_matrix_overhauser_uni(mbasis)

BASIS_MATRIX_OVERHAUSER_UNI sets the uniform Overhauser spline basis matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: mbasis(4,4)

public subroutine basis_matrix_overhauser_uni_l(mbasis)

BASIS_MATRIX_OVERHAUSER_UNI_L sets the left uniform Overhauser basis matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: mbasis(3,3)

public subroutine basis_matrix_overhauser_uni_r(mbasis)

BASIS_MATRIX_OVERHAUSER_UNI_R sets the right uniform Overhauser basis matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: mbasis(3,3)

public subroutine basis_matrix_tmp(left, n, mbasis, ndata, tdata, ydata, tval, yval)

BASIS_MATRIX_TMP computes Q = T * MBASIS * P

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: left
integer(kind=4) :: n
real(kind=8) :: mbasis(n,n)
integer(kind=4) :: ndata
real(kind=8) :: tdata(ndata)
real(kind=8) :: ydata(ndata)
real(kind=8) :: tval
real(kind=8) :: yval

public subroutine bc_val(n, t, xcon, ycon, xval, yval)

BC_VAL evaluates a parameterized N-th degree Bezier curve in 2D.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: t
real(kind=8) :: xcon(0:n)
real(kind=8) :: ycon(0:n)
real(kind=8) :: xval
real(kind=8) :: yval

public subroutine bp01(n, x, bern)

BP01 evaluates the Bernstein basis polynomials for [0,1] at a point.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: x
real(kind=8) :: bern(0:n)

public subroutine bpab(n, a, b, x, bern)

BPAB evaluates the Bernstein basis polynomials for [A,B] at a point.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a
real(kind=8) :: b
real(kind=8) :: x
real(kind=8) :: bern(0:n)

public subroutine bpab_approx(n, a, b, ydata, xval, yval)

BPAB_APPROX evaluates the Bernstein polynomial approximant to F(X) on [A,B].

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a
real(kind=8) :: b
real(kind=8) :: ydata(0:n)
real(kind=8) :: xval
real(kind=8) :: yval

public subroutine chfev(x1, x2, f1, f2, d1, d2, ne, xe, fe, next, ierr)

CHFEV evaluates a cubic polynomial given in Hermite form.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: x1
real(kind=8) :: x2
real(kind=8) :: f1
real(kind=8) :: f2
real(kind=8) :: d1
real(kind=8) :: d2
integer(kind=4) :: ne
real(kind=8) :: xe(ne)
real(kind=8) :: fe(ne)
integer(kind=4) :: next(2)
integer(kind=4) :: ierr

public subroutine data_to_dif(ntab, xtab, ytab, diftab)

DATA_TO_DIF sets up a divided difference table from raw data.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: ntab
real(kind=8) :: xtab(ntab)
real(kind=8) :: ytab(ntab)
real(kind=8) :: diftab(ntab)

public subroutine dif_val(ntab, xtab, diftab, xval, yval)

DIF_VAL evaluates a divided difference polynomial at a point.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: ntab
real(kind=8) :: xtab(ntab)
real(kind=8) :: diftab(ntab)
real(kind=8) :: xval
real(kind=8) :: yval

public subroutine least_set_old(ntab, xtab, ytab, ndeg, ptab, b, c, d, eps, ierror)

LEAST_SET_OLD constructs the least squares polynomial approximation to data.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: ntab
real(kind=8) :: xtab(ntab)
real(kind=8) :: ytab(ntab)
integer(kind=4) :: ndeg
real(kind=8) :: ptab(ntab)
real(kind=8) :: b(1:ndeg)
real(kind=8) :: c(0:ndeg)
real(kind=8) :: d(2:ndeg)
real(kind=8) :: eps
integer(kind=4) :: ierror

public subroutine least_val_old(x, ndeg, b, c, d, value)

LEAST_VAL_OLD evaluates a least squares polynomial defined by LEAST_SET_OLD.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: x
integer(kind=4) :: ndeg
real(kind=8) :: b(1:ndeg)
real(kind=8) :: c(0:ndeg)
real(kind=8) :: d(2:ndeg)
real(kind=8) :: value

public subroutine least_set(point_num, x, f, w, nterms, b, c, d)

LEAST_SET defines a least squares polynomial for given data.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: point_num
real(kind=8) :: x(point_num)
real(kind=8) :: f(point_num)
real(kind=8) :: w(point_num)
integer(kind=4) :: nterms
real(kind=8) :: b(nterms)
real(kind=8) :: c(nterms)
real(kind=8) :: d(nterms)

public subroutine least_val(nterms, b, c, d, x, px)

LEAST_VAL evaluates a least squares polynomial defined by LEAST_SET.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: nterms
real(kind=8) :: b(nterms)
real(kind=8) :: c(nterms)
real(kind=8) :: d(nterms)
real(kind=8) :: x
real(kind=8) :: px

public subroutine least_val2(nterms, b, c, d, x, px, pxp)

LEAST_VAL2 evaluates a least squares polynomial defined by LEAST_SET.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: nterms
real(kind=8) :: b(nterms)
real(kind=8) :: c(nterms)
real(kind=8) :: d(nterms)
real(kind=8) :: x
real(kind=8) :: px
real(kind=8) :: pxp

public subroutine parabola_val2(dim_num, ndata, tdata, ydata, left, tval, yval)

PARABOLA_VAL2 evaluates a parabolic interpolant through tabular data.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: dim_num
integer(kind=4) :: ndata
real(kind=8) :: tdata(ndata)
real(kind=8) :: ydata(dim_num,ndata)
integer(kind=4) :: left
real(kind=8) :: tval
real(kind=8) :: yval(dim_num)

public subroutine penta(n, a1, a2, a3, a4, a5, b, x)

PENTA solves a pentadiagonal system of linear equations.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a1(n)
real(kind=8) :: a2(n)
real(kind=8) :: a3(n)
real(kind=8) :: a4(n)
real(kind=8) :: a5(n)
real(kind=8) :: b(n)
real(kind=8) :: x(n)

public subroutine r8_swap(x, y)

R8_SWAP swaps two real values.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: x
real(kind=8) :: y

public subroutine r83_mxv(n, a, x, b)

R83_MXV multiplies an R83 matrix times a vector.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a(3,n)
real(kind=8) :: x(n)
real(kind=8) :: b(n)

public subroutine r83_np_fs(n, a, b, x)

R83_NP_FS factors and solves an R83 system.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a(3,n)
real(kind=8) :: b(n)
real(kind=8) :: x(n)

public subroutine r83_uniform(n, seed, a)

R83_UNIFORM randomizes an R83 matrix.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
integer(kind=4) :: seed
real(kind=8) :: a(3,n)

public subroutine r85_np_fs(n, a, b, x)

R85_NP_FS factors and solves an R85 linear system.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a(5,n)
real(kind=8) :: b(n)
real(kind=8) :: x(n)

public subroutine r85_print(n, a, title)

R85_PRINT prints an R85 matrix.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a(5,n)
character(len=*) :: title

public subroutine r85_print_some(n, a, ilo, jlo, ihi, jhi, title)

R85_PRINT_SOME prints some of an R85 matrix.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a(5,n)
integer(kind=4) :: ilo
integer(kind=4) :: jlo
integer(kind=4) :: ihi
integer(kind=4) :: jhi
character(len=*) :: title

public subroutine r8ge_fs(n, a, b, info)

R8GE_FS factors and solves an R8GE system.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a(n,n)
real(kind=8) :: b(n)
integer(kind=4) :: info

public subroutine r8vec_bracket(n, x, xval, left, right)

R8VEC_BRACKET searches a sorted R8VEC for successive brackets of a value.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: xval
integer(kind=4) :: left
integer(kind=4) :: right

public subroutine r8vec_bracket3(n, t, tval, left)

R8VEC_BRACKET3 finds the interval containing or nearest a given value.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: t(n)
real(kind=8) :: tval
integer(kind=4) :: left

public subroutine r8vec_even(n, alo, ahi, a)

R8VEC_EVEN returns N real values, evenly spaced between ALO and AHI.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: alo
real(kind=8) :: ahi
real(kind=8) :: a(n)

public subroutine r8vec_indicator(n, a)

R8VEC_INDICATOR sets an R8VEC to the indicator vector.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a(n)

public subroutine r8vec_order_type(n, a, order)

R8VEC_ORDER_TYPE determines the order type of an R8VEC.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a(n)
integer(kind=4) :: order

public subroutine r8vec_print(n, a, title)

R8VEC_PRINT prints an R8VEC.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a(n)
character(len=*) :: title

public subroutine r8vec_sort_bubble_a(n, a)

R8VEC_SORT_BUBBLE_A ascending sorts an R8VEC using bubble sort.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a(n)

public subroutine r8vec_uniform_01(n, seed, r)

R8VEC_UNIFORM_01 returns a unit pseudorandom R8VEC.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
integer(kind=4) :: seed
real(kind=8) :: r(n)

public subroutine r8vec_unique_count(n, a, tol, unique_num)

R8VEC_UNIQUE_COUNT counts the unique elements in an unsorted R8VEC.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a(n)
real(kind=8) :: tol
integer(kind=4) :: unique_num

public subroutine spline_b_val(ndata, tdata, ydata, tval, yval)

SPLINE_B_VAL evaluates a cubic B spline approximant.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: ndata
real(kind=8) :: tdata(ndata)
real(kind=8) :: ydata(ndata)
real(kind=8) :: tval
real(kind=8) :: yval

public subroutine spline_beta_val(beta1, beta2, ndata, tdata, ydata, tval, yval)

SPLINE_BETA_VAL evaluates a cubic beta spline approximant.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: beta1
real(kind=8) :: beta2
integer(kind=4) :: ndata
real(kind=8) :: tdata(ndata)
real(kind=8) :: ydata(ndata)
real(kind=8) :: tval
real(kind=8) :: yval

public subroutine spline_bezier_val(dim_num, interval_num, data_val, point_num, point_t, point_val)

SPLINE_BEZIER_VAL evaluates a cubic Bezier spline.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: dim_num
integer(kind=4) :: interval_num
real(kind=8) :: data_val(dim_num,cubic*interval_num+1)
integer(kind=4) :: point_num
real(kind=8) :: point_t(point_num)
real(kind=8) :: point_val(dim_num,point_num)

public subroutine spline_constant_val(ndata, tdata, ydata, tval, yval)

SPLINE_CONSTANT_VAL evaluates a piecewise constant spline at a point.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: ndata
real(kind=8) :: tdata(ndata-1)
real(kind=8) :: ydata(ndata)
real(kind=8) :: tval
real(kind=8) :: yval

public subroutine spline_cubic_set_full(n, t, y, ibcbeg, ybcbeg, ibcend, ybcend, ypp)

SPLINE_CUBIC_SET_FULL computes second derivatives of piecewise cubic spline.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: t(n)
real(kind=8) :: y(n)
integer(kind=4) :: ibcbeg
real(kind=8) :: ybcbeg
integer(kind=4) :: ibcend
real(kind=8) :: ybcend
real(kind=8) :: ypp(n)

public subroutine spline_cubic_set(n, t, y, ibcbeg, ybcbeg, ibcend, ybcend, ypp)

SPLINE_CUBIC_SET computes the second derivatives of a piecewise cubic spline.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: t(n)
real(kind=8) :: y(n)
integer(kind=4) :: ibcbeg
real(kind=8) :: ybcbeg
integer(kind=4) :: ibcend
real(kind=8) :: ybcend
real(kind=8) :: ypp(n)

public subroutine spline_cubic_val(n, t, y, ypp, tval, yval, ypval, yppval)

SPLINE_CUBIC_VAL evaluates a piecewise cubic spline at a point.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: t(n)
real(kind=8) :: y(n)
real(kind=8) :: ypp(n)
real(kind=8) :: tval
real(kind=8) :: yval
real(kind=8) :: ypval
real(kind=8) :: yppval

public subroutine spline_cubic_val2(n, t, y, ypp, left, tval, yval, ypval, yppval)

SPLINE_CUBIC_VAL2 evaluates a piecewise cubic spline at a point.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: t(n)
real(kind=8) :: y(n)
real(kind=8) :: ypp(n)
integer(kind=4) :: left
real(kind=8) :: tval
real(kind=8) :: yval
real(kind=8) :: ypval
real(kind=8) :: yppval

public subroutine spline_hermite_set(ndata, tdata, ydata, ypdata, c)

SPLINE_HERMITE_SET sets up a piecewise cubic Hermite interpolant.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: ndata
real(kind=8) :: tdata(ndata)
real(kind=8) :: ydata(ndata)
real(kind=8) :: ypdata(ndata)
real(kind=8) :: c(4,ndata)

public subroutine spline_hermite_val(ndata, tdata, c, tval, sval, spval)

SPLINE_HERMITE_VAL evaluates a piecewise cubic Hermite interpolant.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: ndata
real(kind=8) :: tdata(ndata)
real(kind=8) :: c(4,ndata)
real(kind=8) :: tval
real(kind=8) :: sval
real(kind=8) :: spval

public subroutine spline_linear_int(ndata, tdata, ydata, a, b, int_val)

SPLINE_LINEAR_INT evaluates the integral of a piecewise linear spline.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: ndata
real(kind=8) :: tdata(ndata)
real(kind=8) :: ydata(ndata)
real(kind=8) :: a
real(kind=8) :: b
real(kind=8) :: int_val

public subroutine spline_linear_intset(n, int_x, int_v, data_x, data_y)

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: int_x(n+1)
real(kind=8) :: int_v(n)
real(kind=8) :: data_x(n)
real(kind=8) :: data_y(n)

public subroutine spline_linear_val(ndata, tdata, ydata, tval, yval, ypval)

SPLINE_LINEAR_VAL evaluates a piecewise linear spline at a point.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: ndata
real(kind=8) :: tdata(ndata)
real(kind=8) :: ydata(ndata)
real(kind=8) :: tval
real(kind=8) :: yval
real(kind=8) :: ypval

public subroutine spline_overhauser_nonuni_val(ndata, tdata, ydata, tval, yval)

SPLINE_OVERHAUSER_NONUNI_VAL evaluates the nonuniform Overhauser spline.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: ndata
real(kind=8) :: tdata(ndata)
real(kind=8) :: ydata(ndata)
real(kind=8) :: tval
real(kind=8) :: yval

public subroutine spline_overhauser_uni_val(ndata, tdata, ydata, tval, yval)

SPLINE_OVERHAUSER_UNI_VAL evaluates the uniform Overhauser spline.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: ndata
real(kind=8) :: tdata(ndata)
real(kind=8) :: ydata(ndata)
real(kind=8) :: tval
real(kind=8) :: yval

public subroutine spline_overhauser_val(dim_num, ndata, tdata, ydata, tval, yval)

SPLINE_OVERHAUSER_VAL evaluates an Overhauser spline.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: dim_num
integer(kind=4) :: ndata
real(kind=8) :: tdata(ndata)
real(kind=8) :: ydata(dim_num,ndata)
real(kind=8) :: tval
real(kind=8) :: yval(dim_num)

public subroutine spline_pchip_set(n, x, f, d)

SPLINE_PCHIP_SET sets derivatives for a piecewise cubic Hermite interpolant.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: f(n)
real(kind=8) :: d(n)

public subroutine spline_pchip_val(n, x, f, d, ne, xe, fe)

SPLINE_PCHIP_VAL evaluates a piecewise cubic Hermite function.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: f(n)
real(kind=8) :: d(n)
integer(kind=4) :: ne
real(kind=8) :: xe(ne)
real(kind=8) :: fe(ne)

public subroutine spline_quadratic_val(ndata, tdata, ydata, tval, yval, ypval)

SPLINE_QUADRATIC_VAL evaluates a piecewise quadratic spline at a point.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: ndata
real(kind=8) :: tdata(ndata)
real(kind=8) :: ydata(ndata)
real(kind=8) :: tval
real(kind=8) :: yval
real(kind=8) :: ypval