mod_dft_gridint Module


Uses

  • module~~mod_dft_gridint~~UsesGraph module~mod_dft_gridint mod_dft_gridint module~basis_tools basis_tools module~mod_dft_gridint->module~basis_tools module~functionals functionals module~mod_dft_gridint->module~functionals module~io_constants io_constants module~mod_dft_gridint->module~io_constants module~mod_dft_molgrid mod_dft_molgrid module~mod_dft_gridint->module~mod_dft_molgrid module~mod_dft_xc_libxc mod_dft_xc_libxc module~mod_dft_gridint->module~mod_dft_xc_libxc module~oqp_linalg oqp_linalg module~mod_dft_gridint->module~oqp_linalg module~parallel parallel module~mod_dft_gridint->module~parallel module~precision precision module~mod_dft_gridint->module~precision module~basis_tools->module~io_constants module~basis_tools->module~parallel module~basis_tools->module~precision iso_fortran_env iso_fortran_env module~basis_tools->iso_fortran_env module~atomic_structure_m atomic_structure_m module~basis_tools->module~atomic_structure_m module~constants constants module~basis_tools->module~constants module~functionals->module~precision iso_c_binding iso_c_binding module~functionals->iso_c_binding xc_f03_lib_m xc_f03_lib_m module~functionals->xc_f03_lib_m module~mod_dft_molgrid->module~precision module~bragg_slater_radii bragg_slater_radii module~mod_dft_molgrid->module~bragg_slater_radii module~lebedev lebedev module~mod_dft_molgrid->module~lebedev module~mod_grid_storage mod_grid_storage module~mod_dft_molgrid->module~mod_grid_storage module~mod_dft_xc_libxc->module~precision module~mod_dft_xclib mod_dft_xclib module~mod_dft_xc_libxc->module~mod_dft_xclib module~blas_wrap blas_wrap module~oqp_linalg->module~blas_wrap module~lapack_wrap lapack_wrap module~oqp_linalg->module~lapack_wrap module~parallel->module~precision module~parallel->iso_c_binding module~parallel->iso_fortran_env mpi mpi module~parallel->mpi module~precision->iso_fortran_env module~atomic_structure_m->iso_c_binding module~blas_wrap->module~precision module~mathlib_types mathlib_types module~blas_wrap->module~mathlib_types module~messages messages module~blas_wrap->module~messages module~bragg_slater_radii->module~precision module~constants->module~precision module~lapack_wrap->module~precision module~lapack_wrap->module~mathlib_types module~lapack_wrap->module~messages module~lebedev->module~precision module~mod_dft_xclib->module~functionals module~mod_dft_xclib->module~precision module~mod_grid_storage->module~precision module~messages->module~io_constants module~messages->module~precision comm_IOFILE comm_IOFILE module~messages->comm_IOFILE comm_PAR comm_PAR module~messages->comm_PAR

