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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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. |
The return value is the extrapolated data at the required location.
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