LightKrylov_Constants Module

This module defines a list of simple constants used throughout LightKrylov. It also provides some utility functions related to let LightKrylov be aware of any MPI-related information (e.g. rank of the current MPI process, dimension of the MPI communicator, etc).


Variables

Type Visibility Attributes Name Initial
real(kind=dp), public, parameter :: atol_dp = 10.0_dp**-precision(1.0_dp)

Absolute tolerance for double precision computations.

real(kind=sp), public, parameter :: atol_sp = 10.0_sp**-precision(1.0_sp)

Absolute tolerance for single precision computations.

integer, public, parameter :: dp = selected_real_kind(15, 307)

Double precision data type.

complex(kind=dp), public, parameter :: one_cdp = cmplx(1.0_dp, 0.0_dp, kind=dp)

Complex-valued double precision one.

complex(kind=sp), public, parameter :: one_csp = cmplx(1.0_sp, 0.0_sp, kind=sp)

Complex-valued single precision one.

complex(kind=sp), public, parameter :: one_im_cdp = cmplx(0.0_dp, 1.0_dp, kind=dp)

Complex-valued double precision imaginary unit.

complex(kind=sp), public, parameter :: one_im_csp = cmplx(0.0_sp, 1.0_sp, kind=sp)

Complex-valued single precision imaginary unit.

real(kind=dp), public, parameter :: one_rdp = 1.0_dp

Real-valued double precision one.

real(kind=sp), public, parameter :: one_rsp = 1.0_sp

Real-valued single precision one.

real(kind=dp), public, parameter :: rtol_dp = sqrt(atol_dp)

Relative tolerance for double precision computations.

real(kind=sp), public, parameter :: rtol_sp = sqrt(atol_sp)

Relative tolerance for single precision computations.

integer, public, parameter :: sp = selected_real_kind(6, 37)

Single precision data type.

complex(kind=dp), public, parameter :: zero_cdp = cmplx(0.0_dp, 0.0_dp, kind=dp)

Complex-valued double precision zero.

complex(kind=sp), public, parameter :: zero_csp = cmplx(0.0_sp, 0.0_sp, kind=sp)

Complex-value single precision zero.

real(kind=dp), public, parameter :: zero_rdp = 0.0_dp

Real-valued double precision zero.

real(kind=sp), public, parameter :: zero_rsp = 0.0_sp

Real-valued single precision zero.


Functions

public pure function get_comm_size() result(c_size)

Utility function to get the dimension of the communicator known to LightKrylov.

Arguments

None

Return Value integer

public pure function get_rank() result(rank)

Utility function to get the rank of the current MPI process.

Arguments

None

Return Value integer

public pure function io_rank() result(is_io)

Utility function to determine whether the current MPI process can do I/O.

Arguments

None

Return Value logical


Subroutines

public subroutine set_comm_size(c_size)

Utility function to inform LightKrylov of the MPI-communicator's dimension.

Arguments

Type IntentOptional Attributes Name
integer :: c_size

Dimension of the MPI communicator.

public subroutine set_io_rank(rk)

Utility function to set the rank of the process doing I/O.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: rk

Desired rank for the IO process.

public subroutine set_rank(rank)

Utility function to set the rank of an MPI process.

Arguments

Type IntentOptional Attributes Name
integer :: rank

Desired rank identification.