43#include "./base/base_uses.f90"
51 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_loc_types'
82 LOGICAL :: do_localize = .false., first_time = .false.
85 CHARACTER(LEN=default_string_length) :: tag_mo =
""
88 POINTER :: moloc_coeff => null()
90 POINTER :: op_fm_set => null()
94 POINTER :: localized_wfn_control => null()
96 POINTER :: particle_set => null()
98 POINTER :: op_sm_set => null()
99 REAL(kind=
dp) :: start_time = -1.0_dp, target_time = -1.0_dp
100 REAL(kind=
dp) :: weights(6) = -1.0_dp
101 INTEGER :: dim_op = -1
123 INTEGER :: ref_count = -1
124 INTEGER :: min_or_max = -1
125 INTEGER :: localization_method = -1
126 INTEGER :: operator_type = -1
127 INTEGER,
DIMENSION(2) :: nloc_states = -1, nguess = -1
128 INTEGER :: set_of_states = -1
129 INTEGER,
DIMENSION(2, 2) :: lu_bound_states = -1
130 INTEGER :: max_iter = -1
131 INTEGER :: out_each = -1
132 INTEGER :: nextra = -1
133 INTEGER :: coeff_po_guess = -1, coeff_po_guess_mo_space = -1
134 REAL(kind=
dp) :: eps_localization = -1.0_dp
135 REAL(kind=
dp) :: max_crazy_angle = -1.0_dp
136 REAL(kind=
dp) :: crazy_scale = -1.0_dp
137 REAL(kind=
dp) :: eps_occ = -1.0_dp
138 REAL(kind=
dp),
DIMENSION(2) :: lu_ene_bound = -1.0_dp
139 LOGICAL :: crazy_use_diag = .false.
140 LOGICAL :: print_cubes = .false., jacobi_fallback = .false., jacobi_refinement = .false.
141 LOGICAL :: print_centers = .false.
142 LOGICAL :: print_spreads = .false.
143 LOGICAL :: do_homo = .false.
144 LOGICAL :: do_mixed = .false., do_cg_po = .false.
145 LOGICAL :: loc_restart = .false.
146 LOGICAL :: use_history = .false.
147 INTEGER,
POINTER,
DIMENSION(:, :) :: loc_states => null()
170 qs_loc_env%tag_mo =
""
171 NULLIFY (qs_loc_env%para_env)
172 NULLIFY (qs_loc_env%cell)
173 NULLIFY (qs_loc_env%op_sm_set)
174 NULLIFY (qs_loc_env%op_fm_set)
175 NULLIFY (qs_loc_env%local_molecules)
176 NULLIFY (qs_loc_env%moloc_coeff)
177 NULLIFY (qs_loc_env%particle_set)
178 NULLIFY (qs_loc_env%localized_wfn_control)
179 qs_loc_env%weights = 0.0_dp
198 IF (
ASSOCIATED(qs_loc_env%cell))
CALL cell_release(qs_loc_env%cell)
199 IF (
ASSOCIATED(qs_loc_env%local_molecules))
THEN
202 IF (
ASSOCIATED(qs_loc_env%localized_wfn_control))
THEN
206 IF (
ASSOCIATED(qs_loc_env%particle_set))
NULLIFY (qs_loc_env%particle_set)
208 IF (
ASSOCIATED(qs_loc_env%moloc_coeff))
THEN
209 DO i = 1,
SIZE(qs_loc_env%moloc_coeff, 1)
210 ii = lbound(qs_loc_env%moloc_coeff, 1) + i - 1
213 DEALLOCATE (qs_loc_env%moloc_coeff)
218 IF (
ASSOCIATED(qs_loc_env%op_sm_set))
THEN
219 DO i = 1,
SIZE(qs_loc_env%op_sm_set, 2)
220 DO j = 1,
SIZE(qs_loc_env%op_sm_set, 1)
224 DEALLOCATE (qs_loc_env%op_sm_set)
238 cpassert(.NOT.
ASSOCIATED(localized_wfn_control))
239 ALLOCATE (localized_wfn_control)
241 localized_wfn_control%ref_count = 1
242 localized_wfn_control%nloc_states = 0
243 localized_wfn_control%nextra = 0
244 localized_wfn_control%nguess = 0
245 localized_wfn_control%lu_bound_states = 0
246 localized_wfn_control%lu_ene_bound = 0.0_dp
247 localized_wfn_control%print_cubes = .false.
248 localized_wfn_control%print_centers = .false.
249 localized_wfn_control%print_spreads = .false.
250 localized_wfn_control%do_homo = .true.
251 localized_wfn_control%use_history = .false.
252 NULLIFY (localized_wfn_control%loc_states)
253 NULLIFY (localized_wfn_control%centers_set(1)%array)
254 NULLIFY (localized_wfn_control%centers_set(2)%array)
267 IF (
ASSOCIATED(localized_wfn_control))
THEN
268 cpassert(localized_wfn_control%ref_count > 0)
269 localized_wfn_control%ref_count = localized_wfn_control%ref_count - 1
270 IF (localized_wfn_control%ref_count == 0)
THEN
271 IF (
ASSOCIATED(localized_wfn_control%loc_states))
THEN
272 DEALLOCATE (localized_wfn_control%loc_states)
274 IF (
ASSOCIATED(localized_wfn_control%centers_set(1)%array))
THEN
275 DEALLOCATE (localized_wfn_control%centers_set(1)%array)
277 IF (
ASSOCIATED(localized_wfn_control%centers_set(2)%array))
THEN
278 DEALLOCATE (localized_wfn_control%centers_set(2)%array)
280 localized_wfn_control%ref_count = 0
281 DEALLOCATE (localized_wfn_control)
292 SUBROUTINE localized_wfn_control_retain(localized_wfn_control)
295 cpassert(
ASSOCIATED(localized_wfn_control))
297 localized_wfn_control%ref_count = localized_wfn_control%ref_count + 1
298 END SUBROUTINE localized_wfn_control_retain
317 SUBROUTINE get_qs_loc_env(qs_loc_env, cell, local_molecules, localized_wfn_control, &
318 moloc_coeff, op_sm_set, op_fm_set, para_env, &
319 particle_set, weights, dim_op)
322 TYPE(
cell_type),
OPTIONAL,
POINTER :: cell
325 POINTER :: localized_wfn_control
326 TYPE(
cp_fm_type),
DIMENSION(:),
OPTIONAL,
POINTER :: moloc_coeff
329 TYPE(
cp_fm_type),
DIMENSION(:, :),
OPTIONAL, &
333 POINTER :: particle_set
334 REAL(
dp),
DIMENSION(6),
OPTIONAL :: weights
335 INTEGER,
OPTIONAL :: dim_op
337 IF (
PRESENT(cell)) cell => qs_loc_env%cell
338 IF (
PRESENT(moloc_coeff)) moloc_coeff => qs_loc_env%moloc_coeff
339 IF (
PRESENT(local_molecules)) local_molecules => qs_loc_env%local_molecules
340 IF (
PRESENT(localized_wfn_control))
THEN
341 localized_wfn_control => qs_loc_env%localized_wfn_control
343 IF (
PRESENT(op_sm_set)) op_sm_set => qs_loc_env%op_sm_set
344 IF (
PRESENT(op_fm_set)) op_fm_set => qs_loc_env%op_fm_set
345 IF (
PRESENT(para_env)) para_env => qs_loc_env%para_env
346 IF (
PRESENT(particle_set)) particle_set => qs_loc_env%particle_set
347 IF (
PRESENT(weights)) weights(1:6) = qs_loc_env%weights(1:6)
348 IF (
PRESENT(dim_op)) dim_op = qs_loc_env%dim_op
369 SUBROUTINE set_qs_loc_env(qs_loc_env, cell, local_molecules, localized_wfn_control, &
370 moloc_coeff, op_sm_set, op_fm_set, para_env, &
371 particle_set, weights, dim_op)
374 TYPE(
cell_type),
OPTIONAL,
POINTER :: cell
377 POINTER :: localized_wfn_control
378 TYPE(
cp_fm_type),
DIMENSION(:),
OPTIONAL,
POINTER :: moloc_coeff
381 TYPE(
cp_fm_type),
DIMENSION(:, :),
OPTIONAL, &
385 POINTER :: particle_set
386 REAL(
dp),
DIMENSION(6),
OPTIONAL :: weights
387 INTEGER,
OPTIONAL :: dim_op
389 IF (
PRESENT(cell))
THEN
392 qs_loc_env%cell => cell
395 IF (
PRESENT(local_molecules))
THEN
397 IF (
ASSOCIATED(qs_loc_env%local_molecules))
THEN
400 qs_loc_env%local_molecules => local_molecules
403 IF (
PRESENT(localized_wfn_control))
THEN
404 CALL localized_wfn_control_retain(localized_wfn_control)
406 qs_loc_env%localized_wfn_control => localized_wfn_control
408 IF (
PRESENT(para_env))
THEN
409 CALL para_env%retain()
411 qs_loc_env%para_env => para_env
413 IF (
PRESENT(particle_set)) qs_loc_env%particle_set => particle_set
414 IF (
PRESENT(moloc_coeff))
THEN
416 qs_loc_env%moloc_coeff => moloc_coeff
418 IF (
PRESENT(op_sm_set))
THEN
419 qs_loc_env%op_sm_set => op_sm_set
421 IF (
PRESENT(op_fm_set))
THEN
422 qs_loc_env%op_fm_set => op_fm_set
424 IF (
PRESENT(weights))
THEN
425 qs_loc_env%weights = weights
427 IF (
PRESENT(dim_op))
THEN
428 qs_loc_env%dim_op = dim_op
Handles all functions related to the CELL.
subroutine, public cell_release(cell)
releases the given cell (see doc/ReferenceCounting.html)
subroutine, public cell_retain(cell)
retains the given cell (see doc/ReferenceCounting.html)
various utilities that regard array of different kinds: output, allocation,... maybe it is not a good...
subroutine, public dbcsr_deallocate_matrix(matrix)
...
represent a full matrix distributed on many processors
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
subroutine, public distribution_1d_retain(distribution_1d)
retains a distribution_1d
subroutine, public distribution_1d_release(distribution_1d)
releases the given distribution_1d
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Interface to the message passing library MPI.
subroutine, public mp_para_env_release(para_env)
releases the para object (to be called when you don't want anymore the shared copy of this object)
Routines for the calculation of molecular states.
Define the data structure for the particle information.
New version of the module for the localization of the molecular orbitals This should be able to use d...
subroutine, public localized_wfn_control_create(localized_wfn_control)
create the localized_wfn_control_type
subroutine, public qs_loc_env_release(qs_loc_env)
...
subroutine, public localized_wfn_control_release(localized_wfn_control)
release the localized_wfn_control_type
subroutine, public get_qs_loc_env(qs_loc_env, cell, local_molecules, localized_wfn_control, moloc_coeff, op_sm_set, op_fm_set, para_env, particle_set, weights, dim_op)
...
subroutine, public set_qs_loc_env(qs_loc_env, cell, local_molecules, localized_wfn_control, moloc_coeff, op_sm_set, op_fm_set, para_env, particle_set, weights, dim_op)
...
subroutine, public qs_loc_env_create(qs_loc_env)
...
Routines for the calculation of wannier states.
Type defining parameters related to the simulation cell.
represent a pointer to a 2d array
structure to store local (to a processor) ordered lists of integers.
stores all the informations relevant to an mpi environment
A type that holds controlling information for the calculation of the spread of wfn and the optimizati...
contains all the info needed by quickstep to calculate the spread of a selected set of orbitals and i...