(git:6a2e663)
negf_integr_cc Module Reference

Adaptive Clenshaw-Curtis quadrature algorithm to integrate a complex-valued function in a complex plane. More...

Functions/Subroutines

subroutine, public ccquad_init (cc_env, xnodes, nnodes, a, b, interval_id, shape_id, weights, tnodes_restart)
 Initialise a Clenshaw-Curtis quadrature environment variable. More...
 
subroutine, public ccquad_release (cc_env)
 Release a Clenshaw-Curtis quadrature environment variable. More...
 
subroutine, public ccquad_double_number_of_points (cc_env, xnodes_next)
 Get the next set of points at which the integrand needs to be computed. These points are then can be used to refine the integral approximation. More...
 
subroutine, public ccquad_reduce_and_append_zdata (cc_env, zdata_next)
 Prepare Clenshaw-Curtis environment for the subsequent refinement of the integral. More...
 
subroutine, public ccquad_refine_integral (cc_env)
 Refine approximated integral. More...
 

Variables

integer, parameter, public cc_interval_full = 0
 
integer, parameter, public cc_interval_half = 1
 
integer, parameter, public cc_shape_linear = contour_shape_linear
 
integer, parameter, public cc_shape_arc = contour_shape_arc
 

Detailed Description

Adaptive Clenshaw-Curtis quadrature algorithm to integrate a complex-valued function in a complex plane.

History
  • 05.2017 created [Sergey Chulkov]

Function/Subroutine Documentation

◆ ccquad_init()

subroutine, public negf_integr_cc::ccquad_init ( type(ccquad_type), intent(out)  cc_env,
complex(kind=dp), dimension(nnodes), intent(out)  xnodes,
integer, intent(inout)  nnodes,
complex(kind=dp), intent(in)  a,
complex(kind=dp), intent(in)  b,
integer, intent(in)  interval_id,
integer, intent(in)  shape_id,
type(cp_fm_type), intent(in)  weights,
real(kind=dp), dimension(nnodes), intent(in), optional  tnodes_restart 
)

Initialise a Clenshaw-Curtis quadrature environment variable.

Parameters
cc_envenvironment variable to initialise
xnodespoints at which an integrand needs to be computed (initialised on exit)
nnodesinitial number of points to compute (initialised on exit)
aintegral lower bound
bintegral upper bound
interval_idfull [-1 .. 1] or half [-1 .. 0] interval
shape_idshape of a curve along which the integral will be evaluated
weightsweights associated with matrix elements; used to compute cumulative error
tnodes_restartlist of nodes over the interval [-1 .. 1] from a previous integral evaluation. If present, the same set of 'xnodes' will be used to compute this integral.
History
  • 05.2017 created [Sergey Chulkov]
Note
Clenshaw-Curtis quadratures are defined on the interval [-1 .. 1] and have non-uniforms node distribution which is symmetric and much sparse about 0. When the half-interval [-1 .. 0] is requested, the integrand value on another subinterval (0 .. 1] is assumed to be zero. Half interval mode is typically useful for rapidly decaying integrands (e.g. multiplied by Fermi function), so we do not actually need a fine grid spacing on this tail.

Definition at line 112 of file negf_integr_cc.F.

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

◆ ccquad_release()

subroutine, public negf_integr_cc::ccquad_release ( type(ccquad_type), intent(inout)  cc_env)

Release a Clenshaw-Curtis quadrature environment variable.

Parameters
cc_envenvironment variable to release (modified on exit)
History
  • 05.2017 created [Sergey Chulkov]

Definition at line 201 of file negf_integr_cc.F.

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

◆ ccquad_double_number_of_points()

subroutine, public negf_integr_cc::ccquad_double_number_of_points ( type(ccquad_type), intent(inout)  cc_env,
complex(kind=dp), dimension(:), intent(inout), allocatable  xnodes_next 
)

Get the next set of points at which the integrand needs to be computed. These points are then can be used to refine the integral approximation.

Parameters
cc_envenvironment variable (modified on exit)
xnodes_nextset of additional points (allocated and initialised on exit)
History
  • 05.2017 created [Sergey Chulkov]

Definition at line 249 of file negf_integr_cc.F.

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

◆ ccquad_reduce_and_append_zdata()

subroutine, public negf_integr_cc::ccquad_reduce_and_append_zdata ( type(ccquad_type), intent(inout)  cc_env,
type(cp_cfm_type), dimension(:), intent(inout)  zdata_next 
)

Prepare Clenshaw-Curtis environment for the subsequent refinement of the integral.

Parameters
cc_envenvironment variable (modified on exit)
zdata_nextadditional integrand value at additional points (modified on exit)
History
  • 05.2017 created [Sergey Chulkov]
Note
Due to symmetry of Clenshaw-Curtis quadratures (weight(x) == weight(-x)), we do not need to keep all the matrices from 'zdata_next', only 'zdata_next(x) + zdata_next(-x)' is needed. In order to reduce the number of matrix allocations, we move some of the matrices from the end of the 'zdata_new' array to the 'cc_envzdata_cache' array, and nullify the corresponding pointers at 'zdata_next' array. So the calling subroutine need to release the remained matrices or reuse them but taking into account the missed ones.

Definition at line 332 of file negf_integr_cc.F.

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

◆ ccquad_refine_integral()

subroutine, public negf_integr_cc::ccquad_refine_integral ( type(ccquad_type), intent(inout)  cc_env)

Refine approximated integral.

Parameters
cc_envenvironment variable (modified on exit)
History
  • 05.2017 created [Sergey Chulkov]

Definition at line 427 of file negf_integr_cc.F.

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

Variable Documentation

◆ cc_interval_full

integer, parameter, public negf_integr_cc::cc_interval_full = 0

Definition at line 48 of file negf_integr_cc.F.

◆ cc_interval_half

integer, parameter, public negf_integr_cc::cc_interval_half = 1

Definition at line 48 of file negf_integr_cc.F.

◆ cc_shape_linear

integer, parameter, public negf_integr_cc::cc_shape_linear = contour_shape_linear

Definition at line 51 of file negf_integr_cc.F.

◆ cc_shape_arc

integer, parameter, public negf_integr_cc::cc_shape_arc = contour_shape_arc

Definition at line 51 of file negf_integr_cc.F.