xc_lib_t Derived Type

type, public, abstract :: xc_lib_t


Inherits

type~~xc_lib_t~~InheritsGraph type~xc_lib_t xc_lib_t type~xc_pack_t xc_pack_t type~xc_lib_t->type~xc_pack_t ids

Inherited by

type~~xc_lib_t~~InheritedByGraph type~xc_lib_t xc_lib_t type~xc_libxc_t xc_libxc_t type~xc_libxc_t->type~xc_lib_t type~xc_engine_t xc_engine_t type~xc_engine_t->type~xc_libxc_t XCLib

Components

Type Visibility Attributes Name Initial
logical, public :: reqSigma = .FALSE.
logical, public :: reqTau = .FALSE.
logical, public :: reqLapl = .FALSE.
logical, public :: reqBeta = .FALSE.
integer, public :: maxPts = 0
integer, public :: numPts = 0
integer, public :: nDer = 0
real(kind=fp), public :: E_xc = 0.0
real(kind=fp), public :: E_exch = 0.0
real(kind=fp), public :: E_corr = 0.0
logical, public :: providesEXC = .FALSE.
logical, public :: providesEX = .FALSE.
logical, public :: providesEC = .FALSE.
integer, public :: xclibID = XCLIB_LIBXC
type(xc_pack_t), public :: ids
real(kind=fp), public, allocatable :: memory_(:)
real(kind=fp), public, contiguous, pointer :: rho(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: drho(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: sig(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: tau(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: lapl(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: exc(:) => NULL()
real(kind=fp), public, contiguous, pointer :: d1dr(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d1ds(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d1dt(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d1dl(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d2r2(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d2s2(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d2t2(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d2rs(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d2rt(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d2st(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d2rl(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d2sl(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d2tl(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d2l2(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3r3(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3r2s(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3rs2(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3s3(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3t3(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3r2t(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3s2t(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3rt2(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3st2(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3rst(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3r2l(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3rl2(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3rsl(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3rtl(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3s2l(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3sl2(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3stl(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3t2l(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3tl2(:,:) => NULL()
real(kind=fp), public, contiguous, pointer :: d3l3(:,:) => NULL()

Type-Bound Procedures

procedure(init_xc_lib), public, deferred :: init

  • subroutine init_xc_lib(self, reqSigma, reqTau, reqLapl, reqBeta, maxPts, nDer) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(xc_lib_t) :: self
    logical, intent(in) :: reqSigma
    logical, intent(in) :: reqTau
    logical, intent(in) :: reqLapl
    logical, intent(in) :: reqBeta
    integer, intent(in) :: maxPts
    integer, intent(in) :: nDer

procedure(compute_xc_lib), public, deferred :: compute

  • subroutine compute_xc_lib(self, functional, wts) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(xc_lib_t) :: self
    class(functional_t) :: functional
    real(kind=fp), intent(in) :: wts(:)

procedure(setPts_xc_lib), public, deferred :: setPts

  • subroutine setPts_xc_lib(self, numPts) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(xc_lib_t), target :: self
    integer, intent(in) :: numPts

procedure, public :: clean

  • private subroutine clean(self)

    @brief Cleanup @author Vladimir Mironov

    Arguments

    Type IntentOptional Attributes Name
    class(xc_lib_t) :: self

procedure, public :: scalexc

  • private subroutine scalexc(self, wts)

    @brief Scale XC values by grid weights @author Vladimir Mironov

    Arguments

    Type IntentOptional Attributes Name
    class(xc_lib_t) :: self
    real(kind=fp) :: wts(:)

procedure, public, non_overridable :: echo

  • private subroutine echo(self)

    @brief Print parameters of the xc_engine_t instance @author Vladimir Mironov

    Arguments

    Type IntentOptional Attributes Name
    class(xc_lib_t) :: self

procedure, public, non_overridable :: getEnergy

  • private subroutine getEnergy(self, E_xc, E_exch, E_corr)

    @brief Get debug statistics @author Vladimir Mironov

    Arguments

    Type IntentOptional Attributes Name
    class(xc_lib_t) :: self
    real(kind=fp), intent(out) :: E_xc
    real(kind=fp), intent(out) :: E_exch
    real(kind=fp), intent(out) :: E_corr

procedure, public, non_overridable :: resetEnergy

  • private subroutine resetEnergy(self)

    @brief Set debug statistics @author Vladimir Mironov

    Arguments

    Type IntentOptional Attributes Name
    class(xc_lib_t) :: self

Source Code

    type, abstract, public :: xc_lib_t

        logical :: reqSigma  = .FALSE.  !< needs density gradients
        logical :: reqTau    = .FALSE.  !< needs k.e. density gradients
        logical :: reqLapl   = .FALSE.  !< needs laplacian of the density
        logical :: reqBeta   = .FALSE.  !< UHF flag

        integer :: maxPts    = 0
        integer :: numPts    = 0
        integer :: nDer      = 0
!        integer :: funTyp    = 0   !< 0 - LDA, 1 - GGA, 2 - MGGA

        real(kind=fp) :: E_xc       = 0.0
        real(kind=fp) :: E_exch     = 0.0
        real(kind=fp) :: E_corr     = 0.0

        logical :: providesEXC   = .FALSE.  !< Can get E_xc
        logical :: providesEX    = .FALSE.  !< Can get E_exch
        logical :: providesEC    = .FALSE.  !< Can get E_corr

!       Library id
        integer :: xclibID = XCLIB_LIBXC

        type(xc_pack_t) :: ids

        real(kind=fp), allocatable :: memory_(:)

        real(kind=fp), contiguous, pointer :: &
!           Input data
              rho(:,:)      => NULL() & !< density
            , drho(:,:)     => NULL() & !< gradient density
            , sig(:,:)      => NULL() & !< contracted density gradient
            , tau(:,:)      => NULL() & !< K.E. density
            , lapl(:,:)     => NULL() & !< Laplacian of the density

!           Output data
            , exc(:)        => NULL() & !< E(XC)
            , d1dr(:,:)     => NULL() & !< E(XC) LDA values
            , d1ds(:,:)     => NULL() & !< E(XC) GGA values
            , d1dt(:,:)     => NULL() & !< E(XC) MGGA values
            , d1dl(:,:)     => NULL() & !< E(XC) Laplacian

            , d2r2(:,:)     => NULL() & !< second derivatives of functional vs rho^2
            , d2s2(:,:)     => NULL() & !< second derivatives of functional vs sigma^2
            , d2t2(:,:)     => NULL() & !< second derivatives of functional vs tau^2
            , d2rs(:,:)     => NULL() & !< second derivatives of functional vs rho and sigma
            , d2rt(:,:)     => NULL() & !< second derivatives of functional vs rho and tau
            , d2st(:,:)     => NULL() & !< second derivatives of functional vs sigma and tau

            , d2rl(:,:)     => NULL() & !< second derivatives of functional vs rho and lapl
            , d2sl(:,:)     => NULL() & !< second derivatives of functional vs sigma and lapl
            , d2tl(:,:)     => NULL() & !< second derivatives of functional vs tau and lapl
            , d2l2(:,:)     => NULL() & !< second derivatives of functional vs lapl^2

            , d3r3(:,:)     => NULL() & !< third derivatives of functional vs rho^3
            , d3r2s(:,:)    => NULL() & !< third derivatives of functional vs rho^2 and sigma
            , d3rs2(:,:)    => NULL() & !< third derivatives of functional vs rho and sigma^2
            , d3s3(:,:)     => NULL() & !< third derivatives of functional vs sigma^3
            , d3t3(:,:)     => NULL() & !< third derivatives of functional vs tau^3
            , d3r2t(:,:)    => NULL() & !< third derivatives of functional vs rho^2 and tau
            , d3s2t(:,:)    => NULL() & !< third derivatives of functional vs sigma^2 and tau
            , d3rt2(:,:)    => NULL() & !< third derivatives of functional vs rho and tau^2
            , d3st2(:,:)    => NULL() & !< third derivatives of functional vs sigma and tau^2
            , d3rst(:,:)    => NULL() & !< third derivatives of functional vs rho, sigma and tau
            , d3r2l(:,:)    => NULL() & !<
            , d3rl2(:,:)    => NULL() & !<
            , d3rsl(:,:)    => NULL() & !<
            , d3rtl(:,:)    => NULL() & !<
            , d3s2l(:,:)    => NULL() & !<
            , d3sl2(:,:)    => NULL() & !<
            , d3stl(:,:)    => NULL() & !<
            , d3t2l(:,:)    => NULL() & !<
            , d3tl2(:,:)    => NULL() & !<
            , d3l3(:,:)     => NULL()

    contains
        procedure(init_xc_lib),     deferred :: init
        procedure(compute_xc_lib),  deferred :: compute
        procedure(setPts_xc_lib),   deferred :: setPts
        procedure :: clean
        procedure :: scalexc
        procedure, non_overridable :: echo
        procedure, non_overridable :: getEnergy
        procedure, non_overridable :: resetEnergy
    end type xc_lib_t