lMat_t Derived Type

type, public, abstract :: lMat_t

Abstract base class for lMat_t objects (6-index integrals)


Contents

Source Code


Components

Type Visibility Attributes Name Initial
procedure(lMatInd_t), public, nopass, pointer :: indexFunc => lMatIndSym

Type-Bound Procedures

procedure(get_elem_t), public, deferred :: get_elem

  • function get_elem_t(this, index) result(element) Prototype

    Get an element of a lMat. This replaces the old lMatAccess function pointer

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(in) :: this
    integer(kind=int64), intent(in) :: index

    Return Value real(kind=dp)

procedure(set_elem_t), private, deferred :: set_elem

  • subroutine set_elem_t(this, index, element) Prototype

    Set an element of a lMat

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(inout) :: this
    integer(kind=int64), intent(in) :: index
    real(kind=dp), intent(in) :: element

procedure(alloc_t), public, deferred :: alloc

  • subroutine alloc_t(this, size) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(inout) :: this
    integer(kind=int64), intent(in) :: size

procedure(dealloc_t), public, deferred :: safe_dealloc

  • subroutine dealloc_t(this) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(inout) :: this

procedure, public, :: read

  • private subroutine read(this, filename)

    Read in the 6-index integrals from disk and histogram the integrals. The file itself only has to store the nonzero integrals, either in ASCII or in HDF5 format. For conventions in the HDF5 format, please refer to the developer’s guide. @param[in] filename name of the integrals file

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(inout) :: this
    character(len=*), intent(in) :: filename

procedure(read_t), private, deferred :: read_kernel

  • subroutine read_t(this, filename) Prototype

    Read a lMat from a file

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(inout) :: this
    character(len=*), intent(in) :: filename

procedure(read_op_t), private, deferred :: read_op_hdf5

  • subroutine read_op_t(this, indices, entries) Prototype

    Read operation on a single block of data read from an hdf5 file

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(inout) :: this
    integer(kind=int64), intent(inout), allocatable :: indices(:,:)
    integer(kind=int64), intent(inout), allocatable :: entries(:,:)

procedure, public, :: lMat_size

  • private function lMat_size(this) result(size)

    Return the max. index appearing in this lMat_t (i.e. the number of 6-index integrals) @return size The number of 6-index integrals of this object, depending on the symmetry.

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(in) :: this

    Return Value integer(kind=int64)

procedure, public, :: histogram_lMat

  • private subroutine histogram_lMat(this)

    Generate a histogram of the 6-index integrals and write it to stdout

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(in) :: this

Source Code

    type, abstract :: lMat_t
        private

        ! Generic indexing routine
        procedure(lMatInd_t), nopass, pointer, public :: indexFunc => lMatIndSym
    contains
        ! Element getters/setters
        procedure(get_elem_t), deferred :: get_elem
        procedure(set_elem_t), deferred, private :: set_elem

        ! Allocation routines
        procedure(alloc_t), deferred :: alloc
        procedure(dealloc_t), deferred :: safe_dealloc

        ! I/O routines
        ! Interfaced read routine: Delegates to the read_kernel
        procedure :: read
        ! Routine to read in any format (ascii/hdf5) to this object
        procedure(read_t), deferred, private :: read_kernel
        ! When reading hdf5, the read is done by a lMat_hdf5_read object. This object
        ! calls a read_op_t from the respective lMat to load the data to memory
        ! This has to be threadsafe
        procedure(read_op_t), deferred, private :: read_op_hdf5

        procedure :: lMat_size
        procedure :: histogram_lMat
    end type lMat_t