# p1m_functions module reference¶

Linear interpolation functions.

More…

## Functions/Subroutines¶

 p1m_interpolation() Linearly interpolate between edge values. p1m_boundary_extrapolation() Interpolation by linear polynomials within boundary cells.

## Detailed Description¶

This module contains p1m (linear) interpolation routines.

p1m interpolation is performed by estimating the edge values and linearly interpolating between them.

## Function/Subroutine Documentation¶

subroutine p1m_functions/p1m_interpolation(N, h, u, edge_values, ppoly_coef, h_neglect, answers_2018)

Linearly interpolate between edge values.

The resulting piecewise interpolant is stored in ‘ppoly’. See ‘ppoly.F90’ for a definition of this structure.

The edge values MUST have been estimated prior to calling this routine.

The estimated edge values must be limited to ensure monotonicity of the interpolant. We also make sure that edge values are NOT discontinuous.

It is assumed that the size of the array ‘u’ is equal to the number of cells defining ‘grid’ and ‘ppoly’. No consistency check is performed here.

Parameters
• n :: [in] Number of cells

• h :: [in] cell widths (size N) [H]

• u :: [in] cell average properties (size N) [A]

• edge_values :: [inout] Potentially modified edge values [A]

• ppoly_coef :: [inout] Potentially modified piecewise polynomial coefficients, mainly [A]

• h_neglect :: [in] A negligibly small width [H]

• answers_2018 :: [in] If true use older, less acccurate expressions.

Call to
Called from

regrid_interp::regridding_set_ppolys

subroutine p1m_functions/p1m_boundary_extrapolation(N, h, u, edge_values, ppoly_coef)

Interpolation by linear polynomials within boundary cells.

The left and right edge values in the left and right boundary cells, respectively, are estimated using a linear extrapolation within the cells.

It is assumed that the size of the array ‘u’ is equal to the number of cells defining ‘grid’ and ‘ppoly’. No consistency check is performed here.

Parameters
• n :: [in] Number of cells

• h :: [in] cell widths (size N) [H]

• u :: [in] cell averages (size N) [A]

• edge_values :: [inout] edge values of piecewise polynomials [A]

• ppoly_coef :: [inout] coefficients of piecewise polynomials, mainly [A]

Called from

regrid_interp::regridding_set_ppolys