(git:6344619)
Loading...
Searching...
No Matches
input_cp2k_loc.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
8 USE bibliography, ONLY: hunt2003,&
17 USE input_constants, ONLY: &
32 USE input_val_types, ONLY: integer_t,&
33 lchar_t,&
34 real_t
35 USE kinds, ONLY: dp
36 USE string_utilities, ONLY: s2a
37#include "./base/base_uses.f90"
38
39 IMPLICIT NONE
40 PRIVATE
41
42 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_loc'
43
45
46CONTAINS
47
48! **************************************************************************************************
49!> \brief parameters fo the localization of wavefunctions
50!> \param section ...
51!> \par History
52!> 03.2005 created [MI]
53! **************************************************************************************************
54
55 SUBROUTINE create_localize_section(section)
56
57 TYPE(section_type), POINTER :: section
58
59 TYPE(keyword_type), POINTER :: keyword
60 TYPE(section_type), POINTER :: print_key, print_section, subsection
61
62 cpassert(.NOT. ASSOCIATED(section))
63
64 NULLIFY (keyword, print_key)
65 CALL section_create(section, __location__, name="LOCALIZE", &
66 description="Use one of the available methods to define the localization"// &
67 " and possibly to optimize it to a minimum or a maximum.", &
68 n_keywords=8, n_subsections=0, repeats=.false., &
69 citations=[schreder2021])
70
71 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
72 description="controls the activation of the MOS localization procedure", &
73 usage="&LOCALIZE T", default_l_val=.false., lone_keyword_l_val=.true.)
74 CALL section_add_keyword(section, keyword)
75 CALL keyword_release(keyword)
76
77 CALL keyword_create(keyword, __location__, name="MAX_ITER", &
78 description="Maximum number of iterations used for localization methods", &
79 usage="MAX_ITER 2000", default_i_val=10000)
80 CALL section_add_keyword(section, keyword)
81 CALL keyword_release(keyword)
82
83 CALL keyword_create( &
84 keyword, __location__, name="MAX_CRAZY_ANGLE", &
85 description="Largest allowed angle for the crazy rotations algorithm (smaller is slower but more stable).", &
86 usage="MAX_CRAZY_ANGLE 0.1", unit_str="rad", default_r_val=0.2_dp)
87 CALL section_add_keyword(section, keyword)
88 CALL keyword_release(keyword)
89
90 CALL keyword_create(keyword, __location__, name="CRAZY_SCALE", &
91 description="scale angles", &
92 usage="CRAZY_SCALE 0.9", default_r_val=1.0_dp)
93 CALL section_add_keyword(section, keyword)
94 CALL keyword_release(keyword)
95
96 CALL keyword_create(keyword, __location__, name="CRAZY_USE_DIAG", &
97 description="Use diagonalization (slow) or pade based calculation of matrix exponentials.", &
98 usage="CRAZY_USE_DIAG ", default_l_val=.false., lone_keyword_l_val=.true.)
99 CALL section_add_keyword(section, keyword)
100 CALL keyword_release(keyword)
101
102 CALL keyword_create( &
103 keyword, __location__, name="USE_HISTORY", &
104 description="Generate an improved initial guess based on a history of results, which is useful during MD. "// &
105 "Will only work if the number of states to be localized remains constant.", &
106 usage="USE_HISTORY ", default_l_val=.false., lone_keyword_l_val=.true.)
107 CALL section_add_keyword(section, keyword)
108 CALL keyword_release(keyword)
109
110 CALL keyword_create(keyword, __location__, name="EACH", &
111 description="localize each n steps", &
112 default_i_val=1)
113 CALL section_add_keyword(section, keyword)
114 CALL keyword_release(keyword)
115
116 CALL keyword_create( &
117 keyword, __location__, name="EPS_OCCUPATION", &
118 description="Tolerance in the occupation number to select only fully occupied orbitals for the rotation", &
119 usage="EPS_OCCUPATION 1.E-5", default_r_val=1.0e-8_dp)
120 CALL section_add_keyword(section, keyword)
121 CALL keyword_release(keyword)
122
123 CALL keyword_create(keyword, __location__, name="OUT_ITER_EACH", &
124 description="Every how many iterations of the localization algorithm "// &
125 "(Jacobi) the tolerance value is printed out", &
126 usage="OUT_ITER_EACH 100", default_i_val=100)
127 CALL section_add_keyword(section, keyword)
128 CALL keyword_release(keyword)
129
130 CALL keyword_create(keyword, __location__, name="EPS_LOCALIZATION", &
131 description="Tolerance used in the convergence criterion of the localization methods.", &
132 usage="EPS_LOCALIZATION 1.0E-2", default_r_val=1.0e-4_dp)
133 CALL section_add_keyword(section, keyword)
134 CALL keyword_release(keyword)
135
136 CALL keyword_create(keyword, __location__, name="MIN_OR_MAX", &
137 description="Requires the maximization of the spread of the wfn", &
138 usage="MIN_OR_MAX (SPREADMIN|SPREADMAX)", &
139 enum_c_vals=["SPREADMIN", "SPREADMAX"], &
140 enum_i_vals=[do_loc_min, do_loc_max], &
141 default_i_val=do_loc_min)
142 CALL section_add_keyword(section, keyword)
143 CALL keyword_release(keyword)
144
145 CALL keyword_create( &
146 keyword, __location__, name="METHOD", &
147 description="Method of optimization if any", &
148 usage="METHOD (JACOBI|CRAZY|DIRECT|GAPO|L1SD|SCDM|CS|NONE)", &
149 enum_c_vals=s2a("NONE", "JACOBI", "CRAZY", "GAPO", "L1SD", "DIRECT", "SCDM", "CS"), &
150 enum_i_vals=[do_loc_none, &
152 do_loc_crazy, &
153 do_loc_gapo, &
156 do_loc_scdm, &
157 do_loc_cs], &
158 enum_desc=s2a("No localization is applied", &
159 "Using 2 x 2 rotations of the orbitals, slow but robust", &
160 "A new fast method is applied, might be slightly less robust than jacobi, but usually much faster", &
161 "Gradient ascent for partially occupied wannier functions", &
162 "Steepest descent minimization of an approximate l1 norm", &
163 "Using a direct minimisation approacha", &
164 "Use QR factorization", &
165 "Using the Cardoso-Souloumiac algorithm for complex matrices"), &
166 default_i_val=do_loc_jacobi, &
167 citations=[schreder2021, schreder2024_2])
168 CALL section_add_keyword(section, keyword)
169 CALL keyword_release(keyword)
170
171 CALL keyword_create(keyword, __location__, name="CPO_GUESS", &
172 description="Initial guess for coefficients if METHOD GAPO is used", &
173 usage="CPO_GUESS (ATOMIC|RESTART|RANDOM)", &
174 enum_c_vals=s2a("ATOMIC", "RESTART", "RANDOM"), &
176 default_i_val=do_loc_cpo_atomic)
177 CALL section_add_keyword(section, keyword)
178 CALL keyword_release(keyword)
179
180 CALL keyword_create(keyword, __location__, name="CPO_GUESS_SPACE", &
181 description="Orbital space from which initial guess for coefficients is determined "// &
182 "if METHOD GAPO and CPO_GUESS ATOMIC are employed", &
183 usage="CPO_GUESS_SPACE (WAN|ALL)", &
184 enum_c_vals=s2a("WAN", "ALL"), &
186 default_i_val=do_loc_cpo_space_wan)
187 CALL section_add_keyword(section, keyword)
188 CALL keyword_release(keyword)
189
190 CALL keyword_create(keyword, __location__, name="CG_PO", &
191 description="Use conjugate gradient in conjunction with METHOD GAPO. If FALSE, "// &
192 "steepest descent is used instead.", &
193 usage="CG_PO", default_l_val=.true., &
194 lone_keyword_l_val=.true.)
195 CALL section_add_keyword(section, keyword)
196 CALL keyword_release(keyword)
197
198 CALL keyword_create(keyword, __location__, name="JACOBI_FALLBACK", &
199 description="Use Jacobi method in case no convergence was achieved"// &
200 " by using the crazy rotations method.", &
201 usage="JACOBI_FALLBACK", default_l_val=.true., &
202 lone_keyword_l_val=.true.)
203 CALL section_add_keyword(section, keyword)
204 CALL keyword_release(keyword)
205
206 CALL keyword_create(keyword, __location__, name="JACOBI_REFINEMENT", &
207 description="Use Jacobi method to refine the localisation obtained by SCDM", &
208 usage="JACOBI_REFINEMENT", default_l_val=.false., &
209 lone_keyword_l_val=.true.)
210 CALL section_add_keyword(section, keyword)
211 CALL keyword_release(keyword)
212
213 CALL keyword_create(keyword, __location__, name="RESTART", &
214 description="Restart the localization from a set of orbitals"// &
215 " read from a localization restart file.", &
216 usage="RESTART", default_l_val=.false., &
217 lone_keyword_l_val=.true.)
218 CALL section_add_keyword(section, keyword)
219 CALL keyword_release(keyword)
220
221 CALL keyword_create(keyword, __location__, name="LOCHOMO_RESTART_FILE_NAME", &
222 description="File name where to read the MOS from "// &
223 "which to restart the localization procedure for occupied states", &
224 usage="LOCHOMO_RESTART_FILE_NAME <FILENAME>", &
225 type_of_var=lchar_t)
226 CALL section_add_keyword(section, keyword)
227 CALL keyword_release(keyword)
228
229 CALL keyword_create(keyword, __location__, name="LOCMIXD_RESTART_FILE_NAME", &
230 description="File name where to read the MOS from "// &
231 "which to restart the localization procedure for MIXED states", &
232 usage="LOCMIXD_RESTART_FILE_NAME <FILENAME>", &
233 type_of_var=lchar_t)
234 CALL section_add_keyword(section, keyword)
235 CALL keyword_release(keyword)
236
237 CALL keyword_create(keyword, __location__, name="LOCLUMO_RESTART_FILE_NAME", &
238 description="File name where to read the MOS from "// &
239 "which to restart the localization procedure for unoccupied states", &
240 usage="LOCLUMO_RESTART_FILE_NAME <FILENAME>", &
241 type_of_var=lchar_t)
242 CALL section_add_keyword(section, keyword)
243 CALL keyword_release(keyword)
244
245 CALL keyword_create(keyword, __location__, name="OPERATOR", &
246 description="Type of opertator which defines the spread functional", &
247 usage="OPERATOR (BERRY|BOYS|PIPEK)", &
248 enum_c_vals=s2a("BERRY", "BOYS", "PIPEK"), &
249 enum_i_vals=[op_loc_berry, op_loc_boys, op_loc_pipek], &
250 default_i_val=op_loc_berry, &
251 citations=[schreder2024_2])
252 CALL section_add_keyword(section, keyword)
253 CALL keyword_release(keyword)
254
255 CALL keyword_create(keyword, __location__, name="LIST", &
256 description="Indexes of the occupied wfn to be localized "// &
257 "This keyword can be repeated several times "// &
258 "(useful if you have to specify many indexes).", &
259 usage="LIST 1 2", &
260 n_var=-1, type_of_var=integer_t, repeats=.true.)
261 CALL section_add_keyword(section, keyword)
262 CALL keyword_release(keyword)
263
264 CALL keyword_create(keyword, __location__, name="LIST_UNOCCUPIED", &
265 description="Indexes of the unoccupied states to be localized, "// &
266 "up to now only valid in combination with GPW. "// &
267 "This keyword has to be present if unoccupied states should be localized. "// &
268 "This keyword can be repeated several times "// &
269 "(useful if you have to specify many indexes).", &
270 usage="LIST_UNOCCUPIED 1 2", &
271 n_var=-1, type_of_var=integer_t, repeats=.true.)
272 CALL section_add_keyword(section, keyword)
273 CALL keyword_release(keyword)
274
275 CALL keyword_create(keyword, __location__, name="NEXTRA", &
276 description="Number of orbitals above fully occupied MOs to be localized, "// &
277 "up to now only valid in combination with GPW. "// &
278 "This keyword has to be present for STATES MIXED option. "// &
279 "Otherwise, only the fully occupied MOs are localized.", &
280 usage="NEXTRA 5", default_i_val=0)
281 CALL section_add_keyword(section, keyword)
282 CALL keyword_release(keyword)
283
284 CALL keyword_create(keyword, __location__, name="STATES", &
285 description="Which states to localize, LUMO up to now only available in GPW", &
286 usage="STATES (HOMO|LUMO|MIXED|ALL)", &
287 enum_c_vals=s2a("OCCUPIED", "UNOCCUPIED", "MIXED", "ALL"), &
289 default_i_val=do_loc_homo)
290 CALL section_add_keyword(section, keyword)
291 CALL keyword_release(keyword)
292
293 CALL keyword_create( &
294 keyword, __location__, &
295 name="ENERGY_RANGE", &
296 description="Select the orbitals to be localized within the given energy range."// &
297 " This type of selection cannot be added on top of the selection through a LIST. It reads to reals that are"// &
298 " lower and higher boundaries of the energy range.", &
299 usage="ENERGY_RANGE lower_bound {real}, higher_bound {real}", &
300 repeats=.false., &
301 n_var=2, default_r_vals=[0._dp, 0._dp], unit_str='eV', &
302 type_of_var=real_t)
303 CALL section_add_keyword(section, keyword)
304 CALL keyword_release(keyword)
305
306 NULLIFY (print_section)
307 CALL section_create(print_section, __location__, name="PRINT", &
308 description="Collects all printing options related to the Wannier centers and "// &
309 "properties computed with Wannier centers.", &
310 n_keywords=0, n_subsections=1, repeats=.false.)
311 NULLIFY (print_key)
312 CALL cp_print_key_section_create(print_key, __location__, "program_run_info", &
313 description="Controls the printing basic info about the method", &
314 print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
315 CALL section_add_subsection(print_section, print_key)
316 CALL section_release(print_key)
317 ! Add printing of wannier infos
318 CALL print_wanniers(print_section)
319 NULLIFY (subsection)
320 ! Total Dipoles with wannier
321 CALL create_dipoles_section(subsection, "TOTAL_DIPOLE", debug_print_level + 1)
322 CALL section_add_subsection(print_section, subsection)
323 CALL section_release(subsection)
324 ! Molecular Dipoles with wannier
325 CALL create_dipoles_section(subsection, "MOLECULAR_DIPOLES", debug_print_level + 1)
326 CALL section_add_subsection(print_section, subsection)
327 CALL section_release(subsection)
328 ! Molecular Mulipole Moments with wannier
329 CALL cp_print_key_section_create(subsection, __location__, name="MOLECULAR_MOMENTS", &
330 description="Section controlling the calculation of molecular multipole moments.", &
331 print_level=debug_print_level + 1, filename="__STD_OUT__")
332 CALL keyword_create(keyword, __location__, name="ORDER", &
333 description="Maximum order of mulitpoles to be calculated.", &
334 usage="ORDER {integer}", default_i_val=2, type_of_var=integer_t)
335 CALL section_add_keyword(subsection, keyword)
336 CALL keyword_release(keyword)
337 !
338 CALL section_add_subsection(print_section, subsection)
339 CALL section_release(subsection)
340 !
341 CALL cp_print_key_section_create(subsection, __location__, name="LOCALIZED_MOMENTS", &
342 description="Section controlling the calculation of "// &
343 "localized moments", &
344 print_level=debug_print_level + 1, filename="__STD_OUT__", &
345 citations=[schreder2021, schreder2024_1])
346 !
347 CALL keyword_create(keyword, __location__, &
348 name="MAX_MOMENT", &
349 description="Maximum moment to be calculated.", &
350 usage="MAX_MOMENT {integer}", &
351 repeats=.false., &
352 n_var=1, &
353 type_of_var=integer_t, &
354 default_i_val=1)
355 CALL section_add_keyword(subsection, keyword)
356 CALL keyword_release(keyword)
357 !
358 CALL keyword_create(keyword, __location__, &
359 name="MAGNETIC", &
360 description="Calculate also magnetic moments.", &
361 usage="MAGNETIC .TRUE.", &
362 repeats=.false., &
363 n_var=1, &
364 default_l_val=.false., &
365 lone_keyword_l_val=.true.)
366 CALL section_add_keyword(subsection, keyword)
367 CALL keyword_release(keyword)
368 !
369 CALL keyword_create(keyword, __location__, &
370 name="VEL_REPRS", &
371 description="Calculate expectation values of the el. multipole "// &
372 "moments in their velocity representation during RTP. Implemented up "// &
373 "to el. quadrupole moment.", &
374 usage="VEL_REPRS .TRUE.", &
375 repeats=.false., &
376 n_var=1, &
377 default_l_val=.false., &
378 lone_keyword_l_val=.true.)
379 CALL section_add_keyword(subsection, keyword)
380 CALL keyword_release(keyword)
381 !
382 CALL keyword_create(keyword, __location__, &
383 name="COM_NL", &
384 description="Include non local commutator for velocity "// &
385 "representations. Necessary for origin independent results.", &
386 usage="COM_NL .TRUE.", &
387 repeats=.false., &
388 n_var=1, &
389 default_l_val=.false., &
390 lone_keyword_l_val=.true.)
391 CALL section_add_keyword(subsection, keyword)
392 CALL keyword_release(keyword)
393 !
394 CALL section_add_subsection(print_section, subsection)
395 CALL section_release(subsection)
396 ! Molecular States with wannier
397 CALL create_molecular_states_section(subsection)
398 CALL section_add_subsection(print_section, subsection)
399 CALL section_release(subsection)
400 ! Wannier States with wannier
401 CALL create_wannier_states_section(subsection)
402 CALL section_add_subsection(print_section, subsection)
403 CALL section_release(subsection)
404 !
405 CALL section_add_subsection(section, print_section)
406 CALL section_release(print_section)
407
408 END SUBROUTINE create_localize_section
409
410! **************************************************************************************************
411!> \brief Controls the printing of the basic info coming from the LOCALIZE
412!> section
413!> \param section ...
414!> \author teo
415! **************************************************************************************************
416 SUBROUTINE print_wanniers(section)
417 TYPE(section_type), POINTER :: section
418
419 TYPE(keyword_type), POINTER :: keyword
420 TYPE(section_type), POINTER :: print_key
421
422 cpassert(ASSOCIATED(section))
423 NULLIFY (print_key, keyword)
424 CALL cp_print_key_section_create(print_key, __location__, "WANNIER_CUBES", &
425 description="Controls the printing of the wannier functions ", &
426 print_level=high_print_level, add_last=add_last_numeric, filename="")
427 CALL keyword_create(keyword, __location__, name="stride", &
428 description="The stride (X,Y,Z) used to write the cube file "// &
429 "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
430 " 1 number valid for all components.", &
431 usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
432 CALL section_add_keyword(print_key, keyword)
433 CALL keyword_release(keyword)
434
435 CALL keyword_create(keyword, __location__, name="DENSITY", &
436 description="Controls the printing of the Wannier function "// &
437 "electronic densities", &
438 default_l_val=.false., lone_keyword_l_val=.true.)
439 CALL section_add_keyword(print_key, keyword)
440 CALL keyword_release(keyword)
441
442 CALL keyword_create(keyword, __location__, name="CUBES_LU_BOUNDS", &
443 variants=["CUBES_LU"], &
444 description="The lower and upper index of the states to be printed as cube", &
445 usage="CUBES_LU_BOUNDS integer integer", &
446 n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
447 CALL section_add_keyword(print_key, keyword)
448 CALL keyword_release(keyword)
449
450 CALL keyword_create(keyword, __location__, name="CUBES_LIST", &
451 description="Indexes of the states to be printed as cube files"// &
452 " This keyword can be repeated several times"// &
453 " (useful if you have to specify many indexes).", &
454 usage="CUBES_LIST 1 2", &
455 n_var=-1, type_of_var=integer_t, repeats=.true.)
456 CALL section_add_keyword(print_key, keyword)
457 CALL keyword_release(keyword)
458 CALL keyword_create(keyword, __location__, name="APPEND", &
459 description="append the cube files when they already exist", &
460 default_l_val=.false., lone_keyword_l_val=.true.)
461 CALL section_add_keyword(print_key, keyword)
462 CALL keyword_release(keyword)
463
464 CALL section_add_subsection(section, print_key)
465 CALL section_release(print_key)
466
467 NULLIFY (print_key)
468 CALL cp_print_key_section_create(print_key, __location__, "WANNIER_CENTERS", &
469 description="Controls the printing of the wannier functions", &
470 print_level=high_print_level, add_last=add_last_numeric, filename="", &
471 unit_str="angstrom")
472
473 CALL keyword_create(keyword, __location__, name="IONS+CENTERS", &
474 description="prints out the wannier centers together with the particles", &
475 usage="IONS+CENTERS", default_l_val=.false., &
476 lone_keyword_l_val=.true.)
477 CALL section_add_keyword(print_key, keyword)
478 CALL keyword_release(keyword)
479
480 CALL add_format_keyword(keyword, print_key, pos=.true., &
481 description="Specifies the format of the output file when IONS+CENTERS is enabled.")
482 CALL section_add_subsection(section, print_key)
483 CALL section_release(print_key)
484
485 NULLIFY (print_key)
486 CALL cp_print_key_section_create(print_key, __location__, "WANNIER_SPREADS", &
487 description="Controls the printing of the wannier functions", &
488 print_level=high_print_level, add_last=add_last_numeric, filename="")
489
490 CALL keyword_create(keyword, __location__, name="SECOND_MOMENTS", &
491 description="Prints out the upper triangular part of the position covariance matrix. "// &
492 "Default is to use a non-periodic position operator. ", &
493 usage="SECOND_MOMENTS", default_l_val=.false., &
494 lone_keyword_l_val=.true.)
495 CALL section_add_keyword(print_key, keyword)
496 CALL keyword_release(keyword)
497
498 CALL keyword_create(keyword, __location__, name="PERIODIC", &
499 description="For the covariance matrix, use the periodic position operator."// &
500 " Requires setting LMAXN1 in QS section to 6 or higher.", &
501 usage="PERIODIC", default_l_val=.false., &
502 lone_keyword_l_val=.true.)
503 CALL section_add_keyword(print_key, keyword)
504 CALL keyword_release(keyword)
505
506 CALL section_add_subsection(section, print_key)
507 CALL section_release(print_key)
508
509 NULLIFY (print_key)
510 CALL cp_print_key_section_create(print_key, __location__, "LOC_RESTART", &
511 description="Controls the printing of restart file for localized MOS", &
512 print_level=high_print_level, add_last=add_last_numeric, filename="")
513 CALL section_add_subsection(section, print_key)
514 CALL section_release(print_key)
515
516 END SUBROUTINE print_wanniers
517
518! **************************************************************************************************
519!> \brief creates the input section for the molecular states
520!> \param print_key ...
521!> \author teo
522! **************************************************************************************************
523 SUBROUTINE create_molecular_states_section(print_key)
524 TYPE(section_type), POINTER :: print_key
525
526 TYPE(keyword_type), POINTER :: keyword
527 TYPE(section_type), POINTER :: print_key2
528
529 cpassert(.NOT. ASSOCIATED(print_key))
530 NULLIFY (print_key2, keyword)
531 CALL cp_print_key_section_create(print_key, __location__, "MOLECULAR_STATES", &
532 description="Controls printing of molecular states ", &
533 print_level=high_print_level, filename=" ", citations=[hunt2003])
534
535 CALL keyword_create( &
536 keyword, __location__, name="CUBE_EVAL_RANGE", &
537 description="only write cubes if the energies of the corresponding molecular states lie in the given interval. "// &
538 "Default is all states.", &
539 usage="CUBE_EVAL_RANGE -1.0 1.0", unit_str="hartree", n_var=2, type_of_var=real_t)
540 CALL section_add_keyword(print_key, keyword)
541 CALL keyword_release(keyword)
542
543 CALL keyword_create(keyword, __location__, name="MARK_STATES", &
544 description="Can be used to mark given molecular states."// &
545 " Sets a mark to both, occupied and unoccupied states. "// &
546 "Occupied states are counted beginning with HOMO=1, "// &
547 "unoccupied states are counted beginning with LUMO=1, "// &
548 "This is only meaningful in combination with WFN_MIX. "// &
549 "First integer specifies the molecule, second integer specifies the state.", &
550 usage="MARK_STATES integer integer", &
551 n_var=2, default_i_vals=[-1, -1], type_of_var=integer_t, repeats=.true.)
552 CALL section_add_keyword(print_key, keyword)
553 CALL keyword_release(keyword)
554
555 CALL cp_print_key_section_create(print_key2, __location__, "cubes", &
556 description="Controls the printing of cube files", &
557 print_level=high_print_level, filename="")
558 CALL keyword_create(keyword, __location__, name="stride", &
559 description="The stride (X,Y,Z) used to write the cube file "// &
560 "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
561 " 1 number valid for all components.", &
562 usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
563 CALL section_add_keyword(print_key2, keyword)
564 CALL keyword_release(keyword)
565 CALL section_add_subsection(print_key, print_key2)
566 CALL section_release(print_key2)
567 END SUBROUTINE create_molecular_states_section
568
569! **************************************************************************************************
570!> \brief ...
571!> \param print_key ...
572! **************************************************************************************************
573 SUBROUTINE create_wannier_states_section(print_key)
574 TYPE(section_type), POINTER :: print_key
575
576 TYPE(keyword_type), POINTER :: keyword
577 TYPE(section_type), POINTER :: print_key2
578
579 cpassert(.NOT. ASSOCIATED(print_key))
580 NULLIFY (print_key2, keyword)
581 CALL cp_print_key_section_create(print_key, __location__, "WANNIER_STATES", &
582 description="Controls printing of Wannier states ", &
583 print_level=high_print_level, filename=" ")
584
585 CALL keyword_create( &
586 keyword, __location__, name="CUBE_EVAL_RANGE", &
587 description="only write cubes if the energies of the corresponding molecular states lie in the given interval. "// &
588 "Default is all states.", &
589 usage="CUBE_EVAL_RANGE -1.0 1.0", unit_str="hartree", n_var=2, type_of_var=real_t)
590 CALL section_add_keyword(print_key, keyword)
591 CALL keyword_release(keyword)
592
593 CALL keyword_create(keyword, __location__, name="MARK_STATES", &
594 description="Can be used to mark given molecular states."// &
595 " Sets a mark to both, occupied and unoccupied states. "// &
596 "Occupied states are counted beginning with HOMO=1, "// &
597 "unoccupied states are counted beginning with LUMO=1, "// &
598 "This is only meaningful in combination with WFN_MIX. "// &
599 "First integer specifies the molecule, second integer specifies the state.", &
600 usage="MARK_STATES integer integer", &
601 n_var=2, default_i_vals=[-1, -1], type_of_var=integer_t, repeats=.true.)
602 CALL section_add_keyword(print_key, keyword)
603 CALL keyword_release(keyword)
604
605 CALL keyword_create(keyword, __location__, name="CARTESIAN", &
606 description="Print the Wannier states in the Cartesian basis instead of the default spherical basis.", &
607 default_l_val=.false., lone_keyword_l_val=.true.)
608 CALL section_add_keyword(print_key, keyword)
609 CALL keyword_release(keyword)
610
611 CALL cp_print_key_section_create(print_key2, __location__, "cubes", &
612 description="Controls the printing of cube files", &
613 print_level=high_print_level, filename="")
614 CALL keyword_create(keyword, __location__, name="stride", &
615 description="The stride (X,Y,Z) used to write the cube file "// &
616 "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
617 " 1 number valid for all components.", &
618 usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
619 CALL section_add_keyword(print_key2, keyword)
620 CALL keyword_release(keyword)
621 CALL section_add_subsection(print_key, print_key2)
622 CALL section_release(print_key2)
623 END SUBROUTINE create_wannier_states_section
624
625END MODULE input_cp2k_loc
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public hunt2003
integer, save, public schreder2024_2
integer, save, public schreder2024_1
integer, save, public schreder2021
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
subroutine, public cp_print_key_section_create(print_key_section, location, name, description, print_level, each_iter_names, each_iter_values, add_last, filename, common_iter_levels, citations, unit_str, do_backup)
creates a print_key section
integer, parameter, public debug_print_level
integer, parameter, public low_print_level
integer, parameter, public high_print_level
integer, parameter, public add_last_numeric
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public op_loc_pipek
integer, parameter, public do_loc_jacobi
integer, parameter, public do_loc_l1_norm_sd
integer, parameter, public do_loc_mixed
integer, parameter, public do_loc_cpo_space_nmo
integer, parameter, public do_loc_none
integer, parameter, public do_loc_scdm
integer, parameter, public op_loc_berry
integer, parameter, public do_loc_crazy
integer, parameter, public do_loc_cs
integer, parameter, public do_loc_gapo
integer, parameter, public op_loc_boys
integer, parameter, public do_loc_cpo_random
integer, parameter, public do_loc_lumo
integer, parameter, public do_loc_min
integer, parameter, public do_loc_cpo_restart
integer, parameter, public do_loc_homo
integer, parameter, public do_loc_cpo_space_wan
integer, parameter, public do_loc_max
integer, parameter, public do_loc_direct
integer, parameter, public do_loc_cpo_atomic
integer, parameter, public do_loc_both
subroutine, public create_localize_section(section)
parameters fo the localization of wavefunctions
subroutine, public print_wanniers(section)
Controls the printing of the basic info coming from the LOCALIZE section.
creates the mm section of the input
subroutine, public create_dipoles_section(print_key, label, print_level)
creates the input section for the qs part
subroutine, public add_format_keyword(keyword, section, pos, description)
creates the FORMAT keyword
represents keywords in an input
subroutine, public keyword_release(keyword)
releases the given keyword (see doc/ReferenceCounting.html)
subroutine, public keyword_create(keyword, location, name, description, usage, type_of_var, n_var, repeats, variants, default_val, default_l_val, default_r_val, default_lc_val, default_c_val, default_i_val, default_l_vals, default_r_vals, default_c_vals, default_i_vals, lone_keyword_val, lone_keyword_l_val, lone_keyword_r_val, lone_keyword_c_val, lone_keyword_i_val, lone_keyword_l_vals, lone_keyword_r_vals, lone_keyword_c_vals, lone_keyword_i_vals, enum_c_vals, enum_i_vals, enum, enum_strict, enum_desc, unit_str, citations, deprecation_notice, removed)
creates a keyword object
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_create(section, location, name, description, n_keywords, n_subsections, repeats, citations, deprecation_notice)
creates a list of keywords
subroutine, public section_add_keyword(section, keyword)
adds a keyword to the given section
subroutine, public section_add_subsection(section, subsection)
adds a subsection to the given section
recursive subroutine, public section_release(section)
releases the given keyword list (see doc/ReferenceCounting.html)
a wrapper for basic fortran types.
integer, parameter, public real_t
integer, parameter, public lchar_t
integer, parameter, public integer_t
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Utilities for string manipulations.
represent a keyword in the input
represent a section of the input file