29#include "./base/base_uses.f90"
33 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_block_davidson_types'
39 INTEGER :: max_iter = -1, prec_type = -1, solver_type = -1, niter_new_prec = -1, first_prec = -1
40 LOGICAL :: use_sparse_mos = .false.
41 REAL(kind=
dp) :: conv_percent = -1.0_dp, energy_gap = -1.0_dp, eps_iter = -1.0_dp
42 TYPE(
cp_fm_type),
POINTER :: h_block_mat => null(), h_block_vec => null(), &
43 matrix_z => null(), matrix_pz => null(), s_block_mat => null(), w_block_mat => null()
59 INTEGER,
INTENT(IN) :: nspins
64 cpassert(.NOT.
ASSOCIATED(bdav_env))
65 ALLOCATE (bdav_env(nspins))
67 NULLIFY (bdav_env(ispin)%H_block_mat)
68 NULLIFY (bdav_env(ispin)%H_block_vec)
69 NULLIFY (bdav_env(ispin)%S_block_mat)
70 NULLIFY (bdav_env(ispin)%W_block_mat)
71 NULLIFY (bdav_env(ispin)%matrix_z)
72 NULLIFY (bdav_env(ispin)%matrix_pz)
75 i_val=bdav_env(ispin)%prec_type)
77 i_val=bdav_env(ispin)%solver_type)
79 r_val=bdav_env(ispin)%energy_gap)
81 i_val=bdav_env(ispin)%niter_new_prec)
83 i_val=bdav_env(ispin)%max_iter)
85 r_val=bdav_env(ispin)%eps_iter)
87 i_val=bdav_env(ispin)%first_prec)
89 r_val=bdav_env(ispin)%conv_percent)
91 l_val=bdav_env(ispin)%use_sparse_mos)
108 INTEGER,
INTENT(IN) :: nao, nmo
110 CHARACTER(len=*),
PARAMETER :: routinen =
'block_davidson_allocate'
112 INTEGER :: handle, nmox2
115 CALL timeset(routinen, handle)
116 NULLIFY (fm_struct_tmp)
121 para_env=mo_coeff%matrix_struct%para_env, &
122 context=mo_coeff%matrix_struct%context)
123 NULLIFY (bdav_env%matrix_z, bdav_env%matrix_pz)
124 ALLOCATE (bdav_env%matrix_z, bdav_env%matrix_pz)
125 CALL cp_fm_create(bdav_env%matrix_z, fm_struct_tmp, name=
"Z_mat")
126 CALL cp_fm_create(bdav_env%matrix_pz, fm_struct_tmp, name=
"Z_mat")
129 CALL timestop(handle)
141 INTEGER :: ispin, nspins
143 IF (
ASSOCIATED(bdav_env))
THEN
145 nspins =
SIZE(bdav_env)
150 DEALLOCATE (bdav_env(ispin)%matrix_z, bdav_env(ispin)%matrix_pz)
151 NULLIFY (bdav_env(ispin)%matrix_z, bdav_env(ispin)%matrix_pz)
167 INTEGER :: ispin, nspins
169 IF (
ASSOCIATED(bdav_env))
THEN
171 nspins =
SIZE(bdav_env)
174 IF (
ASSOCIATED(bdav_env(ispin)%matrix_z))
THEN
177 DEALLOCATE (bdav_env(ispin)%matrix_z, bdav_env(ispin)%matrix_pz)
178 NULLIFY (bdav_env(ispin)%matrix_z, bdav_env(ispin)%matrix_pz)
182 DEALLOCATE (bdav_env)
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
represent a full matrix distributed on many processors
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp)
creates a new full matrix with the given structure
Defines the basic variable types.
integer, parameter, public dp
module that contains the algorithms to perform an itrative diagonalization by the block-Davidson appr...
subroutine, public block_davidson_allocate(bdav_env, mo_coeff, nao, nmo)
...
subroutine, public block_davidson_release(bdav_env)
...
subroutine, public block_davidson_deallocate(bdav_env)
...
subroutine, public block_davidson_env_create(bdav_env, nspins, scf_section)
...
keeps the information about the structure of a full matrix