numerics Module

Module that contains a number of more or less useful numerical routines.


Uses

  • module~~numerics~~UsesGraph module~numerics numerics module~kinds kinds module~numerics->module~kinds

Used by

  • module~~numerics~~UsedByGraph module~numerics numerics proc~convert_rschw_to_rstar convert_rschw_to_rstar proc~convert_rschw_to_rstar->module~numerics proc~output_coords output_coords proc~output_coords->module~numerics proc~init_grid_coordinates init_grid_coordinates proc~init_grid_coordinates->module~numerics program~test test program~test->module~numerics proc~scal_schw_rhs scal_schw_rhs proc~scal_schw_rhs->module~numerics proc~scal_schw_init scal_schw_init proc~scal_schw_init->module~numerics proc~tdc_set_coefficients tdc_set_coefficients proc~tdc_set_coefficients->module~numerics proc~sf_extract sf_extract proc~sf_extract->module~numerics proc~abmv5_init abmv5_init proc~abmv5_init->module~numerics proc~get_force get_force proc~get_force->module~numerics

Contents


Variables

TypeVisibility AttributesNameInitial
real(kind=sp), public, parameter:: epss =1.0e-5_sp

A single precision constant with a value used to determine convergence of iterative methods.

real(kind=dp), public, parameter:: epsd =1.0e-12_dp

A double precision constant with a value used to determine convergence of iterative methods.

real(kind=qp), public, parameter:: epsq =1.0e-32_qp

A quad precision constant with a value used to determine convergence of iterative methods.

integer(kind=ip), public, parameter:: maxiter =100

An integer constant with a maximum number of iterations for iterative methods.


Interfaces

public interface eps

  • public function eps_prec_s(real_var)

    Single precision version of a function that returns the convergence criterium.

    Arguments

    Type IntentOptional AttributesName
    real(kind=sp) :: real_var

    Any single precision variable.

    Return Value real(kind=sp)

    The single precision convergence criterium.

  • public function eps_prec_d(real_var)

    Double precision version of a function that returns the convergence criterium.

    Arguments

    Type IntentOptional AttributesName
    real(kind=dp) :: real_var

    Any double precision variable.

    Return Value real(kind=dp)

    The double precision convergence criterium.

  • public function eps_prec_q(real_var)

    Quad precision version of a function that returns the convergence criterium.

    Arguments

    Type IntentOptional AttributesName
    real(kind=qp) :: real_var

    Any quad precision variable.

    Return Value real(kind=qp)

    The quad precision convergence criterium.


Functions

public function eps_prec_s(real_var)

Single precision version of a function that returns the convergence criterium.

Arguments

Type IntentOptional AttributesName
real(kind=sp) :: real_var

Any single precision variable.

Return Value real(kind=sp)

The single precision convergence criterium.

public function eps_prec_d(real_var)

Double precision version of a function that returns the convergence criterium.

Arguments

Type IntentOptional AttributesName
real(kind=dp) :: real_var

Any double precision variable.

Return Value real(kind=dp)

The double precision convergence criterium.

public function eps_prec_q(real_var)

Quad precision version of a function that returns the convergence criterium.

Arguments

Type IntentOptional AttributesName
real(kind=qp) :: real_var

Any quad precision variable.

Return Value real(kind=qp)

The quad precision convergence criterium.

public function Lambert(z)

Function to calculate Lambert's W-function.

Read more…

Arguments

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

The input value.

Return Value real(kind=wp)

The return value Lambert(z).

public function rschw(z, mass)

Function to invert the tortoise radius as a function of Schwarzschild radius.

Read more…

Arguments

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

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 .

public function invert_tortoise(rstar, mass)

Function to invert the tortoise radius as a function of Schwarzschild radius.

Read more…

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 .

public function rstar_of_r(r, mass)

Function to calculate the tortoise radius, , as function of the Schwarzschild radius, .

Arguments

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

The schwarzschild radius, .

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

The mass of the black hole, .

Return Value real(kind=wp)

The return value is .

public function ldep(l, order)

Function that calculates the higher order terms, in the self-force expansion over .

Arguments

Type IntentOptional AttributesName
integer(kind=ip), intent(in) :: l

The -value.

integer(kind=ip), intent(in) :: order

The order of the higher order term, .

Return Value real(kind=wp)

The return value is .

public function lsum(lmin, order)

Function that calculates the sum of higher order terms, , provided by ldep from to .

Arguments

Type IntentOptional AttributesName
integer(kind=ip), intent(in) :: lmin

The value of at which to start the sum, .

integer(kind=ip), intent(in) :: order

The order of the higher order term, .

Return Value real(kind=wp)

The return value is .

public function correct_for_higher_modes(ydat, nmodes, startfit, endfit, order, npar)

Function that fits higher order terms to data containing amplitude as function of l-values and corrects the sum over the evolved l-modes with the contribution from the not evolved l-modes.

Arguments

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

A 1d-array containing the amplitudes of the -modes. It is assumed, for now, that the data starts at .

integer(kind=ip), intent(in) :: nmodes

The number of -modes.

integer(kind=ip), intent(in) :: startfit

At what -value should the fit begin.

integer(kind=ip), intent(in) :: endfit

At what -value should the fit end.

integer(kind=ip), intent(in) :: order

What is the lowest order term that should be fitted.

integer(kind=ip), intent(in) :: npar

How many terms should be included in the correction. One more term is included in the fit, but the coefficient for the last fit coefficient is only used as an error estimator.

Return Value real(kind=wp), dimension(3)

A 1d-array of size 3 that on return contains the sum of evolved modes (first entry), the corrected sum (second entry) and the error estimate (third entry).

public recursive function factorial(n) result(fac)

A simple factorial function. Use only for small values of as no consideration of efficiency has been made.

Arguments

Type IntentOptional AttributesName
integer(kind=ip), intent(in) :: n

The value for which the factorial function should be calculated.

Return Value integer(kind=ip)

The return value, .


Subroutines

public subroutine transition(rho, R, S, fT, fTp, fTpp)

Routine to calculate the smooth transition function, , and it's first and second derivative with respect to the computational coordinate, .

Arguments

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

The computational coordinate, , where the transition function should be calculated. Should be between and .

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

The value of where should be .

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

The value of where should be .

real(kind=wp), intent(out) :: fT

On return contains .

real(kind=wp), intent(out) :: fTp

On return contains .

real(kind=wp), intent(out) :: fTpp

On return contains .

public subroutine time_window(time, tsigma, norder, tfac, dtfac_dt, d2tfac_dt2)

Routine to calculate a smooth "Gaussian" type time window function, and it's first and second time derivative.

Arguments

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

The time at which to calculate the time window function, .

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

The width of the time window function, .

integer(kind=ip), intent(in) :: norder

The order of the time window function, .

real(kind=wp), intent(out) :: tfac

On output contains

real(kind=wp), intent(out) :: dtfac_dt

On output contains

real(kind=wp), intent(out) :: d2tfac_dt2

On output contains