mod_arpack_type Module

Contains a dedicated type for the various settings of the ARPACK solvers. All variables that are used in different solver settings are defined, initialised and set in this module.



Contents


Derived Types

type, public :: arpack_t

General type containing the ARPACK configuration.

Components

TypeVisibilityAttributesNameInitial
integer, private :: mode

mode of the solver

integer, public :: ido

reverse communication flag

character(len=1), private :: bmat

type of the matrix B ("I" = unit matrix, "G" = general matrix)

integer, private :: evpdim

dimension of the eigenvalue problem

character(len=2), private :: which

which eigenvalues to calculate

integer, private :: nev

number of eigenvalues to calculate

real(kind=dp), private :: tolerance

stopping criteria, relative accuracy of Ritz eigenvalues

complex(kind=dp), public, allocatable:: residual(:)

residual vector

integer, private :: ncv

indicates how many Arnoldi vectors are generated each iteration

integer, public :: iparam(11)

integer array containing mode and parameters

integer, private :: lworkl

length of workl array, must be at least 3 * ncv**2 + 5 * ncv

integer, public :: info

info parameter

integer, private :: maxiter

maximum number of iterations

Type-Bound Procedures

procedure, public :: get_bmat
procedure, public :: get_evpdim
procedure, public :: get_which
procedure, public :: get_nev
procedure, public :: get_tolerance
procedure, public :: get_ncv
procedure, public :: get_maxiter
procedure, public :: get_lworkl
procedure, public :: parse_znaupd_info
procedure, public :: parse_zneupd_info
procedure, public :: parse_finished_stats
procedure, public :: destroy
procedure, private :: set_mode
procedure, private :: set_bmat
procedure, private :: set_which
procedure, private :: set_nev
procedure, private :: set_residual
procedure, private :: set_ncv
procedure, private :: set_maxiter

Functions

public function new_arpack_config(evpdim, mode, bmat, solver_settings) result(arpack_config)

Constructor for a new ARPACK configuration based on the dimension of the eigenvalue problem, mode of the solver and type of the B-matrix. Initialises required variables and allocates work arrays to be used when calling the solvers.

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: evpdim

dimension of the eigenvalue problem

integer, intent(in) :: mode

mode for the solver

character(len=1), intent(in) :: bmat

type of the matrix B

type(solver_settings_t), intent(inout) :: solver_settings

Return Value type(arpack_t)

initialised arpack configuration

private pure function get_bmat(this)

Getter for kind of B-matrix in eigenvalue problem.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(in) :: this

type instance

Return Value character

private pure function get_evpdim(this)

Getter for dimension of eigenvalue problem.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(in) :: this

type instance

Return Value integer

private pure function get_which(this)

Getter for which eigenvalues to return.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(in) :: this

type instance

Return Value character(len=2)

private pure function get_nev(this)

Getter for number of eigenvalues to calculate.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(in) :: this

type instance

Return Value integer

private pure function get_tolerance(this)

Getter for tolerance (relative accuracy) to indicate eigenvalue convergence.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(in) :: this

type instance

Return Value real(kind=dp)

private pure function get_ncv(this)

Getter for number of Arnoldi basis vectors that should be calculated.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(in) :: this

type instance

Return Value integer

private pure function get_maxiter(this)

Getter for maximum number of iterations.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(in) :: this

type instance

Return Value integer

private pure function get_lworkl(this)

Getter for length of workl array, returns 3 * ncv**2 + 5 * ncv

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(in) :: this

type instance

Return Value integer


Subroutines

private subroutine set_mode(this, mode)

Sets the mode for the solver.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(inout) :: this

type instance

integer, intent(in) :: mode

solver mode

private subroutine set_bmat(this, bmat)

Sets the type of B-matrix.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(inout) :: this

type instance

character, intent(in) :: bmat

type of B-matrix

private subroutine set_which(this, which)

Setter for the "which" argument of ARPACK routines.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(inout) :: this

type instance

character(len=2), intent(in) :: which

which kind of eigenvalues to calculate

private subroutine set_nev(this, nev)

Setter for number of eigenvalues to calculate.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(inout) :: this

type instance

integer, intent(in) :: nev

number of eigenvalues to calculate

private subroutine set_residual(this, evpdim)

Setter for the residual vector, allocates and manually initialises the residual (= starting) vector using a uniform distribution on (-1, 1) for both the real and imaginary parts. Relies on the LAPACK routine zlarnv.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(inout) :: this

type instance

integer, intent(in) :: evpdim

dimension of the eigenvalue problem

private subroutine set_ncv(this, ncv)

Setter for ncv, the number of Arnoldi basis vectors to calculate. This should satisfy 1 <= ncv - nev and ncv <= evpdim, with recommended value ncv = 2 * nev (see arpack docs).

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(inout) :: this

type instance

integer, intent(in) :: ncv

value for ncv

private subroutine set_maxiter(this, maxiter)

Sets the maximum number of iterations that ARPACK is allowed to take, defaults to max(100, 10 * k) with k the number of eigenvalues.

Read more…

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(inout) :: this

type instance

integer, intent(in) :: maxiter

maximum number of iterations

private pure subroutine destroy(this)

Destructor, deallocates variables.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(inout) :: this

type instance

private subroutine parse_znaupd_info(this, converged)

Parses the info parameter that comes out of ARPACK's znaupd method. If info = 0, everything behaved nicely and the reverse communication subroutines exited properly. If info is any other value something went wrong and we handle it accordingly.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(in) :: this

reference to type object

logical, intent(out) :: converged

if .true. the reverse communication routines converged, .false. otherwise

private subroutine parse_zneupd_info(this)

Parses the info parameter that comes out of ARPACK's zneupd method. If info = 0, the eigenvalues extraction routines exited properly, if info is any other value something went wrong and we handle it accordingly.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(in) :: this

reference to type object

private subroutine parse_finished_stats(this)

Parses the statistics that come out of ARPACK when the run is finished. Displays the number of OPX and BX operations and the number of re-orthogonalisation steps that were needed.

Arguments

TypeIntentOptionalAttributesName
class(arpack_t), intent(in) :: this

type instance