Used by

  • module~~mod_dft_gridint~~UsedByGraph module~mod_dft_gridint mod_dft_gridint module~mod_dft_gridint_energy mod_dft_gridint_energy module~mod_dft_gridint_energy->module~mod_dft_gridint module~mod_dft_gridint_fxc mod_dft_gridint_fxc module~mod_dft_gridint_fxc->module~mod_dft_gridint module~mod_dft_gridint_grad mod_dft_gridint_grad module~mod_dft_gridint_grad->module~mod_dft_gridint module~mod_dft_gridint_gxc mod_dft_gridint_gxc module~mod_dft_gridint_gxc->module~mod_dft_gridint module~mod_dft_gridint_gxc->module~mod_dft_gridint_fxc module~mod_dft_gridint_tdxc_grad mod_dft_gridint_tdxc_grad module~mod_dft_gridint_tdxc_grad->module~mod_dft_gridint proc~derexc_blk derexc_blk proc~derexc_blk->module~mod_dft_gridint proc~dmatd_blk dmatd_blk proc~dmatd_blk->module~mod_dft_gridint proc~tddft_fxc tddft_fxc proc~tddft_fxc->module~mod_dft_gridint proc~tddft_gxc tddft_gxc proc~tddft_gxc->module~mod_dft_gridint proc~tddft_xc_gradient tddft_xc_gradient proc~tddft_xc_gradient->module~mod_dft_gridint proc~utddft_fxc utddft_fxc proc~utddft_fxc->module~mod_dft_gridint proc~utddft_xc_gradient utddft_xc_gradient proc~utddft_xc_gradient->module~mod_dft_gridint proc~dftder dftder proc~dftder->module~mod_dft_gridint_grad proc~dftexcor dftexcor proc~dftexcor->module~mod_dft_gridint_energy proc~oqp_tdhf_z_vector oqp_tdhf_z_vector proc~oqp_tdhf_z_vector->module~mod_dft_gridint_fxc proc~oqp_tdhf_z_vector->module~mod_dft_gridint_gxc proc~tdhf_energy tdhf_energy proc~tdhf_energy->module~mod_dft_gridint_fxc proc~tdhf_gradient tdhf_gradient proc~tdhf_gradient->module~mod_dft_gridint_tdxc_grad

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: OQP_FUNTYP_LDA = 0
integer, public, parameter :: OQP_FUNTYP_GGA = 1
integer, public, parameter :: OQP_FUNTYP_MGGA = 2
integer, public, parameter :: X__ = 1
integer, public, parameter :: Y__ = 2
integer, public, parameter :: Z__ = 3
integer, public, parameter :: XX_ = 1
integer, public, parameter :: YY_ = 2
integer, public, parameter :: ZZ_ = 3
integer, public, parameter :: XY_ = 4
integer, public, parameter :: YZ_ = 5
integer, public, parameter :: XZ_ = 6
integer, public, parameter :: dXX = 1
integer, public, parameter :: dXY = 2
integer, public, parameter :: dXZ = 3
integer, public, parameter :: dYX = 4
integer, public, parameter :: dYY = 5
integer, public, parameter :: dYZ = 6
integer, public, parameter :: dZX = 7
integer, public, parameter :: dZY = 8
integer, public, parameter :: dZZ = 9
integer, public, parameter :: XXX = 1
integer, public, parameter :: YYY = 2
integer, public, parameter :: ZZZ = 3
integer, public, parameter :: XXY = 4
integer, public, parameter :: XXZ = 5
integer, public, parameter :: YYX = 6
integer, public, parameter :: YYZ = 7
integer, public, parameter :: ZZX = 8
integer, public, parameter :: ZZY = 9
integer, public, parameter :: XYZ = 10
integer, public, parameter :: SQ_TO_TR(3,3) = reshape([XX_, XY_, XZ_, XY_, YY_, YZ_, XZ_, YZ_, ZZ_], shape(SQ_TO_TR))

Abstract Interfaces

abstract interface

  • public subroutine xc_consumer_parallel_start(self, xce, nthreads)

    @brief Initialization of the data for XC consumer

    Note

    This class should handle multithreaded runs by its own means

    Note

    This subroutine is executed inside the parallel region by master thread only

    Arguments

    Type IntentOptional Attributes Name
    class(xc_consumer_t), intent(inout), target :: self
    class(xc_engine_t), intent(in) :: xce
    integer, intent(in) :: nthreads

abstract interface

  • public subroutine xc_consumer_parallel_stop(self)

    @brief Finalization of data in parallel run

    Note

    This subroutine is executed outside of the parallel region

    Arguments

    Type IntentOptional Attributes Name
    class(xc_consumer_t), intent(inout) :: self

abstract interface

  • public subroutine xc_consumer_clean(self)

    @brief Release resources of xc_consumer_t

    Note

    This subroutine is executed outside of the parallel region

    Arguments

    Type IntentOptional Attributes Name
    class(xc_consumer_t), intent(inout) :: self

abstract interface

  • public subroutine xc_consumer_update(self, xce, mythread)

    @brief Main subroutine to consume XC functional values provided by xc_engine_t

    Note

    This subroutine is executed inside the parallel region by every thread

    Arguments

    Type IntentOptional Attributes Name
    class(xc_consumer_t), intent(inout) :: self
    class(xc_engine_t), intent(in) :: xce
    integer :: mythread

abstract interface

  • public subroutine xc_consumer_postUpdate(self, xce, mythread)

    Note

    This subroutine is executed inside the parallel region by every thread

    Arguments

    Type IntentOptional Attributes Name
    class(xc_consumer_t), intent(inout) :: self
    class(xc_engine_t), intent(in) :: xce
    integer :: mythread

abstract interface

  • public subroutine compute_density(self, rho)

    Arguments

    Type IntentOptional Attributes Name
    class(xc_engine_t) :: self
    real(kind=fp), intent(out) :: rho(:,:)

abstract interface

  • public subroutine compute_density_grad(self, drho, sigma)

    Arguments

    Type IntentOptional Attributes Name
    class(xc_engine_t) :: self
    real(kind=fp), intent(out) :: drho(:,:)
    real(kind=fp), intent(out) :: sigma(:,:)

