25#include "./base/base_uses.f90"
31 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_harris_types'
35 REAL(KIND=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: rvecs
39 CHARACTER(LEN=default_string_length) :: basis_type =
"NDef"
40 TYPE(rho_vec_type),
ALLOCATABLE,
DIMENSION(:, :) :: rhovec
41 TYPE(rho_vec_type),
ALLOCATABLE,
DIMENSION(:, :) :: intvec
44 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: basptr
45 LOGICAL :: frozen = .false.
49 REAL(kind=
dp) :: eharris = 0.0_dp
50 REAL(kind=
dp) :: eband = 0.0_dp
51 REAL(kind=
dp) :: exc_correction = 0.0_dp
52 REAL(kind=
dp) :: eh_correction = 0.0_dp
53 REAL(kind=
dp) :: ewald_correction = 0.0_dp
54 REAL(kind=
dp) :: dispersion = 0.0_dp
64 INTEGER :: energy_functional = 0
65 INTEGER :: density_source = 0
66 INTEGER :: orbital_basis = 0
76 LOGICAL :: debug_forces = .false.
77 LOGICAL :: debug_stress = .false.
96 INTEGER,
INTENT(IN) :: iounit
100 WRITE (unit=iounit, fmt=
"(/,(T2,A))")
"HARRIS MODEL ENERGY INFORMATION"
101 WRITE (unit=iounit, fmt=
"((T3,A,T56,F25.14))") &
102 "Harris model energy: ", energy%eharris, &
103 "Band energy: ", energy%eband, &
104 "Hartree correction energy: ", energy%eh_correction, &
105 "XC correction energy: ", energy%exc_correction, &
106 "Ewald sum correction energy: ", energy%ewald_correction, &
107 "Dispersion energy (pair potential): ", energy%dispersion
122 local_particles, nspin)
124 CHARACTER(LEN=*) :: basis_type
125 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
128 INTEGER,
INTENT(IN) :: nspin
130 INTEGER :: iatom, ikind, iptr, ispin, natom, nkind, &
131 nparticle_local, nsgf
132 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: atom_of_kind, kind_of, nbasf
136 CALL harris_rhoin_release(rhoin)
138 rhoin%basis_type = basis_type
142 atom_of_kind=atom_of_kind, kind_of=kind_of)
143 natom =
SIZE(atom_of_kind)
144 nkind =
SIZE(qs_kind_set)
146 ALLOCATE (nbasf(nkind))
148 qs_kind => qs_kind_set(ikind)
149 CALL get_qs_kind(qs_kind, basis_set=basis_set, basis_type=basis_type)
154 ALLOCATE (rhoin%basptr(natom, 2))
157 ikind = kind_of(iatom)
158 rhoin%basptr(iatom, 1) = iptr
159 iptr = iptr + nbasf(ikind)
160 rhoin%basptr(iatom, 2) = iptr - 1
162 rhoin%nbas = iptr - 1
164 ALLOCATE (rhoin%rhovec(nkind, nspin))
168 nparticle_local = local_particles%n_el(ikind)
169 ALLOCATE (rhoin%rhovec(ikind, ispin)%rvecs(nsgf, nparticle_local))
173 ALLOCATE (rhoin%intvec(nkind, nspin))
177 nparticle_local = local_particles%n_el(ikind)
178 ALLOCATE (rhoin%intvec(ikind, ispin)%rvecs(nsgf, nparticle_local))
195 IF (
ASSOCIATED(harris_env))
THEN
197 CALL harris_rhoin_release(harris_env%rhoin)
199 IF (
ASSOCIATED(harris_env%vh_rspace%pw_grid))
THEN
200 CALL harris_env%vh_rspace%release()
202 IF (
ASSOCIATED(harris_env%vxc_rspace))
THEN
203 DO iab = 1,
SIZE(harris_env%vxc_rspace)
204 CALL harris_env%vxc_rspace(iab)%release()
206 DEALLOCATE (harris_env%vxc_rspace)
209 DEALLOCATE (harris_env)
220 SUBROUTINE harris_rhoin_release(rhoin)
225 IF (
ALLOCATED(rhoin%rhovec))
THEN
226 DO i = 1,
SIZE(rhoin%rhovec, 2)
227 DO j = 1,
SIZE(rhoin%rhovec, 1)
228 IF (
ALLOCATED(rhoin%rhovec(j, i)%rvecs))
THEN
229 DEALLOCATE (rhoin%rhovec(j, i)%rvecs)
233 DEALLOCATE (rhoin%rhovec)
235 IF (
ALLOCATED(rhoin%intvec))
THEN
236 DO i = 1,
SIZE(rhoin%intvec, 2)
237 DO j = 1,
SIZE(rhoin%intvec, 1)
238 IF (
ALLOCATED(rhoin%intvec(j, i)%rvecs))
THEN
239 DEALLOCATE (rhoin%intvec(j, i)%rvecs)
243 DEALLOCATE (rhoin%intvec)
245 IF (
ALLOCATED(rhoin%basptr))
THEN
246 DEALLOCATE (rhoin%basptr)
248 rhoin%basis_type =
"NDef"
251 rhoin%frozen = .false.
253 END SUBROUTINE harris_rhoin_release
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
subroutine, public get_gto_basis_set(gto_basis_set, name, aliases, norm_type, kind_radius, ncgf, nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum)
...
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Types needed for a for a Harris model calculation.
subroutine, public harris_env_release(harris_env)
...
subroutine, public harris_rhoin_init(rhoin, basis_type, qs_kind_set, atomic_kind_set, local_particles, nspin)
...
subroutine, public harris_print_energy(iounit, energy)
...
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, init_u_ramping_each_scf, reltmat, ghost, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
Provides all information about an atomic kind.
structure to store local (to a processor) ordered lists of integers.
Contains information on the Harris method.
Provides all information about a quickstep kind.