Function to invert the tortoise radius as a function of Schwarzschild radius.
Uses rschw for rstar>=0 and Lambert for rstar<0. The Lmabert method has problems for large rstar due to numerical overflow of it's argument.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | rstar | The tortoise radius to invert, . |
||
real(kind=wp), | intent(in) | :: | mass | The mass of the black hole, . |
The return value is .
function invert_tortoise ( rstar, mass )
!! Function to invert the tortoise radius as a function of Schwarzschild
!! radius.
!!
!! Uses rschw for rstar>=0 and Lambert for rstar<0. The Lmabert method has
!! problems for large rstar due to numerical overflow of it's argument.
implicit none
real(wp), intent(in) :: rstar
!! The tortoise radius to invert, \(r_*\).
real(wp), intent(in) :: mass
!! The mass of the black hole, \(M\).
real(wp) :: invert_tortoise
!! The return value is \(r_{\mathrm{schw}}(r_*) - 2M\).
if ( rstar >= 0 ) then
invert_tortoise = rschw ( rstar, mass )
else
invert_tortoise = 2.0_wp *mass * Lambert(exp(0.5_wp*rstar/mass - 1.0_wp))
end if
end function invert_tortoise