abstract interface

  • public subroutine compute_density_tau(self, tau)

    Arguments

    Type IntentOptional Attributes Name
    class(xc_engine_t) :: self
    real(kind=fp), intent(out) :: tau(:,:)

Derived Types

type, public, abstract ::  xc_consumer_t

@brief Basic type to consume XC values on a grid

Components

Type Visibility Attributes Name Initial
real(kind=fp), public :: E_xc
real(kind=fp), public :: E_exch
real(kind=fp), public :: E_corr
real(kind=fp), public :: N_elec
real(kind=fp), public :: E_kin
real(kind=fp), public :: G_total(3)
type(par_env_t), public :: pe

Type-Bound Procedures

procedure(xc_consumer_parallel_start), public, deferred, pass :: parallel_start
procedure(xc_consumer_parallel_stop), public, deferred, pass :: parallel_stop
procedure(xc_consumer_update), public, deferred, pass :: update
procedure(xc_consumer_postUpdate), public, deferred, pass :: postUpdate
procedure(xc_consumer_clean), public, deferred, pass :: clean

type, public ::  xc_options_t

@brief Interface structure to set up XC engine options

Components

Type Visibility Attributes Name Initial
logical, public :: isGGA = .false.
logical, public :: needTau = .false.
logical, public :: hasBeta = .false.
logical, public :: isWFVecs = .true.
integer, public :: numAOs = 0
integer, public :: maxPts = 0
integer, public :: limPts = 0
integer, public :: numAtoms = 0
integer, public :: maxAngMom = 0
integer, public :: nDer = 0
integer, public :: nXCDer = 0
integer, public :: numAOVecs = 0
integer, public :: numTmpVec = 0
integer, public :: numOccAlpha = 0
integer, public :: numOccBeta = 0
real(kind=fp), public :: dft_threshold = 0.0d0
real(kind=fp), public :: ao_threshold = 0.0d0
real(kind=fp), public :: ao_sparsity_ratio = 0.0d0
real(kind=fp), public, contiguous, pointer :: wfAlpha(:,:) => null()
real(kind=fp), public, contiguous, pointer :: wfBeta(:,:) => null()
type(dft_grid_t), public, pointer :: molGrid => null()
type(functional_t), public, pointer :: functional

type, public ::  xc_engine_t

@brief Main class which knows how to compute XC functional values, AO and MO values and gradients on a grid @details It is complemented with xc_consumer_t class to use calculation results

Components

Type Visibility Attributes Name Initial
real(kind=fp), public, allocatable :: xyzw(:,:)
real(kind=fp), public, allocatable :: aoMem_(:)
real(kind=fp), public, allocatable :: moMemA_(:)
real(kind=fp), public, allocatable :: moMemB_(:)
real(kind=fp), public, allocatable :: tmpWfAlpha(:)
real(kind=fp), public, allocatable :: tmpWfBeta(:)
integer, public, allocatable :: indices_p(:)
real(kind=fp), public, contiguous, pointer :: aoMem(:,:,:) => null()
real(kind=fp), public, contiguous, pointer :: moMemA(:,:,:) => null()
real(kind=fp), public, contiguous, pointer :: moMemB(:,:,:) => null()
real(kind=fp), public, contiguous, pointer :: aoV(:,:) => null()
real(kind=fp), public, contiguous, pointer :: moVA(:,:) => null()
real(kind=fp), public, contiguous, pointer :: moVB(:,:) => null()
real(kind=fp), public, contiguous, pointer :: aoG1(:,:,:) => null()
real(kind=fp), public, contiguous, pointer :: aoG2(:,:,:) => null()
real(kind=fp), public, contiguous, pointer :: moG1A(:,:,:) => null()
real(kind=fp), public, contiguous, pointer :: moG2A(:,:,:) => null()
real(kind=fp), public, contiguous, pointer :: moG1B(:,:,:) => null()
real(kind=fp), public, contiguous, pointer :: moG2B(:,:,:) => null()
real(kind=fp), public, contiguous, pointer :: wts(:) => null()
real(kind=fp), public, contiguous, pointer :: wfAlpha(:,:) => null()
real(kind=fp), public, contiguous, pointer :: wfBeta(:,:) => null()
real(kind=fp), public, contiguous, pointer :: wfAlpha_p(:,:) => null()
real(kind=fp), public, contiguous, pointer :: wfBeta_p(:,:) => null()
logical, public :: isGGA = .false.
logical, public :: needTau = .false.
logical, public :: hasBeta = .false.
logical, public :: isWFVecs = .true.
integer, public :: numAOs = 0
integer, public :: numAOs_p = 0
logical, public :: skip_p = .true.
integer, public :: numPts = 0
integer, public :: numAtoms = 0
integer, public :: maxPts = 0
integer, public :: maxAngMom = 0
integer, public :: nAODer = 0
integer, public :: nXCDer = 1
integer, public :: funTyp = 0
integer, public :: numAOVecs = 0
integer, public :: numTmpVec = 0
integer, public :: numOccAlpha = 0
integer, public :: numOccBeta = 0
real(kind=fp), public :: threshold = 1.0d-15
real(kind=fp), public :: ao_threshold = 1.0d-15
real(kind=fp), public :: ao_sparsity_ratio = 0.90d+0
type(xc_libxc_t), public, allocatable :: XCLib
integer, public :: dbgLevel = 0
real(kind=fp), public :: N_elec = 0.0
real(kind=fp), public :: E_kin = 0.0
real(kind=fp), public :: G_total(3) = 0.0
procedure(compute_density), public, pointer, pass :: compRho => null()
procedure(compute_density_grad), public, pointer, pass :: compDRho => null()
procedure(compute_density_tau), public, pointer, pass :: compTau => null()

