Linear interpolation coefficients and index for a 1D grid y(x)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=Float64), | intent(in), | dimension(:) | :: | x | Abscissa values  | 
  
|
| real(kind=Float64), | intent(in) | :: | xout | Abscissa value to interpolate  | 
  
||
| type(InterpolCoeffs1D), | intent(out) | :: | c | Interpolation Coefficients  | 
  
||
| integer, | intent(out), | optional | :: | err | Error code  | 
  
subroutine interpol1D_coeff_arr(x,xout,c,err)
    !+ Linear interpolation coefficients and index for a 1D grid y(x)
    real(Float64), dimension(:), intent(in) :: x
        !+ Abscissa values
    real(Float64), intent(in)               :: xout
        !+ Abscissa value to interpolate
    type(InterpolCoeffs1D), intent(out)     :: c
        !+ Interpolation Coefficients
    integer, intent(out), optional          :: err
        !+ Error code
    real(Float64) :: xmin, dx
    integer :: sx,err_status
    err_status = 1
    sx = size(x)
    xmin = x(1)
    dx = abs(x(2)-x(1))
    call interpol1D_coeff(xmin, dx, sx, xout, c, err_status)
    if(present(err)) err = err_status
end subroutine interpol1D_coeff_arr