laserfields
Fortran95 library to describe time-dependent laser pulses
Loading...
Searching...
No Matches
laserfields_miscfuncs Module Reference

Data Types

interface  interpolate
 1-dimensional polynomial interpolation More...
interface  gnuplotstring
 convert real or complex numbers to strings that can be used in gnuplot More...

Functions/Subroutines

integer function get_unused_unit ()
real(dp) pure elemental function phase (c)
 obtain the phase (=argument) of a complex number
complex(dpc) pure elemental function abs2_phase (c)
 return a complex number containing absolute value squared and phase as real and imaginary part: {|c|2,phase(c)}
real(dp) pure function lagrange_interpol (xk, yk, n, x)
 lagrange polynomial interpolation, using the barycentric form (see e.g. wikipedia)
pure integer function binary_search (xs, x)
 do a binary search and return index il for which xs(il) <= x <= xs(il+1)

Function/Subroutine Documentation

◆ get_unused_unit()

integer function laserfields_miscfuncs::get_unused_unit

Definition at line 23 of file laserfields_miscfuncs.f90.

◆ phase()

real(dp) pure elemental function laserfields_miscfuncs::phase ( complex(dpc), intent(in) c)

obtain the phase (=argument) of a complex number

Definition at line 36 of file laserfields_miscfuncs.f90.

◆ abs2_phase()

complex(dpc) pure elemental function laserfields_miscfuncs::abs2_phase ( complex(dpc), intent(in) c)

return a complex number containing absolute value squared and phase as real and imaginary part: {|c|2,phase(c)}

Definition at line 43 of file laserfields_miscfuncs.f90.

◆ lagrange_interpol()

real(dp) pure function laserfields_miscfuncs::lagrange_interpol ( real(dp), dimension(n), intent(in) xk,
real(dp), dimension(n), intent(in) yk,
integer, intent(in) n,
real(dp), intent(in) x )

lagrange polynomial interpolation, using the barycentric form (see e.g. wikipedia)

Parameters
[in]nsize of xk and yk.
[in]xkx-values of points to interpolate.
[in]yky-values of points to interpolate.
[in]xposition at which to evaluate the interpolating polynomial.

Definition at line 104 of file laserfields_miscfuncs.f90.

◆ binary_search()

pure integer function laserfields_miscfuncs::binary_search ( real(dp), dimension(:), intent(in) xs,
real(dp), intent(in) x )

do a binary search and return index il for which xs(il) <= x <= xs(il+1)

Parameters
[in]xsinput array to search, has to be sorted (either in ascending or descending order)
[in]xvalue to search for

Definition at line 138 of file laserfields_miscfuncs.f90.