Type-Bound Procedures

procedure, public :: init
procedure, public :: echo => echoVars
procedure, public :: getStats
procedure, public :: resetPointers
procedure, public :: resetOrbPointers
procedure, public :: resetXCPointers
procedure, public :: compAOs
procedure, public :: pruneAOs
procedure, public :: resetPrunedPointers
procedure, public :: compMOs
procedure, public :: compRMOs
procedure, public :: compRMOGs
generic, public :: compRRho => compRRho_ab, compRRho_a
generic, public :: compRDRho => compRDRho_ab, compRDRho_a
generic, public :: compRTau => compRTau_ab, compRTau_a
procedure, public :: compRhoAll
procedure, public :: compXC

Subroutines

public subroutine mo_tran_symm_(numAOs, nVecs, nPts, A, B, C)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: numAOs
integer, intent(in) :: nVecs
integer, intent(in) :: nPts
real(kind=fp), intent(in) :: A(*)
real(kind=fp), intent(in) :: B(*)
real(kind=fp), intent(inout) :: C(*)

public subroutine mo_tran_gemm_(numMOs, numAOs, nVecs, nPts, numAOs_active, A, B, C)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: numMOs
integer, intent(in) :: numAOs
integer, intent(in) :: nVecs
integer, intent(in) :: nPts
integer, intent(in) :: numAOs_active
real(kind=fp), intent(in) :: A(*)
real(kind=fp), intent(in) :: B(*)
real(kind=fp), intent(inout) :: C(*)

public subroutine compAtGradRho(bfGrad, fGrad, moV, aoG1, nPts)

@brief Compute XC contributions to the gradient from a grid point, LDA part @param[in] iPt index of a grid point @param[inout] bfGrad array of gradient contributions per basis function @param[in] fgrad XC gradient @param[in] moV MO-like orbital values @author Vladimir Mironov

Arguments

Type IntentOptional Attributes Name
real(kind=fp), intent(inout) :: bfGrad(:,:)
real(kind=fp), intent(in) :: fGrad(:)
real(kind=fp), intent(in), contiguous :: moV(:,:)
real(kind=fp), intent(in), contiguous :: aoG1(:,:,:)
integer, intent(in) :: nPts

public subroutine compAtGradDRho(bfGrad, fGrad, moV, moG1, aoG1, aoG2, npts)

@brief Compute XC contributions to the gradient from a grid point, GGA part @param[inout] bfGrad array of gradient contributions per basis function @param[in] fgrad XC gradient @param[in] moV MO-like orbital values @param[in] moG1 MO-like orbital gradients @author Vladimir Mironov

Arguments

Type IntentOptional Attributes Name
real(kind=fp), intent(inout) :: bfGrad(:,:)
real(kind=fp), intent(in) :: fGrad(:,:)
real(kind=fp), intent(in), contiguous :: moV(:,:)
real(kind=fp), intent(in), contiguous :: moG1(:,:,:)
real(kind=fp), intent(in), contiguous :: aoG1(:,:,:)
real(kind=fp), intent(in), contiguous :: aoG2(:,:,:)
integer, intent(in) :: npts

public subroutine compAtGradTau(bfGrad, fgrad, moG1, aoG2, npts)

