linear_extrapolate Function

function linear_extrapolate(x, y)

Utility function for linear extrapolation of data to the horizon and Scri+.

Used to import external initial data from files that do not contain valid data at those locations.

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(3):: x

A 1d array of size (3) of reals that contains the 3 coordinate locations involved in the extrapolation. The first element is the coordinate where the extrapolation is needed, that last two elements are the locations where data is known.

complex(kind=wp), intent(in), dimension(2:3):: y

A 1d array of size(2) that contains the known data.

Return Value complex(kind=wp)

The return value is the extrapolated data at the required location.


Called by

proc~~linear_extrapolate~~CalledByGraph proc~linear_extrapolate linear_extrapolate proc~read_all_modes read_all_modes proc~read_all_modes->proc~linear_extrapolate interface~read_all_modes read_all_modes interface~read_all_modes->proc~read_all_modes

Contents

Source Code


Source Code

  function linear_extrapolate ( x, y )
  !! Utility function for linear extrapolation of data to the horizon and
  !! Scri+.
  !!
  !! Used to import external initial data from files that do not contain valid
  !! data at those locations.

    implicit none

    real(wp), dimension(3), intent(in) :: x
    !! A 1d array of size (3) of reals that contains the 3 coordinate locations
    !! involved in the extrapolation. The first element is the coordinate
    !! where the extrapolation is needed, that last two elements are the
    !! locations where data is known.
    complex(wp), dimension(2:3), intent(in) :: y
    !! A 1d array of size(2) that contains the known data.
    complex(wp) :: linear_extrapolate
    !! The return value is the extrapolated data at the required location.

    linear_extrapolate = y(2) - (y(3)-y(2))*(x(2)-x(1))/(x(3)-x(2))

  end function linear_extrapolate