Multidip  1.0
Multi-photon matrix elements
multidip_special Module Reference

Special functions and objects used by MULTIDIP. More...

Data Types

interface  coulfg
 
interface  couln
 
interface  cphaz
 
interface  decay
 
interface  dgemm
 
interface  dgemv
 
interface  zgemv
 
interface  zgetrf
 
interface  zgetri
 
interface  zgetrs
 

Functions/Subroutines

subroutine calculate_S_matrix (Km, Sm, nopen)
 Calculate S-matrix from K-matrix. More...
 
subroutine scatAk (rmatr, eig, etot, w, Ek, l, Km, Ak)
 Photoionization coefficient. More...
 
real(wp) function cphase (l, k)
 Coulomb phase. More...
 
subroutine coul (l, Ek, r, F, Fp, G, Gp)
 Coulomb functions. More...
 
subroutine coul_gsl (l, Ek, r, F, Fp, G, Gp)
 Coulomb functions (GSL) More...
 
subroutine coul_ukrmol (l, Ek, r, F, Fp, G, Gp)
 Coulomb functions (UKRmol) More...
 
subroutine invert_matrix (T)
 Invert a complex matrix. More...
 
subroutine solve_complex_system (n, A, X, Y)
 Solve system of equations with complex matrix. More...
 
logical function next_permutation (p)
 Construct or advance permutation. More...
 
subroutine swap (a, b)
 Exchange value of two integers. More...
 
subroutine reverse (a)
 Reverse order of elements in array. More...
 
subroutine kahan_add (X, dX, err)
 Compensated summation. More...
 

Variables

real(wp), parameter rzero = 0
 
real(wp), parameter rone = 1
 

Detailed Description

Special functions and objects used by MULTIDIP.

Author
J Benda
Date
2020

Function/Subroutine Documentation

◆ calculate_S_matrix()

subroutine multidip_special::calculate_S_matrix ( real(wp), dimension(:, :), intent(in)  Km,
complex(wp), dimension(:, :), intent(inout), allocatable  Sm,
integer, intent(in)  nopen 
)

Calculate S-matrix from K-matrix.

Author
J Benda
Date
2020

Obtain the S-matrix from the definition formula

s = (1 + ik) (1 - ik)â

Definition at line 187 of file multidip_special.F90.

Here is the call graph for this function:

◆ coul()

subroutine multidip_special::coul ( integer, intent(in)  l,
real(wp), intent(in)  Ek,
real(wp), intent(in)  r,
real(wp), intent(inout)  F,
real(wp), intent(inout)  Fp,
real(wp), intent(inout)  G,
real(wp), intent(inout)  Gp 
)

Coulomb functions.

Author
J Benda
Date
2020

Evaluate the Coulomb wave (regular, irregular and derivatives). Uses GSL or the UKRmol-out library, depending on the configuration. For negative energies, evaluates the exponentially decreasing solution (into G and Gp) obtained from the Whittaker function (if charged) or from solution of the appropriate equation (if neutral).

The derivatives returned are with respect to 'r' already, so they should not be multiplied by the additional factor of 'k'.

Definition at line 315 of file multidip_special.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ coul_gsl()

subroutine multidip_special::coul_gsl ( integer, intent(in)  l,
real(wp), intent(in)  Ek,
real(wp), intent(in)  r,
real(wp), intent(inout)  F,
real(wp), intent(inout)  Fp,
real(wp), intent(inout)  G,
real(wp), intent(inout)  Gp 
)

Coulomb functions (GSL)

Author
J Benda
Date
2020

Coulomb functions (positive- and negative-energy) calculated using GSL.

Definition at line 335 of file multidip_special.F90.

Here is the caller graph for this function:

◆ coul_ukrmol()

subroutine multidip_special::coul_ukrmol ( integer, intent(in)  l,
real(wp), intent(in)  Ek,
real(wp), intent(in)  r,
real(wp), intent(inout)  F,
real(wp), intent(inout)  Fp,
real(wp), intent(inout)  G,
real(wp), intent(inout)  Gp 
)

Coulomb functions (UKRmol)

Author
J Benda
Date
2020

Coulomb functions (positive- and negative-energy) calculated using UKRmol-out.

Definition at line 383 of file multidip_special.F90.

Here is the caller graph for this function:

◆ cphase()

real(wp) function multidip_special::cphase ( integer, intent(in)  l,
real(wp), intent(in)  k 
)