@brief Compute XC contributions to the gradient from a grid point, mGGA part @param[in] iPt index of a grid point @param[inout] bfGrad array of gradient contributinos per basis function @param[in] dedta XC energy, mGGA contribution, alpha-spin @param[in] dedtb XC energy, mGGA contribution, beta-spin @author Vladimir Mironov

Arguments

Type IntentOptional Attributes Name
real(kind=fp), intent(inout) :: bfGrad(:,:)
real(kind=fp), intent(in) :: fgrad(:)
real(kind=fp), intent(in), contiguous :: moG1(:,:,:)
real(kind=fp), intent(in), contiguous :: aoG2(:,:,:)
integer, intent(in) :: npts

public subroutine xc_der1(xce, beta, ipt, d_r, d_s, d_t)

@brief Get first derivative of the XC functional @param[in] xce XC engine @param[in] beta Whether to return spin-polarized quantities @param[out] d_r dE_xc / d_rho (alpha, beta) @param[out] d_s dE_xc / d_sigma (alpha-alpha, beta-beta, alpha-beta) @param[out] d_t dE_xc / d_tau (alpha, beta)

Arguments

Type IntentOptional Attributes Name
class(xc_engine_t) :: xce
logical :: beta
integer, intent(in) :: ipt
real(kind=fp), intent(out) :: d_r(2)
real(kind=fp), intent(out) :: d_s(3)
real(kind=fp), intent(out) :: d_t(2)

public subroutine xc_der2_contr(xce, beta, ipt, dr, ds, dt, f_r, f_s, f_t)

@brief Get second derivative of the XC functional contracted with response densities @param[in] xce XC engine @param[in] beta Whether to return spin-polarized quantities @param[in] d_r \delta_rho (alpha, beta) @param[in] d_s \delta_sigma (alpha-alpha, beta-beta, alpha-beta) @param[in] d_t \delta_tau (alpha, beta) @param[out] f_r \sum_i d2E_xc / (d_rho * d_zeta_i) (alpha, beta) @param[out] f_s \sum_i d2E_xc / (d_sigma * d_zeta_i) (alpha-alpha, beta-beta, alpha-beta) @param[out] f_t \sum_i d2E_xc / (d_tau * d_zeta_i) (alpha, beta)

Arguments

Type IntentOptional Attributes Name
class(xc_engine_t) :: xce
logical, intent(in) :: beta
integer, intent(in) :: ipt
real(kind=fp), intent(in) :: dr(2)
real(kind=fp), intent(in) :: ds(3)
real(kind=fp), intent(in) :: dt(2)
real(kind=fp), intent(out) :: f_r(2)
real(kind=fp), intent(out) :: f_s(3)
real(kind=fp), intent(out) :: f_t(2)

public subroutine xc_der3_contr(xce, ipt, dr, ds, dt, ss, f_s, g_r, g_s, g_t)

@brief Get third derivative of the XC functional contracted with response densities, spin-polarized version @param[in] xce XC engine @param[in] d_r \delta_rho (alpha, beta) @param[in] d_s \delta_sigma (alpha-alpha, beta-beta, alpha-beta) @param[in] d_t \delta_tau (alpha, beta) @param[in] ss (\nabla\rho(T)\nabla\rho(T)) (alpha-alpha, beta-beta, alpha-beta) @param[out] g_r \sum_i,j d2E_xc / (d_rho * d_zeta_id_zeta_j) (alpha, beta) @param[out] g_s \sum_i,j d2E_xc / (d_sigma * d_zeta_id_zeta_j) (alpha-alpha, beta-beta, alpha-beta) @param[out] g_t \sum_i,j d2E_xc / (d_tau * d_zeta_id_zeta_j) (alpha, beta)

Arguments

Type IntentOptional Attributes Name
class(xc_engine_t) :: xce
integer, intent(in) :: ipt
real(kind=fp), intent(in) :: dr(2)
real(kind=fp), intent(in) :: ds(3)
real(kind=fp), intent(in) :: dt(2)
real(kind=fp), intent(in) :: ss(3)
real(kind=fp), intent(out) :: f_s(3)
real(kind=fp), intent(out) :: g_r(2)
real(kind=fp), intent(out) :: g_s(3)
real(kind=fp), intent(out) :: g_t(2)

public subroutine run_xc(xc_opts, xc_dat, basis)

Arguments

Type IntentOptional Attributes Name
type(xc_options_t), intent(in) :: xc_opts
class(xc_consumer_t), intent(inout) :: xc_dat
type(basis_set), intent(in) :: basis