46#include "./base/base_uses.f90"
52 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'ec_env_types'
64 CHARACTER(len=20) :: ec_name =
""
65 INTEGER :: energy_functional = 0
66 INTEGER :: ks_solver = 0
67 INTEGER :: factorization = 0
68 INTEGER :: ec_initial_guess = 0
69 REAL(kind=
dp) :: eps_default = 0.0_dp
70 LOGICAL :: do_ec_admm = .false.
71 LOGICAL :: do_ec_hfx = .false.
72 LOGICAL :: should_update = .false.
73 LOGICAL :: use_ls_solver = .false.
74 LOGICAL :: reuse_hfx = .false.
75 LOGICAL :: basis_inconsistent = .false.
77 LOGICAL :: write_harris_wfn = .false.
79 LOGICAL :: debug_forces = .false.
80 LOGICAL :: debug_stress = .false.
81 LOGICAL :: debug_external = .false.
82 REAL(kind=
dp) :: orbrot_index = 0.0_dp
83 REAL(kind=
dp) :: phase_index = 0.0_dp
85 CHARACTER(len=20) :: basis =
""
86 LOGICAL :: mao = .false.
88 LOGICAL :: do_skip = .false., skip_ec = .false.
90 INTEGER :: mao_max_iter = 0
91 REAL(kind=
dp) :: mao_eps_grad = 0.0_dp
92 REAL(kind=
dp) :: mao_eps1 = 0.0_dp
93 INTEGER :: mao_iolevel = 0
97 REAL(kind=
dp) :: etotal = 0.0_dp, old_etotal = 0.0_dp
98 REAL(kind=
dp) :: eband = 0.0_dp, ecore = 0.0_dp, exc = 0.0_dp, &
99 ehartree = 0.0_dp, vhxc = 0.0_dp
100 REAL(kind=
dp) :: edispersion = 0.0_dp, efield_elec = 0.0_dp, &
101 efield_nuclear = 0.0_dp, ex = 0.0_dp, exc_aux_fit = 0.0_dp
102 REAL(kind=
dp) :: exc1 = 0.0_dp, exc1_aux_fit = 0.0_dp, ehartree_1c = 0.0_dp
103 REAL(kind=
dp) :: ekts = 0.0_dp
108 DIMENSION(:),
POINTER :: sab_orb => null(), sac_ppl => null(), &
109 sac_ae => null(), sap_ppnl => null(), &
110 sab_kp => null(), sab_kp_nosym => null(), &
118 LOGICAL :: do_kpoints = .false.
124 matrix_h => null(), &
125 matrix_s => null(), &
126 matrix_t => null(), &
127 matrix_p => null(), &
140 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_hz => null(), matrix_wz => null(), &
141 matrix_z => null(), z_admm => null()
148 vtau_rspace => null(), &
149 vadmm_rspace => null()
155 TYPE(
hfx_type),
DIMENSION(:, :),
POINTER :: x_data => null()
158 xc_section_aux => null()
160 CHARACTER(len=40) :: exresp_fn =
""
161 CHARACTER(len=40) :: exresperr_fn =
""
162 CHARACTER(len=40) :: exresult_fn =
""
163 LOGICAL :: do_error = .false.
164 CHARACTER(len=1) :: error_method =
"E"
165 REAL(kind=
dp) :: error_cutoff = 0.0_dp
166 INTEGER :: error_subspace = 0
167 REAL(kind=
dp),
DIMENSION(3, 3) :: rpv = 0.0_dp
168 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: rf => null()
181 CHARACTER(LEN=*),
PARAMETER :: routinen =
'ec_env_release'
185 CALL timeset(routinen, handle)
187 IF (
ASSOCIATED(ec_env))
THEN
208 IF (
ASSOCIATED(ec_env%task_list))
THEN
211 IF (
ASSOCIATED(ec_env%task_list_soft))
THEN
217 IF (
ASSOCIATED(ec_env%dispersion_env))
THEN
226 IF (
ASSOCIATED(ec_env%p_env))
THEN
228 DEALLOCATE (ec_env%p_env)
235 IF (
ASSOCIATED(ec_env%ls_env))
THEN
239 IF (.NOT. ec_env%reuse_hfx)
THEN
240 IF (
ASSOCIATED(ec_env%x_data))
CALL hfx_release(ec_env%x_data)
250 IF (
ASSOCIATED(ec_env%rf))
THEN
251 DEALLOCATE (ec_env%rf)
260 CALL timestop(handle)
271 IF (
ASSOCIATED(ec_env))
THEN
273 NULLIFY (ec_env%matrix_hz)
275 NULLIFY (ec_env%matrix_wz)
277 NULLIFY (ec_env%matrix_z)
279 NULLIFY (ec_env%z_admm)
293 IF (
ASSOCIATED(ec_env))
THEN
294 IF (
ASSOCIATED(ec_env%vh_rspace%pw_grid))
THEN
295 CALL ec_env%vh_rspace%release()
297 IF (
ASSOCIATED(ec_env%vxc_rspace))
THEN
298 DO iab = 1,
SIZE(ec_env%vxc_rspace)
299 CALL ec_env%vxc_rspace(iab)%release()
301 DEALLOCATE (ec_env%vxc_rspace)
302 NULLIFY (ec_env%vxc_rspace)
304 IF (
ASSOCIATED(ec_env%vtau_rspace))
THEN
305 DO iab = 1,
SIZE(ec_env%vtau_rspace)
306 CALL ec_env%vtau_rspace(iab)%release()
308 DEALLOCATE (ec_env%vtau_rspace)
309 NULLIFY (ec_env%vtau_rspace)
311 IF (
ASSOCIATED(ec_env%vadmm_rspace))
THEN
312 DO iab = 1,
SIZE(ec_env%vadmm_rspace)
313 CALL ec_env%vadmm_rspace(iab)%release()
315 DEALLOCATE (ec_env%vadmm_rspace)
316 NULLIFY (ec_env%vadmm_rspace)
318 IF (
ASSOCIATED(ec_env%local_rho_set))
THEN
320 NULLIFY (ec_env%local_rho_set)
322 IF (
ASSOCIATED(ec_env%local_rho_set_admm))
THEN
324 NULLIFY (ec_env%local_rho_set_admm)
DBCSR operations in CP2K.
represent a full matrix distributed on many processors
Types needed for a linear scaling quickstep SCF run based on the density matrix.
subroutine, public ls_scf_release(ls_scf_env)
release the LS type.
Types needed for a for a Energy Correction.
subroutine, public ec_env_potential_release(ec_env)
...
subroutine, public ec_env_matrix_release(ec_env)
...
subroutine, public ec_env_release(ec_env)
...
Types and set/get functions for HFX.
subroutine, public hfx_release(x_data)
This routine deallocates all data structures
Defines the basic variable types.
integer, parameter, public dp
Types and basic routines needed for a kpoint calculation.
subroutine, public kpoint_release(kpoint)
Release a kpoint environment, deallocate all data.
Definition of disperson types for DFT calculations.
subroutine, public qs_dispersion_release(dispersion_env)
...
subroutine, public deallocate_qs_force(qs_force)
Deallocate a Quickstep force data structure.
subroutine, public local_rho_set_release(local_rho_set)
...
Define the neighbor list data types and the corresponding functionality.
subroutine, public release_neighbor_list_sets(nlists)
releases an array of neighbor_list_sets
subroutine, public deallocate_oce_set(oce_set)
Deallocate the matrix set of oce coefficients.
basis types for the calculation of the perturbation of density theory.
subroutine, public p_env_release(p_env)
relases the given p_env (see doc/ReferenceCounting.html)
type for berry phase efield matrices. At the moment only used for cosmat and sinmat
subroutine, public efield_berry_release(efield)
...
parameters that control an scf iteration
subroutine, public deallocate_task_list(task_list)
deallocates the components and the object itself
Contains information on the energy correction functional for KG.
stores some data used in construction of Kohn-Sham matrix
Contains information about kpoints.
Represent a qs system that is perturbed. Can calculate the linear operator and the rhs of the system ...
contains the parameters needed by a scf run