Coulomb phase.

Author
J Benda
Date
2020

Return the Coulomb phase, arg Gamma(l + 1 - i/k). Uses GSL or the UKRmol-out library, depending on the configuration.

Definition at line 283 of file multidip_special.F90.

Here is the caller graph for this function:

◆ invert_matrix()

subroutine multidip_special::invert_matrix ( complex(wp), dimension(:, :), intent(inout), allocatable  T)

Invert a complex matrix.

Author
J Benda
Date
2020

Calculate inverse of a complex matrix. Use the standard LAPACK decompose+solve sequence.

Definition at line 421 of file multidip_special.F90.

Here is the caller graph for this function:

◆ kahan_add()

subroutine multidip_special::kahan_add ( complex(wp), intent(inout)  X,
complex(wp), intent(in)  dX,
complex(wp), intent(inout)  err 
)

Compensated summation.

Author
J Benda
Date
2020

Add dX to X, keep track of numerical error. Uses Kahan's algorithm. This subroutine is in infinite precision equivalent to just

x = x + dx
err = 0

but in the finite precision arithmetic it compensates the running numerical error. It mustn't be optimized away by the compiler! Flags like -ffast-math or -Ofast are detrimental here. Common optimization flags like -O2 or -O3 should be safe (but it may depend on the compiler).

Definition at line 599 of file multidip_special.F90.

Here is the caller graph for this function:

◆ next_permutation()

logical function multidip_special::next_permutation ( integer, dimension(:), intent(inout)  p)

Construct or advance permutation.

Author
J Benda
Date
2020

If the given integer array contains a negative element, fill it with identical permutation (i.e. the sequence 1, 2, ..., N) and return TRUE. Otherwise attempt to generate the "next" permutation of the N values in the manner compatible with C++ std::next_permutation (lexicographically ordered sequences). When no further permutation is possible, return FALSE.

The algorithm is shamelessly copied from the source of GCC's libstdc++ library and (except for the added initialization option) faithfully mimics the behaviour of the built-on C++ function std::next_permutation.

Definition at line 498 of file multidip_special.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reverse()

subroutine multidip_special::reverse ( integer, dimension(:), intent(inout)  a)

Reverse order of elements in array.

Author
J Benda
Date
2020

This subroutine mimics the behaviour of the built-in C++ function std::reverse.

Definition at line 571 of file multidip_special.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scatAk()

subroutine multidip_special::scatAk ( real(wp), intent(in)  rmatr,
real(wp), dimension(:), intent(in)  eig,
real(wp), intent(in)  etot,
real(wp), dimension(:,:), intent(in)  w,
real(wp), dimension(:), intent(in)  Ek,
integer, dimension(:), intent(in)  l,
real(wp), dimension(:,:), intent(in)  Km,
complex(wp), dimension(:,:), intent(inout), allocatable  Ak 
)

Photoionization coefficient.

Author
J Benda
Date
2020

Evaluates the wave function coefficient Ak for the final stationary photoionization wave. Ak needs to be allocated to neig x nchan.

Definition at line 221 of file multidip_special.F90.

Here is the call graph for this function:

◆ solve_complex_system()

subroutine multidip_special::solve_complex_system ( integer, intent(in)  n,
complex(wp), dimension(:, :), intent(inout), allocatable  A,
real(wp), dimension(:, :), intent(inout), allocatable  X,
real(wp), dimension(:, :), intent(inout), allocatable  Y 
)

Solve system of equations with complex matrix.

Author
J Benda
Date
2020

The matrix A is complex. The columns of matrices X and Y correspond to real and imaginary part of the right-hand side and of the solution, respectively.

Definition at line 456 of file multidip_special.F90.

Here is the caller graph for this function:

◆ swap()

subroutine multidip_special::swap ( integer, intent(inout)  a,
integer, intent(inout)  b 
)

Exchange value of two integers.

Author
J Benda
Date
2020

This subroutine mimics the behaviour of the built-in C++ function std::swap.

Definition at line 553 of file multidip_special.F90.

Here is the caller graph for this function:

Variable Documentation

◆ rone

real(wp), parameter multidip_special::rone = 1

Definition at line 38 of file multidip_special.F90.

◆ rzero

real(wp), parameter multidip_special::rzero = 0

Definition at line 37 of file multidip_special.F90.