invert_tortoise Function

public 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.

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in) :: rstar

The tortoise radius to invert, .

real(kind=wp), intent(in) :: mass

The mass of the black hole, .

Return Value real(kind=wp)

The return value is .


Calls

proc~~invert_tortoise~~CallsGraph proc~invert_tortoise invert_tortoise proc~lambert Lambert proc~invert_tortoise->proc~lambert proc~rschw rschw proc~invert_tortoise->proc~rschw interface~eps eps proc~lambert->interface~eps proc~rschw->interface~eps proc~eps_prec_s eps_prec_s interface~eps->proc~eps_prec_s proc~eps_prec_q eps_prec_q interface~eps->proc~eps_prec_q proc~eps_prec_d eps_prec_d interface~eps->proc~eps_prec_d

Called by

proc~~invert_tortoise~~CalledByGraph proc~invert_tortoise invert_tortoise proc~tdc_set_coefficients tdc_set_coefficients proc~tdc_set_coefficients->proc~invert_tortoise proc~scal_schw_init scal_schw_init proc~scal_schw_init->proc~invert_tortoise proc~output_coords output_coords proc~output_coords->proc~invert_tortoise interface~output_coords output_coords interface~output_coords->proc~output_coords interface~scal_schw_init scal_schw_init interface~scal_schw_init->proc~scal_schw_init interface~tdc_set_coefficients tdc_set_coefficients interface~tdc_set_coefficients->proc~tdc_set_coefficients

Contents

Source Code


Source Code

  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