(git:b279b6b)
input_cp2k_dft.F
Go to the documentation of this file.
1 !--------------------------------------------------------------------------------------------------!
2 ! CP2K: A general program to perform molecular dynamics simulations !
3 ! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4 ! !
5 ! SPDX-License-Identifier: GPL-2.0-or-later !
6 !--------------------------------------------------------------------------------------------------!
7 
8 ! **************************************************************************************************
9 !> \brief function that build the dft section of the input
10 !> \par History
11 !> 10.2005 moved out of input_cp2k [fawzi]
12 !> \author fawzi
13 ! **************************************************************************************************
17  USE bibliography, ONLY: &
26  yin2017
34  USE cp_spline_utils, ONLY: pw_interp, &
37  USE cp_units, ONLY: cp_unit_to_cp2k
38  USE input_constants, ONLY: &
136  USE input_keyword_types, ONLY: keyword_create, &
137  keyword_release, &
138  keyword_type
141  section_create, &
142  section_release, &
143  section_type
144  USE input_val_types, ONLY: char_t, &
145  integer_t, &
146  lchar_t, &
147  logical_t, &
148  real_t
149  USE kinds, ONLY: dp
150  USE pw_grids, ONLY: do_pw_grid_blocked_false, &
153  USE pw_spline_utils, ONLY: no_precond, &
154  precond_spl3_1, &
155  precond_spl3_2, &
156  precond_spl3_3, &
162  USE string_utilities, ONLY: newline, &
163  s2a
164 #include "./base/base_uses.f90"
165 
166  IMPLICIT NONE
167  PRIVATE
168 
169  CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_dft'
170 
171  PUBLIC :: create_dft_section
173  PUBLIC :: create_scf_section
174  PUBLIC :: create_interp_section
176  PUBLIC :: create_mgrid_section
177  PUBLIC :: create_lrigpw_section
178 
179 CONTAINS
180 
181 ! **************************************************************************************************
182 !> \brief creates the dft section
183 !> \param section the section to be created
184 !> \author fawzi
185 ! **************************************************************************************************
186  SUBROUTINE create_dft_section(section)
187  TYPE(section_type), POINTER :: section
188 
189  TYPE(keyword_type), POINTER :: keyword
190  TYPE(section_type), POINTER :: subsection
191 
192  cpassert(.NOT. ASSOCIATED(section))
193  CALL section_create(section, __location__, name="DFT", &
194  description="Parameter needed by LCAO DFT programs", &
195  n_keywords=3, n_subsections=4, repeats=.false.)
196 
197  NULLIFY (keyword)
198  CALL keyword_create(keyword, __location__, name="BASIS_SET_FILE_NAME", &
199  description="Name of the basis set file, may include a path", &
200  usage="BASIS_SET_FILE_NAME <FILENAME>", &
201  type_of_var=lchar_t, repeats=.true., &
202  default_lc_val="BASIS_SET", n_var=1)
203  CALL section_add_keyword(section, keyword)
204  CALL keyword_release(keyword)
205 
206  CALL keyword_create(keyword, __location__, name="POTENTIAL_FILE_NAME", &
207  description="Name of the pseudo potential file, may include a path", &
208  usage="POTENTIAL_FILE_NAME <FILENAME>", &
209  default_lc_val="POTENTIAL")
210  CALL section_add_keyword(section, keyword)
211  CALL keyword_release(keyword)
212 
213  CALL keyword_create(keyword, __location__, name="WFN_RESTART_FILE_NAME", &
214  variants=(/"RESTART_FILE_NAME"/), &
215  description="Name of the wavefunction restart file, may include a path."// &
216  " If no file is specified, the default is to open the file as generated by the wfn restart print key.", &
217  usage="WFN_RESTART_FILE_NAME <FILENAME>", &
218  type_of_var=lchar_t)
219  CALL section_add_keyword(section, keyword)
220  CALL keyword_release(keyword)
221 
222  CALL keyword_create(keyword, __location__, &
223  name="UKS", &
224  variants=s2a("UNRESTRICTED_KOHN_SHAM", &
225  "LSD", &
226  "SPIN_POLARIZED"), &
227  description="Requests a spin-polarized calculation using alpha "// &
228  "and beta orbitals, i.e. no spin restriction is applied", &
229  usage="LSD", &
230  default_l_val=.false., &
231  lone_keyword_l_val=.true.)
232  CALL section_add_keyword(section, keyword)
233  CALL keyword_release(keyword)
234  CALL keyword_create(keyword, __location__, &
235  name="ROKS", &
236  variants=(/"RESTRICTED_OPEN_KOHN_SHAM"/), &
237  description="Requests a restricted open Kohn-Sham calculation", &
238  usage="ROKS", &
239  default_l_val=.false., &
240  lone_keyword_l_val=.true.)
241  CALL section_add_keyword(section, keyword)
242  CALL keyword_release(keyword)
243  CALL keyword_create(keyword, __location__, &
244  name="MULTIPLICITY", &
245  variants=(/"MULTIP"/), &
246  description="Two times the total spin plus one. "// &
247  "Specify 3 for a triplet, 4 for a quartet, "// &
248  "and so on. Default is 1 (singlet) for an "// &
249  "even number and 2 (doublet) for an odd number "// &
250  "of electrons.", &
251  usage="MULTIPLICITY 3", &
252  default_i_val=0) ! this default value is just a flag to get the above
253  CALL section_add_keyword(section, keyword)
254  CALL keyword_release(keyword)
255  CALL keyword_create(keyword, __location__, name="CHARGE", &
256  description="The total charge of the system", &
257  usage="CHARGE -1", &
258  default_i_val=0)
259  CALL section_add_keyword(section, keyword)
260  CALL keyword_release(keyword)
261  CALL keyword_create(keyword, __location__, name="EXCITATIONS", &
262  description="If excitations should be calculated", &
263  usage="EXCITATIONS", &
264  enum_c_vals=s2a("NONE", "TDLR", "TDDFPT"), &
265  enum_i_vals=(/no_excitations, tddfpt_excitations, &
266  tddfpt_excitations/), &
267  default_i_val=no_excitations)
268  CALL section_add_keyword(section, keyword)
269  CALL keyword_release(keyword)
270 
271  CALL keyword_create(keyword, __location__, &
272  name="PLUS_U_METHOD", &
273  description="Method employed for the calculation of the DFT+U contribution", &
274  repeats=.false., &
275  enum_c_vals=s2a("LOWDIN", "MULLIKEN", "MULLIKEN_CHARGES"), &
277  enum_desc=s2a("Method based on Lowdin population analysis "// &
278  "(computationally expensive, since the diagonalization of the "// &
279  "overlap matrix is required, but possibly more robust than Mulliken)", &
280  "Method based on Mulliken population analysis using the net AO and "// &
281  "overlap populations (computationally cheap method)", &
282  "Method based on Mulliken gross orbital populations (GOP)"), &
283  n_var=1, &
284  default_i_val=plus_u_mulliken, &
285  usage="METHOD Lowdin")
286  CALL section_add_keyword(section, keyword)
287  CALL keyword_release(keyword)
288 
289  CALL keyword_create(keyword, __location__, &
290  name="RELAX_MULTIPLICITY", &
291  variants=(/"RELAX_MULTIP"/), &
292  description="Tolerance in Hartrees. Do not enforce the occupation "// &
293  "of alpha and beta MOs due to the initially "// &
294  "defined multiplicity, but rather follow the Aufbau principle. "// &
295  "A value greater than zero activates this option. "// &
296  "Larger tolerance values increase the probability for a spin flip. "// &
297  "This option is only valid for unrestricted (i.e. spin polarised) "// &
298  "Kohn-Sham (UKS) calculations.", &
299  usage="RELAX_MULTIPLICITY 0.00001", &
300  repeats=.false., &
301  default_r_val=0.0_dp)
302  CALL section_add_keyword(section, keyword)
303  CALL keyword_release(keyword)
304 
305  CALL keyword_create(keyword, __location__, name="SUBCELLS", &
306  description="Read the grid size for subcell generation in the construction of "// &
307  "neighbor lists.", usage="SUBCELLS 1.5", &
308  n_var=1, default_r_val=2.0_dp)
309  CALL section_add_keyword(section, keyword)
310  CALL keyword_release(keyword)
311 
312  CALL keyword_create(keyword, __location__, name="AUTO_BASIS", &
313  description="Specify size of automatically generated auxiliary (RI) basis sets: "// &
314  "Options={small,medium,large,huge}", &
315  usage="AUTO_BASIS {basis_type} {basis_size}", &
316  type_of_var=char_t, repeats=.true., n_var=-1, default_c_vals=(/"X", "X"/))
317  CALL section_add_keyword(section, keyword)
318  CALL keyword_release(keyword)
319 
320  CALL keyword_create(keyword, __location__, &
321  name="SURFACE_DIPOLE_CORRECTION", &
322  variants=s2a("SURFACE_DIPOLE", &
323  "SURF_DIP"), &
324  description="For slab calculations with asymmetric geometries, activate the correction of "// &
325  "the electrostatic potential with "// &
326  "by compensating for the surface dipole. Implemented only for slabs with normal "// &
327  "parallel to one Cartesian axis. The normal direction is given by the keyword SURF_DIP_DIR", &
328  usage="SURF_DIP", &
329  default_l_val=.false., &
330  lone_keyword_l_val=.true., &
331  citations=(/bengtsson1999/))
332  CALL section_add_keyword(section, keyword)
333  CALL keyword_release(keyword)
334 
335  CALL keyword_create(keyword, __location__, &
336  name="SURF_DIP_DIR", &
337  description="Cartesian axis parallel to surface normal.", &
338  enum_c_vals=s2a("X", "Y", "Z"), &
339  enum_i_vals=(/1, 2, 3/), &
340  enum_desc=s2a("Along x", "Along y", "Along z"), &
341  n_var=1, &
342  default_i_val=3, &
343  usage="SURF_DIP_DIR Z")
344  CALL section_add_keyword(section, keyword)
345  CALL keyword_release(keyword)
346 
347  CALL keyword_create(keyword, __location__, &
348  name="SURF_DIP_POS", &
349  description="This keyword assigns an user defined position in Angstroms "// &
350  "in the direction normal to the surface (given by SURF_DIP_DIR). "// &
351  "The default value is -1.0_dp which appplies the correction at a position "// &
352  "that has minimum electron density on the grid.", &
353  usage="SURF_DIP_POS -1.0_dp", &
354  default_r_val=-1.0_dp)
355  CALL section_add_keyword(section, keyword)
356  CALL keyword_release(keyword)
357 
358  CALL keyword_create(keyword, __location__, &
359  name="SURF_DIP_SWITCH", &
360  description="WARNING: Experimental feature under development that will help the "// &
361  "user to switch parameters to facilitate SCF convergence. In its current form the "// &
362  "surface dipole correction is switched off if the calculation does not converge in "// &
363  "(0.5*MAX_SCF + 1) outer_scf steps. "// &
364  "The default value is .FALSE.", &
365  usage="SURF_DIP_SWITCH .TRUE.", &
366  default_l_val=.false., &
367  lone_keyword_l_val=.true.)
368  CALL section_add_keyword(section, keyword)
369  CALL keyword_release(keyword)
370 
371  CALL keyword_create(keyword, __location__, &
372  name="CORE_CORR_DIP", &
373  description="If the total CORE_CORRECTION is non-zero and surface dipole "// &
374  "correction is switched on, presence of this keyword will adjust electron "// &
375  "density via MO occupation to reflect the total CORE_CORRECTION. "// &
376  "The default value is .FALSE.", &
377  usage="CORE_CORR_DIP .TRUE.", &
378  default_l_val=.false., &
379  lone_keyword_l_val=.true.)
380  CALL section_add_keyword(section, keyword)
381  CALL keyword_release(keyword)
382 
383  CALL keyword_create(keyword, __location__, &
384  name="SORT_BASIS", &
385  description="Sort basis sets according to a certain criterion. ", &
386  enum_c_vals=s2a("DEFAULT", "EXP"), &
387  enum_i_vals=(/basis_sort_default, basis_sort_zet/), &
388  enum_desc=s2a("don't sort", "sort w.r.t. exponent"), &
389  default_i_val=basis_sort_default, &
390  usage="SORT_BASIS EXP")
391  CALL section_add_keyword(section, keyword)
392  CALL keyword_release(keyword)
393 
394  NULLIFY (subsection)
395  CALL create_scf_section(subsection)
396  CALL section_add_subsection(section, subsection)
397  CALL section_release(subsection)
398 
399  CALL create_ls_scf_section(subsection)
400  CALL section_add_subsection(section, subsection)
401  CALL section_release(subsection)
402 
403  CALL create_almo_scf_section(subsection)
404  CALL section_add_subsection(section, subsection)
405  CALL section_release(subsection)
406 
407  CALL create_kg_section(subsection)
408  CALL section_add_subsection(section, subsection)
409  CALL section_release(subsection)
410 
411  CALL create_ec_section(subsection)
412  CALL section_add_subsection(section, subsection)
413  CALL section_release(subsection)
414 
415  CALL create_exstate_section(subsection)
416  CALL section_add_subsection(section, subsection)
417  CALL section_release(subsection)
418 
419  CALL create_admm_section(subsection)
420  CALL section_add_subsection(section, subsection)
421  CALL section_release(subsection)
422 
423  CALL create_qs_section(subsection)
424  CALL section_add_subsection(section, subsection)
425  CALL section_release(subsection)
426 
427  CALL create_tddfpt_section(subsection)
428  CALL section_add_subsection(section, subsection)
429  CALL section_release(subsection)
430 
431  CALL create_mgrid_section(subsection, create_subsections=.true.)
432  CALL section_add_subsection(section, subsection)
433  CALL section_release(subsection)
434 
435  CALL create_xc_section(subsection)
436  CALL section_add_subsection(section, subsection)
437  CALL section_release(subsection)
438 
439  CALL create_relativistic_section(subsection)
440  CALL section_add_subsection(section, subsection)
441  CALL section_release(subsection)
442 
443  CALL create_sic_section(subsection)
444  CALL section_add_subsection(section, subsection)
445  CALL section_release(subsection)
446 
447  CALL create_low_spin_roks_section(subsection)
448  CALL section_add_subsection(section, subsection)
449  CALL section_release(subsection)
450 
451  CALL create_efield_section(subsection)
452  CALL section_add_subsection(section, subsection)
453  CALL section_release(subsection)
454 
455  CALL create_per_efield_section(subsection)
456  CALL section_add_subsection(section, subsection)
457  CALL section_release(subsection)
458 
459  CALL create_ext_pot_section(subsection)
460  CALL section_add_subsection(section, subsection)
461  CALL section_release(subsection)
462 
463  CALL create_transport_section(subsection)
464  CALL section_add_subsection(section, subsection)
465  CALL section_release(subsection)
466 
467  ! ZMP sections to include the external density or v_xc potential
468  CALL create_ext_den_section(subsection)
469  CALL section_add_subsection(section, subsection)
470  CALL section_release(subsection)
471 
472  CALL create_ext_vxc_section(subsection)
473  CALL section_add_subsection(section, subsection)
474  CALL section_release(subsection)
475 
476  CALL create_poisson_section(subsection)
477  CALL section_add_subsection(section, subsection)
478  CALL section_release(subsection)
479 
480  CALL create_kpoints_section(subsection)
481  CALL section_add_subsection(section, subsection)
482  CALL section_release(subsection)
483 
484  CALL create_implicit_solv_section(subsection)
485  CALL section_add_subsection(section, subsection)
486  CALL section_release(subsection)
487 
488  CALL create_density_fitting_section(subsection)
489  CALL section_add_subsection(section, subsection)
490  CALL section_release(subsection)
491 
492  CALL create_xas_section(subsection)
493  CALL section_add_subsection(section, subsection)
494  CALL section_release(subsection)
495 
496  CALL create_xas_tdp_section(subsection)
497  CALL section_add_subsection(section, subsection)
498  CALL section_release(subsection)
499 
500  CALL create_localize_section(subsection)
501  CALL section_add_subsection(section, subsection)
502  CALL section_release(subsection)
503 
504  CALL create_rtp_section(subsection)
505  CALL section_add_subsection(section, subsection)
506  CALL section_release(subsection)
507 
508  CALL create_print_dft_section(subsection)
509  CALL section_add_subsection(section, subsection)
510  CALL section_release(subsection)
511 
512  CALL create_sccs_section(subsection)
513  CALL section_add_subsection(section, subsection)
514  CALL section_release(subsection)
515 
516  CALL create_active_space_section(subsection)
517  CALL section_add_subsection(section, subsection)
518  CALL section_release(subsection)
519 
520  END SUBROUTINE create_dft_section
521 
522 ! **************************************************************************************************
523 !> \brief Implicit Solvation Model
524 !> \param section ...
525 !> \author tlaino
526 ! **************************************************************************************************
527  SUBROUTINE create_implicit_solv_section(section)
528  TYPE(section_type), POINTER :: section
529 
530  TYPE(keyword_type), POINTER :: keyword
531  TYPE(section_type), POINTER :: print_key, subsection
532 
533  NULLIFY (keyword, subsection, print_key)
534  cpassert(.NOT. ASSOCIATED(section))
535  CALL section_create(section, __location__, name="SCRF", &
536  description="Adds an implicit solvation model to the DFT calculation."// &
537  " Know also as Self Consistent Reaction Field.", &
538  n_keywords=0, n_subsections=0, repeats=.false.)
539 
540  CALL keyword_create(keyword, __location__, name="EPS_OUT", &
541  description="Value of the dielectric constant outside the sphere", &
542  usage="EPS_OUT <REAL>", &
543  default_r_val=1.0_dp)
544  CALL section_add_keyword(section, keyword)
545  CALL keyword_release(keyword)
546 
547  CALL keyword_create(keyword, __location__, name="LMAX", &
548  description="Maximum value of L used in the multipole expansion", &
549  usage="LMAX <INTEGER>", &
550  default_i_val=3)
551  CALL section_add_keyword(section, keyword)
552  CALL keyword_release(keyword)
553 
554  CALL create_sphere_section(subsection)
555  CALL section_add_subsection(section, subsection)
556  CALL section_release(subsection)
557 
558  CALL cp_print_key_section_create(print_key, __location__, "program_run_info", &
559  description="Controls the printing basic info about the method", &
560  print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
561  CALL section_add_subsection(section, print_key)
562  CALL section_release(print_key)
563 
564  END SUBROUTINE create_implicit_solv_section
565 
566 ! **************************************************************************************************
567 !> \brief Create Sphere cavity
568 !> \param section ...
569 !> \author tlaino
570 ! **************************************************************************************************
571  SUBROUTINE create_sphere_section(section)
572  TYPE(section_type), POINTER :: section
573 
574  TYPE(keyword_type), POINTER :: keyword
575  TYPE(section_type), POINTER :: subsection
576 
577  NULLIFY (keyword, subsection)
578  cpassert(.NOT. ASSOCIATED(section))
579  CALL section_create(section, __location__, name="SPHERE", &
580  description="Treats the implicit solvent environment like a sphere", &
581  n_keywords=0, n_subsections=0, repeats=.false.)
582 
583  CALL keyword_create(keyword, __location__, name="RADIUS", &
584  description="Value of the spherical cavity in the dielectric medium", &
585  usage="RADIUS <REAL>", &
586  unit_str="angstrom", &
587  type_of_var=real_t)
588  CALL section_add_keyword(section, keyword)
589  CALL keyword_release(keyword)
590 
591  CALL create_center_section(subsection)
592  CALL section_add_subsection(section, subsection)
593  CALL section_release(subsection)
594 
595  END SUBROUTINE create_sphere_section
596 
597 ! **************************************************************************************************
598 !> \brief ...
599 !> \param section ...
600 !> \author tlaino
601 ! **************************************************************************************************
602  SUBROUTINE create_center_section(section)
603  TYPE(section_type), POINTER :: section
604 
605  TYPE(keyword_type), POINTER :: keyword
606 
607  NULLIFY (keyword)
608  cpassert(.NOT. ASSOCIATED(section))
609  CALL section_create(section, __location__, name="CENTER", &
610  description="Defines the center of the sphere.", &
611  n_keywords=0, n_subsections=0, repeats=.false.)
612  CALL keyword_create(keyword, __location__, name="XYZ", &
613  description="Coordinates of the center of the sphere", &
614  usage="XYZ <REAL> <REAL> <REAL>", &
615  unit_str="angstrom", &
616  type_of_var=real_t, n_var=3)
617  CALL section_add_keyword(section, keyword)
618  CALL keyword_release(keyword)
619 
620  CALL keyword_create(keyword, __location__, name="ATOM_LIST", &
621  description="Defines a list of atoms to define the center of the sphere", &
622  usage="ATOM_LIST <INTEGER> .. <INTEGER>", &
623  type_of_var=integer_t, n_var=-1)
624  CALL section_add_keyword(section, keyword)
625  CALL keyword_release(keyword)
626 
627  CALL keyword_create(keyword, __location__, name="WEIGHT_TYPE", &
628  description="Defines the weight used to define the center of the sphere"// &
629  " (if ATOM_LIST is provided)", &
630  usage="WEIGHT (UNIT|MASS)", &
631  enum_c_vals=(/"UNIT", "MASS"/), &
632  enum_i_vals=(/weight_type_unit, weight_type_mass/), &
633  default_i_val=weight_type_unit)
634  CALL section_add_keyword(section, keyword)
635  CALL keyword_release(keyword)
636 
637  CALL keyword_create(keyword, __location__, name="FIXED", &
638  description="Specify if the center of the sphere should be fixed or"// &
639  " allowed to move", &
640  usage="FIXED <LOGICAL>", &
641  default_l_val=.true.)
642  CALL section_add_keyword(section, keyword)
643  CALL keyword_release(keyword)
644  END SUBROUTINE create_center_section
645 
646 ! **************************************************************************************************
647 !> \brief Create the print dft section
648 !> \param section the section to create
649 !> \author teo
650 ! **************************************************************************************************
651  SUBROUTINE create_print_dft_section(section)
652  TYPE(section_type), POINTER :: section
653 
654  TYPE(keyword_type), POINTER :: keyword
655  TYPE(section_type), POINTER :: print_key, sub_print_key, subsection
656 
657  cpassert(.NOT. ASSOCIATED(section))
658  CALL section_create(section, __location__, name="PRINT", &
659  description="Section of possible print options in DFT code.", &
660  n_keywords=0, n_subsections=1, repeats=.false.)
661 
662  NULLIFY (print_key, keyword, subsection)
663 
664  CALL cp_print_key_section_create(print_key, __location__, "PROGRAM_BANNER", &
665  description="Controls the printing of the banner of the MM program", &
666  print_level=silent_print_level, filename="__STD_OUT__")
667  CALL section_add_subsection(section, print_key)
668  CALL section_release(print_key)
669 
670  CALL cp_print_key_section_create(print_key, __location__, "BASIS_SET_FILE", &
671  description="Controls the printing of a file with all basis sets used.", &
672  print_level=high_print_level, filename="LOCAL_BASIS_SETS")
673  CALL section_add_subsection(section, print_key)
674  CALL section_release(print_key)
675 
676  CALL cp_print_key_section_create(print_key, __location__, "KINETIC_ENERGY", &
677  description="Controls the printing of the kinetic energy", &
678  print_level=high_print_level, filename="__STD_OUT__")
679  CALL section_add_subsection(section, print_key)
680  CALL section_release(print_key)
681 
682  CALL cp_print_key_section_create(print_key, __location__, "DERIVATIVES", &
683  description="Print all derivatives after the DFT calculation", &
684  print_level=high_print_level, filename="__STD_OUT__")
685  CALL keyword_create(keyword, __location__, &
686  name="ndigits", &
687  description="Specify the number of digits used to print derivatives", &
688  default_i_val=6)
689  CALL section_add_keyword(print_key, keyword)
690  CALL keyword_release(keyword)
691 
692  CALL section_add_subsection(section, print_key)
693  CALL section_release(print_key)
694 
695  CALL cp_print_key_section_create(print_key, __location__, name="neighbor_lists", &
696  description="Controls the printing of the neighbor lists", &
697  print_level=debug_print_level, filename="", unit_str="angstrom")
698  CALL keyword_create(keyword, __location__, &
699  name="sab_orb", &
700  description="Activates the printing of the orbital "// &
701  "orbital neighbor lists, "// &
702  "i.e. the overlap neighbor lists", &
703  default_l_val=.false., &
704  lone_keyword_l_val=.true.)
705  CALL section_add_keyword(print_key, keyword)
706  CALL keyword_release(keyword)
707 
708  CALL keyword_create(keyword, __location__, &
709  name="sab_aux_fit", &
710  description="Activates the printing of the orbital "// &
711  "orbital neighbor lists wavefunction fitting basis, "// &
712  "i.e. the overlap neighbor lists", &
713  default_l_val=.false., &
714  lone_keyword_l_val=.true.)
715  CALL section_add_keyword(print_key, keyword)
716  CALL keyword_release(keyword)
717 
718  CALL keyword_create(keyword, __location__, &
719  name="sab_aux_fit_vs_orb", &
720  description="Activates the printing of the orbital "// &
721  "orbital mixed neighbor lists of wavefunction fitting basis, "// &
722  "and the orbital basis, i.e. the overlap neighbor lists", &
723  default_l_val=.false., &
724  lone_keyword_l_val=.true.)
725  CALL section_add_keyword(print_key, keyword)
726  CALL keyword_release(keyword)
727 
728  CALL keyword_create(keyword, __location__, &
729  name="sab_scp", &
730  description="Activates the printing of the vdW SCP "// &
731  "neighbor lists ", &
732  default_l_val=.false., &
733  lone_keyword_l_val=.true.)
734  CALL section_add_keyword(print_key, keyword)
735  CALL keyword_release(keyword)
736 
737  CALL keyword_create(keyword, __location__, &
738  name="sab_vdw", &
739  description="Activates the printing of the vdW "// &
740  "neighbor lists (from DFT, DFTB, SE), "// &
741  "i.e. the dispersion neighbor lists", &
742  default_l_val=.false., &
743  lone_keyword_l_val=.true.)
744  CALL section_add_keyword(print_key, keyword)
745  CALL keyword_release(keyword)
746 
747  CALL keyword_create(keyword, __location__, &
748  name="sab_cn", &
749  description="Activates the printing of the "// &
750  "neighbor lists used for coordination numbers in vdW DFT-D3", &
751  default_l_val=.false., &
752  lone_keyword_l_val=.true.)
753  CALL section_add_keyword(print_key, keyword)
754  CALL keyword_release(keyword)
755 
756  CALL keyword_create(keyword, __location__, &
757  name="sac_ae", &
758  description="Activates the printing of the orbital "// &
759  "nuclear attraction neighbor lists (erfc potential)", &
760  default_l_val=.false., &
761  lone_keyword_l_val=.true.)
762  CALL section_add_keyword(print_key, keyword)
763  CALL keyword_release(keyword)
764 
765  CALL keyword_create(keyword, __location__, &
766  name="sac_ppl", &
767  description="Activates the printing of the orbital "// &
768  "GTH-PPL neighbor lists (local part of the "// &
769  "Goedecker-Teter-Hutter pseudo potentials)", &
770  default_l_val=.false., &
771  lone_keyword_l_val=.true.)
772  CALL section_add_keyword(print_key, keyword)
773  CALL keyword_release(keyword)
774 
775  CALL keyword_create(keyword, __location__, &
776  name="sap_ppnl", &
777  description="Activates the printing of the orbital "// &
778  "GTH-PPNL neighbor lists (non-local part of the "// &
779  "Goedecker-Teter-Hutter pseudo potentials)", &
780  default_l_val=.false., &
781  lone_keyword_l_val=.true.)
782  CALL section_add_keyword(print_key, keyword)
783  CALL keyword_release(keyword)
784 
785  CALL keyword_create(keyword, __location__, &
786  name="sap_oce", &
787  description="Activates the printing of the orbital "// &
788  "PAW-projector neighbor lists (only GAPW)", &
789  default_l_val=.false., &
790  lone_keyword_l_val=.true.)
791  CALL section_add_keyword(print_key, keyword)
792  CALL keyword_release(keyword)
793 
794  CALL keyword_create(keyword, __location__, &
795  name="sab_se", &
796  description="Activates the printing of the two-center "// &
797  "neighbor lists for Coulomb type interactions in NDDO ", &
798  default_l_val=.false., &
799  lone_keyword_l_val=.true.)
800  CALL section_add_keyword(print_key, keyword)
801  CALL keyword_release(keyword)
802 
803  CALL keyword_create(keyword, __location__, &
804  name="sab_lrc", &
805  description="Activates the printing of the long-range SE correction "// &
806  "neighbor lists (only when doing long-range SE with integral scheme KDSO and KDSO-d)", &
807  default_l_val=.false., lone_keyword_l_val=.true.)
808  CALL section_add_keyword(print_key, keyword)
809  CALL keyword_release(keyword)
810 
811  CALL keyword_create(keyword, __location__, &
812  name="sab_tbe", &
813  description="Activates the printing of the DFTB Ewald "// &
814  "neighbor lists ", &
815  default_l_val=.false., &
816  lone_keyword_l_val=.true.)
817  CALL section_add_keyword(print_key, keyword)
818  CALL keyword_release(keyword)
819 
820  CALL keyword_create(keyword, __location__, &
821  name="sab_xtbe", &
822  description="Activates the printing of the xTB sr-Coulomb "// &
823  "neighbor lists ", &
824  default_l_val=.false., &
825  lone_keyword_l_val=.true.)
826  CALL section_add_keyword(print_key, keyword)
827  CALL keyword_release(keyword)
828 
829  CALL keyword_create(keyword, __location__, &
830  name="sab_core", &
831  description="Activates the printing of core interaction "// &
832  "neighbor lists ", &
833  default_l_val=.false., &
834  lone_keyword_l_val=.true.)
835  CALL section_add_keyword(print_key, keyword)
836  CALL keyword_release(keyword)
837 
838  CALL keyword_create(keyword, __location__, &
839  name="sab_xb", &
840  description="Activates the printing of XB interaction from (xTB) "// &
841  "neighbor lists ", &
842  default_l_val=.false., &
843  lone_keyword_l_val=.true.)
844  CALL section_add_keyword(print_key, keyword)
845  CALL keyword_release(keyword)
846 
847  CALL keyword_create(keyword, __location__, &
848  name="sab_xtb_nonbond", &
849  description="Activates the printing of nonbonded interaction from (xTB) "// &
850  "neighbor lists ", &
851  default_l_val=.false., &
852  lone_keyword_l_val=.true.)
853  CALL section_add_keyword(print_key, keyword)
854  CALL keyword_release(keyword)
855 
856  CALL keyword_create(keyword, __location__, &
857  name="soo_list", &
858  description="Activates the printing of RI orbital-orbital "// &
859  "neighbor lists ", &
860  default_l_val=.false., &
861  lone_keyword_l_val=.true.)
862  CALL section_add_keyword(print_key, keyword)
863  CALL keyword_release(keyword)
864 
865  CALL keyword_create(keyword, __location__, &
866  name="sip_list", &
867  description="Activates the printing of RI basis-projector interaction "// &
868  "neighbor lists ", &
869  default_l_val=.false., &
870  lone_keyword_l_val=.true.)
871  CALL section_add_keyword(print_key, keyword)
872  CALL keyword_release(keyword)
873 
874  CALL section_add_subsection(section, print_key)
875  CALL section_release(print_key)
876 
877  CALL cp_print_key_section_create(print_key, __location__, "SUBCELL", &
878  description="Activates the printing of the subcells used for the "// &
879  "generation of neighbor lists.", unit_str="angstrom", &
880  print_level=high_print_level, filename="__STD_OUT__")
881  CALL section_add_subsection(section, print_key)
882  CALL section_release(print_key)
883 
884  CALL cp_print_key_section_create(print_key, __location__, "AO_MATRICES", &
885  description="Controls the printing of the ao (i.e. contracted gaussian) matrices (debug).", &
886  print_level=debug_print_level, filename="__STD_OUT__")
887  CALL keyword_create(keyword, __location__, name="OMIT_HEADERS", &
888  description="Print only the matrix data, not the row and column headers", &
889  default_l_val=.false., lone_keyword_l_val=.true.)
890  CALL section_add_keyword(print_key, keyword)
891  CALL keyword_release(keyword)
892  CALL keyword_create(keyword, __location__, name="NDIGITS", &
893  description="Specify the number of digits used to print the AO matrices", &
894  default_i_val=6)
895  CALL section_add_keyword(print_key, keyword)
896  CALL keyword_release(keyword)
897  CALL keyword_create(keyword, __location__, name="CORE_HAMILTONIAN", &
898  description="If the printkey is activated controls the printing of the hamiltonian matrix", &
899  default_l_val=.false., lone_keyword_l_val=.true.)
900  CALL section_add_keyword(print_key, keyword)
901  CALL keyword_release(keyword)
902  CALL keyword_create(keyword, __location__, name="DENSITY", &
903  description="If the printkey is activated controls the printing of the density (P) matrix", &
904  default_l_val=.false., lone_keyword_l_val=.true.)
905  CALL section_add_keyword(print_key, keyword)
906  CALL keyword_release(keyword)
907 
908  CALL keyword_create(keyword, __location__, name="KINETIC_ENERGY", &
909  description="If the printkey is activated controls the printing of the kinetic energy matrix", &
910  default_l_val=.false., lone_keyword_l_val=.true.)
911  CALL section_add_keyword(print_key, keyword)
912  CALL keyword_release(keyword)
913  CALL keyword_create(keyword, __location__, name="KOHN_SHAM_MATRIX", &
914  description="If the printkey is activated controls the printing of the kohn-sham matrix", &
915  default_l_val=.false., lone_keyword_l_val=.true.)
916  CALL section_add_keyword(print_key, keyword)
917  CALL keyword_release(keyword)
918  CALL keyword_create( &
919  keyword, __location__, name="MATRIX_VXC", &
920  description="If the printkey is activated compute and print the matrix of the exchange and correlation potential. "// &
921  "Only the GGA part for GPW is printed", &
922  default_l_val=.false., lone_keyword_l_val=.true.)
923  CALL section_add_keyword(print_key, keyword)
924  CALL keyword_release(keyword)
925  CALL keyword_create(keyword, __location__, name="ORTHO", &
926  description="If the printkey is activated controls the printing of the orthogonalization matrix", &
927  default_l_val=.false., lone_keyword_l_val=.true.)
928  CALL section_add_keyword(print_key, keyword)
929  CALL keyword_release(keyword)
930  CALL keyword_create(keyword, __location__, name="OVERLAP", &
931  description="If the printkey is activated controls the printing of the overlap matrix", &
932  default_l_val=.false., lone_keyword_l_val=.true.)
933  CALL section_add_keyword(print_key, keyword)
934  CALL keyword_release(keyword)
935  CALL keyword_create(keyword, __location__, name="COMMUTATOR_HR", &
936  description="Controls the printing of the [H,r] commutator matrix", &
937  default_l_val=.false., lone_keyword_l_val=.true.)
938  CALL section_add_keyword(print_key, keyword)
939  CALL keyword_release(keyword)
940 
941  CALL keyword_create(keyword, __location__, name="FERMI_CONTACT", &
942  description="If the printkey is activated controls the printing of the Fermi contact matrix", &
943  default_l_val=.false., lone_keyword_l_val=.true.)
944  CALL section_add_keyword(print_key, keyword)
945  CALL keyword_release(keyword)
946  CALL keyword_create( &
947  keyword, __location__, name="PSO", &
948  description="If the printkey is activated controls the printing of the paramagnetic spin-orbit matrices", &
949  default_l_val=.false., lone_keyword_l_val=.true.)
950  CALL section_add_keyword(print_key, keyword)
951  CALL keyword_release(keyword)
952  CALL keyword_create( &
953  keyword, __location__, name="EFG", &
954  description="If the printkey is activated controls the printing of the electric field gradient matrices", &
955  default_l_val=.false., lone_keyword_l_val=.true.)
956  CALL section_add_keyword(print_key, keyword)
957  CALL keyword_release(keyword)
958  CALL keyword_create(keyword, __location__, name="POTENTIAL_ENERGY", &
959  description="If the printkey is activated controls the printing of the potential energy matrix", &
960  default_l_val=.false., lone_keyword_l_val=.true.)
961  CALL section_add_keyword(print_key, keyword)
962  CALL keyword_release(keyword)
963  CALL keyword_create(keyword, __location__, name="OCE_HARD", &
964  description="If the printkey is activated controls the printing of the OCE HARD matrix", &
965  default_l_val=.false., lone_keyword_l_val=.true.)
966  CALL section_add_keyword(print_key, keyword)
967  CALL keyword_release(keyword)
968  CALL keyword_create(keyword, __location__, name="OCE_SOFT", &
969  description="If the printkey is activated controls the printing of the OCE SOFT matrix", &
970  default_l_val=.false., lone_keyword_l_val=.true.)
971  CALL section_add_keyword(print_key, keyword)
972  CALL keyword_release(keyword)
973  CALL keyword_create(keyword, __location__, name="W_MATRIX", &
974  description="If the printkey is activated controls the printing of the w matrix", &
975  default_l_val=.false., lone_keyword_l_val=.true.)
976  CALL section_add_keyword(print_key, keyword)
977  CALL keyword_release(keyword)
978  CALL keyword_create(keyword, __location__, name="W_MATRIX_AUX_FIT", &
979  description="If the printkey is activated controls the printing of the w matrix", &
980  default_l_val=.false., lone_keyword_l_val=.true.)
981  CALL section_add_keyword(print_key, keyword)
982  CALL keyword_release(keyword)
983  CALL keyword_create(keyword, __location__, name="DERIVATIVES", &
984  description="If the printkey is activated controls the printing "// &
985  "of derivatives (for the matrixes that support this)", &
986  default_l_val=.false., lone_keyword_l_val=.true.)
987  CALL section_add_keyword(print_key, keyword)
988  CALL keyword_release(keyword)
989  CALL section_add_subsection(section, print_key)
990  CALL section_release(print_key)
991 
993  print_key, __location__, "MO", &
994  description="Controls the printing of the molecular orbital (MO) information. The requested MO information "// &
995  "is printed for all occupied MOs by default. Use the MO_INDEX_RANGE keyword to restrict the number "// &
996  "of the MOs or to print the MO information for unoccupied MOs. With diagonalization, additional MOs "// &
997  "have to be made available for printout using the ADDED_MOS keyword in the SCF section. With OT, "// &
998  "it is sufficient to specify the desired MO_INDEX_RANGE. The OT eigensolver can be controlled with "// &
999  "the EPS_LUMO and MAX_ITER_LUMO keywords in the SCF section.", &
1000  print_level=high_print_level, filename="__STD_OUT__")
1001  CALL keyword_create(keyword, __location__, name="CARTESIAN", &
1002  description="Print the MOs in the Cartesian basis instead of the default spherical basis.", &
1003  default_l_val=.false., lone_keyword_l_val=.true.)
1004  CALL section_add_keyword(print_key, keyword)
1005  CALL keyword_release(keyword)
1006  CALL keyword_create(keyword, __location__, name="ENERGIES", &
1007  variants=s2a("EIGENVALUES", "EIGVALS"), &
1008  description="Print the MO energies (eigenvalues).", &
1009  default_l_val=.false., lone_keyword_l_val=.true.)
1010  CALL section_add_keyword(print_key, keyword)
1011  CALL keyword_release(keyword)
1012  CALL keyword_create(keyword, __location__, name="COEFFICIENTS", &
1013  variants=s2a("EIGENVECTORS", "EIGVECS"), &
1014  description="Print the MO coefficients (eigenvectors).", &
1015  default_l_val=.false., lone_keyword_l_val=.true.)
1016  CALL section_add_keyword(print_key, keyword)
1017  CALL keyword_release(keyword)
1018  CALL keyword_create(keyword, __location__, name="OCCUPATION_NUMBERS", &
1019  variants=s2a("OCCNUMS"), &
1020  description="Print the MO occupation numbers.", &
1021  default_l_val=.false., lone_keyword_l_val=.true.)
1022  CALL section_add_keyword(print_key, keyword)
1023  CALL keyword_release(keyword)
1024  CALL keyword_create(keyword, __location__, name="OCCUPATION_NUMBERS_STATS", &
1025  variants=s2a("OCCNUMSTATS"), &
1026  description="Print some stats (max number of occupied MOs, etc.) of the MO occupation numbers."// &
1027  " First logical toggles stats printing, first real is the occupied threshold.", &
1028  type_of_var=char_t, n_var=-1, &
1029  default_c_vals=[".FALSE.", "1.0E-6 "], &
1030  lone_keyword_c_vals=[".TRUE."], &
1031  usage="OCCUPATION_NUMBERS_STATS {Logical} [{Real}]")
1032  CALL section_add_keyword(print_key, keyword)
1033  CALL keyword_release(keyword)
1034  CALL keyword_create(keyword, __location__, name="NDIGITS", &
1035  description="Specify the number of digits used to print the MO information.", &
1036  default_i_val=6)
1037  CALL section_add_keyword(print_key, keyword)
1038  CALL keyword_release(keyword)
1039  CALL keyword_create(keyword, __location__, &
1040  name="MO_INDEX_RANGE", &
1041  variants=s2a("MO_RANGE", "RANGE"), &
1042  description="Print only the requested subset of MOs. The indices of the first and "// &
1043  "the last MO have to be specified to define the range.", &
1044  repeats=.false., &
1045  n_var=2, &
1046  type_of_var=integer_t, &
1047  default_i_vals=(/0, 0/), &
1048  usage="MO_INDEX_RANGE 10 15")
1049  CALL section_add_keyword(print_key, keyword)
1050  CALL keyword_release(keyword)
1051  CALL section_add_subsection(section, print_key)
1052  CALL section_release(print_key)
1053 
1054  CALL cp_print_key_section_create(print_key, __location__, "MO_MOLDEN", &
1055  description="Write the molecular orbitals in Molden file format, for visualisation.", &
1056  print_level=debug_print_level + 1, add_last=add_last_numeric, filename="MOS")
1057  CALL keyword_create(keyword, __location__, name="NDIGITS", &
1058  description="Specifies the number of significant digits retained. 3 is OK for visualization.", &
1059  usage="NDIGITS {int}", &
1060  default_i_val=3)
1061  CALL section_add_keyword(print_key, keyword)
1062  CALL keyword_release(keyword)
1063  CALL keyword_create(keyword, __location__, name="GTO_KIND", &
1064  description="Representation of Gaussian-type orbitals", &
1065  default_i_val=gto_spherical, &
1066  enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
1067  enum_desc=s2a( &
1068  "Cartesian Gaussian orbitals. Use with caution", &
1069  "Spherical Gaussian orbitals. Incompatible with VMD"), &
1070  enum_i_vals=(/gto_cartesian, gto_spherical/))
1071  CALL section_add_keyword(print_key, keyword)
1072  CALL keyword_release(keyword)
1073  CALL section_add_subsection(section, print_key)
1074  CALL section_release(print_key)
1075 
1076  CALL create_mo_cubes_section(print_key)
1077  CALL section_add_subsection(section, print_key)
1078  CALL section_release(print_key)
1079 
1080  CALL create_stm_section(print_key)
1081  CALL section_add_subsection(section, print_key)
1082  CALL section_release(print_key)
1083 
1084  CALL create_wfn_mix_section(subsection)
1085  CALL section_add_subsection(section, subsection)
1086  CALL section_release(subsection)
1087 
1088  CALL section_create(subsection, __location__, name="GAPW", &
1089  description="Controls the printing of some gapw related information (debug).", &
1090  n_keywords=0, n_subsections=1, repeats=.false.)
1091  CALL cp_print_key_section_create(print_key, __location__, "projectors", &
1092  description="If the printkey is activated controls if information on"// &
1093  " the projectors is printed.", &
1094  print_level=debug_print_level, filename="__STD_OUT__")
1095  CALL section_add_subsection(subsection, print_key)
1096  CALL section_release(print_key)
1097  CALL cp_print_key_section_create(print_key, __location__, "rho0_information", &
1098  description="If the printkey is activated controls if information on rho0 is printed.", &
1099  print_level=debug_print_level, filename="__STD_OUT__", unit_str="angstrom")
1100  CALL section_add_subsection(subsection, print_key)
1101  CALL section_release(print_key)
1102  CALL section_add_subsection(section, subsection)
1103  CALL section_release(subsection)
1104 
1105  CALL cp_print_key_section_create(print_key, __location__, "dft_control_parameters", &
1106  description="Controls the printing of dft control parameters.", &
1107  print_level=medium_print_level, filename="__STD_OUT__")
1108  CALL section_add_subsection(section, print_key)
1109  CALL section_release(print_key)
1110 
1111  CALL cp_print_key_section_create(print_key, __location__, "KPOINTS", &
1112  description="Controls the printing of kpoint information.", &
1113  print_level=medium_print_level, filename="__STD_OUT__")
1114  CALL section_add_subsection(section, print_key)
1115  CALL section_release(print_key)
1116 
1117  NULLIFY (subsection)
1118  CALL create_bandstructure_section(subsection)
1119  CALL section_add_subsection(section, subsection)
1120  CALL section_release(subsection)
1121 
1122  CALL cp_print_key_section_create(print_key, __location__, "OVERLAP_CONDITION", &
1123  description="Controls the the checking and printing of and estimate "// &
1124  "of the overlap matrix condition number", &
1125  print_level=debug_print_level, filename="__STD_OUT__")
1126  CALL keyword_create(keyword, __location__, name="1-NORM", &
1127  description="Calculate an estimate of the 1-norm condition number", &
1128  default_l_val=.true., lone_keyword_l_val=.true.)
1129  CALL section_add_keyword(print_key, keyword)
1130  CALL keyword_release(keyword)
1131  CALL keyword_create(keyword, __location__, name="DIAGONALIZATION", &
1132  description="Calculate the 1- and 2-norm condition numbers using diagonalization", &
1133  default_l_val=.false., lone_keyword_l_val=.true.)
1134  CALL section_add_keyword(print_key, keyword)
1135  CALL keyword_release(keyword)
1136  CALL keyword_create(keyword, __location__, name="ARNOLDI", &
1137  description="Calculate the 2-norm condition number using the Arnoldi code (may not be reliable)", &
1138  default_l_val=.false., lone_keyword_l_val=.true.)
1139  CALL section_add_keyword(print_key, keyword)
1140  CALL keyword_release(keyword)
1141  CALL section_add_subsection(section, print_key)
1142  CALL section_release(print_key)
1143 
1144  CALL cp_print_key_section_create(print_key, __location__, name="E_DENSITY_CUBE", &
1145  description="Controls the printing of cube files with "// &
1146  "the electronic density and, for LSD calculations, the spin density.", &
1147  print_level=high_print_level, filename="")
1148  CALL keyword_create(keyword, __location__, name="stride", &
1149  description="The stride (X,Y,Z) used to write the cube file "// &
1150  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1151  " 1 number valid for all components.", &
1152  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
1153  CALL section_add_keyword(print_key, keyword)
1154  CALL keyword_release(keyword)
1155 
1156  CALL keyword_create(keyword, __location__, name="DENSITY_INCLUDE", &
1157  description="Which parts of the density to include. In GAPW the electronic density "// &
1158  "is divided into a hard and a soft component, and the default (TOTAL_HARD_APPROX) "// &
1159  "is to approximate the hard density as a spherical gaussian and to print the smooth "// &
1160  "density accurately. This avoids potential artefacts originating from the hard density. "// &
1161  "If the TOTAL_DENSITY keyword is used the hard density will be computed more accurately "// &
1162  "but may introduce non-physical features. The SOFT_DENSITY keyword will lead to only the "// &
1163  "soft density being printed. In GPW these options have no effect and the cube file will "// &
1164  "only contain the valence electron density.", &
1165  usage="DENSITY_INCLUDE TOTAL_HARD_APPROX", &
1166  enum_c_vals=s2a("TOTAL_HARD_APPROX", "TOTAL_DENSITY", "SOFT_DENSITY"), &
1167  enum_desc=s2a("Print (hard+soft) density where the hard components shape is approximated", &
1168  "Print (hard+soft) density. Only has an effect "// &
1169  "if PAW atoms are present. NOTE: The total "// &
1170  "in real space might exhibit unphysical features "// &
1171  "like spikes due to the finite and thus "// &
1172  "truncated g vector", &
1173  "Print only the soft density"), &
1174  enum_i_vals=(/e_dens_total_hard_approx, &
1176  e_dens_soft_density/), &
1177  default_i_val=e_dens_total_hard_approx)
1178  CALL section_add_keyword(print_key, keyword)
1179  CALL keyword_release(keyword)
1180 
1181  CALL keyword_create(keyword, __location__, name="APPEND", &
1182  description="append the cube files when they already exist", &
1183  default_l_val=.false., lone_keyword_l_val=.true.)
1184  CALL section_add_keyword(print_key, keyword)
1185  CALL keyword_release(keyword)
1186 
1187  CALL keyword_create(keyword, __location__, name="XRD_INTERFACE", &
1188  description="It activates the print out of exponents and coefficients for the"// &
1189  " Gaussian expansion of the core densities, based on atom calculations for each kind."// &
1190  " The resulting core dansities are needed to compute the form factors."// &
1191  " If GAPW the local densities are also given in terms of a Gaussian expansion,"// &
1192  " by fitting the difference between local-fhard and local-soft density for each atom."// &
1193  " In this case the keyword SOFT_DENSITY is enabled.", &
1194  default_l_val=.false., lone_keyword_l_val=.true.)
1195  CALL section_add_keyword(print_key, keyword)
1196  CALL keyword_release(keyword)
1197 
1198  CALL keyword_create(keyword, __location__, name="NGAUSS", &
1199  description="Number of Gaussian functions used in the expansion of atomic (core) density", &
1200  usage="NGAUSS 10", n_var=1, default_i_val=12, type_of_var=integer_t)
1201  CALL section_add_keyword(print_key, keyword)
1202  CALL keyword_release(keyword)
1203 
1204  CALL section_add_subsection(section, print_key)
1205  CALL section_release(print_key)
1206 
1207  CALL cp_print_key_section_create(print_key, __location__, "tot_density_cube", &
1208  description="Controls printing of cube files with "// &
1209  "the total density (electrons+atomic core). Note that "// &
1210  "the value of the total density is positive where the "// &
1211  "electron density dominates and negative where the core is. "// &
1212  "When GPW is enabled this will simply print the combined density "// &
1213  "of the valence electrons and charge-balanced core. In GAPW the "// &
1214  "electronic density (hard+soft plus a correction term) is printed "// &
1215  "together with the charge-balanced core density to produce a complete "// &
1216  "representation of the total density.", &
1217  print_level=high_print_level, filename="")
1218  CALL keyword_create(keyword, __location__, name="stride", &
1219  description="The stride (X,Y,Z) used to write the cube file "// &
1220  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1221  " 1 number valid for all components.", &
1222  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
1223  CALL section_add_keyword(print_key, keyword)
1224  CALL keyword_release(keyword)
1225 
1226  CALL keyword_create(keyword, __location__, name="APPEND", &
1227  description="append the cube files when they already exist", &
1228  default_l_val=.false., lone_keyword_l_val=.true.)
1229  CALL section_add_keyword(print_key, keyword)
1230  CALL keyword_release(keyword)
1231 
1232  CALL section_add_subsection(section, print_key)
1233  CALL section_release(print_key)
1234 
1235  CALL cp_print_key_section_create(print_key, __location__, "v_hartree_cube", &
1236  description="Controls the printing of a cube file with eletrostatic"// &
1237  " potential generated by the total density (electrons+ions). It is"// &
1238  " valid only for QS with GPW formalism."// &
1239  " Note that by convention the potential has opposite sign than the expected physical one.", &
1240  print_level=high_print_level, filename="")
1241  CALL keyword_create(keyword, __location__, name="stride", &
1242  description="The stride (X,Y,Z) used to write the cube file "// &
1243  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1244  " 1 number valid for all components.", &
1245  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
1246  CALL section_add_keyword(print_key, keyword)
1247  CALL keyword_release(keyword)
1248  CALL keyword_create(keyword, __location__, name="APPEND", &
1249  description="append the cube files when they already exist", &
1250  default_l_val=.false., lone_keyword_l_val=.true.)
1251  CALL section_add_keyword(print_key, keyword)
1252  CALL keyword_release(keyword)
1253 
1254  CALL section_add_subsection(section, print_key)
1255  CALL section_release(print_key)
1256 
1257  CALL cp_print_key_section_create(print_key, __location__, "external_potential_cube", &
1258  description="Controls the printing of a cube file with external"// &
1259  " potential from the DFT%EXTERNAL_POTENTIAL section only.", &
1260  print_level=high_print_level, filename="")
1261  CALL keyword_create(keyword, __location__, name="stride", &
1262  description="The stride (X,Y,Z) used to write the cube file "// &
1263  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1264  " 1 number valid for all components.", &
1265  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
1266  CALL section_add_keyword(print_key, keyword)
1267  CALL keyword_release(keyword)
1268  CALL keyword_create(keyword, __location__, name="APPEND", &
1269  description="append the cube files when they already exist", &
1270  default_l_val=.false., lone_keyword_l_val=.true.)
1271  CALL section_add_keyword(print_key, keyword)
1272  CALL keyword_release(keyword)
1273 
1274  CALL section_add_subsection(section, print_key)
1275  CALL section_release(print_key)
1276 
1277  ! Output of BQB volumetric files
1278  CALL cp_print_key_section_create(print_key, __location__, name="E_DENSITY_BQB", &
1279  description="Controls the output of the electron density to the losslessly"// &
1280  " compressed BQB file format, see [Brehm2018]"// &
1281  " (via LibBQB see <https://brehm-research.de/bqb>)."// &
1282  " Currently does not work with changing cell vector (NpT ensemble).", &
1283  print_level=debug_print_level + 1, filename="", &
1284  citations=(/brehm2018/))
1285 
1286  CALL keyword_create(keyword, __location__, name="SKIP_FIRST", &
1287  description="Skips the first step of a MD run (avoids duplicate step if restarted).", &
1288  usage="SKIP_FIRST T", default_l_val=.false., lone_keyword_l_val=.true.)
1289  CALL section_add_keyword(print_key, keyword)
1290  CALL keyword_release(keyword)
1291 
1292  CALL keyword_create(keyword, __location__, name="STORE_STEP_NUMBER", &
1293  description="Stores the step number and simulation time in the comment line of each BQB"// &
1294  " frame. Switch it off for binary compatibility with original CP2k CUBE files.", &
1295  usage="STORE_STEP_NUMBER F", default_l_val=.true., lone_keyword_l_val=.true.)
1296  CALL section_add_keyword(print_key, keyword)
1297  CALL keyword_release(keyword)
1298 
1299  CALL keyword_create(keyword, __location__, name="CHECK", &
1300  description="Performs an on-the-fly decompression of each compressed BQB frame to check"// &
1301  " whether the volumetric data exactly matches, and aborts the run if not so.", &
1302  usage="CHECK T", default_l_val=.false., lone_keyword_l_val=.true.)
1303  CALL section_add_keyword(print_key, keyword)
1304  CALL keyword_release(keyword)
1305 
1306  CALL keyword_create(keyword, __location__, name="OVERWRITE", &
1307  description="Specify this keyword to overwrite the output BQB file if"// &
1308  " it already exists. By default, the data is appended to an existing file.", &
1309  usage="OVERWRITE T", default_l_val=.false., lone_keyword_l_val=.true.)
1310  CALL section_add_keyword(print_key, keyword)
1311  CALL keyword_release(keyword)
1312 
1313  CALL keyword_create(keyword, __location__, name="HISTORY", &
1314  description="Controls how many previous steps are taken into account for extrapolation in"// &
1315  " compression. Use a value of 1 to compress the frames independently.", &
1316  usage="HISTORY 10", n_var=1, default_i_val=10, type_of_var=integer_t)
1317  CALL section_add_keyword(print_key, keyword)
1318  CALL keyword_release(keyword)
1319 
1320  CALL keyword_create(keyword, __location__, name="PARAMETER_KEY", &
1321  description="Allows to supply previously optimized compression parameters via a"// &
1322  " parameter key (alphanumeric character sequence starting with 'at')."// &
1323  " Just leave away the 'at' sign here, because CP2k will otherwise"// &
1324  " assume it is a variable name in the input", &
1325  usage="PARAMETER_KEY <KEY>", n_var=1, default_c_val="", type_of_var=char_t)
1326  CALL section_add_keyword(print_key, keyword)
1327  CALL keyword_release(keyword)
1328 
1329  CALL keyword_create(keyword, __location__, name="OPTIMIZE", &
1330  description="Controls the time spent to optimize the parameters for compression efficiency.", &
1331  usage="OPTIMIZE {OFF,QUICK,NORMAL,PATIENT,EXHAUSTIVE}", repeats=.false., n_var=1, &
1332  default_i_val=bqb_opt_quick, &
1333  enum_c_vals=s2a("OFF", "QUICK", "NORMAL", "PATIENT", "EXHAUSTIVE"), &
1334  enum_desc=s2a("No optimization (use defaults)", "Quick optimization", &
1335  "Standard optimization", "Precise optimization", "Exhaustive optimization"), &
1337  CALL section_add_keyword(print_key, keyword)
1338  CALL keyword_release(keyword)
1339 
1340  CALL section_add_subsection(section, print_key)
1341  CALL section_release(print_key)
1342 
1343  ! Voronoi Integration via LibVori
1344  CALL create_print_voronoi_section(print_key)
1345  CALL section_add_subsection(section, print_key)
1346  CALL section_release(print_key)
1347 
1348  ! cube files for data generated by the implicit (generalized) Poisson solver
1349  CALL create_implicit_psolver_section(subsection)
1350  CALL section_add_subsection(section, subsection)
1351  CALL section_release(subsection)
1352 
1353  ! ZMP adding the print section for the v_xc cube
1354  CALL cp_print_key_section_create(print_key, __location__, "v_xc_cube", &
1355  description="Controls the printing of a cube file with xc"// &
1356  " potential generated by the ZMP method (for the moment). It is"// &
1357  " valid only for QS with GPW formalism .", &
1358  print_level=high_print_level, filename="")
1359  CALL keyword_create(keyword, __location__, name="stride", &
1360  description="The stride (X,Y,Z) used to write the cube file "// &
1361  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1362  " 1 number valid for all components.", &
1363  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
1364  CALL section_add_keyword(print_key, keyword)
1365  CALL keyword_release(keyword)
1366  CALL keyword_create(keyword, __location__, name="APPEND", &
1367  description="append the cube files when they already exist", &
1368  default_l_val=.false., lone_keyword_l_val=.true.)
1369  CALL section_add_keyword(print_key, keyword)
1370  CALL keyword_release(keyword)
1371 
1372  CALL section_add_subsection(section, print_key)
1373  CALL section_release(print_key)
1374 
1375  CALL cp_print_key_section_create(print_key, __location__, "efield_cube", &
1376  description="Controls the printing of cube files with electric"// &
1377  " field generated by the total density (electrons+ions). It is"// &
1378  " valid only for QS with GPW formalism.", &
1379  print_level=high_print_level, filename="")
1380  CALL keyword_create(keyword, __location__, name="stride", &
1381  description="The stride (X,Y,Z) used to write the cube file "// &
1382  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1383  " 1 number valid for all components.", &
1384  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
1385  CALL section_add_keyword(print_key, keyword)
1386  CALL keyword_release(keyword)
1387  CALL keyword_create(keyword, __location__, name="APPEND", &
1388  description="append the cube files when they already exist", &
1389  default_l_val=.false., lone_keyword_l_val=.true.)
1390  CALL section_add_keyword(print_key, keyword)
1391  CALL keyword_release(keyword)
1392 
1393  CALL section_add_subsection(section, print_key)
1394  CALL section_release(print_key)
1395 
1396  CALL cp_print_key_section_create(print_key, __location__, "ELF_CUBE", &
1397  description="Controls printing of cube files with"// &
1398  " the electron localization function (ELF). Note that"// &
1399  " the value of ELF is defined between 0 and 1: Pauli kinetic energy density normalized"// &
1400  " by the kinetic energy density of a uniform el. gas of same density.", &
1401  print_level=high_print_level, filename="")
1402  CALL keyword_create(keyword, __location__, name="stride", &
1403  description="The stride (X,Y,Z) used to write the cube file "// &
1404  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1405  " 1 number valid for all components.", &
1406  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
1407  CALL section_add_keyword(print_key, keyword)
1408  CALL keyword_release(keyword)
1409  CALL keyword_create(keyword, __location__, name="APPEND", &
1410  description="append the cube files when they already exist", &
1411  default_l_val=.false., lone_keyword_l_val=.true.)
1412  CALL section_add_keyword(print_key, keyword)
1413  CALL keyword_release(keyword)
1414 
1415  CALL keyword_create(keyword, __location__, name="density_cutoff", &
1416  description=" ", &
1417  usage="density_cutoff 0.0001", &
1418  repeats=.false., &
1419  n_var=1, &
1420  type_of_var=real_t, &
1421  default_r_val=1.0e-10_dp)
1422  CALL section_add_keyword(print_key, keyword)
1423  CALL keyword_release(keyword)
1424 
1425  CALL section_add_subsection(section, print_key)
1426  CALL section_release(print_key)
1427 
1428  CALL cp_print_key_section_create(print_key, __location__, "LOCAL_ENERGY_CUBE", &
1429  description="Controls the printing of cube files with the local"// &
1430  " energy. It is valid only for QS with GPW/GAPW formalism."// &
1431  " Meta and hybrid functionals are not possible.", &
1432  print_level=debug_print_level, filename="")
1433  CALL keyword_create(keyword, __location__, name="stride", &
1434  description="The stride (X,Y,Z) used to write the cube file "// &
1435  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1436  " 1 number valid for all components.", &
1437  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
1438  CALL section_add_keyword(print_key, keyword)
1439  CALL keyword_release(keyword)
1440  CALL keyword_create(keyword, __location__, name="APPEND", &
1441  description="append the cube files when they already exist", &
1442  default_l_val=.false., lone_keyword_l_val=.true.)
1443  CALL section_add_keyword(print_key, keyword)
1444  CALL keyword_release(keyword)
1445 
1446  CALL section_add_subsection(section, print_key)
1447  CALL section_release(print_key)
1448 
1449  CALL cp_print_key_section_create(print_key, __location__, "LOCAL_STRESS_CUBE", &
1450  description="Controls the printing of cube files with the local"// &
1451  " stress. It is valid only for QS with GPW/GAPW formalism."// &
1452  " Meta and hybrid functionals are not possible.", &
1453  print_level=debug_print_level, filename="")
1454  CALL keyword_create(keyword, __location__, name="stride", &
1455  description="The stride (X,Y,Z) used to write the cube file "// &
1456  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1457  " 1 number valid for all components.", &
1458  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
1459  CALL section_add_keyword(print_key, keyword)
1460  CALL keyword_release(keyword)
1461  CALL keyword_create(keyword, __location__, name="APPEND", &
1462  description="append the cube files when they already exist", &
1463  default_l_val=.false., lone_keyword_l_val=.true.)
1464  CALL section_add_keyword(print_key, keyword)
1465  CALL keyword_release(keyword)
1466 
1467  CALL section_add_subsection(section, print_key)
1468  CALL section_release(print_key)
1469 
1470  CALL create_dos_section(print_key)
1471  CALL section_add_subsection(section, print_key)
1472  CALL section_release(print_key)
1473 
1474  CALL create_pdos_section(print_key)
1475  CALL section_add_subsection(section, print_key)
1476  CALL section_release(print_key)
1477 
1478  CALL create_wannier_section(print_key)
1479  CALL section_add_subsection(section, print_key)
1480  CALL section_release(print_key)
1481 
1482  !Printing of Moments
1483  CALL create_dipoles_section(print_key, "MOMENTS", high_print_level)
1484  CALL keyword_create( &
1485  keyword, __location__, &
1486  name="MAX_MOMENT", &
1487  description="Maximum moment to be calculated. Values higher than 1 not implemented under periodic boundaries.", &
1488  usage="MAX_MOMENT {integer}", &
1489  repeats=.false., &
1490  n_var=1, &
1491  type_of_var=integer_t, &
1492  default_i_val=1)
1493  CALL section_add_keyword(print_key, keyword)
1494  CALL keyword_release(keyword)
1495  CALL keyword_create(keyword, __location__, &
1496  name="MAGNETIC", &
1497  description="Calculate also magnetic moments, only implemented without periodic boundaries", &
1498  usage="MAGNETIC yes", &
1499  repeats=.false., &
1500  n_var=1, &
1501  default_l_val=.false., &
1502  lone_keyword_l_val=.true.)
1503  CALL section_add_keyword(print_key, keyword)
1504  CALL keyword_release(keyword)
1505  CALL keyword_create(keyword, __location__, &
1506  name="VEL_REPRS", &
1507  description="Calculate expectation values of the el. multipole moments in their velocity "// &
1508  "representation during RTP. Implemented up to el. quadrupole moment.", &
1509  usage="VEL_REPS yes", &
1510  repeats=.false., &
1511  n_var=1, &
1512  default_l_val=.false., &
1513  lone_keyword_l_val=.true.)
1514  CALL section_add_keyword(print_key, keyword)
1515  CALL keyword_release(keyword)
1516  CALL keyword_create(keyword, __location__, &
1517  name="COM_NL", &
1518  description="Include non local commutator for velocity representations. "// &
1519  "Necessary for origin independent results.", &
1520  usage="COM_NL yes", &
1521  repeats=.false., &
1522  n_var=1, &
1523  default_l_val=.false., &
1524  lone_keyword_l_val=.true.)
1525  CALL section_add_keyword(print_key, keyword)
1526  CALL keyword_release(keyword)
1527  CALL keyword_create(keyword, __location__, &
1528  name="SECOND_REFERENCE_POINT", &
1529  description="Use second reference point", &
1530  usage="SECOND_REFERENCE_POINT .TRUE.", &
1531  repeats=.false., &
1532  n_var=1, &
1533  default_l_val=.false., &
1534  lone_keyword_l_val=.true.)
1535  CALL section_add_keyword(print_key, keyword)
1536  CALL keyword_release(keyword)
1537  CALL keyword_create(keyword, __location__, name="REFERENCE_2", &
1538  variants=s2a("REF_2"), &
1539  description="Define a second reference point for the calculation of the electrostatic moment.", &
1540  usage="REFERENCE_2 COM", &
1541  enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
1542  enum_desc=s2a("Use Center of Mass", &
1543  "Use Center of Atomic Charges", &
1544  "Use User Defined Point (Keyword:REF_POINT)", &
1545  "Use Origin of Coordinate System"), &
1546  enum_i_vals=(/use_mom_ref_com, &
1547  use_mom_ref_coac, &
1548  use_mom_ref_user, &
1549  use_mom_ref_zero/), &
1550  default_i_val=use_mom_ref_zero)
1551  CALL section_add_keyword(print_key, keyword)
1552  CALL keyword_release(keyword)
1553  CALL keyword_create(keyword, __location__, name="REFERENCE_POINT_2", &
1554  variants=s2a("REF_POINT_2"), &
1555  description="Fixed second reference point for the calculations of the electrostatic moment.", &
1556  usage="REFERENCE_POINT_2 x y z", &
1557  repeats=.false., &
1558  n_var=3, default_r_vals=(/0._dp, 0._dp, 0._dp/), &
1559  type_of_var=real_t, &
1560  unit_str='bohr')
1561  CALL section_add_keyword(print_key, keyword)
1562  CALL keyword_release(keyword)
1563  CALL section_add_subsection(section, print_key)
1564  CALL section_release(print_key)
1565 
1566  ! Mulliken population analysis
1567  CALL cp_print_key_section_create(print_key, __location__, "MULLIKEN", &
1568  description="Controls the printing of the Mulliken (spin) population analysis", &
1569  print_level=medium_print_level, filename="__STD_OUT__", &
1570  common_iter_levels=1)
1571  CALL keyword_create( &
1572  keyword, __location__, &
1573  name="PRINT_GOP", &
1574  description="Print the gross orbital populations (GOP) in addition to the gross atomic populations (GAP) "// &
1575  "and net charges", &
1576  usage="PRINT_GOP yes", &
1577  repeats=.false., &
1578  n_var=1, &
1579  default_l_val=.false., &
1580  lone_keyword_l_val=.true.)
1581  CALL section_add_keyword(print_key, keyword)
1582  CALL keyword_release(keyword)
1583  CALL keyword_create( &
1584  keyword, __location__, &
1585  name="PRINT_ALL", &
1586  description="Print all information including the full net AO and overlap population matrix", &
1587  usage="PRINT_ALL yes", &
1588  repeats=.false., &
1589  n_var=1, &
1590  default_l_val=.false., &
1591  lone_keyword_l_val=.true.)
1592  CALL section_add_keyword(print_key, keyword)
1593  CALL keyword_release(keyword)
1594  CALL section_add_subsection(section, print_key)
1595  CALL section_release(print_key)
1596 
1597  ! Lowdin population analysis (fairly expensive to compute, so only at high)
1598  CALL cp_print_key_section_create(print_key, __location__, "LOWDIN", &
1599  description="Controls the printing of the Lowdin (spin) population analysis", &
1600  print_level=high_print_level, filename="__STD_OUT__", &
1601  common_iter_levels=1)
1602  CALL keyword_create( &
1603  keyword, __location__, &
1604  name="PRINT_GOP", &
1605  description="Print the orbital populations in addition to the atomic populations and net charges", &
1606  usage="PRINT_GOP yes", &
1607  repeats=.false., &
1608  n_var=1, &
1609  default_l_val=.false., &
1610  lone_keyword_l_val=.true.)
1611  CALL section_add_keyword(print_key, keyword)
1612  CALL keyword_release(keyword)
1613  CALL keyword_create( &
1614  keyword, __location__, &
1615  name="PRINT_ALL", &
1616  description="Print all information including the full symmetrically orthogonalised density matrix", &
1617  usage="PRINT_ALL yes", &
1618  repeats=.false., &
1619  n_var=1, &
1620  default_l_val=.false., &
1621  lone_keyword_l_val=.true.)
1622  CALL section_add_keyword(print_key, keyword)
1623  CALL keyword_release(keyword)
1624  CALL section_add_subsection(section, print_key)
1625  CALL section_release(print_key)
1626 
1627  ! Hirshfeld population analysis
1628  CALL cp_print_key_section_create(print_key, __location__, "HIRSHFELD", &
1629  description="Controls the printing of the Hirshfeld (spin) population analysis", &
1630  print_level=medium_print_level, filename="__STD_OUT__", &
1631  common_iter_levels=1)
1632  CALL keyword_create(keyword, __location__, name="SELF_CONSISTENT", &
1633  description="Calculate charges from the Hirscheld-I (self_consistent) method."// &
1634  " This scales only the full shape function, not the added charge as in the original scheme.", &
1635  usage="SELF_CONSISTENT yes", repeats=.false., n_var=1, &
1636  default_l_val=.false., lone_keyword_l_val=.true.)
1637  CALL section_add_keyword(print_key, keyword)
1638  CALL keyword_release(keyword)
1639  CALL keyword_create(keyword, __location__, name="SHAPE_FUNCTION", &
1640  description="Type of shape function used for Hirshfeld partitioning.", &
1641  usage="SHAPE_FUNCTION {Gaussian,Density}", repeats=.false., n_var=1, &
1642  default_i_val=shape_function_gaussian, &
1643  enum_c_vals=s2a("GAUSSIAN", "DENSITY"), &
1644  enum_desc=s2a("Single Gaussian with Colvalent radius", &
1645  "Atomic density expanded in multiple Gaussians"), &
1647  CALL section_add_keyword(print_key, keyword)
1648  CALL keyword_release(keyword)
1649  CALL keyword_create(keyword, __location__, name="REFERENCE_CHARGE", &
1650  description="Charge of atomic partitioning function for Hirshfeld method.", &
1651  usage="REFERENCE_CHARGE {Atomic,Mulliken}", repeats=.false., n_var=1, &
1652  default_i_val=ref_charge_atomic, &
1653  enum_c_vals=s2a("ATOMIC", "MULLIKEN"), &
1654  enum_desc=s2a("Use atomic core charges", "Calculate Mulliken charges"), &
1655  enum_i_vals=(/ref_charge_atomic, ref_charge_mulliken/))
1656  CALL section_add_keyword(print_key, keyword)
1657  CALL keyword_release(keyword)
1658  CALL keyword_create(keyword, __location__, name="USER_RADIUS", &
1659  description="Use user defined radii to generate Gaussians."// &
1660  " These radii are defined by the keyword ATOMIC_RADII", &
1661  usage="USER_RADIUS yes", repeats=.false., n_var=1, &
1662  default_l_val=.false., lone_keyword_l_val=.true.)
1663  CALL section_add_keyword(print_key, keyword)
1664  CALL keyword_release(keyword)
1665  CALL keyword_create(keyword, __location__, name="ATOMIC_RADII", &
1666  description="Defines custom radii to setup the spherical Gaussians.", &
1667  usage="ATOMIC_RADII {real} {real} {real}", repeats=.false., &
1668  unit_str="angstrom", &
1669  type_of_var=real_t, n_var=-1)
1670  CALL section_add_keyword(print_key, keyword)
1671  CALL keyword_release(keyword)
1672  CALL section_add_subsection(section, print_key)
1673  CALL section_release(print_key)
1674 
1675  ! MAO (modified atomic orbital) analysis
1676  CALL cp_print_key_section_create(print_key, __location__, "MAO_ANALYSIS", &
1677  description="Controls the printing of the MAO (modified atomic orbital) analysis", &
1678  print_level=debug_print_level, filename="__STD_OUT__", &
1679  common_iter_levels=1, &
1680  citations=(/heinzmann1976, ehrhardt1985/))
1681  CALL keyword_create(keyword, __location__, name="EPS_FILTER", &
1682  description="Threshold for matrix elements in MAO determination.", &
1683  usage="EPS_FILTER reps", repeats=.false., n_var=1, &
1684  default_r_val=1.e-8_dp, type_of_var=real_t)
1685  CALL section_add_keyword(print_key, keyword)
1686  CALL keyword_release(keyword)
1687  CALL keyword_create(keyword, __location__, name="REFERENCE_BASIS", &
1688  description="Basis set used to construct MAO's.", &
1689  usage="REFERENCE_BASIS {ORBITAL,PRIMITIVE,EXTERNAL}", repeats=.false., n_var=1, &
1690  default_i_val=mao_basis_orb, &
1691  enum_c_vals=s2a("ORBITAL", "PRIMITIVE", "EXTERNAL"), &
1692  enum_desc=s2a("Use standard orbital basis set", "Construct basis from primitives of the orbital basis", &
1693  "Read external basis (MAO)"), &
1694  enum_i_vals=(/mao_basis_orb, mao_basis_prim, mao_basis_ext/))
1695  CALL section_add_keyword(print_key, keyword)
1696  CALL keyword_release(keyword)
1697  CALL keyword_create(keyword, __location__, name="PRINT_BASIS", &
1698  description="Print out MAO reference basis.", &
1699  usage="PRINT_BASIS {logical}", repeats=.false., n_var=1, &
1700  default_l_val=.false., lone_keyword_l_val=.true., type_of_var=logical_t)
1701  CALL section_add_keyword(print_key, keyword)
1702  CALL keyword_release(keyword)
1703  CALL keyword_create(keyword, __location__, name="EPS_GRAD", &
1704  description="Threshold for gradient in MAO optimization.", &
1705  usage="EPS_GRAD reps", repeats=.false., n_var=1, &
1706  default_r_val=1.e-4_dp, type_of_var=real_t)
1707  CALL section_add_keyword(print_key, keyword)
1708  CALL keyword_release(keyword)
1709  CALL keyword_create(keyword, __location__, name="EPS_FUNCTION", &
1710  description="Threshold for electron defect in MAO optimization.", &
1711  usage="EPS_FUNCTION feps", repeats=.false., n_var=1, &
1712  default_r_val=1.e-3_dp, type_of_var=real_t)
1713  CALL section_add_keyword(print_key, keyword)
1714  CALL keyword_release(keyword)
1715  CALL keyword_create(keyword, __location__, name="MAX_ITER", &
1716  description="Maximum allowed iterations for MAO optimization.", &
1717  usage="MAX_ITER iter", repeats=.false., n_var=1, &
1718  default_i_val=0, type_of_var=integer_t)
1719  CALL section_add_keyword(print_key, keyword)
1720  CALL keyword_release(keyword)
1721  CALL keyword_create(keyword, __location__, name="NEGLECT_ABC", &
1722  description="Neglect 3 atom terms in MAO analysis.", &
1723  usage="NEGLECT_ABC {logical}", repeats=.false., n_var=1, &
1724  default_l_val=.true., lone_keyword_l_val=.true., type_of_var=logical_t)
1725  CALL section_add_keyword(print_key, keyword)
1726  CALL keyword_release(keyword)
1727  CALL keyword_create(keyword, __location__, name="AB_THRESHOLD", &
1728  description="Threshold for printing of AB shared electron numbers.", &
1729  usage="AB_THRESHOLD thr", repeats=.false., n_var=1, &
1730  default_r_val=1.e-2_dp, type_of_var=real_t)
1731  CALL section_add_keyword(print_key, keyword)
1732  CALL keyword_release(keyword)
1733  CALL keyword_create(keyword, __location__, name="ABC_THRESHOLD", &
1734  description="Threshold for printing of ABC shared electron numbers.", &
1735  usage="ABC_THRESHOLD thr", repeats=.false., n_var=1, &
1736  default_r_val=1.e-5_dp, type_of_var=real_t)
1737  CALL section_add_keyword(print_key, keyword)
1738  CALL keyword_release(keyword)
1739  CALL keyword_create(keyword, __location__, name="ANALYZE_UNASSIGNED_CHARGE", &
1740  description="Calculate atomic contributions to the unassigned charge.", &
1741  usage="ANALYZE_UNASSIGNED_CHARGE {logical}", repeats=.false., n_var=1, &
1742  default_l_val=.false., lone_keyword_l_val=.true., type_of_var=logical_t)
1743  CALL section_add_keyword(print_key, keyword)
1744  CALL keyword_release(keyword)
1745  CALL section_add_subsection(section, print_key)
1746  CALL section_release(print_key)
1747 
1748  !Minimal localized basis analysis
1749  CALL cp_print_key_section_create(print_key, __location__, "MINBAS_ANALYSIS", &
1750  description="Controls the printing of the minimal localized basis analysis", &
1751  print_level=debug_print_level, filename="__STD_OUT__", &
1752  common_iter_levels=1, &
1753  citations=(/lu2004/))
1754  CALL keyword_create(keyword, __location__, name="EPS_FILTER", &
1755  description="Threshold for matrix elements in basis determination.", &
1756  usage="EPS_FILTER reps", repeats=.false., n_var=1, &
1757  default_r_val=1.e-8_dp, type_of_var=real_t)
1758  CALL section_add_keyword(print_key, keyword)
1759  CALL keyword_release(keyword)
1760  CALL keyword_create(keyword, __location__, name="FULL_ORTHOGONALIZATION", &
1761  description="Orthogonalize the localized minimal basis.", &
1762  usage="FULL_ORTHOGONALIZATION {logical}", repeats=.false., n_var=1, &
1763  default_l_val=.false., lone_keyword_l_val=.true., type_of_var=logical_t)
1764  CALL section_add_keyword(print_key, keyword)
1765  CALL keyword_release(keyword)
1766  CALL keyword_create(keyword, __location__, name="BOND_ORDER", &
1767  description="Calculate Mayer Bond Orders.", &
1768  usage="BOND_ORDER {logical}", repeats=.false., n_var=1, &
1769  default_l_val=.false., lone_keyword_l_val=.true., type_of_var=logical_t)
1770  CALL section_add_keyword(print_key, keyword)
1771  CALL keyword_release(keyword)
1772 
1773  NULLIFY (sub_print_key)
1774  CALL cp_print_key_section_create(sub_print_key, __location__, "MINBAS_CUBE", &
1775  description="Write the minimal basis on Cube files.", &
1776  print_level=debug_print_level + 1, add_last=add_last_numeric, filename="MINBAS")
1777  CALL keyword_create(keyword, __location__, name="STRIDE", &
1778  description="The stride (X,Y,Z) used to write the cube file "// &
1779  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1780  " 1 number valid for all components.", &
1781  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
1782  CALL section_add_keyword(sub_print_key, keyword)
1783  CALL keyword_release(keyword)
1784  CALL keyword_create(keyword, __location__, name="ATOM_LIST", &
1785  description="Indexes of the atoms minimal basis to be printed as cube files "// &
1786  "This keyword can be repeated several times "// &
1787  "(useful if you have to specify many indexes).", &
1788  usage="CUBES_LIST 1 2", &
1789  n_var=-1, type_of_var=integer_t, repeats=.true.)
1790  CALL section_add_keyword(sub_print_key, keyword)
1791  CALL keyword_release(keyword)
1792  CALL section_add_subsection(print_key, sub_print_key)
1793  CALL section_release(sub_print_key)
1794 
1795  NULLIFY (sub_print_key)
1796  CALL cp_print_key_section_create(sub_print_key, __location__, "MINBAS_MOLDEN", &
1797  description="Write the minimal basis in Molden file format, for visualisation.", &
1798  print_level=debug_print_level + 1, add_last=add_last_numeric, filename="MINBAS")
1799  CALL keyword_create(keyword, __location__, name="NDIGITS", &
1800  description="Specifies the number of significant digits retained. 3 is OK for visualization.", &
1801  usage="NDIGITS {int}", &
1802  default_i_val=3)
1803  CALL section_add_keyword(sub_print_key, keyword)
1804  CALL keyword_release(keyword)
1805  CALL keyword_create(keyword, __location__, name="GTO_KIND", &
1806  description="Representation of Gaussian-type orbitals", &
1807  default_i_val=gto_spherical, &
1808  enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
1809  enum_desc=s2a( &
1810  "Cartesian Gaussian orbitals. Use with caution", &
1811  "Spherical Gaussian orbitals. Incompatible with VMD"), &
1812  enum_i_vals=(/gto_cartesian, gto_spherical/))
1813  CALL section_add_keyword(sub_print_key, keyword)
1814  CALL keyword_release(keyword)
1815  CALL section_add_subsection(print_key, sub_print_key)
1816  CALL section_release(sub_print_key)
1817 
1818  CALL section_add_subsection(section, print_key)
1819  CALL section_release(print_key)
1820 
1821  !Energy Decomposition Analysis
1822  CALL cp_print_key_section_create(print_key, __location__, "ENERGY_DECOMPOSITION_ANALYSIS", &
1823  description="Controls energy decomposition analysis", &
1824  print_level=debug_print_level, filename="__STD_OUT__", &
1825  common_iter_levels=1, &
1826  citations=(/eriksen2020/))
1827  CALL keyword_create(keyword, __location__, name="REFERENCE_ORB_CANONICAL", &
1828  description="Use reference orbitals in canonical form.", &
1829  usage="REFERENCE_ORB_CANONICAL {logical}", repeats=.false., n_var=1, &
1830  default_l_val=.true., lone_keyword_l_val=.true., type_of_var=logical_t)
1831  CALL section_add_keyword(print_key, keyword)
1832  CALL keyword_release(keyword)
1833  CALL keyword_create(keyword, __location__, name="SKIP_LOCALIZATION", &
1834  description="Don't localize the MOs.", &
1835  usage="SKIP_LOCALIZATION {logical}", repeats=.false., n_var=1, &
1836  default_l_val=.false., lone_keyword_l_val=.true., type_of_var=logical_t)
1837  CALL section_add_keyword(print_key, keyword)
1838  CALL keyword_release(keyword)
1839  CALL keyword_create(keyword, __location__, name="DETAILED_ENERGY", &
1840  description="Calculate detailed atomic decomposition energies.", &
1841  usage="DETAILED_ENERGY {logical}", repeats=.false., n_var=1, &
1842  default_l_val=.false., lone_keyword_l_val=.true., type_of_var=logical_t)
1843  CALL section_add_keyword(print_key, keyword)
1844  CALL keyword_release(keyword)
1845  CALL keyword_create(keyword, __location__, name="EWALD_ALPHA_PARAMETER", &
1846  description="Calculate Energy Decomposition for a specific alpha value. "// &
1847  "alpha = 1/(2*rc**2), see GTH pseudopotentials.", &
1848  usage="EWALD_ALPHA_PARAMETER alpha", repeats=.false., n_var=1, &
1849  default_r_val=0.0_dp, type_of_var=real_t)
1850  CALL section_add_keyword(print_key, keyword)
1851  CALL keyword_release(keyword)
1852 
1853  CALL section_add_subsection(section, print_key)
1854  CALL section_release(print_key)
1855 
1856  ! IAO (Intrinsic atomic orbital) analysis
1857  CALL cp_print_key_section_create(print_key, __location__, "IAO_ANALYSIS", &
1858  description="Controls the printing of the IAO (intrinsic atomic orbital) analysis", &
1859  print_level=debug_print_level, filename="__STD_OUT__", &
1860  common_iter_levels=1, &
1861  citations=(/knizia2013/))
1862  CALL keyword_create(keyword, __location__, name="EPS_SVD", &
1863  description="Threshold for matrix inversion eigenvalues.", &
1864  usage="EPS_SVD reps", repeats=.false., n_var=1, &
1865  default_r_val=0.0_dp, type_of_var=real_t)
1866  CALL section_add_keyword(print_key, keyword)
1867  CALL keyword_release(keyword)
1868  CALL keyword_create(keyword, __location__, name="EPS_OCC", &
1869  description="Threshold in occupation for vectors included.", &
1870  usage="EPS_OCC reps", repeats=.false., n_var=1, &
1871  default_r_val=0.0_dp, type_of_var=real_t)
1872  CALL section_add_keyword(print_key, keyword)
1873  CALL keyword_release(keyword)
1874  CALL keyword_create(keyword, __location__, name="ATOMIC_CHARGES", &
1875  description="Calculate atomic charges from IAO.", &
1876  usage="ATOMIC_CHARGES {logical}", repeats=.false., n_var=1, &
1877  default_l_val=.true., lone_keyword_l_val=.true., type_of_var=logical_t)
1878  CALL section_add_keyword(print_key, keyword)
1879  CALL keyword_release(keyword)
1880  ! IAO_MOLDEN
1881  NULLIFY (sub_print_key)
1882  CALL cp_print_key_section_create(sub_print_key, __location__, "IAO_MOLDEN", &
1883  description="Write the IAO basis in Molden file format, for visualisation.", &
1884  print_level=debug_print_level + 1, add_last=add_last_numeric, filename="IAOBAS")
1885  CALL keyword_create(keyword, __location__, name="NDIGITS", &
1886  description="Specifies the number of significant digits retained. 3 is OK for visualization.", &
1887  usage="NDIGITS {int}", &
1888  default_i_val=3)
1889  CALL section_add_keyword(sub_print_key, keyword)
1890  CALL keyword_release(keyword)
1891  CALL keyword_create(keyword, __location__, name="GTO_KIND", &
1892  description="Representation of Gaussian-type orbitals", &
1893  default_i_val=gto_spherical, &
1894  enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
1895  enum_desc=s2a( &
1896  "Cartesian Gaussian orbitals. Use with caution", &
1897  "Spherical Gaussian orbitals. Incompatible with VMD"), &
1898  enum_i_vals=(/gto_cartesian, gto_spherical/))
1899  CALL section_add_keyword(sub_print_key, keyword)
1900  CALL keyword_release(keyword)
1901  CALL section_add_subsection(print_key, sub_print_key)
1902  CALL section_release(sub_print_key)
1903  ! IAO_CUBES
1904  NULLIFY (sub_print_key)
1905  CALL cp_print_key_section_create(sub_print_key, __location__, "IAO_CUBES", &
1906  description="Controls the printing of the IAO basis "// &
1907  "as *.cube files.", &
1908  print_level=high_print_level, common_iter_levels=1, &
1909  add_last=add_last_numeric, filename="")
1910  CALL keyword_create(keyword, __location__, name="STRIDE", &
1911  description="The stride (X,Y,Z) used to write the cube file "// &
1912  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1913  " 1 number valid for all components.", &
1914  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
1915  CALL section_add_keyword(sub_print_key, keyword)
1916  CALL keyword_release(keyword)
1917  CALL keyword_create(keyword, __location__, name="APPEND", &
1918  description="append the cube files when they already exist", &
1919  default_l_val=.false., lone_keyword_l_val=.true.)
1920  CALL section_add_keyword(sub_print_key, keyword)
1921  CALL keyword_release(keyword)
1922  CALL keyword_create(keyword, __location__, name="ATOM_LIST", &
1923  description="Indices of the atoms to be included in basis CUBE file printing. ", &
1924  usage="ATOM_LIST {integer} {integer} .. {integer} ", &
1925  n_var=-1, type_of_var=integer_t, repeats=.true.)
1926  CALL section_add_keyword(sub_print_key, keyword)
1927  CALL keyword_release(keyword)
1928  CALL section_add_subsection(print_key, sub_print_key)
1929  CALL section_release(sub_print_key)
1930  ! One Center Expansion of IAO
1931  NULLIFY (sub_print_key)
1932  CALL cp_print_key_section_create(sub_print_key, __location__, "ONE_CENTER_EXPANSION", &
1933  description="Calculates single center expansion of IAOs ", &
1934  print_level=high_print_level, common_iter_levels=1, &
1935  add_last=add_last_numeric, filename="")
1936  CALL keyword_create(keyword, __location__, name="LMAX", &
1937  description="Maximum l quantum number used in the expansion.", &
1938  usage="LMAX 2", n_var=1, default_i_val=3, type_of_var=integer_t)
1939  CALL section_add_keyword(sub_print_key, keyword)
1940  CALL keyword_release(keyword)
1941  CALL keyword_create(keyword, __location__, name="NBAS", &
1942  description="Max number of basis functions used in the expansion."// &
1943  " Default is determined by the orbital basis set.", &
1944  usage="NBAS 10", n_var=1, default_i_val=-1, type_of_var=integer_t)
1945  CALL section_add_keyword(sub_print_key, keyword)
1946  CALL keyword_release(keyword)
1947  CALL keyword_create(keyword, __location__, name="APPEND", &
1948  description="Append the OCE basis files when it already exists", &
1949  default_l_val=.false., lone_keyword_l_val=.true.)
1950  CALL section_add_keyword(sub_print_key, keyword)
1951  CALL keyword_release(keyword)
1952  CALL section_add_subsection(print_key, sub_print_key)
1953  CALL section_release(sub_print_key)
1954  ! Intrinsic Bond orbitals
1955  NULLIFY (sub_print_key)
1956  CALL cp_print_key_section_create(sub_print_key, __location__, "BOND_ORBITALS", &
1957  description="Calculate intrinsic bond orbitals using "// &
1958  "localized MOs in IAO basis.", &
1959  print_level=high_print_level, common_iter_levels=1, &
1960  add_last=add_last_numeric, filename="")
1961 
1962  CALL keyword_create(keyword, __location__, name="LOCALIZATION_OPERATOR", &
1963  description="Operator to be optimized for orbital localization", &
1964  enum_c_vals=s2a("PIPEK_MEZEY", "PIPEK_MEZEY_4", "L1NORM"), &
1965  enum_i_vals=(/do_iaoloc_pm2, do_iaoloc_pm4, do_iaoloc_l1/), &
1966  enum_desc=s2a(operator"Use Pipek-Mezey (order 2)", &
1967  operator"Use Pipek-Mezey (order 4)", &
1968  "Use L1 norm"), &
1969  default_i_val=do_iaoloc_pm2)
1970  CALL section_add_keyword(sub_print_key, keyword)
1971  CALL keyword_release(keyword)
1972  CALL keyword_create(keyword, __location__, name="ENERGY_LOCALIZATION_FUNCTION", &
1973  description="Function for energy localization: f(e_i), e_i orbital energy", &
1974  enum_c_vals=s2a("NONE", "ENERGY", "OCCUPATION"), &
1975  enum_i_vals=(/do_iaoloc_enone, do_iaoloc_energy, do_iaoloc_occ/), &
1976  enum_desc=s2a("Don't use energy localization.", &
1977  "Use orbital energies for localization.", &
1978  "Use occupation numbers for localization."), &
1979  default_i_val=do_iaoloc_enone)
1980  CALL section_add_keyword(sub_print_key, keyword)
1981  CALL keyword_release(keyword)
1982  CALL keyword_create(keyword, __location__, name="ENERGY_LOCALIZATION_WEIGHT", &
1983  description="Weight given to energy localization, using f(e_i) function", &
1984  usage="ENERGY_LOCALIZATION_WEIGHT 0.1", n_var=1, &
1985  default_r_val=0.0_dp, type_of_var=real_t)
1986  CALL section_add_keyword(sub_print_key, keyword)
1987  CALL keyword_release(keyword)
1988 
1989  ! CHARGE CENTER AND SPREAD
1990  NULLIFY (subsection)
1991  CALL cp_print_key_section_create(subsection, __location__, "CHARGE_CENTER", &
1992  description="Calculation and printing of centers and spreads "// &
1993  "of localized orbitals.", &
1994  print_level=high_print_level, common_iter_levels=1, &
1995  add_last=add_last_numeric, filename="")
1996  CALL keyword_create(keyword, __location__, name="POSITION_OPERATOR_BERRY", &
1997  description="Use Berry phase position operator.", &
1998  usage="POSITION_OPERATOR_BERRY T", n_var=1, &
1999  default_l_val=.true., lone_keyword_l_val=.true.)
2000  CALL section_add_keyword(subsection, keyword)
2001  CALL keyword_release(keyword)
2002  CALL section_add_subsection(sub_print_key, subsection)
2003  CALL section_release(subsection)
2004  ! IBO_MOLDEN
2005  NULLIFY (subsection)
2006  CALL cp_print_key_section_create(subsection, __location__, "IBO_MOLDEN", &
2007  description="Write the IBO orbitals in Molden file format, for visualisation.", &
2008  print_level=debug_print_level + 1, add_last=add_last_numeric, filename="IBOBAS")
2009  CALL keyword_create(keyword, __location__, name="NDIGITS", &
2010  description="Specifies the number of significant digits retained. 3 is OK for visualization.", &
2011  usage="NDIGITS {int}", &
2012  default_i_val=3)
2013  CALL section_add_keyword(subsection, keyword)
2014  CALL keyword_release(keyword)
2015  CALL keyword_create(keyword, __location__, name="GTO_KIND", &
2016  description="Representation of Gaussian-type orbitals", &
2017  default_i_val=gto_spherical, &
2018  enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
2019  enum_desc=s2a( &
2020  "Cartesian Gaussian orbitals. Use with caution", &
2021  "Spherical Gaussian orbitals. Incompatible with VMD"), &
2022  enum_i_vals=(/gto_cartesian, gto_spherical/))
2023  CALL section_add_keyword(subsection, keyword)
2024  CALL keyword_release(keyword)
2025  CALL section_add_subsection(sub_print_key, subsection)
2026  CALL section_release(subsection)
2027  ! IAO_CUBES
2028  NULLIFY (subsection)
2029  CALL cp_print_key_section_create(subsection, __location__, "IBO_CUBES", &
2030  description="Controls the printing of the IBO orbitals "// &
2031  "as *.cube files.", &
2032  print_level=high_print_level, common_iter_levels=1, &
2033  add_last=add_last_numeric, filename="")
2034  CALL keyword_create(keyword, __location__, name="STRIDE", &
2035  description="The stride (X,Y,Z) used to write the cube file "// &
2036  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
2037  " 1 number valid for all components.", &
2038  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
2039  CALL section_add_keyword(subsection, keyword)
2040  CALL keyword_release(keyword)
2041  CALL keyword_create(keyword, __location__, name="APPEND", &
2042  description="append the cube files when they already exist", &
2043  default_l_val=.false., lone_keyword_l_val=.true.)
2044  CALL section_add_keyword(subsection, keyword)
2045  CALL keyword_release(keyword)
2046  CALL keyword_create(keyword, __location__, name="STATE_LIST", &
2047  description="Indices of the orbitals to be included in IBO CUBE file printing. ", &
2048  usage="STATE_LIST {integer} {integer} .. {integer} ", &
2049  n_var=-1, type_of_var=integer_t, repeats=.true.)
2050  CALL section_add_keyword(subsection, keyword)
2051  CALL keyword_release(keyword)
2052  CALL section_add_subsection(sub_print_key, subsection)
2053  CALL section_release(subsection)
2054  CALL section_add_subsection(print_key, sub_print_key)
2055  CALL section_release(sub_print_key)
2056 
2057  CALL section_add_subsection(section, print_key)
2058  CALL section_release(print_key)
2059  ! END OF IAO_ANALYSIS SECTION
2060 
2061  !DOS from density matrix
2062  CALL cp_print_key_section_create(print_key, __location__, "ENERGY_WINDOWS", &
2063  description="Controls the printing of the DOS from the density matrix. "// &
2064  "This allows the calculation of the DOS even in density matrix based "// &
2065  "REAL_TIME_PROPAGATION and LS_SCF. "// &
2066  "However, it requires a cubically scaling diagonalization of the Hamiltonian. "// &
2067  "Hartree-Fock NYI, values will be wrong. "// &
2068  "Careful, the orbitals in rtp/emd are not actually eigenstates of the Hamiltonian. "// &
2069  "Assumes absence of spin polarization (so far).", &
2070  print_level=high_print_level, common_iter_levels=3, &
2071  each_iter_names=s2a("MD"), each_iter_values=(/100/), &
2072  add_last=add_last_numeric, filename="energy-windows")
2073  CALL keyword_create(keyword, __location__, name="N_WINDOWS", &
2074  description="The number of energy windows.", &
2075  usage="N_WINDOWS 200", &
2076  default_i_val=100)
2077  CALL section_add_keyword(print_key, keyword)
2078  CALL keyword_release(keyword)
2079  CALL keyword_create(keyword, __location__, name="EPS_FILTER", &
2080  description="Filtering threshold for sparse matrix operations.", &
2081  usage="EPS_FILTER 1.0E-6", &
2082  default_r_val=1.0e-14_dp)
2083  CALL section_add_keyword(print_key, keyword)
2084  CALL keyword_release(keyword)
2085  CALL keyword_create(keyword, __location__, name="RESTRICT_RANGE", &
2086  description="Restricts the energy windows to states close to the fermi level", &
2087  usage="RESTRICT_RANGE .TRUE.", &
2088  default_l_val=.false., lone_keyword_l_val=.true.)
2089  CALL section_add_keyword(print_key, keyword)
2090  CALL keyword_release(keyword)
2091  CALL keyword_create(keyword, __location__, name="RANGE", &
2092  description="If the RESTRICT_RANGE keyword is set, then all energy widnows will"// &
2093  " be placed in an interval from from the fermi level minus to the fermi level plus this keyword", &
2094  usage="RANGE 1", &
2095  default_r_val=1.0_dp)
2096  CALL section_add_keyword(print_key, keyword)
2097  CALL keyword_release(keyword)
2098  CALL keyword_create(keyword, __location__, name="PRINT_CUBES", &
2099  description="Print the energy windows to cube files", &
2100  usage="DENSITY_PROPAGATION .TRUE.", &
2101  default_l_val=.false., lone_keyword_l_val=.true.)
2102  CALL section_add_keyword(print_key, keyword)
2103  CALL keyword_release(keyword)
2104  CALL keyword_create(keyword, __location__, name="STRIDE", &
2105  description="The stride (X,Y,Z) used to write the energy windows cube files (if enabled) "// &
2106  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
2107  " 1 number valid for all components.", &
2108  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
2109  CALL section_add_keyword(print_key, keyword)
2110  CALL keyword_release(keyword)
2111  CALL section_add_subsection(section, print_key)
2112  CALL section_release(print_key)
2113 
2114  ! Hamiltonian in CSR format
2115  CALL cp_print_key_section_create(print_key, __location__, "KS_CSR_WRITE", &
2116  description="Write the KS matrix in CSR format into a file.", &
2117  print_level=debug_print_level, filename="")
2118  CALL keyword_create(keyword, __location__, name="Threshold", &
2119  description="Threshold on the absolute value of the elements to be printed out. "// &
2120  "In CP2K all the elements in a (atomic) matrix block are considered non-zero, "// &
2121  "if the block contains at least one non-zero element.", &
2122  usage="THRESHOLD {real}", &
2123  repeats=.false., &
2124  default_r_val=0.0_dp)
2125  CALL section_add_keyword(print_key, keyword)
2126  CALL keyword_release(keyword)
2127  CALL keyword_create(keyword, __location__, name="Upper_triangular", &
2128  description="Print only the upper triangular part of the matrix. ", &
2129  usage="UPPER_TRIANGULAR {logical}", &
2130  repeats=.false., &
2131  default_l_val=.false., &
2132  lone_keyword_l_val=.true.)
2133  CALL section_add_keyword(print_key, keyword)
2134  CALL keyword_release(keyword)
2135  CALL keyword_create(keyword, __location__, name="Binary", &
2136  description="Whether or not to generate the file in a binary format. ", &
2137  usage="BINARY {logical}", &
2138  repeats=.false., &
2139  default_l_val=.false., &
2140  lone_keyword_l_val=.true.)
2141  CALL section_add_keyword(print_key, keyword)
2142  CALL keyword_release(keyword)
2143  CALL keyword_create(keyword, __location__, name="Real_space", &
2144  description="Print the KS matrix in real-space instead of k-space.. ", &
2145  usage="REAL_SPACE {logical}", &
2146  repeats=.false., &
2147  default_l_val=.false., &
2148  lone_keyword_l_val=.true.)
2149  CALL section_add_keyword(print_key, keyword)
2150  CALL keyword_release(keyword)
2151  CALL section_add_subsection(section, print_key)
2152  CALL section_release(print_key)
2153 
2154  ! Overlap in CSR format
2155  CALL cp_print_key_section_create(print_key, __location__, "S_CSR_WRITE", &
2156  description="Write the overlap matrix in CSR format into a file.", &
2157  print_level=debug_print_level, filename="")
2158  CALL keyword_create(keyword, __location__, name="Threshold", &
2159  description="Threshold on the absolute value of the elements to be printed out. "// &
2160  "In CP2K all the elements in a (atomic) matrix block are considered non-zero, "// &
2161  "if the block contains at least one non-zero element.", &
2162  usage="THRESHOLD {real}", &
2163  repeats=.false., &
2164  default_r_val=0.0_dp)
2165  CALL section_add_keyword(print_key, keyword)
2166  CALL keyword_release(keyword)
2167  CALL keyword_create(keyword, __location__, name="Upper_triangular", &
2168  description="Print only the upper triangular part of the matrix. ", &
2169  usage="UPPER_TRIANGULAR {logical}", &
2170  repeats=.false., &
2171  default_l_val=.false., &
2172  lone_keyword_l_val=.true.)
2173  CALL section_add_keyword(print_key, keyword)
2174  CALL keyword_release(keyword)
2175  CALL keyword_create(keyword, __location__, name="Binary", &
2176  description="Whether or not to generate the file in a binary format. ", &
2177  usage="BINARY {logical}", &
2178  repeats=.false., &
2179  default_l_val=.false., &
2180  lone_keyword_l_val=.true.)
2181  CALL section_add_keyword(print_key, keyword)
2182  CALL keyword_release(keyword)
2183  CALL keyword_create(keyword, __location__, name="Real_space", &
2184  description="Print the overlap matrix in real-space instead of k-space.. ", &
2185  usage="REAL_SPACE {logical}", &
2186  repeats=.false., &
2187  default_l_val=.false., &
2188  lone_keyword_l_val=.true.)
2189  CALL section_add_keyword(print_key, keyword)
2190  CALL keyword_release(keyword)
2191  CALL section_add_subsection(section, print_key)
2192  CALL section_release(print_key)
2193 
2194  ! interaction adjacency matrix
2195  CALL cp_print_key_section_create(print_key, __location__, "ADJMAT_WRITE", &
2196  description="Writes an (upper-triangular) adjacency matrix indicating the "// &
2197  "interaction between atoms (according to overlapping basis functions). The "// &
2198  "columns are: iatom, jatom, ikind, jkind; where iatom and jatom are the atom "// &
2199  "indices (based on the coordinate file), ikind and jkind are the atomic kinds "// &
2200  "(indeces as shown in the ATOMIC KIND INFORMATION section of a CP2K output). ", &
2201  print_level=debug_print_level, filename="")
2202  CALL section_add_subsection(section, print_key)
2203  CALL section_release(print_key)
2204 
2205  ! Xray diffraction
2207  print_key, __location__, name="XRAY_DIFFRACTION_SPECTRUM", &
2208  description="Calculate and print the coherent X-ray "// &
2209  "diffraction spectrum", &
2210  print_level=debug_print_level, &
2211  filename="", &
2212  citations=(/krack2000, krack2002/))
2213  CALL keyword_create( &
2214  keyword, __location__, &
2215  name="Q_MAX", &
2216  variants=(/"Q_MAXIMUM"/), &
2217  description="Maximum Q value calculated for the spectrum", &
2218  usage="Q_MAX {real}", &
2219  repeats=.false., &
2220  n_var=1, &
2221  type_of_var=real_t, &
2222  default_r_val=cp_unit_to_cp2k(value=20.0_dp, &
2223  unit_str="angstrom^-1"), &
2224  unit_str="angstrom^-1")
2225  CALL section_add_keyword(print_key, keyword)
2226  CALL keyword_release(keyword)
2227  CALL section_add_subsection(section, print_key)
2228  CALL section_release(print_key)
2229 
2230  CALL cp_print_key_section_create(print_key, __location__, name="ELECTRIC_FIELD_GRADIENT", &
2231  description="Calculate and print the electric field gradients "// &
2232  "at atomic positions", &
2233  print_level=debug_print_level, &
2234  filename="__STD_OUT__")
2235 
2236  CALL keyword_create(keyword, __location__, &
2237  name="INTERPOLATION", &
2238  description="Use interpolation method from real space grid", &
2239  usage="INTERPOLATION {logical}", &
2240  repeats=.false., &
2241  n_var=1, &
2242  default_l_val=.false., lone_keyword_l_val=.true.)
2243  CALL section_add_keyword(print_key, keyword)
2244  CALL keyword_release(keyword)
2245 
2246  CALL keyword_create(keyword, __location__, &
2247  name="GSPACE_SMOOTHING", &
2248  description="Use a G-space smoothing function", &
2249  usage="GSPACE_SMOOTHING cutoff {real}, width {real}", &
2250  repeats=.false., &
2251  n_var=2, default_r_vals=(/-1._dp, -1._dp/), &
2252  type_of_var=real_t)
2253  CALL section_add_keyword(print_key, keyword)
2254  CALL keyword_release(keyword)
2255 
2256  CALL keyword_create(keyword, __location__, &
2257  name="DEBUG", &
2258  description="Print additional debug output", &
2259  usage="DEBUG {logical}", &
2260  repeats=.false., &
2261  n_var=1, &
2262  default_l_val=.false., lone_keyword_l_val=.true.)
2263  CALL section_add_keyword(print_key, keyword)
2264  CALL keyword_release(keyword)
2265 
2266  CALL create_gspace_interp_section(subsection)
2267  CALL section_add_subsection(print_key, subsection)
2268  CALL section_release(subsection)
2269 
2270  CALL section_add_subsection(section, print_key)
2271  CALL section_release(print_key)
2272 
2273  CALL cp_print_key_section_create(print_key, __location__, name="BASIS_MOLOPT_QUANTITIES", &
2274  description="Print the two quantities needed in the basis molopt generation:"// &
2275  " total energy and condition number of the overlap matrix (S matrix)", &
2276  print_level=debug_print_level, &
2277  filename="__STD_OUT__")
2278  CALL section_add_subsection(section, print_key)
2279  CALL section_release(print_key)
2280 
2281  CALL cp_print_key_section_create(print_key, __location__, name="HYPERFINE_COUPLING_TENSOR", &
2282  description="Calculate and print the EPR hyperfine coupling tensor"// &
2283  " at atomic positions", &
2284  print_level=debug_print_level, &
2285  filename="__STD_OUT__")
2286 
2287  CALL keyword_create(keyword, __location__, &
2288  name="INTERACTION_RADIUS", &
2289  description="Radius of interaction for EPR hyperfine tensor calculation", &
2290  usage="INTERACTION_RADIUS radius {real}", &
2291  repeats=.false., &
2292  n_var=1, default_r_val=10._dp, &
2293  type_of_var=real_t)
2294  CALL section_add_keyword(print_key, keyword)
2295  CALL keyword_release(keyword)
2296 
2297  CALL section_add_subsection(section, print_key)
2298  CALL section_release(print_key)
2299 
2300  CALL cp_print_key_section_create(print_key, __location__, name="OPTIMIZE_LRI_BASIS", &
2301  description="Optimize the exponents of the LRI basis set", &
2302  print_level=low_print_level, &
2303  filename="OPTIMIZED_LRI_BASIS")
2304  CALL section_add_subsection(section, print_key)
2305  CALL section_release(print_key)
2306 
2308  print_key, __location__, name="PLUS_U", &
2309  description="Controls the printing for the DFT+U methods", &
2310  print_level=high_print_level, &
2311  filename="__STD_OUT__", &
2312  each_iter_names=s2a("QS_SCF"), &
2313  each_iter_values=(/0/), &
2314  citations=(/dudarev1997, dudarev1998/))
2315  CALL section_add_subsection(section, print_key)
2316  CALL section_release(print_key)
2317 
2319  print_key, __location__, name="CHARGEMOL", &
2320  description="Write .wfx input file for Chargemol", &
2321  print_level=debug_print_level + 1, &
2322  filename="CHARGEMOL", &
2323  add_last=add_last_numeric)
2324  CALL keyword_create(keyword, __location__, name="BACKUP_COPIES", &
2325  description="Specifies the maximum number of backup copies.", &
2326  usage="BACKUP_COPIES {int}", &
2327  default_i_val=1)
2328  CALL section_add_keyword(print_key, keyword)
2329  CALL keyword_release(keyword)
2330  CALL keyword_create(keyword, __location__, name="PERIODIC", &
2331  description="Write information about cell periodicity.", &
2332  usage="PERIODIC {LOGICAL}", &
2333  default_l_val=.false., lone_keyword_l_val=.true.)
2334  CALL section_add_keyword(print_key, keyword)
2335  CALL keyword_release(keyword)
2336  CALL section_add_subsection(section, print_key)
2337  CALL section_release(print_key)
2338 
2340  print_key, __location__, name="SCCS", &
2341  description="Controls the printing for the SCCS models", &
2342  print_level=high_print_level, &
2343  filename="__STD_OUT__", &
2344  each_iter_names=s2a("QS_SCF"), &
2345  each_iter_values=(/0/), &
2346  citations=(/fattebert2002, andreussi2012, yin2017/))
2347 
2348  NULLIFY (sub_print_key)
2349 
2351  sub_print_key, __location__, name="DENSITY_GRADIENT", &
2352  description="Controls the printing of the cube files with "// &
2353  "the norm of the density gradient |&nabla;&rho;| "// &
2354  "used by the SCCS model.", &
2355  print_level=debug_print_level, &
2356  filename="", &
2357  each_iter_names=s2a("QS_SCF"), &
2358  each_iter_values=(/0/))
2359  CALL keyword_create(keyword, __location__, name="STRIDE", &
2360  description="The stride (X,Y,Z) used to write the cube file "// &
2361  "(larger values result in smaller cube files). You can provide 3 "// &
2362  "numbers (for X,Y,Z) or 1 number valid for all components.", &
2363  n_var=-1, &
2364  default_i_vals=(/2, 2, 2/), &
2365  type_of_var=integer_t, &
2366  repeats=.false.)
2367  CALL section_add_keyword(sub_print_key, keyword)
2368  CALL keyword_release(keyword)
2369  CALL keyword_create(keyword, __location__, name="APPEND", &
2370  description="Append the cube files when they already exist", &
2371  default_l_val=.false., &
2372  lone_keyword_l_val=.true., &
2373  repeats=.false.)
2374  CALL section_add_keyword(sub_print_key, keyword)
2375  CALL keyword_release(keyword)
2376  CALL section_add_subsection(print_key, sub_print_key)
2377  CALL section_release(sub_print_key)
2378 
2380  sub_print_key, __location__, name="DIELECTRIC_FUNCTION", &
2381  description="Controls the printing of the cube files with "// &
2382  "the dielectric function used by the SCCS model. "// &
2383  "This function determines the cavity formed by a solute in "// &
2384  "a solvent and thus it can be used for the visualisaton of the cavity.", &
2385  print_level=debug_print_level, &
2386  filename="", &
2387  each_iter_names=s2a("QS_SCF"), &
2388  each_iter_values=(/0/), &
2389  citations=(/fattebert2002, andreussi2012, yin2017/))
2390  CALL keyword_create(keyword, __location__, name="STRIDE", &
2391  description="The stride (X,Y,Z) used to write the cube file "// &
2392  "(larger values result in smaller cube files). You can provide 3 "// &
2393  "numbers (for X,Y,Z) or 1 number valid for all components.", &
2394  n_var=-1, &
2395  default_i_vals=(/2, 2, 2/), &
2396  type_of_var=integer_t, &
2397  repeats=.false.)
2398  CALL section_add_keyword(sub_print_key, keyword)
2399  CALL keyword_release(keyword)
2400  CALL keyword_create(keyword, __location__, name="APPEND", &
2401  description="Append the cube files when they already exist", &
2402  default_l_val=.false., &
2403  lone_keyword_l_val=.true., &
2404  repeats=.false.)
2405  CALL section_add_keyword(sub_print_key, keyword)
2406  CALL keyword_release(keyword)
2407  CALL section_add_subsection(print_key, sub_print_key)
2408  CALL section_release(sub_print_key)
2409 
2411  sub_print_key, __location__, name="TOTAL_CHARGE_DENSITY", &
2412  description="Controls the printing of the cube files with the "// &
2413  "total charge density $\rho^\text{tot}$ used by the SCCS model.", &
2414  print_level=debug_print_level, &
2415  filename="", &
2416  each_iter_names=s2a("QS_SCF"), &
2417  each_iter_values=(/0/), &
2418  citations=(/fattebert2002, andreussi2012, yin2017/))
2419  CALL keyword_create(keyword, __location__, name="STRIDE", &
2420  description="The stride (X,Y,Z) used to write the cube file "// &
2421  "(larger values result in smaller cube files). You can provide 3 "// &
2422  "numbers (for X,Y,Z) or 1 number valid for all components.", &
2423  n_var=-1, &
2424  default_i_vals=(/2, 2, 2/), &
2425  type_of_var=integer_t, &
2426  repeats=.false.)
2427  CALL section_add_keyword(sub_print_key, keyword)
2428  CALL keyword_release(keyword)
2429  CALL keyword_create(keyword, __location__, name="APPEND", &
2430  description="Append the cube files when they already exist", &
2431  default_l_val=.false., &
2432  lone_keyword_l_val=.true., &
2433  repeats=.false.)
2434  CALL section_add_keyword(sub_print_key, keyword)
2435  CALL keyword_release(keyword)
2436  CALL section_add_subsection(print_key, sub_print_key)
2437  CALL section_release(sub_print_key)
2438 
2440  sub_print_key, __location__, name="POLARISATION_CHARGE_DENSITY", &
2441  description="Controls the printing of the cube files with the "// &
2442  "polarisation charge density $\rho^\text{pol}$ used by the SCCS model with the "// &
2443  "total charge density $\rho^\text{tot} = \rho^\text{sol} + \rho^\text{pol}", &
2444  print_level=debug_print_level, &
2445  filename="", &
2446  each_iter_names=s2a("QS_SCF"), &
2447  each_iter_values=(/0/), &
2448  citations=(/fattebert2002, andreussi2012, yin2017/))
2449  CALL keyword_create(keyword, __location__, name="STRIDE", &
2450  description="The stride (X,Y,Z) used to write the cube file "// &
2451  "(larger values result in smaller cube files). You can provide 3 "// &
2452  "numbers (for X,Y,Z) or 1 number valid for all components.", &
2453  n_var=-1, &
2454  default_i_vals=(/2, 2, 2/), &
2455  type_of_var=integer_t, &
2456  repeats=.false.)
2457  CALL section_add_keyword(sub_print_key, keyword)
2458  CALL keyword_release(keyword)
2459  CALL keyword_create(keyword, __location__, name="APPEND", &
2460  description="Append the cube files when they already exist", &
2461  default_l_val=.false., &
2462  lone_keyword_l_val=.true., &
2463  repeats=.false.)
2464  CALL section_add_keyword(sub_print_key, keyword)
2465  CALL keyword_release(keyword)
2466  CALL section_add_subsection(print_key, sub_print_key)
2467  CALL section_release(sub_print_key)
2468 
2470  sub_print_key, __location__, name="POLARISATION_POTENTIAL", &
2471  description="Controls the printing of the cube files with the "// &
2472  "polarisation potential $\phi^\text{pol}$ used by the SCCS model with the "// &
2473  "total potential $\phi^\text{tot} = \phi^\text{sol} + \phi^\text{pol}$", &
2474  print_level=debug_print_level, &
2475  filename="", &
2476  each_iter_names=s2a("QS_SCF"), &
2477  each_iter_values=(/0/), &
2478  citations=(/fattebert2002, andreussi2012, yin2017/))
2479  CALL keyword_create(keyword, __location__, name="STRIDE", &
2480  description="The stride (X,Y,Z) used to write the cube file "// &
2481  "(larger values result in smaller cube files). You can provide 3 "// &
2482  "numbers (for X,Y,Z) or 1 number valid for all components.", &
2483  n_var=-1, &
2484  default_i_vals=(/2, 2, 2/), &
2485  type_of_var=integer_t, &
2486  repeats=.false.)
2487  CALL section_add_keyword(sub_print_key, keyword)
2488  CALL keyword_release(keyword)
2489  CALL keyword_create(keyword, __location__, name="APPEND", &
2490  description="Append the cube files when they already exist", &
2491  default_l_val=.false., &
2492  lone_keyword_l_val=.true., &
2493  repeats=.false.)
2494  CALL section_add_keyword(sub_print_key, keyword)
2495  CALL keyword_release(keyword)
2496  CALL section_add_subsection(print_key, sub_print_key)
2497  CALL section_release(sub_print_key)
2498 
2499  CALL section_add_subsection(section, print_key)
2500  CALL section_release(print_key)
2501 
2502  END SUBROUTINE create_print_dft_section
2503 
2504 ! **************************************************************************************************
2505 !> \brief ...
2506 !> \param section ...
2507 !> \author JGH
2508 ! **************************************************************************************************
2509  SUBROUTINE create_bandstructure_section(section)
2510  TYPE(section_type), POINTER :: section
2511 
2512  TYPE(keyword_type), POINTER :: keyword
2513  TYPE(section_type), POINTER :: subsection
2514 
2515  cpassert(.NOT. ASSOCIATED(section))
2516  CALL section_create(section, __location__, name="BAND_STRUCTURE", &
2517  description="Specifies the k-points used in band structure calculation.", &
2518  n_keywords=0, n_subsections=0, repeats=.false.)
2519 
2520  NULLIFY (keyword)
2521  CALL keyword_create(keyword, __location__, name="FILE_NAME", &
2522  description="File name used for band structure", &
2523  usage="FILE_NAME <filename>", default_c_val="", &
2524  type_of_var=char_t, n_var=1)
2525  CALL section_add_keyword(section, keyword)
2526  CALL keyword_release(keyword)
2527 
2528  CALL keyword_create(keyword, __location__, name="ADDED_MOS", &
2529  variants=(/"ADDED_BANDS"/), &
2530  description="Number of MOs/Bands added to the Band Structure calculation.", &
2531  default_i_val=0)
2532  CALL section_add_keyword(section, keyword)
2533  CALL keyword_release(keyword)
2534 
2535  NULLIFY (subsection)
2536  CALL create_kpoint_set_section(subsection)
2537  CALL section_add_subsection(section, subsection)
2538  CALL section_release(subsection)
2539 
2540  END SUBROUTINE create_bandstructure_section
2541 
2542 ! **************************************************************************************************
2543 !> \brief creates the input section for dealing with homo lumos, including dumping cubes
2544 !> \param print_key ...
2545 ! **************************************************************************************************
2546  SUBROUTINE create_mo_cubes_section(print_key)
2547  TYPE(section_type), POINTER :: print_key
2548 
2549  TYPE(keyword_type), POINTER :: keyword
2550 
2551  NULLIFY (keyword)
2552 
2553  CALL cp_print_key_section_create(print_key, __location__, "MO_CUBES", &
2554  description="Controls the printing of the molecular orbitals (MOs) as cube files."// &
2555  " It can be used during a Real Time calculation to print the MOs."// &
2556  " In this case, the density corresponding to the time dependent MO is printed"// &
2557  " instead of the wave-function.", &
2558  print_level=high_print_level, filename="")
2559  CALL keyword_create(keyword, __location__, name="stride", &
2560  description="The stride (X,Y,Z) used to write the cube file "// &
2561  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
2562  " 1 number valid for all components.", &
2563  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
2564  CALL section_add_keyword(print_key, keyword)
2565  CALL keyword_release(keyword)
2566 
2567  CALL keyword_create(keyword, __location__, name="write_cube", &
2568  description="If the MO cube file should be written. If false, the eigenvalues are still computed."// &
2569  " Can also be useful in combination with STM calculations", &
2570  default_l_val=.true., lone_keyword_l_val=.true.)
2571  CALL section_add_keyword(print_key, keyword)
2572  CALL keyword_release(keyword)
2573 
2574  CALL keyword_create(keyword, __location__, name="nlumo", &
2575  description="If the printkey is activated controls the number of lumos"// &
2576  " that are printed and dumped as a cube (-1=all)", &
2577  default_i_val=0)
2578  CALL section_add_keyword(print_key, keyword)
2579  CALL keyword_release(keyword)
2580  CALL keyword_create( &
2581  keyword, __location__, name="nhomo", &
2582  description="If the printkey is activated controls the number of homos that dumped as a cube (-1=all),"// &
2583  " eigenvalues are always all dumped", &
2584  default_i_val=1)
2585  CALL section_add_keyword(print_key, keyword)
2586  CALL keyword_release(keyword)
2587 
2588  CALL keyword_create( &
2589  keyword, __location__, name="homo_list", &
2590  description="If the printkey is activated controls the index of homos dumped as a cube,"// &
2591  " eigenvalues are always all dumped. It overrides nhomo.", &
2592  usage="HOMO_LIST {integer} {integer} .. {integer} ", type_of_var=integer_t, &
2593  n_var=-1, repeats=.true.)
2594  CALL section_add_keyword(print_key, keyword)
2595  CALL keyword_release(keyword)
2596 
2597  CALL keyword_create(keyword, __location__, name="APPEND", &
2598  description="append the cube files when they already exist", &
2599  default_l_val=.false., lone_keyword_l_val=.true.)
2600  CALL section_add_keyword(print_key, keyword)
2601  CALL keyword_release(keyword)
2602 
2603  END SUBROUTINE create_mo_cubes_section
2604 
2605 ! **************************************************************************************************
2606 !> \brief ...
2607 !> \param print_key ...
2608 ! **************************************************************************************************
2609  SUBROUTINE create_dos_section(print_key)
2610 
2611  TYPE(section_type), POINTER :: print_key
2612 
2613  TYPE(keyword_type), POINTER :: keyword
2614 
2615  NULLIFY (keyword)
2616 
2617  CALL cp_print_key_section_create(print_key, __location__, "DOS", &
2618  description="Print Density of States (DOS) (only available states from SCF)", &
2619  print_level=debug_print_level, common_iter_levels=1, filename="")
2620 
2621  CALL keyword_create(keyword, __location__, name="APPEND", &
2622  description="Append the DOS obtained at different iterations to the output file. "// &
2623  "By default the file is overwritten", &
2624  usage="APPEND", default_l_val=.false., &
2625  lone_keyword_l_val=.true.)
2626  CALL section_add_keyword(print_key, keyword)
2627  CALL keyword_release(keyword)
2628 
2629  CALL keyword_create(keyword, __location__, name="DELTA_E", &
2630  description="Histogramm energy spacing.", &
2631  usage="DELTA_E 0.0005", type_of_var=real_t, default_r_val=0.001_dp)
2632  CALL section_add_keyword(print_key, keyword)
2633  CALL keyword_release(keyword)
2634 
2635  CALL keyword_create(keyword, __location__, name="NDIGITS", &
2636  description="Specify the number of digits used to print density and occupation", &
2637  default_i_val=4)
2638  CALL section_add_keyword(print_key, keyword)
2639  CALL keyword_release(keyword)
2640 
2641  END SUBROUTINE create_dos_section
2642 
2643 ! **************************************************************************************************
2644 !> \brief ...
2645 !> \param print_key ...
2646 ! **************************************************************************************************
2647  SUBROUTINE create_pdos_section(print_key)
2648 
2649  TYPE(section_type), POINTER :: print_key
2650 
2651  TYPE(keyword_type), POINTER :: keyword
2652  TYPE(section_type), POINTER :: subsection
2653 
2654  NULLIFY (subsection)
2655  NULLIFY (keyword)
2656 
2657  CALL cp_print_key_section_create(print_key, __location__, "PDOS", &
2658  description="Print out the DOS projected per kind and per angular momentum ", &
2659  print_level=debug_print_level, common_iter_levels=1, filename="")
2660  CALL keyword_create(keyword, __location__, name="COMPONENTS", &
2661  description="Print out pdos distinguishing all angular momentum components.", &
2662  usage="COMPONENTS", default_l_val=.false., &
2663  lone_keyword_l_val=.true.)
2664  CALL section_add_keyword(print_key, keyword)
2665  CALL keyword_release(keyword)
2666  CALL keyword_create(keyword, __location__, name="APPEND", &
2667  description="Append the pdos obtained at different iterations to the pdos output file. "// &
2668  "By default the file is overwritten", &
2669  usage="APPEND", default_l_val=.false., &
2670  lone_keyword_l_val=.true.)
2671  CALL section_add_keyword(print_key, keyword)
2672  CALL keyword_release(keyword)
2673  CALL keyword_create( &
2674  keyword, __location__, name="NLUMO", &
2675  description="Number of virtual orbitals to be added to the MO set (-1=all)."//newline// &
2676  "CAUTION: Setting this value to be higher than the number of states present may cause a Cholesky error.", &
2677  usage="NLUMO integer", default_i_val=0)
2678  CALL section_add_keyword(print_key, keyword)
2679  CALL keyword_release(keyword)
2680  CALL keyword_create(keyword, __location__, name="OUT_EACH_MO", &
2681  description="Output on the status of the calculation every OUT_EACH_MO states. If -1 no output", &
2682  usage="OUT_EACH_MO integer", default_i_val=-1)
2683  CALL section_add_keyword(print_key, keyword)
2684  CALL keyword_release(keyword)
2685 
2686  CALL section_create(subsection, __location__, name="LDOS", &
2687  description="Controls the printing of local PDOS, projected on subsets"// &
2688  " of atoms given through lists", &
2689  n_keywords=4, n_subsections=0, repeats=.true.)
2690  CALL keyword_create(keyword, __location__, name="COMPONENTS", &
2691  description="Print out pdos distinguishing all angular momentum components.", &
2692  usage="COMPONENTS", default_l_val=.false., &
2693  lone_keyword_l_val=.true.)
2694  CALL section_add_keyword(subsection, keyword)
2695  CALL keyword_release(keyword)
2696 
2697  CALL keyword_create(keyword, __location__, name="LIST", &
2698  description="Specifies a list of indexes of atoms where to project the DOS ", &
2699  usage="LIST {integer} {integer} .. {integer} ", type_of_var=integer_t, &
2700  n_var=-1, repeats=.true.)
2701  CALL section_add_keyword(subsection, keyword)
2702  CALL keyword_release(keyword)
2703 
2704  CALL section_add_subsection(print_key, subsection)
2705  CALL section_release(subsection)
2706 
2707  CALL section_create(subsection, __location__, name="R_LDOS", &
2708  description="Controls the printing of local PDOS, projected on 3D volume in real space,"// &
2709  " the volume is defined in terms of position with respect to atoms in the lists", &
2710  n_keywords=4, n_subsections=0, repeats=.true.)
2711 
2712  CALL keyword_create(keyword, __location__, name="LIST", &
2713  description="Specifies a list of indexes of atoms used to define the real space volume ", &
2714  usage="LIST {integer} {integer} .. {integer} ", type_of_var=integer_t, &
2715  n_var=-1, repeats=.true.)
2716  CALL section_add_keyword(subsection, keyword)
2717  CALL keyword_release(keyword)
2718 
2719  CALL keyword_create(keyword, __location__, name="XRANGE", &
2720  description="range of positions in Cartesian direction x: all grid points within "// &
2721  "this range from at least one atom of the list are considered", &
2722  usage="XRANGE -10.0 10.0", unit_str="angstrom", n_var=2, type_of_var=real_t)
2723  CALL section_add_keyword(subsection, keyword)
2724  CALL keyword_release(keyword)
2725  CALL keyword_create(keyword, __location__, name="YRANGE", &
2726  description="range of positions in Cartesian direction y: all grid points within "// &
2727  "this range from at least one atom of the list are considered", &
2728  usage="YRANGE -10.0 10.0", unit_str="angstrom", n_var=2, type_of_var=real_t)
2729  CALL section_add_keyword(subsection, keyword)
2730  CALL keyword_release(keyword)
2731  CALL keyword_create(keyword, __location__, name="ZRANGE", &
2732  description="range of positions in Cartesian direction z: all grid points within "// &
2733  "this range from at least one atom of the list are considered", &
2734  usage="ZRANGE -10.0 10.0", unit_str="angstrom", n_var=2, type_of_var=real_t)
2735  CALL section_add_keyword(subsection, keyword)
2736  CALL keyword_release(keyword)
2737 
2738  CALL keyword_create(keyword, __location__, name="ERANGE", &
2739  description="only project states with the eigenvalues in the given interval. "// &
2740  "Default is all states.", &
2741  usage="ERANGE -1.0 1.0", unit_str="hartree", n_var=2, type_of_var=real_t)
2742  CALL section_add_keyword(subsection, keyword)
2743  CALL keyword_release(keyword)
2744 
2745  CALL section_add_subsection(print_key, subsection)
2746  CALL section_release(subsection)
2747 
2748  END SUBROUTINE create_pdos_section
2749 
2750 ! **************************************************************************************************
2751 !> \brief ...
2752 !> \param print_key ...
2753 ! **************************************************************************************************
2754  SUBROUTINE create_wannier_section(print_key)
2755 
2756  TYPE(section_type), POINTER :: print_key
2757 
2758  TYPE(keyword_type), POINTER :: keyword
2759 
2760  NULLIFY (keyword)
2761 
2762  CALL cp_print_key_section_create(print_key, __location__, "WANNIER90", &
2763  description="Interface to Wannier90 code. (EXPERIMENTAL)", &
2764  print_level=debug_print_level, common_iter_levels=1, filename="")
2765 
2766  CALL keyword_create(keyword, __location__, name="SEED_NAME", &
2767  description="The seedname for the Wannier90 calculation (body of filenames).", &
2768  usage="SEED_NAME filename", default_c_val="wannier90", &
2769  n_var=1, type_of_var=char_t)
2770  CALL section_add_keyword(print_key, keyword)
2771  CALL keyword_release(keyword)
2772 
2773  CALL keyword_create(keyword, __location__, name="MP_GRID", &
2774  description="The dimensions of the Monkhorst-Pack k-point grid. ", &
2775  usage="MP_GRID 6 6 6", n_var=-1, default_i_vals=(/10, 10, 10/), type_of_var=integer_t)
2776  CALL section_add_keyword(print_key, keyword)
2777  CALL keyword_release(keyword)
2778 
2779  CALL keyword_create(keyword, __location__, name="ADDED_MOS", &
2780  variants=(/"ADDED_BANDS"/), &
2781  description="Number of MOs/Bands added to the Band Structure calculation.", &
2782  default_i_val=0)
2783  CALL section_add_keyword(print_key, keyword)
2784  CALL keyword_release(keyword)
2785 
2786  CALL keyword_create(keyword, __location__, name="EXCLUDE_BANDS", &
2787  description="List of Bands excluded in the Wannier calculation.", &
2788  usage="EXCLUDE_BANDS b1 b2 ...", n_var=-1, repeats=.true., &
2789  type_of_var=integer_t)
2790  CALL section_add_keyword(print_key, keyword)
2791  CALL keyword_release(keyword)
2792 
2793  CALL keyword_create(keyword, __location__, name="WANNIER_FUNCTIONS", &
2794  description="Number of Wannier functions to be calculated. ", &
2795  usage="WANNIER_FUNCTIONS 6", n_var=1, default_i_val=0, &
2796  repeats=.true., type_of_var=integer_t)
2797  CALL section_add_keyword(print_key, keyword)
2798  CALL keyword_release(keyword)
2799 
2800  END SUBROUTINE create_wannier_section
2801 
2802 ! **************************************************************************************************
2803 !> \brief ...
2804 !> \param print_key ...
2805 ! **************************************************************************************************
2806  SUBROUTINE create_stm_section(print_key)
2807  TYPE(section_type), POINTER :: print_key
2808 
2809  TYPE(keyword_type), POINTER :: keyword
2810 
2811  NULLIFY (keyword)
2812 
2813  CALL cp_print_key_section_create(print_key, __location__, "STM", &
2814  description="Controls the printing of cubes for the generation of STM images.", &
2815  print_level=debug_print_level, filename="")
2816  CALL keyword_create(keyword, __location__, name="stride", &
2817  description="The stride (X,Y,Z) used to write the cube file "// &
2818  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
2819  " 1 number valid for all components.", &
2820  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
2821  CALL section_add_keyword(print_key, keyword)
2822  CALL keyword_release(keyword)
2823 
2824  CALL keyword_create(keyword, __location__, name="nlumo", &
2825  description="If the printkey is activated controls the number of additional lumos"// &
2826  " that are computed to be able to reproduce STM images obtained"// &
2827  " from positive bias (imaging unoccupied states)", &
2828  default_i_val=0)
2829  CALL section_add_keyword(print_key, keyword)
2830  CALL keyword_release(keyword)
2831 
2832  CALL keyword_create(keyword, __location__, name="BIAS", &
2833  description="Bias energy for scanning tunneling microscopy (STM) image generation. "// &
2834  "Orbital densities are summed according to the bias energy. "// &
2835  "For negative values, states in the range ]EF+bias,EF] are summed, "// &
2836  "While positive values sum states in the range [EF,EF+bias[. "// &
2837  "If positive biases are used, sufficiently many unoccupied stated "// &
2838  "(see ADDED_MOS and NLUMO ) should be computed.", &
2839  n_var=-1, type_of_var=real_t, default_r_vals=(/0.0_dp/), unit_str='eV')
2840  CALL section_add_keyword(print_key, keyword)
2841  CALL keyword_release(keyword)
2842 
2843  CALL keyword_create(keyword, __location__, name="TH_TORB", &
2844  description="Tip orbital symmetry in Tersoff-Hamann approximation to compute STM images", &
2845  repeats=.true., &
2846  default_i_val=orb_s, &
2847  usage="TH_TORB s dz2", &
2848  enum_c_vals=s2a("S", "PX", "PY", "PZ", "DXY", "DYZ", "DZX", "DX2", "DY2", "DZ2"), &
2849  enum_i_vals=(/orb_s, orb_px, orb_py, orb_pz, orb_dxy, orb_dyz, orb_dzx, orb_dx2, orb_dy2, orb_dz2/), &
2850  enum_desc=s2a("s orbital", "px orbital", "py orbital", "pz orbital", &
2851  "dxy orbital", "dyz orbital", "dzx orbital", "x^2 orbital", "y^2 orbital", "z^2 orbital"))
2852  CALL section_add_keyword(print_key, keyword)
2853  CALL keyword_release(keyword)
2854 
2855  CALL keyword_create(keyword, __location__, name="REF_ENERGY", &
2856  description="By default the reference energy is the Fermi energy. In order to compare"// &
2857  " with STS experiments, where specific energy ranges are addressed, here"// &
2858  " one can set a different reference energy."// &
2859  " The energy range is anyway controlled by the BIAS", &
2860  type_of_var=real_t, default_r_val=0.0_dp, unit_str='eV')
2861  CALL section_add_keyword(print_key, keyword)
2862  CALL keyword_release(keyword)
2863 
2864  CALL keyword_create(keyword, __location__, name="APPEND", &
2865  description="append the cube files when they already exist", &
2866  default_l_val=.false., lone_keyword_l_val=.true.)
2867  CALL section_add_keyword(print_key, keyword)
2868  CALL keyword_release(keyword)
2869 
2870  END SUBROUTINE create_stm_section
2871 
2872 ! **************************************************************************************************
2873 !> \brief ...
2874 !> \param section ...
2875 ! **************************************************************************************************
2876  SUBROUTINE create_wfn_mix_section(section)
2877 
2878  TYPE(section_type), POINTER :: section
2879 
2880  TYPE(keyword_type), POINTER :: keyword
2881  TYPE(section_type), POINTER :: subsection
2882 
2883  NULLIFY (subsection)
2884  NULLIFY (keyword)
2885 
2886  cpassert(.NOT. ASSOCIATED(section))
2887 
2888  CALL section_create(section, __location__, name="WFN_MIX", &
2889  description="A section that allows manipulation of the MO coeffs, "// &
2890  "e.g. for changing a ground state into an excited state. "// &
2891  "Starting from a copy of the original MOs, changes can be made "// &
2892  "by adding linear combinations of HOMO/LUMO of the original MOs to the result MOs. "// &
2893  "This method is called after an SCF optimization or before an RTP run if "// &
2894  "INITIAL_WFN=RESTART_WFN. Note that if called after an SCF optimization, a restart file "// &
2895  "with the mixed MOs is saved. This is not the case for an RTP with "// &
2896  "INITIAL_WFN=RESTART_WFN.", &
2897  n_keywords=1, n_subsections=0, repeats=.false.)
2898 
2899  CALL keyword_create(keyword, __location__, name="OVERWRITE_MOS", &
2900  description="If set to True, the active molecular orbitals in memory will be replaced by the mixed wfn "// &
2901  "at the end of the wfn mixing procedure. For instance, you can then use this new set of MOs to perform "// &
2902  "RTP or EMD directly. Not that in the case of an RTP run with INITIAL_WFN=RESTART_WFN, this keyword "// &
2903  "is not used: the mixed wfn is used to start the time-dependent run. "// &
2904  "Default value is False.", &
2905  default_l_val=.false., lone_keyword_l_val=.true.)
2906  CALL section_add_keyword(section, keyword)
2907  CALL keyword_release(keyword)
2908 
2909  CALL section_create(subsection, __location__, name="UPDATE", &
2910  description="update a result MO with with a linear combination of of original MOs."// &
2911  " This section can be repeated to build arbitrary linear combinations using repeatedly y=a*y+b*x.", &
2912  n_keywords=1, n_subsections=0, repeats=.true.)
2913 
2914  CALL keyword_create(keyword, __location__, name="RESULT_MO_INDEX", &
2915  description="Index of the MO (y) to be modified. Counting down in energy: "// &
2916  "set to 1 for the HOMO, to 3 for the HOMO-3.", &
2917  usage="RESULT_MO_INDEX 1", type_of_var=integer_t, default_i_val=0)
2918  CALL section_add_keyword(subsection, keyword)
2919  CALL keyword_release(keyword)
2920 
2921  CALL keyword_create(keyword, __location__, name="RESULT_MARKED_STATE", &
2922  description="Specifies the MO according to "// &
2923  "the marks set in MOLECULAR_STATES. The value corresponds to the repetition "// &
2924  "of MARK_STATES in MOLECULAR_STATES", &
2925  usage="ORIG_MARKED_STATE 1", type_of_var=integer_t, default_i_val=0)
2926  CALL section_add_keyword(subsection, keyword)
2927  CALL keyword_release(keyword)
2928 
2929  CALL keyword_create(keyword, __location__, name="RESULT_SPIN_INDEX", &
2930  description="Spin of the MO (y) to be modified.", &
2931  enum_c_vals=s2a("Alpha", "Beta"), &
2932  enum_i_vals=(/1, 2/), & ! direct index in array
2933  default_i_val=1, &
2934  enum_desc=s2a("Majority spin", "Minority spin"))
2935  CALL section_add_keyword(subsection, keyword)
2936  CALL keyword_release(keyword)
2937 
2938  CALL keyword_create(keyword, __location__, name="RESULT_SCALE", &
2939  description="Scaling factor of the result variable (a).", &
2940  usage="RESULT_SCALE 0.0", type_of_var=real_t)
2941  CALL section_add_keyword(subsection, keyword)
2942  CALL keyword_release(keyword)
2943 
2944  CALL keyword_create(keyword, __location__, name="ORIG_MO_INDEX", &
2945  description="Index of the original MO (x). "// &
2946  "If ORIG_TYPE is OCCUPIED, it counts down in energy: set to 1 to point to "// &
2947  "the HOMO and to 3 for the HOMO-3. "// &
2948  "If ORIG_TYPE is VIRTUAL, it counts up in energy: set to 1 to point to "// &
2949  "the LUMO and to 3 for the LUMO+3. "// &
2950  "If ORIG_TYPE is EXTERNAL, it counts down in energy for the external "// &
2951  "set of MOs: set to 1 to point to the HOMO and to 3 for the HOMO-3. "// &
2952  "Do not set to zero or negative values.", &
2953  usage="ORIG_MO_INDEX 1", type_of_var=integer_t, default_i_val=0)
2954  CALL section_add_keyword(subsection, keyword)
2955  CALL keyword_release(keyword)
2956 
2957  CALL keyword_create(keyword, __location__, name="ORIG_MARKED_STATE", &
2958  description="Specifies the MO according to "// &
2959  "the marks set in MOLECULAR_STATES. The value corresponds to the repetition "// &
2960  "of MARK_STATES in MOLECULAR_STATES", &
2961  usage="ORIG_MARKED_STATE 1", type_of_var=integer_t, default_i_val=0)
2962  CALL section_add_keyword(subsection, keyword)
2963  CALL keyword_release(keyword)
2964 
2965  CALL keyword_create(keyword, __location__, name="ORIG_SPIN_INDEX", &
2966  description="Spin of the MO (x) to be modified.", &
2967  enum_c_vals=s2a("Alpha", "Beta"), &
2968  enum_i_vals=(/1, 2/), & ! direct index in array
2969  default_i_val=1, &
2970  enum_desc=s2a("Majority spin", "Minority spin"))
2971  CALL section_add_keyword(subsection, keyword)
2972  CALL keyword_release(keyword)
2973 
2974  CALL keyword_create(keyword, __location__, name="ORIG_SCALE", &
2975  description="Scaling factor of the result variable (b).", &
2976  usage="ORIG_SCALE 0.0", type_of_var=real_t)
2977  CALL section_add_keyword(subsection, keyword)
2978  CALL keyword_release(keyword)
2979 
2980  CALL keyword_create(keyword, __location__, name="ORIG_TYPE", &
2981  description="Type of the orgine MO. Note that using VIRTUAL along with an RTP run with "// &
2982  "INITIAL_WFN=RESTART_WFN will probably crash since no virtual state "// &
2983  "will be available.", &
2984  enum_c_vals=s2a("OCCUPIED", "VIRTUAL", 'EXTERNAL'), &
2985  usage="ORIG_TYPE OCCUPIED", &
2986  default_i_val=wfn_mix_orig_occ, &
2987  enum_desc=s2a("The original MO is in the MOs matrix itself.", &
2988  "The original MO is not in the MOs matrix but in the 'unoccupied' one. "// &
2989  "The SCF cycle shall provide it.", &
2990  "The orginal MO is from an external .wfn file. Use the keyword "// &
2991  "ORIG_EXT_FILE_NAME to define its name."), &
2993  CALL section_add_keyword(subsection, keyword)
2994  CALL keyword_release(keyword)
2995 
2996  CALL keyword_create(keyword, __location__, name="ORIG_EXT_FILE_NAME", &
2997  description="Name of the wavefunction file to read the original MO from. "// &
2998  "For instance, a restart wfn file from SCF calculation or an excited state from XAS_TDP calculation. "// &
2999  "If no file is specified, the run will crash. "// &
3000  "Currently, a RTP restart file (.rtpwfn) cannot be used as reference. "// &
3001  "Currently, this file SHALL have the basis set, number of MO and the same number of spin as the one "// &
3002  "from the SCF cycle.", &
3003  usage="ORIG_EXT_FILE_NAME <FILENAME>", &
3004  default_lc_val="EMPTY")
3005  CALL section_add_keyword(subsection, keyword)
3006  CALL keyword_release(keyword)
3007 
3008  CALL section_add_subsection(section, subsection)
3009  CALL section_release(subsection)
3010 
3011  END SUBROUTINE create_wfn_mix_section
3012 
3013 ! **************************************************************************************************
3014 !> \brief creates the input section for the qs part
3015 !> \param section the section to create
3016 !> \author teo
3017 ! **************************************************************************************************
3018  SUBROUTINE create_qs_section(section)
3019  TYPE(section_type), POINTER :: section
3020 
3021  TYPE(keyword_type), POINTER :: keyword
3022  TYPE(section_type), POINTER :: subsection
3023 
3024  cpassert(.NOT. ASSOCIATED(section))
3025  CALL section_create(section, __location__, name="qs", &
3026  description="parameters needed to set up the Quickstep framework", &
3027  n_keywords=1, n_subsections=0, repeats=.false.)
3028 
3029  NULLIFY (keyword, subsection)
3030 
3031  ! Reals
3032  CALL keyword_create(keyword, __location__, name="EPS_DEFAULT", &
3033  description="Try setting all EPS_xxx to values leading to an energy correct up to EPS_DEFAULT", &
3034  usage="EPS_DEFAULT real", default_r_val=1.0e-10_dp)
3035  CALL section_add_keyword(section, keyword)
3036  CALL keyword_release(keyword)
3037 
3038  CALL keyword_create(keyword, __location__, name="EPS_CORE_CHARGE", &
3039  description="Precision for mapping the core charges.Overrides EPS_DEFAULT/100.0 value", &
3040  usage="EPS_CORE_CHARGE real", type_of_var=real_t)
3041  CALL section_add_keyword(section, keyword)
3042  CALL keyword_release(keyword)
3043 
3044  CALL keyword_create( &
3045  keyword, __location__, name="EPS_GVG_RSPACE", &
3046  variants=(/"EPS_GVG"/), &
3047  description="Sets precision of the realspace KS matrix element integration. Overrides SQRT(EPS_DEFAULT) value", &
3048  usage="EPS_GVG_RSPACE real", type_of_var=real_t)
3049  CALL section_add_keyword(section, keyword)
3050  CALL keyword_release(keyword)
3051 
3052  CALL keyword_create(keyword, __location__, name="EPS_PGF_ORB", &
3053  description="Sets precision of the overlap matrix elements. Overrides SQRT(EPS_DEFAULT) value", &
3054  usage="EPS_PGF_ORB real", type_of_var=real_t)
3055  CALL section_add_keyword(section, keyword)
3056  CALL keyword_release(keyword)
3057 
3058  CALL keyword_create( &
3059  keyword, __location__, name="EPS_KG_ORB", &
3060  description="Sets precision used in coloring the subsets for the Kim-Gordon method. Overrides SQRT(EPS_DEFAULT) value", &
3061  usage="EPS_KG_ORB 1.0E-8", &
3062  type_of_var=real_t)
3063  CALL section_add_keyword(section, keyword)
3064  CALL keyword_release(keyword)
3065 
3066  CALL keyword_create(keyword, __location__, name="EPS_PPL", &
3067  description="Adjusts the precision for the local part of the pseudo potential. ", &
3068  usage="EPS_PPL real", type_of_var=real_t, default_r_val=1.0e-2_dp)
3069  CALL section_add_keyword(section, keyword)
3070  CALL keyword_release(keyword)
3071 
3072  CALL keyword_create( &
3073  keyword, __location__, name="EPS_PPNL", &
3074  description="Sets precision of the non-local part of the pseudo potential. Overrides sqrt(EPS_DEFAULT) value", &
3075  usage="EPS_PPNL real", type_of_var=real_t)
3076  CALL section_add_keyword(section, keyword)
3077  CALL keyword_release(keyword)
3078 
3079  CALL keyword_create(keyword, __location__, name="EPS_CPC", &
3080  description="Sets precision of the GAPW projection. Overrides EPS_DEFAULT value", &
3081  usage="EPS_CPC real", type_of_var=real_t)
3082  CALL section_add_keyword(section, keyword)
3083  CALL keyword_release(keyword)
3084 
3085  CALL keyword_create(keyword, __location__, name="EPS_RHO", &
3086  description="Sets precision of the density mapping on the grids.Overrides EPS_DEFAULT value", &
3087  usage="EPS_RHO real", type_of_var=real_t)
3088  CALL section_add_keyword(section, keyword)
3089  CALL keyword_release(keyword)
3090 
3091  CALL keyword_create(keyword, __location__, name="EPS_RHO_RSPACE", &
3092  description="Sets precision of the density mapping in rspace.Overrides EPS_DEFAULT value."// &
3093  " Overrides EPS_RHO value", &
3094  usage="EPS_RHO_RSPACE real", type_of_var=real_t)
3095  CALL section_add_keyword(section, keyword)
3096  CALL keyword_release(keyword)
3097 
3098  CALL keyword_create(keyword, __location__, name="EPS_RHO_GSPACE", &
3099  description="Sets precision of the density mapping in gspace.Overrides EPS_DEFAULT value."// &
3100  " Overrides EPS_RHO value", &
3101  usage="EPS_RHO_GSPACE real", type_of_var=real_t)
3102  CALL section_add_keyword(section, keyword)
3103  CALL keyword_release(keyword)
3104 
3105  CALL keyword_create(keyword, __location__, name="EPS_FILTER_MATRIX", &
3106  description="Sets the threshold for filtering matrix elements.", &
3107  usage="EPS_FILTER_MATRIX 1.0E-6", type_of_var=real_t, default_r_val=0.0e0_dp)
3108  CALL section_add_keyword(section, keyword)
3109  CALL keyword_release(keyword)
3110 
3111  CALL keyword_create(keyword, __location__, name="EPSFIT", &
3112  variants=(/"EPS_FIT"/), &
3113  description="GAPW: precision to give the extension of a hard gaussian ", &
3114  usage="EPSFIT real", default_r_val=1.0e-4_dp)
3115  CALL section_add_keyword(section, keyword)
3116  CALL keyword_release(keyword)
3117 
3118  CALL keyword_create(keyword, __location__, name="EPSISO", &
3119  variants=(/"EPS_ISO"/), &
3120  description="GAPW: precision to determine an isolated projector", &
3121  usage="EPSISO real", default_r_val=1.0e-12_dp)
3122  CALL section_add_keyword(section, keyword)
3123  CALL keyword_release(keyword)
3124 
3125  CALL keyword_create(keyword, __location__, name="EPSSVD", &
3126  variants=(/"EPS_SVD"/), &
3127  description="GAPW: tolerance used in the singular value decomposition of the projector matrix", &
3128  usage="EPS_SVD real", default_r_val=1.0e-8_dp)
3129  CALL section_add_keyword(section, keyword)
3130  CALL keyword_release(keyword)
3131 
3132  CALL keyword_create(keyword, __location__, name="EPSRHO0", &
3133  variants=s2a("EPSVRHO0", "EPS_VRHO0"), &
3134  description="GAPW : precision to determine the range of V(rho0-rho0soft)", &
3135  usage="EPSRHO0 real", default_r_val=1.0e-6_dp)
3136  CALL section_add_keyword(section, keyword)
3137  CALL keyword_release(keyword)
3138 
3139  CALL keyword_create(keyword, __location__, name="ALPHA0_HARD", &
3140  variants=s2a("ALPHA0_H", "ALPHA0"), &
3141  description="GAPW: Exponent for hard compensation charge", &
3142  usage="ALPHA0_HARD real", default_r_val=0.0_dp)
3143  CALL section_add_keyword(section, keyword)
3144  CALL keyword_release(keyword)
3145 
3146  CALL keyword_create( &
3147  keyword, __location__, name="FORCE_PAW", &
3148  description="Use the GAPW scheme also for atoms with soft basis sets, i.e. "// &
3149  "the local densities are computed even if hard and soft should be equal. "// &
3150  "If this keyword is not set to true, those atoms with soft basis sets are treated by a GPW scheme, i.e. "// &
3151  "the corresponding density contribution goes on the global grid and is expanded in PW. "// &
3152  "This option nullifies the effect of the GPW_TYPE in the atomic KIND", &
3153  usage="FORCE_PAW", &
3154  default_l_val=.false., lone_keyword_l_val=.true.)
3155  CALL section_add_keyword(section, keyword)
3156  CALL keyword_release(keyword)
3157 
3158  CALL keyword_create(keyword, __location__, name="MAX_RAD_LOCAL", &
3159  description="GAPW : maximum radius of gaussian functions"// &
3160  " included in the generation of projectors", &
3161  usage="MAX_RAD_LOCAL real", default_r_val=25.0_dp)
3162  CALL section_add_keyword(section, keyword)
3163  CALL keyword_release(keyword)
3164 
3165  CALL keyword_create(keyword, __location__, name="GAPW_1C_BASIS", &
3166  description="Specifies how to construct the GAPW one center basis set. "// &
3167  "Default is to use the primitives from the orbital basis.", &
3168  usage="GAPW_1C_BASIS MEDIUM", &
3169  enum_c_vals=s2a("ORB", "EXT_SMALL", "EXT_MEDIUM", "EXT_LARGE", "EXT_VERY_LARGE"), &
3170  enum_desc=s2a("Use orbital basis set.", &
3171  "Extension using Small number of primitive Gaussians.", &
3172  "Extension using Medium number of primitive Gaussians.", &
3173  "Extension using Large number of primitive Gaussians.", &
3174  "Extension using Very Large number of primitive Gaussians."), &
3175  enum_i_vals=(/gapw_1c_orb, gapw_1c_small, gapw_1c_medium, &
3177  default_i_val=gapw_1c_orb)
3178  CALL section_add_keyword(section, keyword)
3179  CALL keyword_release(keyword)
3180 
3181  CALL keyword_create(keyword, __location__, name="MIN_PAIR_LIST_RADIUS", &
3182  description="Set the minimum value [Bohr] for the overlap pair list radius."// &
3183  " Default is 0.0 Bohr, negative values are changed to the cell size."// &
3184  " This allows to control the sparsity of the KS matrix for HFX calculations.", &
3185  usage="MIN_PAIR_LIST_RADIUS real", default_r_val=0.0_dp)
3186  CALL section_add_keyword(section, keyword)
3187  CALL keyword_release(keyword)
3188 
3189  ! Logicals
3190  CALL keyword_create(keyword, __location__, name="LS_SCF", &
3191  description="Perform a linear scaling SCF", &
3192  usage="LS_SCF", lone_keyword_l_val=.true., &
3193  default_l_val=.false.)
3194  CALL section_add_keyword(section, keyword)
3195  CALL keyword_release(keyword)
3196 
3197  CALL keyword_create(keyword, __location__, name="ALMO_SCF", &
3198  description="Perform ALMO SCF", &
3199  usage="ALMO_SCF", lone_keyword_l_val=.true., &
3200  default_l_val=.false.)
3201  CALL section_add_keyword(section, keyword)
3202  CALL keyword_release(keyword)
3203 
3204  CALL keyword_create(keyword, __location__, name="TRANSPORT", &
3205  description="Perform transport calculations (coupling CP2K and OMEN)", &
3206  usage="TRANSPORT", lone_keyword_l_val=.true., &
3207  default_l_val=.false.)
3208  CALL section_add_keyword(section, keyword)
3209  CALL keyword_release(keyword)
3210 
3211  CALL keyword_create(keyword, __location__, name="KG_METHOD", &
3212  description="Use a Kim-Gordon-like scheme.", &
3213  usage="KG_METHOD", lone_keyword_l_val=.true., &
3214  default_l_val=.false., citations=(/iannuzzi2006, brelaz1979, andermatt2016/))
3215  CALL section_add_keyword(section, keyword)
3216  CALL keyword_release(keyword)
3217 
3218  CALL keyword_create(keyword, __location__, name="REF_EMBED_SUBSYS", &
3219  description="A total, reference, system in DFT embedding. ", &
3220  usage="REF_EMBED_SUBSYS FALSE", &
3221  default_l_val=.false., lone_keyword_l_val=.true.)
3222  CALL section_add_keyword(section, keyword)
3223  CALL keyword_release(keyword)
3224 
3225  CALL keyword_create(keyword, __location__, name="CLUSTER_EMBED_SUBSYS", &
3226  description="A cluster treated with DFT in DFT embedding. ", &
3227  usage="CLUSTER_EMBED_SUBSYS FALSE", &
3228  default_l_val=.false., lone_keyword_l_val=.true.)
3229  CALL section_add_keyword(section, keyword)
3230  CALL keyword_release(keyword)
3231 
3232  CALL keyword_create(keyword, __location__, name="HIGH_LEVEL_EMBED_SUBSYS", &
3233  description="A cluster treated with a high-level method in DFT embedding. ", &
3234  usage="HIGH_LEVEL_EMBED_SUBSYS FALSE", &
3235  default_l_val=.false., lone_keyword_l_val=.true.)
3236  CALL section_add_keyword(section, keyword)
3237  CALL keyword_release(keyword)
3238 
3239  CALL keyword_create(keyword, __location__, name="DFET_EMBEDDED", &
3240  description="Calculation with DFT-embedding potential. ", &
3241  usage="DFET_EMBEDDED FALSE", &
3242  default_l_val=.false., lone_keyword_l_val=.true.)
3243  CALL section_add_keyword(section, keyword)
3244  CALL keyword_release(keyword)
3245 
3246  CALL keyword_create(keyword, __location__, name="DMFET_EMBEDDED", &
3247  description="Calculation with DM embedding potential. ", &
3248  usage="DMFET_EMBEDDED FALSE", &
3249  default_l_val=.false., lone_keyword_l_val=.true.)
3250  CALL section_add_keyword(section, keyword)
3251  CALL keyword_release(keyword)
3252 
3253  ! Integers
3254  CALL keyword_create(keyword, __location__, name="STO_NG", &
3255  description="Order of Gaussian type expansion of Slater orbital basis sets.", &
3256  usage="STO_NG", default_i_val=6)
3257  CALL section_add_keyword(section, keyword)
3258  CALL keyword_release(keyword)
3259 
3260  CALL keyword_create(keyword, __location__, name="LMAXN1", &
3261  variants=(/"LMAXRHO1"/), &
3262  description="GAPW : max L number for expansion of the atomic densities in spherical gaussians", &
3263  usage="LMAXN1 integer", &
3264  default_i_val=-1)
3265  CALL section_add_keyword(section, keyword)
3266  CALL keyword_release(keyword)
3267 
3268  CALL keyword_create(keyword, __location__, name="LMAXN0", &
3269  variants=(/"LMAXRHO0"/), &
3270  description="GAPW : max L number for the expansion compensation densities in spherical gaussians", &
3271  usage="LMAXN0 integer", &
3272  default_i_val=2)
3273  CALL section_add_keyword(section, keyword)
3274  CALL keyword_release(keyword)
3275 
3276  CALL keyword_create(keyword, __location__, name="LADDN0", &
3277  description="GAPW : integer added to the max L of the basis set, used to determine the "// &
3278  "maximum value of L for the compensation charge density.", &
3279  usage="LADDN0 integer", &
3280  default_i_val=99)
3281  CALL section_add_keyword(section, keyword)
3282  CALL keyword_release(keyword)
3283 
3284  ! Characters
3285  CALL keyword_create(keyword, __location__, name="QUADRATURE", &
3286  description="GAPW: algorithm to construct the atomic radial grids", &
3287  usage="QUADRATURE GC_SIMPLE", &
3288  enum_c_vals=s2a("GC_SIMPLE", "GC_TRANSFORMED", "GC_LOG"), &
3289  enum_i_vals=(/do_gapw_gcs, do_gapw_gct, do_gapw_log/), &
3290  enum_desc=s2a("Gauss-Chebyshev quadrature", &
3291  "Transformed Gauss-Chebyshev quadrature", &
3292  "Logarithmic transformed Gauss-Chebyshev quadrature"), &
3293  default_i_val=do_gapw_log)
3294  CALL section_add_keyword(section, keyword)
3295  CALL keyword_release(keyword)
3296 
3297  CALL keyword_create(keyword, __location__, name="PW_GRID", &
3298  description="What kind of PW_GRID should be employed", &
3299  usage="PW_GRID NS-FULLSPACE", &
3300  enum_c_vals=s2a("SPHERICAL", "NS-FULLSPACE", "NS-HALFSPACE"), &
3301  enum_desc=s2a("- not tested", " tested", " - not tested"), &
3303  default_i_val=do_pwgrid_ns_fullspace)
3304  CALL section_add_keyword(section, keyword)
3305  CALL keyword_release(keyword)
3306 
3307  CALL keyword_create(keyword, __location__, name="PW_GRID_LAYOUT", &
3308  description="Force a particular real-space layout for the plane waves grids. "// &
3309  "Numbers &le; 0 mean that this dimension is free, incorrect layouts will be ignored. "// &
3310  "The default (/-1,-1/) causes CP2K to select a good value, "// &
3311  "i.e. plane distributed for large grids, more general distribution for small grids.", &
3312  usage="PW_GRID_LAYOUT 4 16", &
3313  repeats=.false., n_var=2, &
3314  default_i_vals=(/-1, -1/))
3315  CALL section_add_keyword(section, keyword)
3316  CALL keyword_release(keyword)
3317 
3318  CALL keyword_create(keyword, __location__, name="PW_GRID_BLOCKED", &
3319  description="Can be used to set the distribution in g-space for the pw grids and their FFT.", &
3320  usage="PW_GRID_BLOCKED FREE", &
3321  enum_c_vals=s2a("FREE", "TRUE", "FALSE"), &
3322  enum_desc=s2a("CP2K will select an appropriate value", "blocked", "not blocked"), &
3324  default_i_val=do_pw_grid_blocked_free)
3325  CALL section_add_keyword(section, keyword)
3326  CALL keyword_release(keyword)
3327 
3328  CALL keyword_create( &
3329  keyword, __location__, name="EXTRAPOLATION", &
3330  variants=s2a("INTERPOLATION", "WF_INTERPOLATION"), &
3331  description="Extrapolation strategy for the wavefunction during e.g. MD. "// &
3332  "Not all options are available for all simulation methods. "// &
3333  "PS and ASPC are recommended, see also EXTRAPOLATION_ORDER.", &
3334  citations=(/kolafa2004, vandevondele2005a, kuhne2007/), &
3335  usage="EXTRAPOLATION PS", &
3336  enum_c_vals=s2a("USE_GUESS", "USE_PREV_P", "USE_PREV_RHO_R", "LINEAR_WF", &
3337  "LINEAR_P", "LINEAR_PS", "USE_PREV_WF", "PS", "FROZEN", "ASPC"), &
3338  enum_desc=s2a( &
3339  "Use the method specified with SCF_GUESS, i.e. no extrapolation", &
3340  "Use the previous density matrix", &
3341  "Use the previous density in real space", &
3342  "Linear extrapolation of the wavefunction (not available for K-points)", &
3343  "Linear extrapolation of the density matrix", &
3344  "Linear extrapolation of the density matrix times the overlap matrix (not available for K-points)", &
3345  "Use the previous wavefunction (not available for K-points)", &
3346  "Higher order extrapolation of the density matrix times the overlap matrix (not available for K-points)", &
3347  "Frozen ...", &
3348  "Always stable predictor corrector, similar to PS, but going for MD stability instead of initial guess accuracy. "// &
3349  "(not available for K-points)"), &
3350  enum_i_vals=(/ &
3358  wfi_ps_method_nr, &
3360  wfi_aspc_nr/), &
3361  default_i_val=wfi_aspc_nr)
3362  CALL section_add_keyword(section, keyword)
3363  CALL keyword_release(keyword)
3364 
3365  CALL keyword_create(keyword, __location__, name="EXTRAPOLATION_ORDER", &
3366  description="Order for the PS or ASPC extrapolation (typically 2-4). "// &
3367  "Higher order might bring more accuracy, but comes, "// &
3368  "for large systems, also at some cost. "// &
3369  "In some cases, a high order extrapolation is not stable,"// &
3370  " and the order needs to be reduced.", &
3371  usage="EXTRAPOLATION_ORDER {integer}", default_i_val=3)
3372  CALL section_add_keyword(section, keyword)
3373  CALL keyword_release(keyword)
3374 
3375  CALL keyword_create(keyword, __location__, name="METHOD", &
3376  description="Specifies the electronic structure method that should be employed", &
3377  usage="METHOD GAPW", &
3378  enum_c_vals=s2a("GAPW", "GAPW_XC", "GPW", "LRIGPW", "RIGPW", &
3379  "MNDO", "MNDOD", "AM1", "PM3", "PM6", "PM6-FM", "PDG", "RM1", "PNNL", "DFTB", "xTB", "OFGPW"), &
3380  enum_desc=s2a("Gaussian and augmented plane waves method", &
3381  "Gaussian and augmented plane waves method only for XC", &
3382  "Gaussian and plane waves method", &
3383  "Local resolution of identity method", &
3384  "Resolution of identity method for HXC terms", &
3385  "MNDO semiempirical", "MNDO-d semiempirical", "AM1 semiempirical", &
3386  "PM3 semiempirical", "PM6 semiempirical", "PM6-FM semiempirical", "PDG semiempirical", &
3387  "RM1 semiempirical", &
3388  "PNNL semiempirical", &
3389  "DFTB Density Functional based Tight-Binding", &
3390  "GFN-xTB Extended Tight-Binding", &
3391  "OFGPW Orbital-free GPW method"), &
3399  default_i_val=do_method_gpw)
3400  CALL section_add_keyword(section, keyword)
3401  CALL keyword_release(keyword)
3402 
3403  CALL keyword_create(keyword, __location__, name="CORE_PPL", &
3404  description="Specifies the method used to calculate the local pseudopotential contribution.", &
3405  usage="CORE_PPL ANALYTIC", &
3406  enum_c_vals=s2a("ANALYTIC", "GRID"), &
3407  enum_desc=s2a("Analytic integration of integrals", &
3408  "Numerical integration on real space grid. Lumped together with core charge"), &
3409  enum_i_vals=(/do_ppl_analytic, do_ppl_grid/), &
3410  default_i_val=do_ppl_analytic)
3411  CALL section_add_keyword(section, keyword)
3412  CALL keyword_release(keyword)
3413 
3414  CALL keyword_create(keyword, __location__, name="EMBED_RESTART_FILE_NAME", &
3415  description="Root of the file name where to read the embedding "// &
3416  "potential guess.", &
3417  usage="EMBED_RESTART_FILE_NAME <FILENAME>", &
3418  type_of_var=lchar_t)
3419  CALL section_add_keyword(section, keyword)
3420  CALL keyword_release(keyword)
3421 
3422  CALL keyword_create(keyword, __location__, name="EMBED_CUBE_FILE_NAME", &
3423  description="Root of the file name where to read the embedding "// &
3424  "potential (guess) as a cube.", &
3425  usage="EMBED_CUBE_FILE_NAME <FILENAME>", &
3426  type_of_var=lchar_t)
3427  CALL section_add_keyword(section, keyword)
3428  CALL keyword_release(keyword)
3429 
3430  CALL keyword_create(keyword, __location__, name="EMBED_SPIN_CUBE_FILE_NAME", &
3431  description="Root of the file name where to read the spin part "// &
3432  "of the embedding potential (guess) as a cube.", &
3433  usage="EMBED_SPIN_CUBE_FILE_NAME <FILENAME>", &
3434  type_of_var=lchar_t)
3435  CALL section_add_keyword(section, keyword)
3436  CALL keyword_release(keyword)
3437 
3438  CALL create_distribution_section(subsection)
3439  CALL section_add_subsection(section, subsection)
3440  CALL section_release(subsection)
3441 
3442  CALL create_dftb_control_section(subsection)
3443  CALL section_add_subsection(section, subsection)
3444  CALL section_release(subsection)
3445 
3446  CALL create_xtb_control_section(subsection)
3447  CALL section_add_subsection(section, subsection)
3448  CALL section_release(subsection)
3449 
3450  CALL create_se_control_section(subsection)
3451  CALL section_add_subsection(section, subsection)
3452  CALL section_release(subsection)
3453 
3454  CALL create_mulliken_section(subsection)
3455  CALL section_add_subsection(section, subsection)
3456  CALL section_release(subsection)
3457 
3458  CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT")
3459  CALL section_add_subsection(section, subsection)
3460  CALL section_release(subsection)
3461 
3462  CALL create_cdft_control_section(subsection)
3463  CALL section_add_subsection(section, subsection)
3464  CALL section_release(subsection)
3465 
3466  CALL create_s2_restraint_section(subsection)
3467  CALL section_add_subsection(section, subsection)
3468  CALL section_release(subsection)
3469 
3470  CALL create_lrigpw_section(subsection)
3471  CALL section_add_subsection(section, subsection)
3472  CALL section_release(subsection)
3473 
3474  CALL create_optimize_lri_basis_section(subsection)
3475  CALL section_add_subsection(section, subsection)
3476  CALL section_release(subsection)
3477 
3478  ! Embedding subsections: DFET and DMFET
3479  CALL create_optimize_embed(subsection)
3480  CALL section_add_subsection(section, subsection)
3481  CALL section_release(subsection)
3482 
3483  CALL create_optimize_dmfet(subsection)
3484  CALL section_add_subsection(section, subsection)
3485  CALL section_release(subsection)
3486 
3487  END SUBROUTINE create_qs_section
3488 
3489 ! **************************************************************************************************
3490 !> \brief ...
3491 !> \param section ...
3492 ! **************************************************************************************************
3493  SUBROUTINE create_admm_section(section)
3494  TYPE(section_type), POINTER :: section
3495 
3496  TYPE(keyword_type), POINTER :: keyword
3497 
3498  NULLIFY (keyword)
3499  cpassert(.NOT. ASSOCIATED(section))
3500  CALL section_create(section, __location__, name="AUXILIARY_DENSITY_MATRIX_METHOD", &
3501  description="Parameters needed for the ADMM method.", &
3502  n_keywords=1, n_subsections=1, repeats=.false., &
3503  citations=(/guidon2010/))
3504 
3505  CALL keyword_create( &
3506  keyword, __location__, &
3507  name="ADMM_TYPE", &
3508  description="Type of ADMM (sort name) as refered in literature. "// &
3509  "This sets values for METHOD, ADMM_PURIFICATION_METHOD, and EXCH_SCALING_MODEL", &
3510  enum_c_vals=s2a("NONE", "ADMM1", "ADMM2", "ADMMS", "ADMMP", "ADMMQ"), &
3511  enum_desc=s2a("No short name is used, use specific definitions (default)", &
3512  "ADMM1 method from Guidon2010", &
3513  "ADMM2 method from Guidon2010", &
3514  "ADMMS method from Merlot2014", &
3515  "ADMMP method from Merlot2014", &
3516  "ADMMQ method from Merlot2014"), &
3518  default_i_val=no_admm_type, &
3519  citations=(/guidon2010, merlot2014/))
3520  CALL section_add_keyword(section, keyword)
3521  CALL keyword_release(keyword)
3522 
3523  CALL keyword_create( &
3524  keyword, __location__, &
3525  name="ADMM_PURIFICATION_METHOD", &
3526  description="Method that shall be used for wavefunction fitting. Use MO_DIAG for MD.", &
3527  enum_c_vals=s2a("NONE", "CAUCHY", "CAUCHY_SUBSPACE", "MO_DIAG", "MO_NO_DIAG", "MCWEENY", "NONE_DM"), &
3531  enum_desc=s2a("Do not apply any purification", &
3532  "Perform purification via general Cauchy representation", &
3533  "Perform purification via Cauchy representation in occupied subspace", &
3534  "Calculate MO derivatives via Cauchy representation by diagonalization", &
3535  "Calculate MO derivatives via Cauchy representation by inversion", &
3536  "Perform original McWeeny purification via matrix multiplications", &
3537  "Do not apply any purification, works directly with density matrix"), &
3538  default_i_val=do_admm_purify_mo_diag)
3539  CALL section_add_keyword(section, keyword)
3540  CALL keyword_release(keyword)
3541 
3542  CALL keyword_create( &
3543  keyword, __location__, &
3544  name="METHOD", &
3545  description="Method that shall be used for wavefunction fitting. Use BASIS_PROJECTION for MD.", &
3546  enum_c_vals=s2a("BASIS_PROJECTION", "BLOCKED_PROJECTION_PURIFY_FULL", "BLOCKED_PROJECTION", &
3547  "CHARGE_CONSTRAINED_PROJECTION"), &
3550  enum_desc=s2a("Construct auxiliary density matrix from auxiliary basis.", &
3551  "Construct auxiliary density from a blocked Fock matrix,"// &
3552  " but use the original matrix for purification.", &
3553  "Construct auxiliary density from a blocked Fock matrix.", &
3554  "Construct auxiliary density from auxiliary basis enforcing charge constrain."), &
3555  default_i_val=do_admm_basis_projection)
3556  CALL section_add_keyword(section, keyword)
3557  CALL keyword_release(keyword)
3558 
3559  CALL keyword_create( &
3560  keyword, __location__, &
3561  name="EXCH_SCALING_MODEL", &
3562  description="Scaling of the exchange correction calculated by the auxiliary density matrix.", &
3563  enum_c_vals=s2a("NONE", "MERLOT"), &
3565  enum_desc=s2a("No scaling is enabled, refers to methods ADMM1, ADMM2 or ADMMQ.", &
3566  "Exchange scaling according to Merlot (2014)"), &
3567  default_i_val=do_admm_exch_scaling_none)
3568  CALL section_add_keyword(section, keyword)
3569  CALL keyword_release(keyword)
3570 
3571  CALL keyword_create( &
3572  keyword, __location__, &
3573  name="EXCH_CORRECTION_FUNC", &
3574  description="Exchange functional which is used for the ADMM correction. "// &
3575  "LibXC implementations require linking with LibXC", &
3576  enum_c_vals=s2a("DEFAULT", "PBEX", "NONE", "OPTX", "BECKE88X", &
3577  "PBEX_LIBXC", "BECKE88X_LIBXC", "OPTX_LIBXC", "DEFAULT_LIBXC", "LDA_X_LIBXC"), &
3583  enum_desc=s2a("Use PBE-based corrections according to the chosen interaction operator.", &
3584  "Use PBEX functional for exchange correction.", &
3585  "No correction: X(D)-x(d)-> 0.", &
3586  "Use OPTX functional for exchange correction.", &
3587  "Use Becke88X functional for exchange correction.", &
3588  "Use PBEX functional (LibXC implementation) for exchange correction.", &
3589  "Use Becke88X functional (LibXC implementation) for exchange correction.", &
3590  "Use OPTX functional (LibXC implementation) for exchange correction.", &
3591  "Use PBE-based corrections (LibXC where possible) to the chosen interaction operator.", &
3592  "Use Slater X functional (LibXC where possible) for exchange correction."), &
3593  default_i_val=do_admm_aux_exch_func_default)
3594  CALL section_add_keyword(section, keyword)
3595  CALL keyword_release(keyword)
3596 
3597  CALL keyword_create(keyword, __location__, name="optx_a1", &
3598  description="OPTX a1 coefficient", &
3599  default_r_val=1.05151_dp)
3600  CALL section_add_keyword(section, keyword)
3601  CALL keyword_release(keyword)
3602  CALL keyword_create(keyword, __location__, name="optx_a2", &
3603  description="OPTX a2 coefficient", &
3604  default_r_val=1.43169_dp)
3605  CALL section_add_keyword(section, keyword)
3606  CALL keyword_release(keyword)
3607  CALL keyword_create(keyword, __location__, name="optx_gamma", &
3608  description="OPTX gamma coefficient", &
3609  default_r_val=0.006_dp)
3610  CALL section_add_keyword(section, keyword)
3611  CALL keyword_release(keyword)
3612 
3613  CALL keyword_create(keyword, __location__, name="BLOCK_LIST", &
3614  description="Specifies a list of atoms.", &
3615  usage="LIST {integer} {integer} .. {integer}", &
3616  n_var=-1, type_of_var=integer_t, repeats=.true.)
3617  CALL section_add_keyword(section, keyword)
3618  CALL keyword_release(keyword)
3619 
3620  CALL keyword_create(keyword, __location__, name="EPS_FILTER", &
3621  description="Define accuracy of DBCSR operations", &
3622  usage="EPS_FILTER", default_r_val=0.0_dp)
3623  CALL section_add_keyword(section, keyword)
3624  CALL keyword_release(keyword)
3625 
3626  END SUBROUTINE create_admm_section
3627 
3628 ! **************************************************************************************************
3629 !> \brief ...
3630 !> \param section ...
3631 ! **************************************************************************************************
3632  SUBROUTINE create_se_control_section(section)
3633  TYPE(section_type), POINTER :: section
3634 
3635  TYPE(keyword_type), POINTER :: keyword
3636  TYPE(section_type), POINTER :: subsection
3637 
3638  NULLIFY (keyword)
3639  cpassert(.NOT. ASSOCIATED(section))
3640  CALL section_create(section, __location__, name="SE", &
3641  description="Parameters needed to set up the Semi-empirical methods", &
3642  n_keywords=8, n_subsections=0, repeats=.false.)
3643 
3644  CALL keyword_create(keyword, __location__, name="ORTHOGONAL_BASIS", &
3645  description="Assume orthogonal basis set. This flag is overwritten by "// &
3646  "methods with fixed orthogonal/non-orthogonal basis set.", &
3647  usage="ORTHOGONAL_BASIS", default_l_val=.false., lone_keyword_l_val=.true.)
3648  CALL section_add_keyword(section, keyword)
3649  CALL keyword_release(keyword)
3650 
3651  CALL keyword_create(keyword, __location__, name="STO_NG", &
3652  description="Provides the order of the Slater orbital expansion of Gaussian-Type Orbitals.", &
3653  usage="STO_NG", default_i_val=6)
3654  CALL section_add_keyword(section, keyword)
3655  CALL keyword_release(keyword)
3656 
3657  CALL keyword_create(keyword, __location__, name="ANALYTICAL_GRADIENTS", &
3658  description="Nuclear Gradients are computed analytically or numerically", &
3659  usage="ANALYTICAL_GRADIENTS", default_l_val=.true., lone_keyword_l_val=.true.)
3660  CALL section_add_keyword(section, keyword)
3661  CALL keyword_release(keyword)
3662 
3663  CALL keyword_create(keyword, __location__, name="DELTA", &
3664  description="Step size in finite difference force calculation", &
3665  usage="DELTA {real} ", default_r_val=1.e-6_dp)
3666  CALL section_add_keyword(section, keyword)
3667  CALL keyword_release(keyword)
3668 
3669  CALL keyword_create(keyword, __location__, name="INTEGRAL_SCREENING", &
3670  description="Specifies the functional form for the ", &
3671  usage="INTEGRAL_SCREENING (KDSO|KDSO-D|SLATER)", &
3672  enum_c_vals=s2a("KDSO", "KDSO-D", "SLATER"), &
3673  enum_i_vals=(/do_se_is_kdso, do_se_is_kdso_d, do_se_is_slater/), &
3674  enum_desc=s2a("Uses the standard NDDO Klopman-Dewar-Sabelli-Ohno equation "// &
3675  "for the screening of the Coulomb interactions.", &
3676  "Uses a modified Klopman-Dewar-Sabelli-Ohno equation, dumping the screening "// &
3677  "parameter for the Coulomb interactions.", &
3678  "Uses an exponential Slater-type function for modelling the Coulomb interactions."), &
3679  default_i_val=do_se_is_kdso)
3680  CALL section_add_keyword(section, keyword)
3681  CALL keyword_release(keyword)
3682 
3683  CALL keyword_create(keyword, __location__, name="PERIODIC", &
3684  description="Specifies the type of treatment for the electrostatic long-range part "// &
3685  "in semi-empirical calculations.", &
3686  usage="PERIODIC (NONE|EWALD|EWALD_R3|EWALD_GKS)", &
3687  enum_c_vals=s2a("NONE", "EWALD", "EWALD_R3", "EWALD_GKS"), &
3689  enum_desc=s2a("The long-range part is not explicitly treaten. The interaction "// &
3690  "depends uniquely on the Cutoffs used for the calculation.", &
3691  "Enables the usage of Multipoles Ewald summation schemes. The short-range part "// &
3692  "is tapered according the value of RC_COULOMB.", &
3693  "Enables the usage of Multipoles Ewald summation schemes together with a long-range "// &
3694  "treatment for the 1/R^3 term, deriving from the short-range component. This option "// &
3695  "is active only for K-DSO integral screening type.", &
3696  "Use Ewald directly in Coulomb integral evaluation, works only with Slater screening"), &
3697  default_i_val=do_se_lr_none)
3698  CALL section_add_keyword(section, keyword)
3699  CALL keyword_release(keyword)
3700 
3701  CALL keyword_create(keyword, __location__, name="FORCE_KDSO-D_EXCHANGE", &
3702  description="This keywords forces the usage of the KDSO-D integral screening "// &
3703  "for the Exchange integrals (default is to apply the screening only to the "// &
3704  "Coulomb integrals.", default_l_val=.false., lone_keyword_l_val=.true.)
3705  CALL section_add_keyword(section, keyword)
3706  CALL keyword_release(keyword)
3707 
3708  CALL keyword_create(keyword, __location__, name="DISPERSION", &
3709  description="Use dispersion correction", &
3710  lone_keyword_l_val=.true., &
3711  usage="DISPERSION", default_l_val=.false.)
3712  CALL section_add_keyword(section, keyword)
3713  CALL keyword_release(keyword)
3714 
3715  CALL keyword_create(keyword, __location__, name="DISPERSION_PARAMETER_FILE", &
3716  description="Specify file that contains the atomic dispersion parameters", &
3717  usage="DISPERSION_PARAMETER_FILE filename", &
3718  n_var=1, type_of_var=char_t, default_c_val="")
3719  CALL section_add_keyword(section, keyword)
3720  CALL keyword_release(keyword)
3721 
3722  CALL keyword_create(keyword, __location__, name="DISPERSION_RADIUS", &
3723  description="Define radius of dispersion interaction", &
3724  usage="DISPERSION_RADIUS", default_r_val=15._dp)
3725  CALL section_add_keyword(section, keyword)
3726  CALL keyword_release(keyword)
3727 
3728  CALL keyword_create(keyword, __location__, name="COORDINATION_CUTOFF", &
3729  description="Define cutoff for coordination number calculation", &
3730  usage="COORDINATION_CUTOFF", default_r_val=1.e-6_dp)
3731  CALL section_add_keyword(section, keyword)
3732  CALL keyword_release(keyword)
3733 
3734  CALL keyword_create(keyword, __location__, name="D3_SCALING", &
3735  description="Scaling parameters (s6,sr6,s8) for the D3 dispersion method,", &
3736  usage="D3_SCALING 1.0 1.0 1.0", n_var=3, default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp/))
3737  CALL section_add_keyword(section, keyword)
3738  CALL keyword_release(keyword)
3739 
3740  NULLIFY (subsection)
3741  CALL create_coulomb_section(subsection)
3742  CALL section_add_subsection(section, subsection)
3743  CALL section_release(subsection)
3744 
3745  CALL create_exchange_section(subsection)
3746  CALL section_add_subsection(section, subsection)
3747  CALL section_release(subsection)
3748 
3749  CALL create_screening_section(subsection)
3750  CALL section_add_subsection(section, subsection)
3751  CALL section_release(subsection)
3752 
3753  CALL create_lr_corr_section(subsection)
3754  CALL section_add_subsection(section, subsection)
3755  CALL section_release(subsection)
3756 
3757  CALL create_neighbor_lists_section(subsection)
3758  CALL section_add_subsection(section, subsection)
3759  CALL section_release(subsection)
3760 
3761  CALL create_se_memory_section(subsection)
3762  CALL section_add_subsection(section, subsection)
3763  CALL section_release(subsection)
3764 
3765  CALL create_se_print_section(subsection)
3766  CALL section_add_subsection(section, subsection)
3767  CALL section_release(subsection)
3768 
3769  CALL create_se_ga_section(subsection)
3770  CALL section_add_subsection(section, subsection)
3771  CALL section_release(subsection)
3772 
3773  END SUBROUTINE create_se_control_section
3774 
3775 ! **************************************************************************************************
3776 !> \brief Create the COULOMB se section
3777 !> \param section the section to create
3778 !> \date 03.2009
3779 !> \author Teodoro Laino [tlaino]
3780 ! **************************************************************************************************
3781  SUBROUTINE create_lr_corr_section(section)
3782  TYPE(section_type), POINTER :: section
3783 
3784  TYPE(keyword_type), POINTER :: keyword
3785 
3786  cpassert(.NOT. ASSOCIATED(section))
3787  CALL section_create(section, __location__, name="LR_CORRECTION", &
3788  description="Setup parameters for the evaluation of the long-range correction term in SE "// &
3789  "calculations.", n_keywords=0, n_subsections=1, repeats=.false.)
3790  NULLIFY (keyword)
3791 
3792  CALL keyword_create(keyword, __location__, name="CUTOFF", &
3793  description="Atomic Cutoff Radius Cutoff for the evaluation of the long-ranbe correction integrals. ", &
3794  usage="CUTOFF {real} ", unit_str="angstrom", &
3795  default_r_val=cp_unit_to_cp2k(value=6.0_dp, unit_str="angstrom"))
3796  CALL section_add_keyword(section, keyword)
3797  CALL keyword_release(keyword)
3798 
3799  CALL keyword_create(keyword, __location__, name="RC_TAPER", &
3800  description="Atomic Cutoff Radius Cutoff for Tapering the long-range correction integrals. "// &
3801  "If not specified it assumes the same value specified for the CUTOFF.", &
3802  usage="RC_TAPER {real} ", unit_str="angstrom", type_of_var=real_t)
3803  CALL section_add_keyword(section, keyword)
3804  CALL keyword_release(keyword)
3805 
3806  CALL keyword_create(keyword, __location__, name="RC_RANGE", &
3807  description="Range of cutoff switch function (tapering): 0.5*(1-TANH((r-r0)/RC_RANGE)), "// &
3808  "where r0=2.0*RC_TAPER-20.0*RC_RANGE.", &
3809  usage="RC_RANGE {real} ", unit_str="angstrom", default_r_val=0.0_dp)
3810  CALL section_add_keyword(section, keyword)
3811  CALL keyword_release(keyword)
3812 
3813  END SUBROUTINE create_lr_corr_section
3814 
3815 ! **************************************************************************************************
3816 !> \brief Create the COULOMB se section
3817 !> \param section the section to create
3818 !> \date 03.2009
3819 !> \author Teodoro Laino [tlaino]
3820 ! **************************************************************************************************
3821  SUBROUTINE create_coulomb_section(section)
3822  TYPE(section_type), POINTER :: section
3823 
3824  TYPE(keyword_type), POINTER :: keyword
3825 
3826  cpassert(.NOT. ASSOCIATED(section))
3827  CALL section_create(section, __location__, name="COULOMB", &
3828  description="Setup parameters for the evaluation of the COULOMB term in SE "// &
3829  "calculations.", n_keywords=0, n_subsections=1, repeats=.false.)
3830  NULLIFY (keyword)
3831 
3832  CALL keyword_create( &
3833  keyword, __location__, name="CUTOFF", &
3834  description="Atomic Cutoff Radius Cutoff for the evaluation of the Coulomb integrals. "// &
3835  "For non-periodic calculation the default value is exactly the full cell dimension, in order "// &
3836  "to evaluate all pair interactions. Instead, for periodic calculations the default numerical value is used.", &
3837  usage="CUTOFF {real} ", unit_str="angstrom", &
3838  default_r_val=cp_unit_to_cp2k(value=12.0_dp, unit_str="angstrom"))
3839  CALL section_add_keyword(section, keyword)
3840  CALL keyword_release(keyword)
3841 
3842  CALL keyword_create(keyword, __location__, name="RC_TAPER", &
3843  description="Atomic Cutoff Radius Cutoff for Tapering Coulomb integrals. "// &
3844  "If not specified it assumes the same value specified for the CUTOFF.", &
3845  usage="RC_TAPER {real} ", unit_str="angstrom", type_of_var=real_t)
3846  CALL section_add_keyword(section, keyword)
3847  CALL keyword_release(keyword)
3848 
3849  CALL keyword_create(keyword, __location__, name="RC_RANGE", &
3850  description="Range of cutoff switch function (tapering): 0.5*(1-TANH((r-r0)/RC_RANGE)), "// &
3851  "where r0=2.0*RC_TAPER-20.0*RC_RANGE.", &
3852  usage="RC_RANGE {real} ", unit_str="angstrom", default_r_val=0.0_dp)
3853  CALL section_add_keyword(section, keyword)
3854  CALL keyword_release(keyword)
3855 
3856  END SUBROUTINE create_coulomb_section
3857 
3858 ! **************************************************************************************************
3859 !> \brief Create the EXCHANGE se section
3860 !> \param section the section to create
3861 !> \date 03.2009
3862 !> \author Teodoro Laino [tlaino]
3863 ! **************************************************************************************************
3864  SUBROUTINE create_exchange_section(section)
3865  TYPE(section_type), POINTER :: section
3866 
3867  TYPE(keyword_type), POINTER :: keyword
3868 
3869  cpassert(.NOT. ASSOCIATED(section))
3870  CALL section_create(section, __location__, name="EXCHANGE", &
3871  description="Setup parameters for the evaluation of the EXCHANGE and "// &
3872  "core Hamiltonian terms in SE calculations.", n_keywords=0, n_subsections=1, &
3873  repeats=.false.)
3874  NULLIFY (keyword)
3875 
3876  CALL keyword_create(keyword, __location__, name="CUTOFF", &
3877  description="Atomic Cutoff Radius Cutoff for the evaluation of the Exchange integrals. "// &
3878  "For non-periodic calculation the default value is exactly the full cell dimension, in order "// &
3879  "to evaluate all pair interactions. Instead, for periodic calculations the default is the "// &
3880  "minimum value between 1/4 of the cell dimension and the value specified in input (either"// &
3881  " explicitly defined or the default numerical value).", &
3882  usage="CUTOFF {real} ", unit_str="angstrom", &
3883  default_r_val=cp_unit_to_cp2k(value=12.0_dp, unit_str="angstrom"))
3884  CALL section_add_keyword(section, keyword)
3885  CALL keyword_release(keyword)
3886 
3887  CALL keyword_create(keyword, __location__, name="RC_TAPER", &
3888  description="Atomic Cutoff Radius Cutoff for Tapering Exchange integrals. "// &
3889  "If not specified it assumes the same value specified for the CUTOFF.", &
3890  usage="RC_TAPER {real} ", unit_str="angstrom", type_of_var=real_t)
3891  CALL section_add_keyword(section, keyword)
3892  CALL keyword_release(keyword)
3893 
3894  CALL keyword_create(keyword, __location__, name="RC_RANGE", &
3895  description="Range of cutoff switch function (tapering): 0.5*(1-TANH((r-r0)/RC_RANGE)), "// &
3896  "where r0=2.0*RC_TAPER-20.0*RC_RANGE.", &
3897  usage="RC_RANGE {real} ", unit_str="angstrom", default_r_val=0.0_dp)
3898  CALL section_add_keyword(section, keyword)
3899  CALL keyword_release(keyword)
3900 
3901  END SUBROUTINE create_exchange_section
3902 
3903 ! **************************************************************************************************
3904 !> \brief Create the SCREENING se section
3905 !> \param section the section to create
3906 !> \date 03.2009
3907 !> \author Teodoro Laino [tlaino]
3908 ! **************************************************************************************************
3909  SUBROUTINE create_screening_section(section)
3910  TYPE(section_type), POINTER :: section
3911 
3912  TYPE(keyword_type), POINTER :: keyword
3913 
3914  cpassert(.NOT. ASSOCIATED(section))
3915  CALL section_create(section, __location__, name="SCREENING", &
3916  description="Setup parameters for the tapering of the Coulomb/Exchange Screening in "// &
3917  "KDSO-D integral scheme,", n_keywords=0, n_subsections=1, repeats=.false.)
3918  NULLIFY (keyword)
3919 
3920  CALL keyword_create(keyword, __location__, name="RC_TAPER", &
3921  description="Atomic Cutoff Radius Cutoff for Tapering the screening term. ", &
3922  usage="RC_TAPER {real} ", unit_str="angstrom", &
3923  default_r_val=cp_unit_to_cp2k(value=12.0_dp, unit_str="angstrom"))
3924  CALL section_add_keyword(section, keyword)
3925  CALL keyword_release(keyword)
3926 
3927  CALL keyword_create(keyword, __location__, name="RC_RANGE", &
3928  description="Range of cutoff switch function (tapering): 0.5*(1-TANH((r-r0)/RC_RANGE)), "// &
3929  "where r0=2*RC_TAPER-20*RC_RANGE.", &
3930  usage="RC_RANGE {real} ", unit_str="angstrom", default_r_val=0.0_dp)
3931  CALL section_add_keyword(section, keyword)
3932  CALL keyword_release(keyword)
3933 
3934  END SUBROUTINE create_screening_section
3935 
3936 ! **************************************************************************************************
3937 !> \brief Create the print se section
3938 !> \param section the section to create
3939 !> \author teo
3940 ! **************************************************************************************************
3941  SUBROUTINE create_se_print_section(section)
3942  TYPE(section_type), POINTER :: section
3943 
3944  TYPE(section_type), POINTER :: print_key
3945 
3946  cpassert(.NOT. ASSOCIATED(section))
3947  CALL section_create(section, __location__, name="print", &
3948  description="Section of possible print options in SE code.", &
3949  n_keywords=0, n_subsections=1, repeats=.false.)
3950 
3951  NULLIFY (print_key)
3952  CALL cp_print_key_section_create(print_key, __location__, "NEIGHBOR_LISTS", &
3953  description="Activates the printing of the neighbor lists used"// &
3954  " for the periodic SE calculations.", &
3955  print_level=high_print_level, filename="", unit_str="angstrom")
3956  CALL section_add_subsection(section, print_key)
3957  CALL section_release(print_key)
3958 
3959  CALL cp_print_key_section_create(print_key, __location__, "SUBCELL", &
3960  description="Activates the printing of the subcells used for the "// &
3961  "generation of neighbor lists for periodic SE.", &
3962  print_level=high_print_level, filename="__STD_OUT__")
3963  CALL section_add_subsection(section, print_key)
3964  CALL section_release(print_key)
3965 
3966  CALL cp_print_key_section_create(print_key, __location__, "EWALD_INFO", &
3967  description="Activates the printing of the information for "// &
3968  "Ewald multipole summation in periodic SE.", &
3969  print_level=high_print_level, filename="__STD_OUT__")
3970  CALL section_add_subsection(section, print_key)
3971  CALL section_release(print_key)
3972 
3973  END SUBROUTINE create_se_print_section
3974 
3975 ! **************************************************************************************************
3976 !> \brief creates the input section for use with the GA part of the code
3977 !> \param section the section to create
3978 !> \author Teodoro Laino [tlaino] - University of Zurich - 05.2008
3979 ! **************************************************************************************************
3980  SUBROUTINE create_se_ga_section(section)
3981  TYPE(section_type), POINTER :: section
3982 
3983  TYPE(keyword_type), POINTER :: keyword
3984 
3985  cpassert(.NOT. ASSOCIATED(section))
3986  CALL section_create(section, __location__, name="GA", &
3987  description="Sets up memory parameters for the storage of the integrals", &
3988  n_keywords=1, n_subsections=0, repeats=.false.)
3989  NULLIFY (keyword)
3990 
3991  CALL keyword_create( &
3992  keyword, __location__, &
3993  name="NCELLS", &
3994  description="Defines the number of linked cells for the neighbor list. "// &
3995  "Default value is number of processors", &
3996  usage="NCELLS 10", &
3997  default_i_val=0)
3998  CALL section_add_keyword(section, keyword)
3999  CALL keyword_release(keyword)
4000  END SUBROUTINE create_se_ga_section
4001 
4002 ! **************************************************************************************************
4003 !> \brief creates the input section for the se-memory part integral storage
4004 !> \param section the section to create
4005 !> \author Teodoro Laino [tlaino] - University of Zurich - 05.2008
4006 ! **************************************************************************************************
4007  SUBROUTINE create_se_memory_section(section)
4008  TYPE(section_type), POINTER :: section
4009 
4010  TYPE(keyword_type), POINTER :: keyword
4011 
4012  cpassert(.NOT. ASSOCIATED(section))
4013  CALL section_create(section, __location__, name="MEMORY", &
4014  description="Sets up memory parameters for the storage of the integrals", &
4015  n_keywords=1, n_subsections=0, repeats=.false.)
4016  NULLIFY (keyword)
4017  CALL keyword_create( &
4018  keyword, __location__, &
4019  name="EPS_STORAGE", &
4020  description="Storage threshold for compression is EPS_STORAGE", &
4021  usage="EPS_STORAGE 1.0E-10", &
4022  default_r_val=1.0e-10_dp)
4023  CALL section_add_keyword(section, keyword)
4024  CALL keyword_release(keyword)
4025 
4026  CALL keyword_create( &
4027  keyword, __location__, &
4028  name="MAX_MEMORY", &
4029  description="Defines the maximum amount of memory [MB] used to store precomputed "// &
4030  "(possibly compressed) two-electron two-center integrals", &
4031  usage="MAX_MEMORY 256", &
4032  default_i_val=50)
4033  CALL section_add_keyword(section, keyword)
4034  CALL keyword_release(keyword)
4035 
4036  CALL keyword_create(keyword, __location__, name="COMPRESS", &
4037  description="Enables the compression of the integrals in memory.", &
4038  usage="COMPRESS <LOGICAL>", &
4039  default_l_val=.false., lone_keyword_l_val=.true.)
4040  CALL section_add_keyword(section, keyword)
4041  CALL keyword_release(keyword)
4042 
4043  END SUBROUTINE create_se_memory_section
4044 
4045 ! **************************************************************************************************
4046 !> \brief ...
4047 !> \param section ...
4048 ! **************************************************************************************************
4049  SUBROUTINE create_mulliken_section(section)
4050  TYPE(section_type), POINTER :: section
4051 
4052  TYPE(keyword_type), POINTER :: keyword
4053 
4054  NULLIFY (keyword)
4055  cpassert(.NOT. ASSOCIATED(section))
4056  CALL section_create(section, __location__, name="MULLIKEN_RESTRAINT", &
4057  description="Use mulliken charges in a restraint (check code for details)", &
4058  n_keywords=7, n_subsections=0, repeats=.false.)
4059 
4060  CALL keyword_create(keyword, __location__, name="STRENGTH", &
4061  description="force constant of the restraint", &
4062  usage="STRENGTH {real} ", default_r_val=0.1_dp)
4063  CALL section_add_keyword(section, keyword)
4064  CALL keyword_release(keyword)
4065 
4066  CALL keyword_create(keyword, __location__, name="TARGET", &
4067  description="target value of the restraint", &
4068  usage="TARGET {real} ", default_r_val=1._dp)
4069  CALL section_add_keyword(section, keyword)
4070  CALL keyword_release(keyword)
4071 
4072  CALL keyword_create(keyword, __location__, name="ATOMS", &
4073  description="Specifies the list of atoms that is summed in the restraint", &
4074  usage="ATOMS {integer} {integer} .. {integer}", &
4075  n_var=-1, type_of_var=integer_t)
4076  CALL section_add_keyword(section, keyword)
4077  CALL keyword_release(keyword)
4078 
4079  END SUBROUTINE create_mulliken_section
4080 
4081 ! **************************************************************************************************
4082 !> \brief ...
4083 !> \param section ...
4084 ! **************************************************************************************************
4085  SUBROUTINE create_density_fitting_section(section)
4086  TYPE(section_type), POINTER :: section
4087 
4088  TYPE(keyword_type), POINTER :: keyword
4089  TYPE(section_type), POINTER :: print_key
4090 
4091  NULLIFY (keyword, print_key)
4092  cpassert(.NOT. ASSOCIATED(section))
4093  CALL section_create(section, __location__, name="DENSITY_FITTING", &
4094  description="Setup parameters for density fitting (Bloechl charges or density derived "// &
4095  "atomic point charges (DDAPC) charges)", &
4096  n_keywords=7, n_subsections=0, repeats=.false., &
4097  citations=(/blochl1995/))
4098 
4099  CALL keyword_create(keyword, __location__, name="NUM_GAUSS", &
4100  description="Specifies the numbers of gaussian used to fit the QM density for each atomic site.", &
4101  usage="NUM_GAUSS {integer}", &
4102  n_var=1, type_of_var=integer_t, default_i_val=3)
4103  CALL section_add_keyword(section, keyword)
4104  CALL keyword_release(keyword)
4105 
4106  CALL keyword_create(keyword, __location__, name="PFACTOR", &
4107  description="Specifies the progression factor for the gaussian exponent for each atomic site.", &
4108  usage="PFACTOR {real}", &
4109  n_var=1, type_of_var=real_t, default_r_val=1.5_dp)
4110  CALL section_add_keyword(section, keyword)
4111  CALL keyword_release(keyword)
4112 
4113  CALL keyword_create(keyword, __location__, name="MIN_RADIUS", &
4114  description="Specifies the smallest radius of the gaussian used in the fit. All other radius are"// &
4115  " obtained with the progression factor.", &
4116  usage="MIN_RADIUS {real}", &
4117  unit_str="angstrom", n_var=1, type_of_var=real_t, default_r_val=0.5_dp)
4118  CALL section_add_keyword(section, keyword)
4119  CALL keyword_release(keyword)
4120 
4121  CALL keyword_create(keyword, __location__, name="RADII", &
4122  description="Specifies all the radius of the gaussian used in the fit for each atomic site. The use"// &
4123  " of this keyword disables all other keywords of this section.", &
4124  usage="RADII {real} {real} .. {real}", &
4125  unit_str="angstrom", n_var=-1, type_of_var=real_t)
4126  CALL section_add_keyword(section, keyword)
4127  CALL keyword_release(keyword)
4128 
4129  CALL keyword_create(keyword, __location__, name="GCUT", &
4130  description="Cutoff for charge fit in G-space.", &
4131  usage="GCUT {real}", &
4132  n_var=1, type_of_var=real_t, default_r_val=sqrt(6.0_dp))
4133  CALL section_add_keyword(section, keyword)
4134  CALL keyword_release(keyword)
4135 
4136  CALL cp_print_key_section_create(print_key, __location__, "program_run_info", &
4137  description="Controls the printing of basic information during the run", &
4138  print_level=high_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
4139 
4140  CALL keyword_create(keyword, __location__, name="CONDITION_NUMBER", &
4141  description="Prints information regarding the condition numbers of the A matrix (to be inverted)", &
4142  usage="ANALYTICAL_GTERM <LOGICAL>", &
4143  default_l_val=.false., lone_keyword_l_val=.true.)
4144  CALL section_add_keyword(print_key, keyword)
4145  CALL keyword_release(keyword)
4146 
4147  CALL section_add_subsection(section, print_key)
4148  CALL section_release(print_key)
4149 
4150  END SUBROUTINE create_density_fitting_section
4151 
4152 ! **************************************************************************************************
4153 !> \brief ...
4154 !> \param section ...
4155 !> \param section_name ...
4156 ! **************************************************************************************************
4157  SUBROUTINE create_ddapc_restraint_section(section, section_name)
4158  TYPE(section_type), POINTER :: section
4159  CHARACTER(len=*), INTENT(in) :: section_name
4160 
4161  TYPE(keyword_type), POINTER :: keyword
4162  TYPE(section_type), POINTER :: print_key
4163 
4164  NULLIFY (keyword, print_key)
4165  cpassert(.NOT. ASSOCIATED(section))
4166  CALL section_create(section, __location__, name=trim(adjustl(section_name)), &
4167  description="Use DDAPC charges in a restraint (check code for details)", &
4168  n_keywords=7, n_subsections=0, repeats=.true.)
4169 
4170  CALL keyword_create(keyword, __location__, name="TYPE_OF_DENSITY", &
4171  description="Specifies the type of density used for the fitting", &
4172  usage="TYPE_OF_DENSITY (FULL|SPIN)", &
4173  enum_c_vals=s2a("FULL", "SPIN"), &
4174  enum_i_vals=(/do_full_density, do_spin_density/), &
4175  enum_desc=s2a("Full density", "Spin density"), &
4176  default_i_val=do_full_density)
4177  CALL section_add_keyword(section, keyword)
4178  CALL keyword_release(keyword)
4179 
4180  CALL keyword_create(keyword, __location__, name="STRENGTH", &
4181  description="force constant of the restraint", &
4182  usage="STRENGTH {real} ", default_r_val=0.1_dp)
4183  CALL section_add_keyword(section, keyword)
4184  CALL keyword_release(keyword)
4185 
4186  CALL keyword_create(keyword, __location__, name="TARGET", &
4187  description="target value of the restraint", &
4188  usage="TARGET {real} ", default_r_val=1._dp)
4189  CALL section_add_keyword(section, keyword)
4190  CALL keyword_release(keyword)
4191 
4192  CALL keyword_create(keyword, __location__, name="ATOMS", &
4193  description="Specifies the list of atoms that is summed in the restraint", &
4194  usage="ATOMS {integer} {integer} .. {integer}", &
4195  n_var=-1, type_of_var=integer_t)
4196  CALL section_add_keyword(section, keyword)
4197  CALL keyword_release(keyword)
4198 
4199  CALL keyword_create(keyword, __location__, name="COEFF", &
4200  description="Defines the the coefficient of the atom in the atom list (default is one) ", &
4201  usage="COEFF 1.0 -1.0", &
4202  type_of_var=real_t, n_var=-1)
4203  CALL section_add_keyword(section, keyword)
4204  CALL keyword_release(keyword)
4205 
4206  CALL keyword_create(keyword, __location__, name="FUNCTIONAL_FORM", &
4207  description="Specifies the functional form of the term added", &
4208  usage="FUNCTIONAL_FORM RESTRAINT", &
4209  enum_c_vals=s2a("RESTRAINT", "CONSTRAINT"), &
4210  enum_i_vals=(/do_ddapc_restraint, do_ddapc_constraint/), &
4211  enum_desc=s2a("Harmonic potential: s*(q-t)**2", "Constraint form: s*(q-t)"), &
4212  default_i_val=do_ddapc_restraint)
4213  CALL section_add_keyword(section, keyword)
4214  CALL keyword_release(keyword)
4215 
4216  CALL cp_print_key_section_create(print_key, __location__, "program_run_info", &
4217  description="Controls the printing basic info about the method", &
4218  print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
4219  CALL section_add_subsection(section, print_key)
4220  CALL section_release(print_key)
4221 
4222  END SUBROUTINE create_ddapc_restraint_section
4223 
4224 ! **************************************************************************************************
4225 !> \brief Create input section to define CDFT constraint settings specific to Becke weight function.
4226 !> \param section the section to create
4227 ! **************************************************************************************************
4228  SUBROUTINE create_becke_constraint_section(section)
4229  TYPE(section_type), POINTER :: section
4230 
4231  TYPE(keyword_type), POINTER :: keyword
4232 
4233  NULLIFY (keyword)
4234  cpassert(.NOT. ASSOCIATED(section))
4235  CALL section_create(section, __location__, name="BECKE_CONSTRAINT", &
4236  description="Define settings influencing the construction of the Becke weight function.", &
4237  n_keywords=13, repeats=.false., citations=(/becke1988b/))
4238 
4239  CALL keyword_create(keyword, __location__, name="ADJUST_SIZE", &
4240  description="Adjust Becke cell boundaries with atomic"// &
4241  " radii to generate a heteronuclear cutoff profile. These"// &
4242  " radii are defined with the keyword ATOMIC_RADII.", &
4243  usage="ADJUST_SIZE", &
4244  default_l_val=.false., lone_keyword_l_val=.true.)
4245  CALL section_add_keyword(section, keyword)
4246  CALL keyword_release(keyword)
4247 
4248  CALL keyword_create(keyword, __location__, name="ATOMIC_RADII", &
4249  description="Defines atomic radii to generate a heteronuclear cutoff profile."// &
4250  " Give one value per element in the same order as they"// &
4251  " appear in the input coordinates.", &
4252  usage="ATOMIC_RADII {real} {real} {real}", repeats=.false., &
4253  unit_str="angstrom", &
4254  type_of_var=real_t, n_var=-1)
4255  CALL section_add_keyword(section, keyword)
4256  CALL keyword_release(keyword)
4257 
4258  CALL keyword_create(keyword, __location__, name="SHOULD_SKIP", &
4259  description="If grid point is farther than GLOBAL_CUTOFF from all constraint atoms, "// &
4260  "move directly to next grid point, thus saving computational resources.", &
4261  usage="SHOULD_SKIP", &
4262  default_l_val=.false., lone_keyword_l_val=.true.)
4263  CALL section_add_keyword(section, keyword)
4264  CALL keyword_release(keyword)
4265 
4266  CALL keyword_create(keyword, __location__, name="CAVITY_CONFINE", &
4267  description="Activates Gaussian cavity confinement. The constraint is evaluated only inside "// &
4268  "the cavity. The cavity is formed by summing spherical Gaussians centered on the constraint atoms.", &
4269  usage="CAVITY_CONFINE", &
4270  default_l_val=.false., lone_keyword_l_val=.true.)
4271  CALL section_add_keyword(section, keyword)
4272  CALL keyword_release(keyword)
4273 
4274  CALL keyword_create(keyword, __location__, name="CAVITY_SHAPE", &
4275  description="Specifies the type of Gaussian cavity used.", &
4276  usage="CAVITY_SHAPE (SINGLE|VDW|COVALENT|USER)", &
4277  enum_c_vals=s2a("DEFAULT", "SINGLE", "VDW", "COVALENT", "USER"), &
4279  enum_desc=s2a("Use covalent radii (in angstrom) to construct Gaussians, but fixed"// &
4280  " 1.0_dp radius for elements with a radius larger than this value.", &
4281  "Single Gaussian for all atom types with radius given by CAVITY_RADIUS.", &
4282  "Use van der Waals radii to construct Gaussians.", &
4283  "Use covalent radii to construct Gaussians.", &
4284  "Use user defined radii (keyword ATOMIC_RADII) to construct Gaussians."), &
4285  default_i_val=radius_default)
4286  CALL section_add_keyword(section, keyword)
4287  CALL keyword_release(keyword)
4288 
4289  CALL keyword_create(keyword, __location__, name="CAVITY_USE_BOHR", &
4290  description="Convert the cavity radius from angstrom to bohr. This results in a larger"// &
4291  " confinement cavity than without unit conversion.", &
4292  usage="CAVITY_USE_BOHR TRUE", &
4293  default_l_val=.false., lone_keyword_l_val=.true.)
4294  CALL section_add_keyword(section, keyword)
4295  CALL keyword_release(keyword)
4296 
4297  CALL keyword_create(keyword, __location__, name="CAVITY_PRINT", &
4298  description="Print cavity in Gaussian cube file format. Currently, printing options"// &
4299  " are hardcoded.", &
4300  usage="CAVITY_PRINT", &
4301  default_l_val=.false., lone_keyword_l_val=.true.)
4302  CALL section_add_keyword(section, keyword)
4303  CALL keyword_release(keyword)
4304 
4305  CALL keyword_create(keyword, __location__, name="CAVITY_RADIUS", &
4306  description="Radius parameter controlling the creation of Gaussian cavity confinement.", &
4307  usage="CAVITY_RADIUS <REAL>", &
4308  unit_str="angstrom", &
4309  default_r_val=cp_unit_to_cp2k(3.0_dp, "angstrom"), &
4310  type_of_var=real_t, n_var=1)
4311  CALL section_add_keyword(section, keyword)
4312  CALL keyword_release(keyword)
4313 
4314  CALL keyword_create(keyword, __location__, name="EPS_CAVITY", &
4315  description="Density threshold for cavity creation. Grid points where the Gaussian"// &
4316  " density falls below the threshold are ignored.", &
4317  usage="EPS_CAVITY {real} ", default_r_val=1.0e-6_dp)
4318  CALL section_add_keyword(section, keyword)
4319  CALL keyword_release(keyword)
4320 
4321  CALL keyword_create(keyword, __location__, name="CUTOFF_TYPE", &
4322  description="Specifies the type of cutoff used when building the Becke weight function.", &
4323  usage="CUTOFF_TYPE (GLOBAL|ELEMENT)", &
4324  enum_c_vals=s2a("GLOBAL", "ELEMENT"), &
4325  enum_i_vals=(/becke_cutoff_global, becke_cutoff_element/), &
4326  enum_desc=s2a("Use a single value for all elements. Read from GLOBAL_CUTOFF.", &
4327  "Use a different value for all elements. Values read from ELEMENT_CUTOFF."), &
4328  default_i_val=becke_cutoff_global)
4329  CALL section_add_keyword(section, keyword)
4330  CALL keyword_release(keyword)
4331 
4332  CALL keyword_create(keyword, __location__, name="GLOBAL_CUTOFF", &
4333  description="Parameter used to select which atoms contribute to the"// &
4334  " weight function at each real space grid point.", &
4335  usage="GLOBAL_CUTOFF <REAL>", &
4336  unit_str="angstrom", &
4337  default_r_val=cp_unit_to_cp2k(3.1750632515_dp, "angstrom"), &
4338  type_of_var=real_t, n_var=1)
4339  CALL section_add_keyword(section, keyword)
4340  CALL keyword_release(keyword)
4341 
4342  CALL keyword_create(keyword, __location__, name="ELEMENT_CUTOFF", &
4343  description="Defines element specific cutoffs to decide which atoms contribute to the"// &
4344  " weight function at each real space grid point. Give one value per element in the same"// &
4345  " order as they appear in the coordinates.", &
4346  usage="ELEMENT_CUTOFF {real} {real} {real}", repeats=.false., &
4347  unit_str="angstrom", &
4348  type_of_var=real_t, n_var=-1)
4349  CALL section_add_keyword(section, keyword)
4350  CALL keyword_release(keyword)
4351 
4352  CALL keyword_create(keyword, __location__, name="IN_MEMORY", &
4353  description="Precompute gradients due to Becke constraint during"// &
4354  " initial formation of constraint and store them in memory. Useful"// &
4355  " in combination with confinement, memory intensive otherwise. Does"// &
4356  " nothing if forces are not calculated.", &
4357  usage="IN_MEMORY", &
4358  default_l_val=.false., lone_keyword_l_val=.true.)
4359  CALL section_add_keyword(section, keyword)
4360  CALL keyword_release(keyword)
4361 
4362  END SUBROUTINE create_becke_constraint_section
4363 
4364 ! **************************************************************************************************
4365 !> \brief Creates the input section for defining CDFT constraints.
4366 !> \param section the section to create
4367 ! **************************************************************************************************
4368  SUBROUTINE create_cdft_control_section(section)
4369  TYPE(section_type), POINTER :: section
4370 
4371  TYPE(keyword_type), POINTER :: keyword
4372  TYPE(section_type), POINTER :: group_section, print_key, subsection
4373 
4374  NULLIFY (keyword, subsection, group_section, print_key)
4375 
4376  cpassert(.NOT. ASSOCIATED(section))
4377  CALL section_create(section, __location__, name="CDFT", &
4378  description="Parameters needed to set up a constrained DFT calculation."// &
4379  " Each repetition of the ATOM_GROUP section defines a new constraint."// &
4380  " The constraint(s) is (are) converged in a separate external SCF loop with settings"// &
4381  " read from the OUTER_SCF section. Supported constraints: Becke and Gaussian"// &
4382  " Hirshfeld (partial).", n_keywords=8, n_subsections=2, &
4383  repeats=.false., citations=(/holmberg2017, holmberg2018/))
4384 
4385  NULLIFY (subsection, keyword)
4386  CALL create_outer_scf_section(subsection)
4387  CALL section_add_subsection(section, subsection)
4388  CALL section_release(subsection)
4389 
4390  CALL create_becke_constraint_section(subsection)
4391  CALL section_add_subsection(section, subsection)
4392  CALL section_release(subsection)
4393 
4394  CALL create_hirshfeld_constraint_section(subsection)
4395  CALL section_add_subsection(section, subsection)
4396  CALL section_release(subsection)
4397 
4398  CALL keyword_create(keyword, __location__, name="TYPE_OF_CONSTRAINT", &
4399  description="Specifies the type of constraint used.", &
4400  usage="TYPE_OF_CONSTRAINT (NONE|HIRSHFELD|BECKE)", &
4401  enum_c_vals=s2a("NONE", "HIRSHFELD", "BECKE"), &
4404  enum_desc=s2a("No constraint (disables section).", &
4405  "Gaussian Hirshfeld constraint. Partial implementation: no forces. "// &
4406  "Requires corresponding section. Not as extensively tested.", &
4407  "Becke constraint. Requires corresponding section."), &
4408  citations=(/becke1988b/), &
4409  default_i_val=outer_scf_none)
4410  CALL section_add_keyword(section, keyword)
4411  CALL keyword_release(keyword)
4412 
4413  CALL keyword_create(keyword, __location__, name="STRENGTH", &
4414  description="Constraint force constants (Lagrange multipliers). "// &
4415  "Give one value per constraint group.", &
4416  type_of_var=real_t, n_var=-1, &
4417  default_r_val=0.0_dp)
4418  CALL section_add_keyword(section, keyword)
4419  CALL keyword_release(keyword)
4420 
4421  CALL keyword_create(keyword, __location__, name="TARGET", &
4422  description="Constraint target values. Give one value per constraint group. "// &
4423  "The target value is the desired number of valence electrons, spin moment, or the number of "// &
4424  "alpha or beta electrons on the atoms that define the constraint, suitably multiplied by "// &
4425  "atomic coefficients in case a relative constraint between two sets of atoms is employed. "// &
4426  "Note that core charges are not subtracted from the target value.", &
4427  usage="TARGET {real}", repeats=.false., &
4428  type_of_var=real_t, n_var=-1, &
4429  default_r_val=0.0_dp)
4430  CALL section_add_keyword(section, keyword)
4431  CALL keyword_release(keyword)
4432 
4433  CALL keyword_create(keyword, __location__, name="ATOMIC_CHARGES", &
4434  description="Calculate atomic CDFT charges with selected weight function"// &
4435  " (Z = Z_core - Z_CDFT). With fragment based constraints, charges are"// &
4436  " relative to the fragment reference state i.e. Z = Z_CDFT -"// &
4437  " Z_frag_reference. Note: if the number of atoms is greater than the"// &
4438  " default pw_pool max cache, calculation of atomic CDFT charges"// &
4439  " will prompt harmless warnings during deallocation of atomic grids.", &
4440  usage="ATOMIC_CHARGES", &
4441  default_l_val=.false., lone_keyword_l_val=.true.)
4442  CALL section_add_keyword(section, keyword)
4443  CALL keyword_release(keyword)
4444 
4445  CALL keyword_create(keyword, __location__, name="FRAGMENT_A_FILE_NAME", variants=(/"FRAGMENT_A_FILE"/), &
4446  description="Name of the reference total electron density cube file for fragment A."// &
4447  " May include a path. The reference electron density needs to be outputted"// &
4448  " on the same grid as the full system (same cutoff and cell, output stride 1).", &
4449  usage="FRAGMENT_A_FILE_NAME <FILENAME>", &
4450  default_lc_val="fragment_a.cube")
4451  CALL section_add_keyword(section, keyword)
4452  CALL keyword_release(keyword)
4453 
4454  CALL keyword_create(keyword, __location__, name="FRAGMENT_B_FILE_NAME", variants=(/"FRAGMENT_B_FILE"/), &
4455  description="Name of the reference total electron density cube file for fragment B."// &
4456  " May include a path. The reference electron density needs to be outputted"// &
4457  " on the same grid as the full system (same cutoff and cell, output stride 1).", &
4458  usage="FRAGMENT_B_FILE_NAME <FILENAME>", &
4459  default_lc_val="fragment_b.cube")
4460  CALL section_add_keyword(section, keyword)
4461  CALL keyword_release(keyword)
4462 
4463  CALL keyword_create(keyword, __location__, name="FRAGMENT_A_SPIN_FILE", &
4464  variants=(/"FRAGMENT_A_SPIN_FILE_NAME"/), &
4465  description="Name of the reference spin density cube file for fragment A."// &
4466  " May include a path. The reference spin density needs to be outputted"// &
4467  " on the same grid as the full system (same cutoff and cell, output stride 1).", &
4468  usage="FRAGMENT_A_FILE_NAME <FILENAME>", &
4469  default_lc_val="fragment_a_spin.cube")
4470  CALL section_add_keyword(section, keyword)
4471  CALL keyword_release(keyword)
4472 
4473  CALL keyword_create(keyword, __location__, name="FRAGMENT_B_SPIN_FILE", &
4474  variants=(/"FRAGMENT_B_SPIN_FILE_NAME"/), &
4475  description="Name of the reference spin density cube file for fragment B."// &
4476  " May include a path. The reference spin density needs to be outputted"// &
4477  " on the same grid as the full system (same cutoff and cell, output stride 1).", &
4478  usage="FRAGMENT_B_FILE_NAME <FILENAME>", &
4479  default_lc_val="fragment_b_spin.cube")
4480  CALL section_add_keyword(section, keyword)
4481  CALL keyword_release(keyword)
4482 
4483  CALL keyword_create(keyword, __location__, name="FLIP_FRAGMENT_A", &
4484  description="Logical which determines if the reference spin difference density "// &
4485  "(rho_alpha-rho_beta) for fragment A should be flipped. With default (off) "// &
4486  "value, the fragment is constrained to have more alpha than beta electrons "// &
4487  "if the isolated fragment has unpaired electrons. Useful in conjunction with "// &
4488  "FLIP_FRAGMENT_B.", &
4489  usage="FLIP_FRAGMENT_A", &
4490  default_l_val=.false., lone_keyword_l_val=.true.)
4491  CALL section_add_keyword(section, keyword)
4492  CALL keyword_release(keyword)
4493 
4494  CALL keyword_create(keyword, __location__, name="FLIP_FRAGMENT_B", &
4495  description="Logical which determines if the reference spin difference density "// &
4496  "(rho_alpha-rho_beta) for fragment B should be flipped. With default (off) "// &
4497  "value, the fragment is constrained to have more alpha than beta electrons "// &
4498  "if the isolated fragment has unpaired electrons. Useful in conjunction with "// &
4499  "FLIP_FRAGMENT_A.", &
4500  usage="FLIP_FRAGMENT_B", &
4501  default_l_val=.false., lone_keyword_l_val=.true.)
4502  CALL section_add_keyword(section, keyword)
4503  CALL keyword_release(keyword)
4504 
4505  CALL cp_print_key_section_create(print_key, __location__, "PROGRAM_RUN_INFO", &
4506  description="Controls the printing of basic info about the method.", &
4507  print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
4508 
4509  CALL section_create(subsection, __location__, name="WEIGHT_FUNCTION", &
4510  description="Controls the printing of cube files with "// &
4511  "the CDFT weight function(s). Intended for single-point testing. "// &
4512  "In multistep simulations, generated cube files are overwritten each step.", &
4513  n_keywords=1, n_subsections=0, repeats=.false.)
4514 
4515  CALL keyword_create(keyword, __location__, name="STRIDE", &
4516  description="The stride (X,Y,Z) used to write the cube file "// &
4517  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
4518  " 1 number valid for all components.", &
4519  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
4520  CALL section_add_keyword(subsection, keyword)
4521  CALL keyword_release(keyword)
4522 
4523  CALL section_add_subsection(print_key, subsection)
4524  CALL section_release(subsection)
4525 
4526  CALL section_add_subsection(section, print_key)
4527  CALL section_release(print_key)
4528 
4529  CALL section_create(group_section, __location__, name="ATOM_GROUP", &
4530  description="Define a group of atoms for use in a CDFT constraint. Each repetition of "// &
4531  "this section creates a new constraint.", &
4532  n_keywords=4, n_subsections=0, repeats=.true.)
4533 
4534  CALL keyword_create(keyword, __location__, name="ATOMS", &
4535  description="Specifies the list of atoms that are included in the constraint group.", &
4536  usage="ATOMS {integer} {integer} .. {integer}", &
4537  n_var=-1, type_of_var=integer_t)
4538  CALL section_add_keyword(group_section, keyword)
4539  CALL keyword_release(keyword)
4540 
4541  CALL keyword_create(keyword, __location__, name="COEFF", &
4542  description="Defines coefficients for the atoms in the list of atoms. Accepts values +/-1.0.", &
4543  usage="COEFF 1.0 -1.0", repeats=.true., &
4544  type_of_var=real_t, n_var=-1)
4545  CALL section_add_keyword(group_section, keyword)
4546  CALL keyword_release(keyword)
4547 
4548  CALL keyword_create(keyword, __location__, name="CONSTRAINT_TYPE ", &
4549  description="Determines what type of constraint to apply. ", &
4550  usage="CONSTRAINT_TYPE (CHARGE|MAGNETIZATION|ALPHA|BETA)", &
4551  enum_c_vals=s2a("CHARGE", "MAGNETIZATION", "ALPHA", "BETA"), &
4554  enum_desc=s2a("Total charge density constraint (rho_alpha + rho_beta).", &
4555  "Magnetization density constraint (rho_alpha - rho_beta).", &
4556  "Alpha spin density constraint.", &
4557  "Beta spin density constraint."), &
4558  default_i_val=cdft_charge_constraint)
4559  CALL section_add_keyword(group_section, keyword)
4560  CALL keyword_release(keyword)
4561 
4562  CALL keyword_create(keyword, __location__, name="FRAGMENT_CONSTRAINT", &
4563  description="Use a fragment based constraint. "// &
4564  "Takes as input the electron densities of two isolated fragments in the "// &
4565  "same geometry that they have in the full system. "// &
4566  "The isolated fragment densities are read from cube files defined in FRAGMENT_{A,B}_FILE. "// &
4567  "For magnetization density constraints, additional files containing the spin difference "// &
4568  "densities must be defined with the keywords FRAGMENT_{A,B}_SPIN_FILE. "// &
4569  "With this keyword active, the target value of the constraint is calculated from the "// &
4570  "the superposition of the isolated fragment densities. Supports only static calculations.", &
4571  usage="FRAGMENT_CONSTRAINT", &
4572  default_l_val=.false., lone_keyword_l_val=.true.)
4573  CALL section_add_keyword(group_section, keyword)
4574  CALL keyword_release(keyword)
4575 
4576  CALL section_add_subsection(section, group_section)
4577  CALL section_release(group_section)
4578 
4579  CALL section_create(group_section, __location__, name="DUMMY_ATOMS", &
4580  description="Define an extra group of atoms for which only atomic CDFT charges "// &
4581  "should be computed. The section cannot contain any constraint "// &
4582  "atoms that were included in section ATOM_GROUP.", &
4583  n_keywords=1, n_subsections=0, repeats=.true.)
4584 
4585  CALL keyword_create(keyword, __location__, name="ATOMS", &
4586  description="Specifies the list of atoms that are included in the DUMMY_ATOMS group.", &
4587  usage="ATOMS {integer} {integer} .. {integer}", &
4588  n_var=-1, type_of_var=integer_t)
4589  CALL section_add_keyword(group_section, keyword)
4590  CALL keyword_release(keyword)
4591 
4592  CALL section_add_subsection(section, group_section)
4593  CALL section_release(group_section)
4594 
4595  CALL keyword_create(keyword, __location__, name="REUSE_PRECOND", &
4596  description="Reuse a previously built OT preconditioner between subsequent CDFT SCF iterations "// &
4597  "if the inner OT SCF loop converged in PRECOND_FREQ steps or less. Intended mainly for MD "// &
4598  "simulations with the FULL_ALL preconditioner to speed up the final iterations of the CDFT SCF loop.", &
4599  usage="REUSE_PRECOND yes", repeats=.false., n_var=1, &
4600  default_l_val=.false., lone_keyword_l_val=.true.)
4601  CALL section_add_keyword(section, keyword)
4602  CALL keyword_release(keyword)
4603 
4604  CALL keyword_create(keyword, __location__, name="PRECOND_FREQ", &
4605  description="See REUSE_PRECOND.", &
4606  usage="PRECOND_FREQ {int}", default_i_val=0)
4607  CALL section_add_keyword(section, keyword)
4608  CALL keyword_release(keyword)
4609 
4610  CALL keyword_create(keyword, __location__, name="MAX_REUSE", &
4611  description="Determines how many times a previously built preconditioner can be reused.", &
4612  usage="MAX_REUSE {int}", default_i_val=0)
4613  CALL section_add_keyword(section, keyword)
4614  CALL keyword_release(keyword)
4615 
4616  CALL keyword_create(keyword, __location__, name="PURGE_HISTORY", &
4617  description="Purge wavefunction and constraint history to improve SCF convergence during MD."// &
4618  " Counts how often the convergence of the first CDFT SCF iteration takes 2 or more outer SCF"// &
4619  " iterations and purges the history if the counter exceeds PURGE_FREQ, and PURGE_OFFSET"// &
4620  " MD steps have passed since the last purge."// &
4621  " The counter is zeroed after each purge.", &
4622  usage="PURGE_HISTORY yes", repeats=.false., n_var=1, &
4623  default_l_val=.false., lone_keyword_l_val=.true.)
4624  CALL section_add_keyword(section, keyword)
4625  CALL keyword_release(keyword)
4626 
4627  CALL keyword_create(keyword, __location__, name="PURGE_FREQ", &
4628  description="See PURGE_HISTORY.", &
4629  usage="PURGE_FREQ {int} ", default_i_val=1)
4630  CALL section_add_keyword(section, keyword)
4631  CALL keyword_release(keyword)
4632 
4633  CALL keyword_create(keyword, __location__, name="PURGE_OFFSET", &
4634  description="See PURGE_HISTORY.", &
4635  usage="PURGE_OFFSET {int} ", default_i_val=1)
4636  CALL section_add_keyword(section, keyword)
4637  CALL keyword_release(keyword)
4638 
4639  CALL keyword_create(keyword, __location__, name="COUNTER", &
4640  description="A counter to track the total number of energy evaluations. Needed by"// &
4641  " some optimizers to print information. Useful mainly for restarts.", &
4642  usage="COUNTER {int} ", default_i_val=0)
4643  CALL section_add_keyword(section, keyword)
4644  CALL keyword_release(keyword)
4645 
4646  CALL keyword_create(keyword, __location__, name="IN_MEMORY", &
4647  description="Precompute gradients due to constraint during"// &
4648  " initial formation of constraint and store them in memory. Does"// &
4649  " nothing if forces are not calculated.", &
4650  usage="IN_MEMORY", &
4651  default_l_val=.false., lone_keyword_l_val=.true.)
4652  CALL section_add_keyword(section, keyword)
4653  CALL keyword_release(keyword)
4654 
4655  END SUBROUTINE create_cdft_control_section
4656 
4657 ! **************************************************************************************************
4658 !> \brief Creates the input section for defining Gaussian Hirshfeld CDFT constraints.
4659 !> \param section the section to create
4660 ! **************************************************************************************************
4661  SUBROUTINE create_hirshfeld_constraint_section(section)
4662  TYPE(section_type), POINTER :: section
4663 
4664  TYPE(keyword_type), POINTER :: keyword
4665 
4666  NULLIFY (keyword)
4667 
4668  cpassert(.NOT. ASSOCIATED(section))
4669  CALL section_create(section, __location__, name="HIRSHFELD_CONSTRAINT", &
4670  description="Parameters for CDFT with a Gaussian Hirshfeld constraint.", &
4671  n_keywords=11, n_subsections=0, repeats=.false.)
4672 
4673  CALL keyword_create(keyword, __location__, name="SHAPE_FUNCTION", &
4674  description="Type of shape function used for Hirshfeld partitioning.", &
4675  usage="SHAPE_FUNCTION {Gaussian,Density}", repeats=.false., n_var=1, &
4676  default_i_val=shape_function_gaussian, &
4677  enum_c_vals=s2a("GAUSSIAN", "DENSITY"), &
4678  enum_desc=s2a("One Gaussian per atom with radius determined by the keyword GAUSSIAN_SHAPE.", &
4679  "Atomic density expanded in terms of multiple Gaussians."), &
4681  CALL section_add_keyword(section, keyword)
4682  CALL keyword_release(keyword)
4683 
4684  CALL keyword_create(keyword, __location__, name="GAUSSIAN_SHAPE", &
4685  description="Specifies the type of Gaussian used for SHAPE_FUNCTION GAUSSIAN.", &
4686  usage="GAUSSIAN_SHAPE (SINGLE|VDW|COVALENT|USER)", &
4687  enum_c_vals=s2a("DEFAULT", "SINGLE", "VDW", "COVALENT", "USER"), &
4689  enum_desc=s2a("Use covalent radii (in angstrom) to construct Gaussians, but fixed"// &
4690  " 1.0_dp radius for elements with a radius larger than this value.", &
4691  "Single Gaussian for all atom types with radius given by GAUSSIAN_RADIUS.", &
4692  "Use van der Waals radii to construct Gaussians.", &
4693  "Use covalent radii to construct Gaussians.", &
4694  "Use user defined radii (keyword ATOMIC_RADII) to construct Gaussians."), &
4695  default_i_val=radius_default)
4696  CALL section_add_keyword(section, keyword)
4697  CALL keyword_release(keyword)
4698 
4699  CALL keyword_create(keyword, __location__, name="GAUSSIAN_RADIUS", &
4700  description="Radius parameter controlling the creation of Gaussians.", &
4701  usage="GAUSSIAN_RADIUS <REAL>", &
4702  unit_str="angstrom", &
4703  default_r_val=cp_unit_to_cp2k(3.0_dp, "angstrom"), &
4704  type_of_var=real_t, n_var=1)
4705  CALL section_add_keyword(section, keyword)
4706  CALL keyword_release(keyword)
4707 
4708  CALL keyword_create(keyword, __location__, name="ATOMIC_RADII", &
4709  description="Defines custom radii to setup the spherical Gaussians. "// &
4710  "Give one value per element in the same order as they "// &
4711  "appear in the input coordinates.", &
4712  usage="ATOMIC_RADII {real} {real} {real}", repeats=.false., &
4713  unit_str="angstrom", &
4714  type_of_var=real_t, n_var=-1)
4715  CALL section_add_keyword(section, keyword)
4716  CALL keyword_release(keyword)
4717 
4718  CALL keyword_create(keyword, __location__, name="USE_BOHR", &
4719  description="Convert the Gaussian radius from angstrom to bohr. This results in a larger "// &
4720  "Gaussian than without unit conversion.", &
4721  usage="CAVITY_USE_BOHR TRUE", &
4722  default_l_val=.false., lone_keyword_l_val=.true.)
4723  CALL section_add_keyword(section, keyword)
4724  CALL keyword_release(keyword)
4725 
4726  CALL keyword_create(keyword, __location__, name="PRINT_DENSITY", &
4727  description="Logical to control printing of Hirshfeld densities to .cube file.", &
4728  usage="PRINT_DENSITY TRUE", &
4729  default_l_val=.false., lone_keyword_l_val=.true.)
4730  CALL section_add_keyword(section, keyword)
4731  CALL keyword_release(keyword)
4732 
4733  CALL keyword_create(keyword, __location__, name="ATOMS_MEMORY", &
4734  description="Number of atomic gradients to store in memory.", &
4735  usage="ATOMS_MEMORY", &
4736  n_var=1, type_of_var=integer_t, &
4737  default_i_val=80)
4738  CALL section_add_keyword(section, keyword)
4739  CALL keyword_release(keyword)
4740 
4741  CALL keyword_create(keyword, __location__, name="USE_ATOMIC_CUTOFF", &
4742  description="Logical to control use of ATOMIC_CUTOFF.", &
4743  usage="USE_ATOMIC_CUTOFF TRUE", &
4744  default_l_val=.true., lone_keyword_l_val=.true.)
4745  CALL section_add_keyword(section, keyword)
4746  CALL keyword_release(keyword)
4747 
4748  CALL keyword_create(keyword, __location__, name="EPS_CUTOFF", &
4749  description="Numerical cutoff for calculation of weight function.", &
4750  usage="EPS_CUTOFF {real} ", default_r_val=1.0e-12_dp)
4751  CALL section_add_keyword(section, keyword)
4752  CALL keyword_release(keyword)
4753 
4754  CALL keyword_create(keyword, __location__, name="ATOMIC_CUTOFF", &
4755  description="Numerical cutoff for calculation of Hirshfeld densities.", &
4756  usage="ATOMIC_CUTOFF {real} ", default_r_val=1.0e-12_dp)
4757  CALL section_add_keyword(section, keyword)
4758  CALL keyword_release(keyword)
4759 
4760  END SUBROUTINE create_hirshfeld_constraint_section
4761 
4762 ! **************************************************************************************************
4763 !> \brief ...
4764 !> \param section ...
4765 ! **************************************************************************************************
4766  SUBROUTINE create_s2_restraint_section(section)
4767  TYPE(section_type), POINTER :: section
4768 
4769  TYPE(keyword_type), POINTER :: keyword
4770 
4771  NULLIFY (keyword)
4772  cpassert(.NOT. ASSOCIATED(section))
4773 
4774  CALL section_create(section, __location__, name="S2_RESTRAINT", &
4775  description="Use S2 in a re/constraint (OT only)", &
4776  n_keywords=7, n_subsections=0, repeats=.false.)
4777 
4778  CALL keyword_create(keyword, __location__, name="STRENGTH", &
4779  description="force constant of the restraint", &
4780  usage="STRENGTH {real} ", default_r_val=0.1_dp)
4781  CALL section_add_keyword(section, keyword)
4782  CALL keyword_release(keyword)
4783 
4784  CALL keyword_create(keyword, __location__, name="TARGET", &
4785  description="target value of the restraint", &
4786  usage="TARGET {real} ", default_r_val=1._dp)
4787  CALL section_add_keyword(section, keyword)
4788  CALL keyword_release(keyword)
4789 
4790  CALL keyword_create(keyword, __location__, name="FUNCTIONAL_FORM", &
4791  description="Specifies the functional form of the term added", &
4792  usage="FUNCTIONAL_FORM RESTRAINT", &
4793  enum_c_vals=s2a("RESTRAINT", "CONSTRAINT"), &
4794  enum_i_vals=(/do_s2_restraint, do_s2_constraint/), &
4795  enum_desc=s2a("Harmonic potential: s*(q-t)**2", "Constraint form: s*(q-t)"), &
4796  default_i_val=do_s2_restraint)
4797  CALL section_add_keyword(section, keyword)
4798  CALL keyword_release(keyword)
4799 
4800  END SUBROUTINE create_s2_restraint_section
4801 
4802 ! **************************************************************************************************
4803 !> \brief creates the input section for the tddfpt part
4804 !> \param section the section to create
4805 !> \author teo
4806 ! **************************************************************************************************
4807  SUBROUTINE create_tddfpt_section(section)
4808  TYPE(section_type), POINTER :: section
4809 
4810  TYPE(keyword_type), POINTER :: keyword
4811  TYPE(section_type), POINTER :: subsection
4812 
4813  cpassert(.NOT. ASSOCIATED(section))
4814  CALL section_create(section, __location__, name="tddfpt", &
4815  description="Old TDDFPT code. Use new version in CP2K_INPUT / FORCE_EVAL / PROPERTIES / TDDFPT", &
4816  n_keywords=5, n_subsections=1, repeats=.false., &
4817  citations=(/iannuzzi2005/))
4818 
4819  NULLIFY (subsection, keyword)
4820 
4821  ! Integer
4822  CALL keyword_create(keyword, __location__, name="MAX_KV", &
4823  variants=s2a("MAX_VECTORS"), &
4824  description=" maximal number of Krylov space vectors", &
4825  usage="MAX_KV someInteger>0", &
4826  n_var=1, type_of_var=integer_t, &
4827  default_i_val=60)
4828  CALL section_add_keyword(section, keyword)
4829  CALL keyword_release(keyword)
4830 
4831  CALL keyword_create(keyword, __location__, name="RESTARTS", &
4832  variants=s2a("N_RESTARTS"), &
4833  description=" maximal number subspace search restarts", &
4834  usage="RESTARTS someInteger>0", &
4835  n_var=1, type_of_var=integer_t, &
4836  default_i_val=5)
4837  CALL section_add_keyword(section, keyword)
4838  CALL keyword_release(keyword)
4839 
4840  CALL keyword_create(keyword, __location__, name="NEV", &
4841  variants=s2a("N_EV", "EV"), &
4842  description=" number of excitations to calculate", &
4843  usage="NEV someInteger>0", &
4844  n_var=1, type_of_var=integer_t, &
4845  default_i_val=1)
4846  CALL section_add_keyword(section, keyword)
4847  CALL keyword_release(keyword)
4848 
4849  CALL keyword_create(keyword, __location__, name="NLUMO", &
4850  description=" number of additional unoccupied orbitals ", &
4851  usage="NLUMO 10", &
4852  n_var=1, type_of_var=integer_t, &
4853  default_i_val=5)
4854  CALL section_add_keyword(section, keyword)
4855  CALL keyword_release(keyword)
4856 
4857  CALL keyword_create(keyword, __location__, name="NREORTHO", &
4858  variants=s2a("N_REORTHO", "REORTHO", "REORTHOGONALITAZIONS"), &
4859  description=" number of reorthogonalization steps", &
4860  usage="NREORTHO someInteger>0", &
4861  n_var=1, type_of_var=integer_t, &
4862  default_i_val=2)
4863  CALL section_add_keyword(section, keyword)
4864  CALL keyword_release(keyword)
4865 
4866  ! Logical
4867  CALL keyword_create(keyword, __location__, name="KERNEL", &
4868  variants=s2a("DO_KERNEL"), &
4869  description="compute the kernel (debug purpose only)", &
4870  usage="KERNEL logical_value", &
4871  default_l_val=.true., lone_keyword_l_val=.true.)
4872  CALL section_add_keyword(section, keyword)
4873  CALL keyword_release(keyword)
4874 
4875  CALL keyword_create(keyword, __location__, name="LSD_SINGLETS", &
4876  description="compute singlets using lsd vxc kernel", &
4877  usage="LSD_SINGLETS logical_value", &
4878  default_l_val=.false., lone_keyword_l_val=.true.)
4879  CALL section_add_keyword(section, keyword)
4880  CALL keyword_release(keyword)
4881 
4882  CALL keyword_create(keyword, __location__, name="INVERT_S", &
4883  variants=s2a("INVERT_OVERLAP"), &
4884  description="use the inverse of the overlap matrix", &
4885  usage="INVERT_S logical_value", &
4886  default_l_val=.true., lone_keyword_l_val=.true.)
4887  CALL section_add_keyword(section, keyword)
4888  CALL keyword_release(keyword)
4889 
4890  CALL keyword_create(keyword, __location__, name="PRECONDITIONER", &
4891  variants=s2a("PRECOND"), &
4892  description="use the preconditioner (only for Davidson)", &
4893  usage="PRECONDITIONER logical_value", &
4894  default_l_val=.true., lone_keyword_l_val=.true.)
4895  CALL section_add_keyword(section, keyword)
4896  CALL keyword_release(keyword)
4897 
4898  ! Character
4899  CALL keyword_create(keyword, __location__, name="RES_ETYPE", &
4900  variants=s2a("RESTRICTED_EXCITATIONS_TYPE", "RES_E_TYPE"), &
4901  description="(singlets/triplets) for restricted calculation", &
4902  usage="RES_ETYPE T", &
4903  enum_c_vals=s2a("S", "SINGLET", "SINGLETS", "T", "TRIPLET", "TRIPLETS"), &
4904  enum_i_vals=(/tddfpt_singlet, tddfpt_singlet, tddfpt_singlet, &
4906  default_i_val=tddfpt_singlet)
4907  CALL section_add_keyword(section, keyword)
4908  CALL keyword_release(keyword)
4909 
4910  CALL keyword_create(keyword, __location__, name="DIAG_METHOD", &
4911  variants=s2a("DIAGONALIZATION_METHOD", "METHOD"), &
4912  description="Diagonalization method used in tddfpt", &
4913  usage="DIAG_METHOD DAVIDSON", &
4914  enum_c_vals=s2a("DAVIDSON", "LANCZOS"), &
4915  enum_i_vals=(/tddfpt_davidson, tddfpt_lanczos/), &
4916  default_i_val=tddfpt_davidson)
4917  CALL section_add_keyword(section, keyword)
4918  CALL keyword_release(keyword)
4919 
4920  CALL keyword_create(keyword, __location__, name="OE_CORR", &
4921  variants=s2a("ORBITAL_EIGENVALUES_CORRECTION"), &
4922  description="Which type of orbital eigenvalue correction to use "// &
4923  "(to yield better HOMO-LUMO energies)", &
4924  usage="OE_CORR SAOP", &
4925  enum_c_vals=s2a("NONE", "LB", "LB_ALPHA", "LB94", "GLLB", "GLB", "SAOP", "SIC"), &
4926  enum_i_vals=(/oe_none, oe_lb, oe_lb, oe_lb, oe_gllb, oe_gllb, oe_saop, oe_sic/), &
4927  default_i_val=oe_none)
4928  CALL section_add_keyword(section, keyword)
4929  CALL keyword_release(keyword)
4930 
4931  ! Real
4932  CALL keyword_create(keyword, __location__, name="CONVERGENCE", &
4933  variants=s2a("CONV"), &
4934  description="The convergence of the eigenvalues", &
4935  usage="CONVERGENCE 1.0E-6 ", &
4936  n_var=1, type_of_var=real_t, &
4937  default_r_val=1.0e-5_dp)
4938  CALL section_add_keyword(section, keyword)
4939  CALL keyword_release(keyword)
4940 
4941  CALL create_xc_section(subsection)
4942  CALL section_add_subsection(section, subsection)
4943  CALL section_release(subsection)
4944 
4945  CALL create_sic_section(subsection)
4946  CALL section_add_subsection(section, subsection)
4947  CALL section_release(subsection)
4948 
4949  END SUBROUTINE create_tddfpt_section
4950 
4951 ! **************************************************************************************************
4952 !> \brief creates the input section for the relativistic part
4953 !> \param section the section to create
4954 !> \author jens
4955 ! **************************************************************************************************
4956  SUBROUTINE create_relativistic_section(section)
4957  TYPE(section_type), POINTER :: section
4958 
4959  TYPE(keyword_type), POINTER :: keyword
4960 
4961  cpassert(.NOT. ASSOCIATED(section))
4962  CALL section_create(section, __location__, name="relativistic", &
4963  description="parameters needed and setup for relativistic calculations", &
4964  n_keywords=5, n_subsections=0, repeats=.false.)
4965 
4966  NULLIFY (keyword)
4967 
4968  CALL keyword_create(keyword, __location__, name="method", &
4969  description="type of relativistic correction used", &
4970  usage="method (NONE|DKH|ZORA)", default_i_val=rel_none, &
4971  enum_c_vals=s2a("NONE", "DKH", "ZORA"), &
4972  enum_i_vals=(/rel_none, rel_dkh, rel_zora/), &
4973  enum_desc=s2a("Use no relativistic correction", &
4974  "Use Douglas-Kroll-Hess method", &
4975  "Use ZORA method"))
4976  CALL section_add_keyword(section, keyword)
4977  CALL keyword_release(keyword)
4978 
4979  CALL keyword_create(keyword, __location__, name="DKH_order", &
4980  description="The order of the DKH transformation ", &
4981  usage="DKH_order 2", default_i_val=2)
4982  CALL section_add_keyword(section, keyword)
4983  CALL keyword_release(keyword)
4984 
4985  CALL keyword_create(keyword, __location__, name="ZORA_type", &
4986  description="Type of ZORA method to be used", &
4987  usage="ZORA_type scMP", default_i_val=rel_zora_full, &
4988  enum_c_vals=s2a("FULL", "MP", "scMP"), &
4989  enum_desc=s2a("Full ZORA method (not implemented)", &
4990  "ZORA with atomic model potential", &
4991  "Scaled ZORA with atomic model potential"), &
4992  enum_i_vals=(/rel_zora_full, rel_zora_mp, rel_sczora_mp/))
4993  CALL section_add_keyword(section, keyword)
4994  CALL keyword_release(keyword)
4995 
4996  CALL keyword_create(keyword, __location__, name="transformation", &
4997  description="Type of DKH transformation", &
4998  usage="transformation (FULL|MOLECULE|ATOM)", default_i_val=rel_trans_atom, &
4999  enum_c_vals=s2a("FULL", "MOLECULE", "ATOM"), &
5000  enum_i_vals=(/rel_trans_full, rel_trans_molecule, rel_trans_atom/), &
5001  enum_desc=s2a("Use full matrix transformation", &
5002  "Use transformation blocked by molecule", &
5003  "Use atomic blocks"))
5004  CALL section_add_keyword(section, keyword)
5005  CALL keyword_release(keyword)
5006 
5007  CALL keyword_create(keyword, __location__, name="z_cutoff", &
5008  description="The minimal atomic number considered for atom transformation", &
5009  usage="z_cutoff 50", default_i_val=1)
5010  CALL section_add_keyword(section, keyword)
5011  CALL keyword_release(keyword)
5012 
5013  CALL keyword_create(keyword, __location__, name="potential", &
5014  description="External potential used in DKH transformation, full 1/r or erfc(r)/r", &
5015  usage="POTENTIAL {FULL,ERFC}", default_i_val=rel_pot_erfc, &
5016  enum_c_vals=s2a("FULL", "ERFC"), &
5017  enum_i_vals=(/rel_pot_full, rel_pot_erfc/))
5018  CALL section_add_keyword(section, keyword)
5019  CALL keyword_release(keyword)
5020 
5021  END SUBROUTINE create_relativistic_section
5022 
5023 ! **************************************************************************************************
5024 !> \brief creates the structure of the section with the DFT SCF parameters
5025 !> \param section will contain the SCF section
5026 !> \author fawzi
5027 ! **************************************************************************************************
5028  SUBROUTINE create_scf_section(section)
5029  TYPE(section_type), POINTER :: section
5030 
5031  TYPE(keyword_type), POINTER :: keyword
5032  TYPE(section_type), POINTER :: print_key, subsection
5033 
5034  NULLIFY (print_key)
5035 
5036  cpassert(.NOT. ASSOCIATED(section))
5037  CALL section_create(section, __location__, name="scf", &
5038  description="Parameters needed to perform an SCF run.", &
5039  n_keywords=18, n_subsections=7, repeats=.false.)
5040 
5041  NULLIFY (subsection)
5042 
5043  CALL create_ot_section(subsection)
5044  CALL section_add_subsection(section, subsection)
5045  CALL section_release(subsection)
5046 
5047  CALL create_diagonalization_section(subsection)
5048  CALL section_add_subsection(section, subsection)
5049  CALL section_release(subsection)
5050 
5051  CALL create_outer_scf_section(subsection)
5052  CALL section_add_subsection(section, subsection)
5053  CALL section_release(subsection)
5054 
5055  CALL create_smear_section(subsection)
5056  CALL section_add_subsection(section, subsection)
5057  CALL section_release(subsection)
5058 
5059  CALL create_mixing_section(subsection)
5060  CALL section_add_subsection(section, subsection)
5061  CALL section_release(subsection)
5062 
5063  CALL create_mom_section(subsection)
5064  CALL section_add_subsection(section, subsection)
5065  CALL section_release(subsection)
5066 
5067  NULLIFY (keyword)
5068 
5069  CALL keyword_create(keyword, __location__, name="MAX_ITER_LUMO", &
5070  variants=(/"MAX_ITER_LUMOS"/), &
5071  description="Maximum number of iterations for the calculation of the LUMO energies "// &
5072  "with the OT eigensolver.", &
5073  usage="MAX_ITER_LUMO 100", default_i_val=299)
5074  CALL section_add_keyword(section, keyword)
5075  CALL keyword_release(keyword)
5076 
5077  CALL keyword_create(keyword, __location__, name="EPS_LUMO", &
5078  variants=(/"EPS_LUMOS"/), &
5079  description="Target accuracy for the calculation of the LUMO energies with the OT eigensolver.", &
5080  usage="EPS_LUMO 1.0E-6", default_r_val=1.0e-5_dp)
5081  CALL section_add_keyword(section, keyword)
5082  CALL keyword_release(keyword)
5083 
5084  CALL keyword_create(keyword, __location__, name="MAX_SCF", &
5085  description="Maximum number of SCF iteration to be performed for one optimization", &
5086  usage="MAX_SCF 200", default_i_val=50)
5087  CALL section_add_keyword(section, keyword)
5088  CALL keyword_release(keyword)
5089 
5090  CALL keyword_create(keyword, __location__, name="MAX_SCF_HISTORY", variants=(/"MAX_SCF_HIST"/), &
5091  description="Maximum number of SCF iterations after the history pipeline is filled", &
5092  usage="MAX_SCF_HISTORY 1", default_i_val=0, lone_keyword_i_val=1)
5093  CALL section_add_keyword(section, keyword)
5094  CALL keyword_release(keyword)
5095 
5096  CALL keyword_create(keyword, __location__, name="MAX_DIIS", &
5097  variants=(/"MAX_DIIS_BUFFER_SIZE"/), &
5098  description="Maximum number of DIIS vectors to be used", &
5099  usage="MAX_DIIS 3", default_i_val=4)
5100  CALL section_add_keyword(section, keyword)
5101  CALL keyword_release(keyword)
5102 
5103  CALL keyword_create(keyword, __location__, name="LEVEL_SHIFT", &
5104  variants=(/"LSHIFT"/), &
5105  description="Use level shifting to improve convergence", &
5106  unit_str="au_e", &
5107  usage="LEVEL_SHIFT 0.1", &
5108  default_r_val=0.0_dp)
5109  CALL section_add_keyword(section, keyword)
5110  CALL keyword_release(keyword)
5111 
5112  CALL keyword_create(keyword, __location__, name="EPS_SCF", &
5113  description="Target accuracy for the SCF convergence.", &
5114  usage="EPS_SCF 1.e-6", default_r_val=1.e-5_dp)
5115  CALL section_add_keyword(section, keyword)
5116  CALL keyword_release(keyword)
5117 
5118  CALL keyword_create(keyword, __location__, name="EPS_SCF_HISTORY", variants=(/"EPS_SCF_HIST"/), &
5119  description="Target accuracy for the SCF convergence after the history pipeline is filled.", &
5120  usage="EPS_SCF_HISTORY 1.e-5", default_r_val=0.0_dp, lone_keyword_r_val=1.0e-5_dp)
5121  CALL section_add_keyword(section, keyword)
5122  CALL keyword_release(keyword)
5123 
5124  CALL keyword_create(keyword, __location__, name="CHOLESKY", &
5125  description="If the cholesky method should be used for computing "// &
5126  "the inverse of S, and in this case calling which Lapack routines", &
5127  usage="CHOLESKY REDUCE", default_i_val=cholesky_restore, &
5128  enum_c_vals=s2a("OFF", "REDUCE", "RESTORE", "INVERSE", "INVERSE_DBCSR"), &
5129  enum_desc=s2a("The cholesky algorithm is not used", "Reduce is called", &
5130  "Reduce is replaced by two restore", &
5131  "Restore uses operator multiply by inverse of the triangular matrix", &
5132  "Like inverse, but matrix stored as dbcsr, sparce matrix algebra used when possible"), &
5134  CALL section_add_keyword(section, keyword)
5135  CALL keyword_release(keyword)
5136 
5137  CALL keyword_create(keyword, __location__, name="EPS_EIGVAL", &
5138  description="Throw away linear combinations of basis functions with a small eigenvalue in S", &
5139  usage="EPS_EIGVAL 1.0", default_r_val=1.0e-5_dp)
5140  CALL section_add_keyword(section, keyword)
5141  CALL keyword_release(keyword)
5142 
5143  CALL keyword_create(keyword, __location__, name="EPS_DIIS", &
5144  description="Threshold on the convergence to start using DIAG/DIIS", &
5145  usage="EPS_DIIS 5.0e-2", default_r_val=0.1_dp)
5146  CALL section_add_keyword(section, keyword)
5147  CALL keyword_release(keyword)
5148 
5149  CALL keyword_create( &
5150  keyword, __location__, name="SCF_GUESS", &
5151  description="Change the initial guess for the wavefunction.", &
5152  usage="SCF_GUESS RESTART", default_i_val=atomic_guess, &
5153  enum_c_vals=s2a("ATOMIC", "RESTART", "RANDOM", "CORE", &
5154  "HISTORY_RESTART", "MOPAC", "SPARSE", "NONE"), &
5155  enum_desc=s2a("Generate an atomic density using the atomic code", &
5156  "Use the RESTART file as an initial guess (and ATOMIC if not present).", &
5157  "Use random wavefunction coefficients.", &
5158  "Diagonalize the core hamiltonian for an initial guess.", &
5159  "Extrapolated from previous RESTART files.", &
5160  "Use same guess as MOPAC for semi-empirical methods or a simple diagonal density matrix for other methods", &
5161  "Generate a sparse wavefunction using the atomic code (for OT based methods)", &
5162  "Skip initial guess (only for NON-SCC DFTB)."), &
5165  CALL section_add_keyword(section, keyword)
5166  CALL keyword_release(keyword)
5167 
5168  CALL keyword_create(keyword, __location__, name="NROW_BLOCK", &
5169  description="sets the number of rows in a scalapack block", &
5170  usage="NROW_BLOCK 31", default_i_val=32)
5171  CALL section_add_keyword(section, keyword)
5172  CALL keyword_release(keyword)
5173 
5174  CALL keyword_create(keyword, __location__, name="NCOL_BLOCK", &
5175  description="Sets the number of columns in a scalapack block", &
5176  usage="NCOL_BLOCK 31", default_i_val=32)
5177  CALL section_add_keyword(section, keyword)
5178  CALL keyword_release(keyword)
5179 
5180  CALL keyword_create(keyword, __location__, name="ADDED_MOS", &
5181  description="Number of additional MOS added for each spin. Use -1 to add all available. "// &
5182  "alpha/beta spin can be specified independently (if spin-polarized calculation requested).", &
5183  usage="ADDED_MOS", default_i_val=0, n_var=-1)
5184  CALL section_add_keyword(section, keyword)
5185  CALL keyword_release(keyword)
5186 
5187  CALL keyword_create(keyword, __location__, &
5188  name="ROKS_SCHEME", &
5189  description="Selects the ROKS scheme when ROKS is applied.", &
5190  usage="ROKS_SCHEME HIGH-SPIN", &
5191  repeats=.false., &
5192  n_var=1, &
5193  enum_c_vals=s2a("GENERAL", "HIGH-SPIN"), &
5194  enum_i_vals=(/general_roks, high_spin_roks/), &
5195  default_i_val=high_spin_roks)
5196  CALL section_add_keyword(section, keyword)
5197  CALL keyword_release(keyword)
5198 
5199  CALL keyword_create(keyword, __location__, &
5200  name="ROKS_F", &
5201  variants=(/"F_ROKS"/), &
5202  description="Allows to define the parameter f for the "// &
5203  "general ROKS scheme.", &
5204  usage="ROKS_PARAMETER 1/2", &
5205  repeats=.false., &
5206  n_var=1, &
5207  type_of_var=real_t, &
5208  default_r_val=0.5_dp)
5209  CALL section_add_keyword(section, keyword)
5210  CALL keyword_release(keyword)
5211 
5212  CALL keyword_create(keyword, __location__, &
5213  name="ROKS_PARAMETERS", &
5214  variants=(/"ROKS_PARAMETER"/), &
5215  description="Allows to define all parameters for the high-spin "// &
5216  "ROKS scheme explicitly. "// &
5217  "The full set of 6 parameters has to be specified "// &
5218  "in the order acc, bcc, aoo, boo, avv, bvv", &
5219  usage="ROKS_PARAMETERS 1/2 1/2 1/2 1/2 1/2 1/2", &
5220  repeats=.false., &
5221  n_var=6, &
5222  type_of_var=real_t, &
5223  default_r_vals=(/-0.5_dp, 1.5_dp, 0.5_dp, 0.5_dp, 1.5_dp, -0.5_dp/))
5224  CALL section_add_keyword(section, keyword)
5225  CALL keyword_release(keyword)
5226 
5227  CALL keyword_create(keyword, __location__, name="IGNORE_CONVERGENCE_FAILURE", &
5228  description="If true, only a warning is issued if an SCF "// &
5229  "iteration has not converged. By default, a run is aborted "// &
5230  "if the required convergence criteria have not been achieved.", &
5231  usage="IGNORE_CONVERGENCE_FAILURE logical_value", &
5232  default_l_val=.false., &
5233  lone_keyword_l_val=.true.)
5234  CALL section_add_keyword(section, keyword)
5235  CALL keyword_release(keyword)
5236 
5237  CALL section_create(subsection, __location__, name="PRINT", &
5238  description="Printing of information during the SCF.", repeats=.false.)
5239 
5240  CALL cp_print_key_section_create(print_key, __location__, "RESTART", &
5241  description="Controls the dumping of the MO restart file during SCF. "// &
5242  "By default keeps a short history of three restarts. "// &
5243  "See also RESTART_HISTORY", &
5244  print_level=low_print_level, common_iter_levels=3, &
5245  each_iter_names=s2a("QS_SCF"), each_iter_values=(/20/), &
5246  add_last=add_last_numeric, filename="RESTART")
5247  CALL keyword_create(keyword, __location__, name="BACKUP_COPIES", &
5248  description="Specifies the maximum number of backup copies.", &
5249  usage="BACKUP_COPIES {int}", &
5250  default_i_val=1)
5251  CALL section_add_keyword(print_key, keyword)
5252  CALL keyword_release(keyword)
5253  CALL section_add_subsection(subsection, print_key)
5254  CALL section_release(print_key)
5255 
5257  print_key, __location__, "RESTART_HISTORY", &
5258  description="Dumps unique MO restart files during the run keeping all of them.", &
5259  print_level=low_print_level, common_iter_levels=0, &
5260  each_iter_names=s2a("__ROOT__", "MD", "GEO_OPT", "ROT_OPT", "NEB", "METADYNAMICS", "QS_SCF"), &
5261  each_iter_values=(/500, 500, 500, 500, 500, 500, 500/), &
5262  filename="RESTART")
5263  CALL keyword_create(keyword, __location__, name="BACKUP_COPIES", &
5264  description="Specifies the maximum number of backup copies.", &
5265  usage="BACKUP_COPIES {int}", &
5266  default_i_val=1)
5267  CALL section_add_keyword(print_key, keyword)
5268  CALL keyword_release(keyword)
5269  CALL section_add_subsection(subsection, print_key)
5270  CALL section_release(print_key)
5271 
5272  CALL cp_print_key_section_create(print_key, __location__, "iteration_info", &
5273  description="Controls the printing of basic iteration information during the SCF.", &
5274  print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
5275  CALL keyword_create(keyword, __location__, name="time_cumul", &
5276  description="If the printkey is activated switches the printing of timings"// &
5277  " to cumulative (over the SCF).", &
5278  default_l_val=.false., lone_keyword_l_val=.true.)
5279  CALL section_add_keyword(print_key, keyword)
5280  CALL keyword_release(keyword)
5281  CALL section_add_subsection(subsection, print_key)
5282  CALL section_release(print_key)
5283 
5284  CALL cp_print_key_section_create(print_key, __location__, "program_run_info", &
5285  description="Controls the printing of basic information during the SCF.", &
5286  print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
5287  CALL section_add_subsection(subsection, print_key)
5288  CALL section_release(print_key)
5289 
5290  CALL cp_print_key_section_create(print_key, __location__, "MO_ORTHONORMALITY", &
5291  description="Controls the printing relative to the orthonormality of MOs (CT S C).", &
5292  print_level=high_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
5293  CALL section_add_subsection(subsection, print_key)
5294  CALL section_release(print_key)
5295 
5296  CALL cp_print_key_section_create(print_key, __location__, "MO_MAGNITUDE", &
5297  description="Prints the min/max eigenvalues of the overlap of the MOs without S (CT C).", &
5298  print_level=high_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
5299  CALL section_add_subsection(subsection, print_key)
5300  CALL section_release(print_key)
5301 
5302  CALL cp_print_key_section_create(print_key, __location__, "detailed_energy", &
5303  description="Controls the printing of detailed energy information.", &
5304  print_level=high_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
5305  CALL section_add_subsection(subsection, print_key)
5306  CALL section_release(print_key)
5307 
5308  CALL cp_print_key_section_create(print_key, __location__, "diis_info", &
5309  description="Controls the printing of DIIS information.", &
5310  print_level=high_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
5311  CALL section_add_subsection(subsection, print_key)
5312  CALL section_release(print_key)
5313 
5314  CALL cp_print_key_section_create(print_key, __location__, "total_densities", &
5315  description="Controls the printing of total densities.", &
5316  print_level=high_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
5317  CALL section_add_subsection(subsection, print_key)
5318  CALL section_release(print_key)
5319 
5320  CALL cp_print_key_section_create(print_key, __location__, "Lanczos", &
5321  description="Controls the printing of information on Lanczos refinement iterations.", &
5322  print_level=high_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
5323  CALL section_add_subsection(subsection, print_key)
5324  CALL section_release(print_key)
5325 
5327  print_key, __location__, "DIAG_SUB_SCF", &
5328  description="Controls the printing of information on subspace diagonalization internal loop. ", &
5329  print_level=high_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
5330  CALL section_add_subsection(subsection, print_key)
5331  CALL section_release(print_key)
5332 
5333  CALL cp_print_key_section_create(print_key, __location__, "Davidson", &
5334  description="Controls the printing of information on Davidson iterations.", &
5335  print_level=high_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
5336  CALL section_add_subsection(subsection, print_key)
5337  CALL section_release(print_key)
5338 
5339  CALL cp_print_key_section_create(print_key, __location__, "FILTER_MATRIX", &
5340  description="Controls the printing of information on Filter Matrix method.", &
5341  print_level=high_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
5342  CALL section_add_subsection(subsection, print_key)
5343  CALL section_release(print_key)
5344 
5345  CALL keyword_create(keyword, __location__, name="DM_RESTART_WRITE", &
5346  description="Write the density matrix into a binary file at the end of the SCF.", &
5347  usage="DM_RESTART_WRITE", default_l_val=.false., lone_keyword_l_val=.true.)
5348  CALL section_add_keyword(subsection, keyword)
5349  CALL keyword_release(keyword)
5350 
5351  CALL section_add_subsection(section, subsection)
5352  CALL section_release(subsection)
5353 
5354  END SUBROUTINE create_scf_section
5355 
5356 ! **************************************************************************************************
5357 !> \brief creates the KG section
5358 !> \param section ...
5359 !> \author Martin Haeufel [2012.07]
5360 ! **************************************************************************************************
5361  SUBROUTINE create_kg_section(section)
5362  TYPE(section_type), POINTER :: section
5363 
5364  TYPE(keyword_type), POINTER :: keyword
5365  TYPE(section_type), POINTER :: print_key, subsection
5366 
5367  cpassert(.NOT. ASSOCIATED(section))
5368  CALL section_create(section, __location__, name="KG_METHOD", &
5369  description="Specifies the parameters for a Kim-Gordon-like partitioning"// &
5370  " into molecular subunits", &
5371  n_keywords=0, n_subsections=1, repeats=.false., &
5372  citations=(/iannuzzi2006, brelaz1979, andermatt2016/))
5373 
5374  NULLIFY (keyword, subsection, print_key)
5375 
5376  ! add a XC section
5377  CALL create_xc_section(subsection)
5378  CALL section_add_subsection(section, subsection)
5379  CALL section_release(subsection)
5380 
5381  ! add LRI section
5382  CALL create_lrigpw_section(subsection)
5383  CALL section_add_subsection(section, subsection)
5384  CALL section_release(subsection)
5385 
5386  CALL keyword_create(keyword, __location__, name="COLORING_METHOD", &
5387  description="Which algorithm to use for coloring.", &
5388  usage="COLORING_METHOD GREEDY", &
5389  default_i_val=kg_color_dsatur, &
5390  enum_c_vals=s2a("DSATUR", "GREEDY"), &
5391  enum_desc=s2a("Maximum degree of saturation, relatively accurate", &
5392  "Greedy, fast coloring, less accurate"), &
5393  enum_i_vals=(/kg_color_dsatur, kg_color_greedy/))
5394  CALL section_add_keyword(section, keyword)
5395  CALL keyword_release(keyword)
5396 
5397  CALL keyword_create(keyword, __location__, name="TNADD_METHOD", &
5398  description="Algorithm to use for the calculation of the nonadditive kinetic energy.", &
5399  usage="TNADD_METHOD ATOMIC", &
5400  default_i_val=kg_tnadd_embed, &
5401  enum_c_vals=s2a("EMBEDDING", "RI_EMBEDDING", "ATOMIC", "NONE"), &
5402  enum_desc=s2a("Use full embedding potential (see Iannuzzi et al)", &
5403  "Use full embedding potential with RI density fitting", &
5404  "Use sum of atomic model potentials", &
5405  "Do not use kinetic energy embedding"), &
5407  CALL section_add_keyword(section, keyword)
5408  CALL keyword_release(keyword)
5409 
5410  CALL keyword_create(keyword, __location__, name="INTEGRATION_GRID", &
5411  description="Grid [small,medium,large,huge]to be used for the TNADD integration.", &
5412  usage="INTEGRATION_GRID MEDIUM", &
5413  default_c_val="MEDIUM")
5414  CALL section_add_keyword(section, keyword)
5415  CALL keyword_release(keyword)
5416 
5417  CALL section_create(subsection, __location__, name="PRINT", &
5418  description="Print section", &
5419  n_keywords=0, n_subsections=1, repeats=.false.)
5420 
5421  CALL cp_print_key_section_create(print_key, __location__, "NEIGHBOR_LISTS", &
5422  description="Controls the printing of the neighbor lists.", &
5423  print_level=low_print_level, filename="__STD_OUT__", unit_str="angstrom")
5424 
5425  CALL keyword_create(keyword, __location__, &
5426  name="SAB_ORB_FULL", &
5427  description="Activates the printing of the full orbital "// &
5428  "orbital neighbor lists.", &
5429  default_l_val=.false., &
5430  lone_keyword_l_val=.true.)
5431  CALL section_add_keyword(print_key, keyword)
5432  CALL keyword_release(keyword)
5433 
5434  CALL keyword_create(keyword, __location__, &
5435  name="SAB_ORB_MOLECULAR", &
5436  description="Activates the printing of the orbital "// &
5437  "orbital neighbor lists for molecular subsets.", &
5438  default_l_val=.false., &
5439  lone_keyword_l_val=.true.)
5440  CALL section_add_keyword(print_key, keyword)
5441  CALL keyword_release(keyword)
5442 
5443  CALL keyword_create(keyword, __location__, &
5444  name="SAC_KIN", &
5445  description="Activates the printing of the orbital "// &
5446  "atomic potential neighbor list.", &
5447  default_l_val=.false., &
5448  lone_keyword_l_val=.true.)
5449  CALL section_add_keyword(print_key, keyword)
5450  CALL keyword_release(keyword)
5451 
5452  CALL section_add_subsection(subsection, print_key)
5453  CALL section_release(print_key)
5454 
5455  CALL section_add_subsection(section, subsection)
5456  CALL section_release(subsection)
5457 
5458  END SUBROUTINE create_kg_section
5459 
5460 ! **************************************************************************************************
5461 !> \brief creates the structure of the section with SCF parameters
5462 !> controlling an other loop
5463 !> \param section will contain the SCF section
5464 !> \author Joost VandeVondele [2006.03]
5465 ! **************************************************************************************************
5466  SUBROUTINE create_outer_scf_section(section)
5467  TYPE(section_type), POINTER :: section
5468 
5469  TYPE(keyword_type), POINTER :: keyword
5470  TYPE(section_type), POINTER :: subsection
5471 
5472  cpassert(.NOT. ASSOCIATED(section))
5473  CALL section_create(section, __location__, name="OUTER_SCF", &
5474  description="parameters controlling the outer SCF loop", &
5475  n_keywords=13, n_subsections=1, repeats=.false.)
5476 
5477  NULLIFY (keyword)
5478 
5479  CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
5480  description="controls the activation of the outer SCF loop", &
5481  usage="&OUTER_SCF ON", default_l_val=.false., lone_keyword_l_val=.true.)
5482  CALL section_add_keyword(section, keyword)
5483  CALL keyword_release(keyword)
5484 
5485  ! add CDFT_OPT section
5486  NULLIFY (subsection)
5487  CALL create_cdft_opt_section(subsection)
5488  CALL section_add_subsection(section, subsection)
5489  CALL section_release(subsection)
5490 
5491  CALL keyword_create(keyword, __location__, name="TYPE", &
5492  description="Specifies which kind of outer SCF should be employed", &
5493  usage="TYPE DDAPC_CONSTRAINT ", &
5494  default_i_val=outer_scf_none, &
5495  enum_c_vals=s2a("DDAPC_CONSTRAINT", "S2_CONSTRAINT", &
5496  "BASIS_CENTER_OPT", "CDFT_CONSTRAINT", "NONE"), &
5497  enum_desc=s2a("Enforce a constraint on the DDAPC, requires the corresponding section", &
5498  "Enforce a constraint on the S2, requires the corresponding section", &
5499  "Optimize positions of basis functions, if atom types FLOATING_BASIS_CENTER "// &
5500  "are defined", &
5501  "Enforce a constraint on a generic CDFT weight population. "// &
5502  "Requires the corresponding section QS&CDFT"// &
5503  " which determines the type of weight used.", &
5504  "Do nothing in the outer loop, useful for resetting the inner loop,"), &
5507  CALL section_add_keyword(section, keyword)
5508  CALL keyword_release(keyword)
5509 
5510  CALL keyword_create(keyword, __location__, name="OPTIMIZER", &
5511  description="Method used to bring the outer loop to a stationary point", &
5512  usage="OPTIMIZER SD", &
5513  default_i_val=outer_scf_optimizer_none, &
5514  enum_c_vals=s2a("SD", "DIIS", "NONE", "BISECT", "BROYDEN", "NEWTON", "SECANT", "NEWTON_LS"), &
5515  enum_desc=s2a("Takes steps in the direction of the gradient, multiplied by step_size", &
5516  "Uses a Direct Inversion in the Iterative Subspace method", &
5517  "Do nothing, useful only with the none type", &
5518  "Bisection of the gradient, useful for difficult one dimensional cases", &
5519  "Broyden's method. Variant defined in BROYDEN_TYPE.", &
5520  "Newton's method. Only compatible with CDFT constraints.", &
5521  "Secant method. Only for one dimensional cases. See Broyden for "// &
5522  "multidimensional cases.", &
5523  "Newton's method with backtracking line search to find the optimal step size. "// &
5524  "Only compatible with CDFT constraints. Starts from the regular Newton solution "// &
5525  "and successively reduces the step size until the L2 norm of the CDFT gradient "// &
5526  "decreases or MAX_LS steps is reached. Potentially very expensive because "// &
5527  "each iteration performs a full SCF calculation."), &
5532  CALL section_add_keyword(section, keyword)
5533  CALL keyword_release(keyword)
5534 
5535  CALL keyword_create(keyword, __location__, name="BISECT_TRUST_COUNT", &
5536  description="Maximum number of times the same point will be used in bisection,"// &
5537  " a small number guards against the effect of wrongly converged states.", &
5538  usage="BISECT_TRUST_COUNT 5", default_i_val=10)
5539  CALL section_add_keyword(section, keyword)
5540  CALL keyword_release(keyword)
5541 
5542  CALL keyword_create(keyword, __location__, name="EPS_SCF", &
5543  description="The target gradient of the outer SCF variables. "// &
5544  "Notice that the EPS_SCF of the inner loop also determines "// &
5545  "the value that can be reached in the outer loop, "// &
5546  "typically EPS_SCF of the outer loop must be smaller "// &
5547  "than or equal to EPS_SCF of the inner loop.", &
5548  usage="EPS_SCF 1.0E-6 ", default_r_val=1.0e-5_dp)
5549  CALL section_add_keyword(section, keyword)
5550  CALL keyword_release(keyword)
5551 
5552  CALL keyword_create(keyword, __location__, name="DIIS_BUFFER_LENGTH", &
5553  description="Maximum number of DIIS vectors used ", &
5554  usage="DIIS_BUFFER_LENGTH 5", default_i_val=3)
5555  CALL section_add_keyword(section, keyword)
5556  CALL keyword_release(keyword)
5557 
5558  CALL keyword_create(keyword, __location__, name="EXTRAPOLATION_ORDER", &
5559  description="Number of past states used in the extrapolation of the variables during e.g. MD", &
5560  usage="EXTRAPOLATION_ORDER 5", default_i_val=3)
5561  CALL section_add_keyword(section, keyword)
5562  CALL keyword_release(keyword)
5563 
5564  CALL keyword_create(keyword, __location__, name="MAX_SCF", &
5565  description="The maximum number of outer loops ", &
5566  usage="MAX_SCF 20", default_i_val=50)
5567  CALL section_add_keyword(section, keyword)
5568  CALL keyword_release(keyword)
5569 
5570  CALL keyword_create(keyword, __location__, name="STEP_SIZE", &
5571  description="The initial step_size used in the optimizer (currently steepest descent). "// &
5572  "Note that in cases where a sadle point is sought for (constrained DFT),"// &
5573  " this can be negative. For Newton and Broyden optimizers, use a value less/higher than "// &
5574  "the default 1.0 (in absolute value, the sign is not significant) to active an under/overrelaxed "// &
5575  "optimizer.", &
5576  usage="STEP_SIZE -1.0", default_r_val=0.5_dp)
5577  CALL section_add_keyword(section, keyword)
5578  CALL keyword_release(keyword)
5579 
5580  END SUBROUTINE create_outer_scf_section
5581 
5582 ! **************************************************************************************************
5583 !> \brief Create the BSSE section for counterpoise correction
5584 !> \param section the section to create
5585 !> \author teo
5586 ! **************************************************************************************************
5587  SUBROUTINE create_bsse_section(section)
5588  TYPE(section_type), POINTER :: section
5589 
5590  TYPE(keyword_type), POINTER :: keyword
5591  TYPE(section_type), POINTER :: subsection
5592 
5593  cpassert(.NOT. ASSOCIATED(section))
5594  CALL section_create(section, __location__, name="BSSE", &
5595  description="This section is used to set up the BSSE calculation. "// &
5596  "It also requires that for each atomic kind X a kind X_ghost is present, "// &
5597  "with the GHOST keyword specified, in addition to the other required fields.", &
5598  n_keywords=3, n_subsections=1, repeats=.false.)
5599 
5600  NULLIFY (keyword, subsection)
5601  ! FRAGMENT SECTION
5602  CALL section_create(subsection, __location__, name="FRAGMENT", &
5603  description="Specify the atom number belonging to this fragment.", &
5604  n_keywords=2, n_subsections=0, repeats=.true.)
5605 
5606  CALL keyword_create(keyword, __location__, name="LIST", &
5607  description="Specifies a list of atoms.", &
5608  usage="LIST {integer} {integer} .. {integer}", &
5609  repeats=.true., n_var=-1, type_of_var=integer_t)
5610  CALL section_add_keyword(subsection, keyword)
5611  CALL keyword_release(keyword)
5612 
5613  CALL section_add_subsection(section, subsection)
5614  CALL section_release(subsection)
5615 
5616  ! CONFIGURATION SECTION
5617  CALL section_create(subsection, __location__, name="CONFIGURATION", &
5618  description="Specify additional parameters for the combinatorial configurations. "// &
5619  "Use this section to manually specify charge and multiplicity of the fragments "// &
5620  "and their combinations.", &
5621  n_keywords=2, n_subsections=0, repeats=.true.)
5622 
5623  CALL keyword_create(keyword, __location__, name="GLB_CONF", &
5624  description="Specifies the global configuration using 1 or 0 for each fragment. "// &
5625  "1 specifies the respective fragment as used, 0 as unused.", &
5626  usage="GLB_CONF {integer} {integer} .. {integer}", &
5627  n_var=-1, type_of_var=integer_t)
5628  CALL section_add_keyword(subsection, keyword)
5629  CALL keyword_release(keyword)
5630 
5631  CALL keyword_create(keyword, __location__, name="SUB_CONF", &
5632  description="Specifies the subconfiguration using 1 or 0 belonging to the global configuration. "// &
5633  "1 specifies the respective fragment as real, 0 as ghost.", &
5634  usage="SUB_CONF {integer} {integer} .. {integer}", &
5635  n_var=-1, type_of_var=integer_t)
5636  CALL section_add_keyword(subsection, keyword)
5637  CALL keyword_release(keyword)
5638 
5639  CALL keyword_create(keyword, __location__, &
5640  name="MULTIPLICITY", &
5641  variants=(/"MULTIP"/), &
5642  description="Specify for each fragment the multiplicity. Two times the total spin plus one. "// &
5643  "Specify 3 for a triplet, 4 for a quartet,and so on. Default is 1 (singlet) for an "// &
5644  "even number and 2 (doublet) for an odd number of electrons.", &
5645  usage="MULTIPLICITY 3", &
5646  default_i_val=0) ! this default value is just a flag to get the above
5647  CALL section_add_keyword(subsection, keyword)
5648  CALL keyword_release(keyword)
5649 
5650  CALL keyword_create(keyword, __location__, name="CHARGE", &
5651  description="The total charge for each fragment.", &
5652  usage="CHARGE -1", &
5653  default_i_val=0)
5654  CALL section_add_keyword(subsection, keyword)
5655  CALL keyword_release(keyword)
5656  CALL section_add_subsection(section, subsection)
5657  CALL section_release(subsection)
5658 
5659  CALL section_create(subsection, __location__, name="FRAGMENT_ENERGIES", &
5660  description="This section contains the energies of the fragments already"// &
5661  " computed. It is useful as a summary and specifically for restarting BSSE runs.", &
5662  n_keywords=2, n_subsections=0, repeats=.true.)
5663  CALL keyword_create(keyword, __location__, name="_DEFAULT_KEYWORD_", &
5664  description="The energy computed for each fragment", repeats=.true., &
5665  usage="{REAL}", type_of_var=real_t)
5666  CALL section_add_keyword(subsection, keyword)
5667  CALL keyword_release(keyword)
5668  CALL section_add_subsection(section, subsection)
5669  CALL section_release(subsection)
5670 
5671  CALL create_print_bsse_section(subsection)
5672  CALL section_add_subsection(section, subsection)
5673  CALL section_release(subsection)
5674 
5675  END SUBROUTINE create_bsse_section
5676 
5677 ! **************************************************************************************************
5678 !> \brief Create the print bsse section
5679 !> \param section the section to create
5680 !> \author teo
5681 ! **************************************************************************************************
5682  SUBROUTINE create_print_bsse_section(section)
5683  TYPE(section_type), POINTER :: section
5684 
5685  TYPE(section_type), POINTER :: print_key
5686 
5687  cpassert(.NOT. ASSOCIATED(section))
5688  CALL section_create(section, __location__, name="print", &
5689  description="Section of possible print options in BSSE code.", &
5690  n_keywords=0, n_subsections=1, repeats=.false.)
5691 
5692  NULLIFY (print_key)
5693  CALL cp_print_key_section_create(print_key, __location__, "PROGRAM_RUN_INFO", &
5694  description="Controls the printing of information regarding the run.", &
5695  print_level=low_print_level, filename="__STD_OUT__")
5696  CALL section_add_subsection(section, print_key)
5697  CALL section_release(print_key)
5698 
5699  CALL cp_print_key_section_create(print_key, __location__, "RESTART", &
5700  description="Controls the dumping of the restart file during BSSE runs. "// &
5701  "By default the restart is updated after each configuration calculation is "// &
5702  "completed.", &
5703  print_level=silent_print_level, common_iter_levels=0, &
5704  add_last=add_last_numeric, filename="")
5705  CALL section_add_subsection(section, print_key)
5706  CALL section_release(print_key)
5707 
5708  END SUBROUTINE create_print_bsse_section
5709 
5710 ! **************************************************************************************************
5711 !> \brief creates the interpolation section for the periodic QM/MM
5712 !> \param section ...
5713 !> \author tlaino
5714 ! **************************************************************************************************
5715  SUBROUTINE create_gspace_interp_section(section)
5716  TYPE(section_type), POINTER :: section
5717 
5718  TYPE(keyword_type), POINTER :: keyword
5719  TYPE(section_type), POINTER :: print_key
5720 
5721  cpassert(.NOT. ASSOCIATED(section))
5722  CALL section_create(section, __location__, name="interpolator", &
5723  description="controls the interpolation for the G-space term", &
5724  n_keywords=5, n_subsections=0, repeats=.false.)
5725 
5726  NULLIFY (keyword, print_key)
5727 
5728  CALL keyword_create(keyword, __location__, name="aint_precond", &
5729  description="the approximate inverse to use to get the starting point"// &
5730  " for the linear solver of the spline3 methods", &
5731  usage="kind spline3", &
5732  default_i_val=precond_spl3_aint, &
5733  enum_c_vals=s2a("copy", "spl3_nopbc_aint1", "spl3_nopbc_precond1", &
5734  "spl3_nopbc_aint2", "spl3_nopbc_precond2", "spl3_nopbc_precond3"), &
5735  enum_i_vals=(/no_precond, precond_spl3_aint, precond_spl3_1, &
5737  CALL section_add_keyword(section, keyword)
5738  CALL keyword_release(keyword)
5739 
5740  CALL keyword_create(keyword, __location__, name="precond", &
5741  description="The preconditioner used"// &
5742  " for the linear solver of the spline3 methods", &
5743  usage="kind spline3", &
5744  default_i_val=precond_spl3_3, &
5745  enum_c_vals=s2a("copy", "spl3_nopbc_aint1", "spl3_nopbc_precond1", &
5746  "spl3_nopbc_aint2", "spl3_nopbc_precond2", "spl3_nopbc_precond3"), &
5747  enum_i_vals=(/no_precond, precond_spl3_aint, precond_spl3_1, &
5749  CALL section_add_keyword(section, keyword)
5750  CALL keyword_release(keyword)
5751 
5752  CALL keyword_create(keyword, __location__, name="eps_x", &
5753  description="accuracy on the solution for spline3 the interpolators", &
5754  usage="eps_x 1.e-15", default_r_val=1.e-10_dp)
5755  CALL section_add_keyword(section, keyword)
5756  CALL keyword_release(keyword)
5757 
5758  CALL keyword_create(keyword, __location__, name="eps_r", &
5759  description="accuracy on the residual for spline3 the interpolators", &
5760  usage="eps_r 1.e-15", default_r_val=1.e-10_dp)
5761  CALL section_add_keyword(section, keyword)
5762  CALL keyword_release(keyword)
5763 
5764  CALL keyword_create(keyword, __location__, name="max_iter", &
5765  variants=(/'maxiter'/), &
5766  description="the maximum number of iterations", &
5767  usage="max_iter 200", default_i_val=100)
5768  CALL section_add_keyword(section, keyword)
5769  CALL keyword_release(keyword)
5770 
5771  NULLIFY (print_key)
5772  CALL cp_print_key_section_create(print_key, __location__, "conv_info", &
5773  description="if convergence information about the linear solver"// &
5774  " of the spline methods should be printed", &
5775  print_level=medium_print_level, each_iter_names=s2a("SPLINE_FIND_COEFFS"), &
5776  each_iter_values=(/10/), filename="__STD_OUT__", &
5777  add_last=add_last_numeric)
5778  CALL section_add_subsection(section, print_key)
5779  CALL section_release(print_key)
5780 
5781  END SUBROUTINE create_gspace_interp_section
5782 
5783 ! **************************************************************************************************
5784 !> \brief input section for optional parameters for LRIGPW
5785 !> LRI: local resolution of identity
5786 !> \param section the section to create
5787 !> \author Dorothea Golze [02.2015]
5788 ! **************************************************************************************************
5789  SUBROUTINE create_lrigpw_section(section)
5790  TYPE(section_type), POINTER :: section
5791 
5792  TYPE(keyword_type), POINTER :: keyword
5793 
5794  cpassert(.NOT. ASSOCIATED(section))
5795  CALL section_create(section, __location__, name="LRIGPW", &
5796  description="This section specifies optional parameters for LRIGPW.", &
5797  n_keywords=3, n_subsections=0, repeats=.false., citations=(/golze2017b/))
5798 
5799  NULLIFY (keyword)
5800 
5801  CALL keyword_create(keyword, __location__, name="LRI_OVERLAP_MATRIX", &
5802  description="Specifies whether to calculate the inverse or the "// &
5803  "pseudoinverse of the overlap matrix of the auxiliary "// &
5804  "basis set. Calculating the pseudoinverse is necessary "// &
5805  "for very large auxiliary basis sets, but more expensive. "// &
5806  "Using the pseudoinverse, consistent forces are not "// &
5807  "guaranteed yet.", &
5808  usage="LRI_OVERLAP_MATRIX INVERSE", &
5809  enum_c_vals=s2a("INVERSE", "PSEUDO_INVERSE_SVD", "PSEUDO_INVERSE_DIAG", &
5810  "AUTOSELECT"), &
5811  enum_desc=s2a("Calculate inverse of the overlap matrix.", &
5812  "Calculate the pseuodinverse of the overlap matrix "// &
5813  "using singular value decomposition.", &
5814  "Calculate the pseudoinverse of the overlap matrix "// &
5815  "by prior diagonalization.", &
5816  "Choose automatically for each pair whether to "// &
5817  "calculate the inverse or pseudoinverse based on the "// &
5818  "condition number of the overlap matrix for each pair. "// &
5819  "Calculating the pseudoinverse is much more expensive."), &
5820  enum_i_vals=(/do_lri_inv, do_lri_pseudoinv_svd, &
5822  default_i_val=do_lri_inv)
5823  CALL section_add_keyword(section, keyword)
5824  CALL keyword_release(keyword)
5825 
5826  CALL keyword_create(keyword, __location__, name="MAX_CONDITION_NUM", &
5827  description="If AUTOSELECT is chosen for LRI_OVERLAP_MATRIX, this "// &
5828  "keyword specifies that the pseudoinverse is calculated "// &
5829  "only if the LOG of the condition number of the lri "// &
5830  "overlap matrix is larger than the given value.", &
5831  usage="MAX_CONDITION_NUM 20.0", default_r_val=20.0_dp)
5832  CALL section_add_keyword(section, keyword)
5833  CALL keyword_release(keyword)
5834 
5835  CALL keyword_create(keyword, __location__, name="EPS_O3_INT", &
5836  description="Threshold for ABA and ABB integrals in LRI. "// &
5837  "This is used for screening in the KS and "// &
5838  "force calculations (tensor contractions).", &
5839  usage="EPS_O3_INT 1.e-10", default_r_val=1.0e-14_dp)
5840  CALL section_add_keyword(section, keyword)
5841  CALL keyword_release(keyword)
5842 
5843  CALL keyword_create(keyword, __location__, name="DEBUG_LRI_INTEGRALS", &
5844  description="Debug the integrals needed for LRIGPW.", &
5845  usage="DEBUG_LRI_INTEGRALS TRUE", &
5846  default_l_val=.false., lone_keyword_l_val=.true.)
5847  CALL section_add_keyword(section, keyword)
5848  CALL keyword_release(keyword)
5849 
5850  CALL keyword_create(keyword, __location__, name="EXACT_1C_TERMS", &
5851  description="Don't use LRI for one center densities.", &
5852  usage="EXACT_1C_TERMS TRUE", &
5853  default_l_val=.false., lone_keyword_l_val=.true.)
5854  CALL section_add_keyword(section, keyword)
5855  CALL keyword_release(keyword)
5856 
5857  CALL keyword_create(keyword, __location__, name="PPL_RI", &
5858  description="Use LRI/RI for local pseudopotential.", &
5859  usage="PPL_RI TRUE", &
5860  default_l_val=.false., lone_keyword_l_val=.true.)
5861  CALL section_add_keyword(section, keyword)
5862  CALL keyword_release(keyword)
5863 
5864  CALL keyword_create(keyword, __location__, name="RI_STATISTIC", &
5865  description="Print statistical information on the RI calculation.", &
5866  usage="RI_STATISTIC TRUE", &
5867  default_l_val=.false., lone_keyword_l_val=.true.)
5868  CALL section_add_keyword(section, keyword)
5869  CALL keyword_release(keyword)
5870 
5871  CALL keyword_create(keyword, __location__, name="DISTANT_PAIR_APPROXIMATION", &
5872  description="Calculate distant pairs using an independent atom approximation.", &
5873  usage="DISTANT_PAIR_APPROXIMATION TRUE", &
5874  default_l_val=.false., lone_keyword_l_val=.true.)
5875  CALL section_add_keyword(section, keyword)
5876  CALL keyword_release(keyword)
5877 
5878  CALL keyword_create(keyword, __location__, name="DISTANT_PAIR_METHOD", &
5879  description="Method used to separate pair density for distant pairs. "// &
5880  "Options: EW (equal weights); AW (atomic weights); SW (set weights); "// &
5881  "LW (shell function weights)", &
5882  usage="DISTANT_PAIR_METHOD {method}", &
5883  default_c_val="LW")
5884  CALL section_add_keyword(section, keyword)
5885  CALL keyword_release(keyword)
5886 
5887  CALL keyword_create(keyword, __location__, name="DISTANT_PAIR_RADII", &
5888  description="Inner and outer radii used in distant "// &
5889  "pair separation. Smooth interpolation between inner and outer "// &
5890  "radius is used.", &
5891  usage="DISTANT_PAIR_RADII r_inner {real} r_outer {real} ", &
5892  n_var=2, default_r_vals=(/8._dp, 12._dp/), unit_str='bohr', &
5893  type_of_var=real_t)
5894  CALL section_add_keyword(section, keyword)
5895  CALL keyword_release(keyword)
5896 
5897  CALL keyword_create(keyword, __location__, name="SHG_LRI_INTEGRALS", &
5898  description="Uses the SHG (solid harmonic Gaussian) integral "// &
5899  "scheme instead of Obara-Saika", &
5900  usage="SHG_LRI_INTEGRALS TRUE", &
5901  default_l_val=.true., lone_keyword_l_val=.true., &
5902  citations=(/golze2017a/))
5903  CALL section_add_keyword(section, keyword)
5904  CALL keyword_release(keyword)
5905 
5906  CALL keyword_create(keyword, __location__, name="RI_SINV", &
5907  description="Approximation to be used for the inverse of the "// &
5908  "RI overlap matrix. INVF, INVS: exact inverse, apply directly "// &
5909  "for solver (F:full matrix, S:sparsematrix). AINV approximate inverse, use with PCG. "// &
5910  "NONE: no approximation used with CG solver.", &
5911  usage="RI_SINV NONE", default_c_val="INVF")
5912  CALL section_add_keyword(section, keyword)
5913  CALL keyword_release(keyword)
5914 
5915  END SUBROUTINE create_lrigpw_section
5916 
5917 ! **************************************************************************************************
5918 !> \brief input section for optimization of the auxililary basis for LRIGPW
5919 !> \param section the section to create
5920 !> \author Dorothea Golze [05.2014]
5921 ! **************************************************************************************************
5922  SUBROUTINE create_optimize_lri_basis_section(section)
5923  TYPE(section_type), POINTER :: section
5924 
5925  TYPE(keyword_type), POINTER :: keyword
5926  TYPE(section_type), POINTER :: subsection
5927 
5928  cpassert(.NOT. ASSOCIATED(section))
5929  CALL section_create(section, __location__, name="OPTIMIZE_LRI_BASIS", &
5930  description="This section specifies the parameters for optimizing "// &
5931  "the lri auxiliary basis sets for LRIGPW. The Powell optimizer is used.", &
5932  n_keywords=1, n_subsections=0, repeats=.false.)
5933 
5934  NULLIFY (keyword, subsection)
5935 
5936  CALL keyword_create(keyword, __location__, name="ACCURACY", &
5937  description="Target accuracy for the objective function (RHOEND)", &
5938  usage="ACCURACY 5.0E-4", default_r_val=1.0e-5_dp)
5939  CALL section_add_keyword(section, keyword)
5940  CALL keyword_release(keyword)
5941 
5942  CALL keyword_create(keyword, __location__, name="MAX_FUN", &
5943  description="Maximum number of function evaluations", &
5944  usage="MAX_FUN 200", default_i_val=4000)
5945  CALL section_add_keyword(section, keyword)
5946  CALL keyword_release(keyword)
5947 
5948  CALL keyword_create(keyword, __location__, name="STEP_SIZE", &
5949  description="Initial step size for search algorithm (RHOBEG)", &
5950  usage="STEP_SIZE 1.0E-1", default_r_val=5.0e-2_dp)
5951  CALL section_add_keyword(section, keyword)
5952  CALL keyword_release(keyword)
5953 
5954  CALL keyword_create(keyword, __location__, name="CONDITION_WEIGHT", &
5955  description="This keyword allows to give different weight "// &
5956  "factors to the condition number (LOG(cond) is used).", &
5957  usage="CONDITION_WEIGHT 1.0E-4", default_r_val=1.0e-6_dp)
5958  CALL section_add_keyword(section, keyword)
5959  CALL keyword_release(keyword)
5960 
5961  CALL keyword_create(keyword, __location__, name="USE_CONDITION_NUMBER", &
5962  description="Determines whether condition number should be part "// &
5963  "of optimization or not", &
5964  usage="USE_CONDITION_NUMBER", &
5965  default_l_val=.false., lone_keyword_l_val=.true.)
5966  CALL section_add_keyword(section, keyword)
5967  CALL keyword_release(keyword)
5968 
5969  CALL keyword_create(keyword, __location__, name="GEOMETRIC_SEQUENCE", &
5970  description="Exponents are assumed to be a geometric sequence. "// &
5971  "Only the minimal and maximal exponents of one set are optimized and "// &
5972  "the other exponents are obtained by geometric progression.", &
5973  usage="GEOMETRIC_SEQUENCE", &
5974  default_l_val=.false., lone_keyword_l_val=.true.)
5975  CALL section_add_keyword(section, keyword)
5976  CALL keyword_release(keyword)
5977 
5978  CALL keyword_create(keyword, __location__, name="DEGREES_OF_FREEDOM", &
5979  description="Specifies the degrees of freedom in the basis "// &
5980  "optimization.", &
5981  usage="DEGREES_OF_FREEDOM ALL", &
5982  enum_c_vals=s2a("ALL", "COEFFICIENTS", "EXPONENTS"), &
5983  enum_desc=s2a("Set all parameters in the basis to be variable.", &
5984  "Set all coefficients in the basis set to be variable.", &
5985  "Set all exponents in the basis to be variable."), &
5986  enum_i_vals=(/do_lri_opt_all, do_lri_opt_coeff, do_lri_opt_exps/), &
5987  default_i_val=do_lri_opt_exps)
5988  CALL section_add_keyword(section, keyword)
5989  CALL keyword_release(keyword)
5990 
5991  CALL create_constrain_exponents_section(subsection)
5992  CALL section_add_subsection(section, subsection)
5993  CALL section_release(subsection)
5994 
5995  END SUBROUTINE create_optimize_lri_basis_section
5996 
5997 ! **************************************************************************************************
5998 !> \brief Input for DFT embedding
5999 !> \param section ...
6000 !> \author Vladimir Rybkin [08.2017]
6001 ! **************************************************************************************************
6002  SUBROUTINE create_optimize_embed(section)
6003  TYPE(section_type), POINTER :: section
6004 
6005  TYPE(keyword_type), POINTER :: keyword
6006 
6007  cpassert(.NOT. ASSOCIATED(section))
6008  CALL section_create(section, __location__, name="OPT_EMBED", &
6009  description="This section specifies optional parameters for DFT embedding potential optimization.", &
6010  n_keywords=19, n_subsections=4, repeats=.false.)
6011 
6012  NULLIFY (keyword)
6013 
6014  CALL keyword_create(keyword, __location__, name="REG_LAMBDA", &
6015  description="Parameter for Yang's regularization "// &
6016  "involving kinetic matrix.", &
6017  usage="REG_LAMBDA 0.0001", default_r_val=0.0001_dp)
6018  CALL section_add_keyword(section, keyword)
6019  CALL keyword_release(keyword)
6020 
6021  CALL keyword_create(keyword, __location__, name="N_ITER", &
6022  description="Maximum number of iterations "// &
6023  "in the optimization procedure.", &
6024  usage="N_ITER 75", default_i_val=50)
6025  CALL section_add_keyword(section, keyword)
6026  CALL keyword_release(keyword)
6027 
6028  CALL keyword_create(keyword, __location__, name="TRUST_RAD", &
6029  description="Maximum number of iterations "// &
6030  "in the optimization procedure.", &
6031  usage="TRUST_RAD 0.5", default_r_val=0.5_dp)
6032  CALL section_add_keyword(section, keyword)
6033  CALL keyword_release(keyword)
6034 
6035  CALL keyword_create(keyword, __location__, name="DENS_CONV_MAX", &
6036  description="Convergence criterion for "// &
6037  "the maximum electron density difference.", &
6038  usage="DENS_CONV_MAX 0.01", default_r_val=0.01_dp)
6039  CALL section_add_keyword(section, keyword)
6040  CALL keyword_release(keyword)
6041 
6042  CALL keyword_create(keyword, __location__, name="DENS_CONV_INT", &
6043  description="Convergence criterion for "// &
6044  "the integrated electron density difference.", &
6045  usage="DENS_CONV_INT 0.1", default_r_val=0.1_dp)
6046  CALL section_add_keyword(section, keyword)
6047  CALL keyword_release(keyword)
6048 
6049  CALL keyword_create(keyword, __location__, name="SPIN_DENS_CONV_MAX", &
6050  description="Convergence criterion for "// &
6051  "the maximum electron density difference.", &
6052  usage="DENS_CONV_MAX 0.01", default_r_val=0.01_dp)
6053  CALL section_add_keyword(section, keyword)
6054  CALL keyword_release(keyword)
6055 
6056  CALL keyword_create(keyword, __location__, name="SPIN_DENS_CONV_INT", &
6057  description="Convergence criterion for "// &
6058  "the integrated electron density difference.", &
6059  usage="DENS_CONV_INT 0.1", default_r_val=0.1_dp)
6060  CALL section_add_keyword(section, keyword)
6061  CALL keyword_release(keyword)
6062 
6063  CALL keyword_create(keyword, __location__, name="OPTIMIZER", &
6064  description="Optimize embedding potential.", &
6065  usage="OPTIMIZER LEVEL_SHIFT", &
6066  default_i_val=embed_steep_desc, &
6067  enum_c_vals=s2a("STEEPEST_DESCENT", "QUASI_NEWTON", "LEVEL_SHIFT"), &
6068  enum_desc=s2a("Steepest descent.", "Quasi-Newton.", "Level shift."), &
6070  CALL section_add_keyword(section, keyword)
6071  CALL keyword_release(keyword)
6072 
6073  CALL keyword_create(keyword, __location__, name="GRID_OPT", &
6074  description="Optimize embedding potential on the grid. ", &
6075  usage="GRID_OPT .TRUE.", &
6076  default_l_val=.true.)
6077  CALL section_add_keyword(section, keyword)
6078  CALL keyword_release(keyword)
6079 
6080  CALL keyword_create(keyword, __location__, name="LEEUWEN-BAERENDS", &
6081  description="Van Leeuwen-Baerends iterative update. Alternative to Wu-Yang "// &
6082  "optimizer. Use only with ADD_CONTST_POT.", &
6083  usage="LEEUWEN-BAERENDS .TRUE.", &
6084  default_l_val=.false.)
6085  CALL section_add_keyword(section, keyword)
6086  CALL keyword_release(keyword)
6087 
6088  CALL keyword_create(keyword, __location__, name="FAB", &
6089  description="Finzel-Ayers-Bultinck iterative update. Generally, not reliable. ", &
6090  usage="FAB .TRUE.", &
6091  default_l_val=.false.)
6092  CALL section_add_keyword(section, keyword)
6093  CALL keyword_release(keyword)
6094 
6095  CALL keyword_create(keyword, __location__, name="VW_CUTOFF", &
6096  description="Cutoff for von Weizsacker potential in "// &
6097  "the FAB optimization procedure.", &
6098  usage="VW_CUTOFF 0.01", default_r_val=0.01_dp)
6099  CALL section_add_keyword(section, keyword)
6100  CALL keyword_release(keyword)
6101 
6102  CALL keyword_create(keyword, __location__, name="VW_SMOOTH_CUT_RANGE", &
6103  description="Smooth cutoff range for von Weizsacker potential in "// &
6104  "the FAB optimization procedure.", &
6105  usage="VW_CUTOFF 1.0", default_r_val=1.0_dp)
6106  CALL section_add_keyword(section, keyword)
6107  CALL keyword_release(keyword)
6108 
6109  CALL keyword_create(keyword, __location__, name="POT_GUESS", &
6110  description="Specifies the guess of the embedding "// &
6111  "potential. For optimization in finite basis (not grid optimization) "// &
6112  "in is a constant part to be added to the one in finite basis. ", &
6113  usage="DEGREES_OF_FREEDOM ALL", &
6114  enum_c_vals=s2a("NONE", "DIFF", "Fermi_Amaldi", "RESP"), &
6115  enum_desc=s2a("Initial guess is zero grid.", &
6116  "Initial density difference. A euristic but working approach.", &
6117  "Fermi-Amaldi potential. More rigorous than DIFF, although less efficient.", &
6118  "Coulomb interaction between the subsystem using RESP charges)"// &
6119  " on the total system."), &
6120  enum_i_vals=(/embed_none, embed_diff, embed_fa, embed_resp/), &
6121  default_i_val=embed_none)
6122  CALL section_add_keyword(section, keyword)
6123  CALL keyword_release(keyword)
6124 
6125  CALL keyword_create(keyword, __location__, name="CHARGE_DISTR_WIDTH", &
6126  description="Width of the Gaussian representing "// &
6127  "point charges. To be used with ADD_COULOMB_POT.", &
6128  usage="CHARGE_DISTR_WIDTH 3.000", default_r_val=1.12490_dp)
6129  CALL section_add_keyword(section, keyword)
6130  CALL keyword_release(keyword)
6131 
6132  CALL keyword_create(keyword, __location__, name="READ_EMBED_POT", &
6133  description="Read the embedding potential "// &
6134  "restart vector as a guess.", &
6135  usage="READ_EMBED_POT .FALSE.", default_l_val=.false.)
6136  CALL section_add_keyword(section, keyword)
6137  CALL keyword_release(keyword)
6138 
6139  CALL keyword_create(keyword, __location__, name="READ_EMBED_POT_CUBE", &
6140  description="Read the embedding potential "// &
6141  "(restart) from the cube file.", &
6142  usage="READ_EMBED_POT_CUBE .FALSE.", default_l_val=.false.)
6143  CALL section_add_keyword(section, keyword)
6144  CALL keyword_release(keyword)
6145 
6146  CALL keyword_create(keyword, __location__, name="EMBED_RESTART_FILE_NAME", &
6147  description="Root of the file name where to read the embedding "// &
6148  "potential guess.", &
6149  usage="EMBED_RESTART_FILE_NAME <FILENAME>", &
6150  type_of_var=lchar_t)
6151  CALL section_add_keyword(section, keyword)
6152  CALL keyword_release(keyword)
6153 
6154  CALL keyword_create(keyword, __location__, name="EMBED_CUBE_FILE_NAME", &
6155  description="Root of the file name where to read the embedding "// &
6156  "potential (guess) as a cube.", &
6157  usage="EMBED_CUBE_FILE_NAME <FILENAME>", &
6158  type_of_var=lchar_t)
6159  CALL section_add_keyword(section, keyword)
6160  CALL keyword_release(keyword)
6161 
6162  CALL keyword_create(keyword, __location__, name="EMBED_SPIN_CUBE_FILE_NAME", &
6163  description="Root of the file name where to read the spin part "// &
6164  "of the embedding potential (guess) as a cube.", &
6165  usage="EMBED_SPIN_CUBE_FILE_NAME <FILENAME>", &
6166  type_of_var=lchar_t)
6167  CALL section_add_keyword(section, keyword)
6168  CALL keyword_release(keyword)
6169 
6170  CALL create_print_embed_diff(section)
6171 
6172  CALL create_print_embed_pot_cube(section)
6173 
6174  CALL create_print_embed_restart_vec(section)
6175 
6176  CALL create_print_simple_grid(section)
6177 
6178  END SUBROUTINE create_optimize_embed
6179 
6180 ! **************************************************************************************************
6181 !> \brief Input for density matrix functional embedding, DMFET
6182 !> \param section ...
6183 !> \author Vladimir Rybkin [08.2018]
6184 ! **************************************************************************************************
6185  SUBROUTINE create_optimize_dmfet(section)
6186  TYPE(section_type), POINTER :: section
6187 
6188  TYPE(keyword_type), POINTER :: keyword
6189 
6190  cpassert(.NOT. ASSOCIATED(section))
6191  CALL section_create(section, __location__, name="OPT_DMFET", &
6192  description="This section specifies optional parameters for DMFET matrix potential optimization.", &
6193  n_keywords=8, n_subsections=4, repeats=.false.)
6194 
6195  NULLIFY (keyword)
6196 
6197  CALL keyword_create(keyword, __location__, name="N_ITER", &
6198  description="Maximum number of iterations "// &
6199  "in the optimization procedure.", &
6200  usage="N_ITER 75", default_i_val=50)
6201  CALL section_add_keyword(section, keyword)
6202  CALL keyword_release(keyword)
6203 
6204  CALL keyword_create(keyword, __location__, name="TRUST_RAD", &
6205  description="Step length "// &
6206  "in the optimization procedure.", &
6207  usage="TRUST_RAD 0.5", default_r_val=0.5_dp)
6208  CALL section_add_keyword(section, keyword)
6209  CALL keyword_release(keyword)
6210 
6211  CALL keyword_create(keyword, __location__, name="DM_CONV_MAX", &
6212  description="Convergence criterion for "// &
6213  "the maximum element of density matrix difference.", &
6214  usage="DM_CONV_MAX 0.01", default_r_val=0.01_dp)
6215  CALL section_add_keyword(section, keyword)
6216  CALL keyword_release(keyword)
6217 
6218  CALL keyword_create(keyword, __location__, name="DM_CONV_INT", &
6219  description="Convergence criterion for "// &
6220  "the total density matrix difference.", &
6221  usage="DM_CONV_INT 0.1", default_r_val=0.1_dp)
6222  CALL section_add_keyword(section, keyword)
6223  CALL keyword_release(keyword)
6224 
6225  CALL keyword_create(keyword, __location__, name="BETA_DM_CONV_MAX", &
6226  description="Convergence criterion for "// &
6227  "the maximum element of the beta-spin density "// &
6228  "matrix difference.", &
6229  usage="DM_CONV_MAX 0.01", default_r_val=0.01_dp)
6230  CALL section_add_keyword(section, keyword)
6231  CALL keyword_release(keyword)
6232 
6233  CALL keyword_create(keyword, __location__, name="BETA_DM_CONV_INT", &
6234  description="Convergence criterion for "// &
6235  "the total beta-spin density matrix difference.", &
6236  usage="DM_CONV_INT 0.1", default_r_val=0.1_dp)
6237  CALL section_add_keyword(section, keyword)
6238  CALL keyword_release(keyword)
6239 
6240  CALL keyword_create(keyword, __location__, name="READ_DMFET_POT", &
6241  description="Read the matrix embedding potential "// &
6242  "(restart) from the cube file.", &
6243  usage="READ_DMFET_POT .FALSE.", default_l_val=.false.)
6244  CALL section_add_keyword(section, keyword)
6245  CALL keyword_release(keyword)
6246 
6247  CALL keyword_create(keyword, __location__, name="DMFET_RESTART_FILE_NAME", &
6248  description="Root of the file name where to read the matrix "// &
6249  "potential guess.", &
6250  usage="DMFET_RESTART_FILE_NAME <FILENAME>", &
6251  type_of_var=lchar_t)
6252  CALL section_add_keyword(section, keyword)
6253  CALL keyword_release(keyword)
6254 
6255  END SUBROUTINE create_optimize_dmfet
6256 
6257 ! **************************************************************************************************
6258 !> \brief ...
6259 !> \param section ...
6260 ! **************************************************************************************************
6261  SUBROUTINE create_print_embed_diff(section)
6262  TYPE(section_type), POINTER :: section
6263 
6264  TYPE(keyword_type), POINTER :: keyword
6265  TYPE(section_type), POINTER :: print_key
6266 
6267  NULLIFY (print_key, keyword)
6268  CALL cp_print_key_section_create(print_key, __location__, "EMBED_DENS_DIFF", &
6269  description="Controls the printing of cube files with "// &
6270  "embedding densisty differences", &
6271  print_level=high_print_level, add_last=add_last_numeric, filename="")
6272  CALL keyword_create(keyword, __location__, name="stride", &
6273  description="The stride (X,Y,Z) used to write the cube file "// &
6274  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
6275  " 1 number valid for all components.", &
6276  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
6277  CALL section_add_keyword(print_key, keyword)
6278  CALL keyword_release(keyword)
6279 
6280  CALL section_add_subsection(section, print_key)
6281  CALL section_release(print_key)
6282 
6283  END SUBROUTINE create_print_embed_diff
6284 
6285 ! **************************************************************************************************
6286 !> \brief ...
6287 !> \param section ...
6288 ! **************************************************************************************************
6289  SUBROUTINE create_print_embed_pot_cube(section)
6290  TYPE(section_type), POINTER :: section
6291 
6292  TYPE(keyword_type), POINTER :: keyword
6293  TYPE(section_type), POINTER :: print_key
6294 
6295  NULLIFY (print_key, keyword)
6296  CALL cp_print_key_section_create(print_key, __location__, "EMBED_POT_CUBE", &
6297  description="Controls the printing of cube files with "// &
6298  "with embedding potential", &
6299  print_level=high_print_level, add_last=add_last_numeric, filename="")
6300  CALL keyword_create(keyword, __location__, name="stride", &
6301  description="The stride (X,Y,Z) used to write the cube file "// &
6302  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
6303  " 1 number valid for all components.", &
6304  usage="STRIDE 1 1 1", n_var=-1, default_i_vals=(/1, 1, 1/), type_of_var=integer_t)
6305  CALL section_add_keyword(print_key, keyword)
6306  CALL keyword_release(keyword)
6307 
6308  CALL section_add_subsection(section, print_key)
6309  CALL section_release(print_key)
6310 
6311  END SUBROUTINE create_print_embed_pot_cube
6312 
6313 ! **************************************************************************************************
6314 !> \brief ...
6315 !> \param section ...
6316 ! **************************************************************************************************
6317  SUBROUTINE create_print_embed_restart_vec(section)
6318  TYPE(section_type), POINTER :: section
6319 
6320  TYPE(section_type), POINTER :: print_key
6321 
6322  NULLIFY (print_key)
6323  CALL cp_print_key_section_create(print_key, __location__, "EMBED_POT_VECTOR", &
6324  description="Controls the printing of cube files with "// &
6325  "with embedding potential", &
6326  print_level=silent_print_level, add_last=add_last_numeric, filename="")
6327  CALL section_add_subsection(section, print_key)
6328  CALL section_release(print_key)
6329 
6330  END SUBROUTINE create_print_embed_restart_vec
6331 
6332 ! **************************************************************************************************
6333 !> \brief ...
6334 !> \param section ...
6335 ! **************************************************************************************************
6336  SUBROUTINE create_print_simple_grid(section)
6337  TYPE(section_type), POINTER :: section
6338 
6339  TYPE(keyword_type), POINTER :: keyword
6340  TYPE(section_type), POINTER :: print_key
6341 
6342  NULLIFY (print_key, keyword)
6343  CALL cp_print_key_section_create(print_key, __location__, "WRITE_SIMPLE_GRID", &
6344  description="Controls the printing of simple grid "// &
6345  "files with embedding potential: X Y Z value", &
6346  print_level=high_print_level, add_last=add_last_numeric, filename="")
6347 
6348  CALL keyword_create(keyword, __location__, name="STRIDE", &
6349  description="The stride (X,Y,Z) used to write the cube file "// &
6350  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
6351  " 1 number valid for all components.", &
6352  usage="STRIDE 1 1 1", n_var=-1, default_i_vals=(/1, 1, 1/), type_of_var=integer_t)
6353  CALL section_add_keyword(print_key, keyword)
6354  CALL keyword_release(keyword)
6355 
6356  CALL keyword_create(keyword, __location__, name="UNITS", &
6357  description="Units of the volumetric file: Angstrom or Bohr.", &
6358  usage="UNITS BOHR", &
6359  default_i_val=embed_grid_bohr, &
6360  enum_c_vals=s2a("BOHR", "ANGSTROM"), &
6361  enum_desc=s2a("Atomic units: Bohr", "Metric units: Angstrom."), &
6362  enum_i_vals=(/embed_grid_bohr, embed_grid_angstrom/))
6363  CALL section_add_keyword(print_key, keyword)
6364  CALL keyword_release(keyword)
6365 
6366  CALL keyword_create(keyword, __location__, name="FOLD_COORD", &
6367  description="Activates printing folded coordinates corresponding "// &
6368  "to the simple grid. Used as input for external programs.", &
6369  usage="FOLD_COORD .TRUE.", n_var=1, type_of_var=logical_t, &
6370  default_l_val=.true., lone_keyword_l_val=.true.)
6371  CALL section_add_keyword(print_key, keyword)
6372 
6373  CALL keyword_release(keyword)
6374  CALL section_add_subsection(section, print_key)
6375  CALL section_release(print_key)
6376 
6377  END SUBROUTINE create_print_simple_grid
6378 
6379 ! **************************************************************************************************
6380 !> \brief input section for optional parameters for RIGPW
6381 !> \param section the section to create
6382 !> \author JGH [06.2017]
6383 ! **************************************************************************************************
6384  SUBROUTINE create_rigpw_section(section)
6385  TYPE(section_type), POINTER :: section
6386 
6387  cpassert(.NOT. ASSOCIATED(section))
6388  CALL section_create(section, __location__, name="RIGPW", &
6389  description="This section specifies optional parameters for RIGPW.", &
6390  n_keywords=1, n_subsections=0, repeats=.false.)
6391 
6392 ! CALL keyword_create(keyword, __LOCATION__, name="RI_OVERLAP_MATRIX", &
6393 ! description="Specifies whether to calculate the inverse or the "// &
6394 ! "pseudoinverse of the overlap matrix of the auxiliary "// &
6395 ! "basis set. Calculating the pseudoinverse is necessary "// &
6396 ! "for very large auxiliary basis sets, but more expensive. "// &
6397 ! "Using the pseudoinverse, consistent forces are not "// &
6398 ! "guaranteed yet.", &
6399 ! usage="RI_OVERLAP_MATRIX INVERSE", &
6400 ! enum_c_vals=s2a("INVERSE", "PSEUDO_INVERSE_SVD", "PSEUDO_INVERSE_DIAG", &
6401 ! "AUTOSELECT"), &
6402 ! enum_desc=s2a("Calculate inverse of the overlap matrix.", &
6403 ! "Calculate the pseuodinverse of the overlap matrix "// &
6404 ! "using singular value decomposition.", &
6405 ! "Calculate the pseudoinverse of the overlap matrix "// &
6406 ! "by prior diagonalization.", &
6407 ! "Choose automatically for each pair whether to "// &
6408 ! "calculate the inverse or pseudoinverse based on the "// &
6409 ! "condition number of the overlap matrix for each pair. "// &
6410 ! "Calculating the pseudoinverse is much more expensive."), &
6411 ! enum_i_vals=(/do_lri_inv, do_lri_pseudoinv_svd, &
6412 ! do_lri_pseudoinv_diag, do_lri_inv_auto/), &
6413 ! default_i_val=do_lri_inv)
6414 ! CALL section_add_keyword(section, keyword)
6415 ! CALL keyword_release(keyword)
6416 
6417  END SUBROUTINE create_rigpw_section
6418 
6419 ! **************************************************************************************************
6420 !> \brief input section for constraints for auxiliary basis set optimization
6421 !> \param section the section to create
6422 !> \author Dorothea Golze [11.2014]
6423 ! **************************************************************************************************
6424  SUBROUTINE create_constrain_exponents_section(section)
6425  TYPE(section_type), POINTER :: section
6426 
6427  TYPE(keyword_type), POINTER :: keyword
6428 
6429  CALL section_create(section, __location__, name="CONSTRAIN_EXPONENTS", &
6430  description="specifies constraints for the exponents of the "// &
6431  "lri auxiliary basis sets in the optimization.", &
6432  n_keywords=1, n_subsections=0, repeats=.false.)
6433 
6434  NULLIFY (keyword)
6435 
6436  CALL keyword_create(keyword, __location__, name="SCALE", &
6437  description="Defines the upper and lower boundaries as "// &
6438  "(1+scale)*exp and (1-scale)*exp. Fermi-like constraint "// &
6439  "function", &
6440  usage="SCALE 0.3", default_r_val=0.3_dp)
6441  CALL section_add_keyword(section, keyword)
6442  CALL keyword_release(keyword)
6443 
6444  CALL keyword_create(keyword, __location__, name="FERMI_EXP", &
6445  description="Exponent in the fermi-like constraint function. ", &
6446  usage="FERMI_EXP 2.63", default_r_val=2.63391_dp)
6447  CALL section_add_keyword(section, keyword)
6448  CALL keyword_release(keyword)
6449 
6450  END SUBROUTINE create_constrain_exponents_section
6451 
6452 ! **************************************************************************************************
6453 !> \brief creates the multigrid
6454 !> \param section input section to create
6455 !> \param create_subsections indicates whether or not subsections INTERPOLATOR and RS_GRID
6456 !> should be created
6457 !> \author fawzi
6458 ! **************************************************************************************************
6459  SUBROUTINE create_mgrid_section(section, create_subsections)
6460  TYPE(section_type), POINTER :: section
6461  LOGICAL, INTENT(in) :: create_subsections
6462 
6463  TYPE(keyword_type), POINTER :: keyword
6464  TYPE(section_type), POINTER :: subsection
6465 
6466  cpassert(.NOT. ASSOCIATED(section))
6467  CALL section_create(section, __location__, name="mgrid", &
6468  description="multigrid information", &
6469  n_keywords=5, n_subsections=1, repeats=.false.)
6470  NULLIFY (keyword)
6471  CALL keyword_create(keyword, __location__, name="NGRIDS", &
6472  description="The number of multigrids to use", &
6473  usage="ngrids 1", default_i_val=4)
6474  CALL section_add_keyword(section, keyword)
6475  CALL keyword_release(keyword)
6476 
6477  CALL keyword_create(keyword, __location__, name="cutoff", &
6478  description="The cutoff of the finest grid level. Default value for "// &
6479  "SE or DFTB calculation is 1.0 [Ry].", &
6480  usage="cutoff 300", default_r_val=cp_unit_to_cp2k(value=280.0_dp, &
6481  unit_str="Ry"), n_var=1, unit_str="Ry")
6482  CALL section_add_keyword(section, keyword)
6483  CALL keyword_release(keyword)
6484 
6485  CALL keyword_create(keyword, __location__, name="progression_factor", &
6486  description="Factor used to find the cutoff of the multigrids that"// &
6487  " where not given explicitly", &
6488  usage="progression_factor <integer>", default_r_val=3._dp)
6489  CALL section_add_keyword(section, keyword)
6490  CALL keyword_release(keyword)
6491 
6492  CALL keyword_create(keyword, __location__, name="commensurate", &
6493  description="If the grids should be commensurate. If true overrides "// &
6494  "the progression factor and the cutoffs of the sub grids", &
6495  usage="commensurate", default_l_val=.false., &
6496  lone_keyword_l_val=.true.)
6497  CALL section_add_keyword(section, keyword)
6498  CALL keyword_release(keyword)
6499 
6500  CALL keyword_create(keyword, __location__, name="realspace", &
6501  description="If both rho and rho_gspace are needed ", &
6502  usage="realspace", default_l_val=.false., &
6503  lone_keyword_l_val=.true.)
6504  CALL section_add_keyword(section, keyword)
6505  CALL keyword_release(keyword)
6506 
6507  CALL keyword_create(keyword, __location__, name="REL_CUTOFF", &
6508  variants=(/"RELATIVE_CUTOFF"/), &
6509  description="Determines the grid at which a Gaussian is mapped,"// &
6510  " giving the cutoff used for a gaussian with alpha=1."// &
6511  " A value 50+-10Ry might be required for highly accurate results,"// &
6512  " Or for simulations with a variable cell."// &
6513  " Versions prior to 2.3 used a default of 30Ry.", &
6514  usage="RELATIVE_CUTOFF real", default_r_val=20.0_dp, &
6515  unit_str="Ry")
6516  CALL section_add_keyword(section, keyword)
6517  CALL keyword_release(keyword)
6518 
6519  CALL keyword_create(keyword, __location__, name="MULTIGRID_SET", &
6520  description="Activate a manual setting of the multigrids", &
6521  usage="MULTIGRID_SET", default_l_val=.false.)
6522  CALL section_add_keyword(section, keyword)
6523  CALL keyword_release(keyword)
6524 
6525  CALL keyword_create(keyword, __location__, &
6526  name="SKIP_LOAD_BALANCE_DISTRIBUTED", &
6527  description="Skips load balancing on distributed multigrids. "// &
6528  "Memory usage is O(p) so may be used "// &
6529  "for all but the very largest runs.", &
6530  usage="SKIP_LOAD_BALANCE_DISTRIBUTED", &
6531  default_l_val=.false., &
6532  lone_keyword_l_val=.true.)
6533 ! CALL keyword_create(keyword, __LOCATION__, name="SKIP_LOAD_BALANCE_DISTRIBUTED",&
6534 ! description="Skip load balancing on distributed multigrids, which might be memory intensive."//&
6535 ! "If not explicitly specified, runs using more than 1024 MPI tasks will default to .TRUE.",&
6536 ! usage="SKIP_LOAD_BALANCE_DISTRIBUTED", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
6537 
6538  CALL section_add_keyword(section, keyword)
6539  CALL keyword_release(keyword)
6540 
6541  CALL keyword_create(keyword, __location__, name="MULTIGRID_CUTOFF", &
6542  variants=(/"CUTOFF_LIST"/), &
6543  description="List of cutoff values to set up multigrids manually", &
6544  usage="MULTIGRID_CUTOFF 200.0 100.0 ", &
6545  n_var=-1, &
6546  type_of_var=real_t, &
6547  unit_str="Ry")
6548  CALL section_add_keyword(section, keyword)
6549  CALL keyword_release(keyword)
6550 
6551  IF (create_subsections) THEN
6552  NULLIFY (subsection)
6553  CALL create_rsgrid_section(subsection)
6554  CALL section_add_subsection(section, subsection)
6555  CALL section_release(subsection)
6556 
6557  NULLIFY (subsection)
6558  CALL create_interp_section(subsection)
6559  CALL section_add_subsection(section, subsection)
6560  CALL section_release(subsection)
6561  END IF
6562  END SUBROUTINE create_mgrid_section
6563 
6564 ! **************************************************************************************************
6565 !> \brief creates the interpolation section
6566 !> \param section ...
6567 !> \author tlaino
6568 ! **************************************************************************************************
6569  SUBROUTINE create_interp_section(section)
6570  TYPE(section_type), POINTER :: section
6571 
6572  TYPE(keyword_type), POINTER :: keyword
6573  TYPE(section_type), POINTER :: print_key
6574 
6575  cpassert(.NOT. ASSOCIATED(section))
6576  CALL section_create(section, __location__, name="interpolator", &
6577  description="kind of interpolation used between the multigrids", &
6578  n_keywords=5, n_subsections=0, repeats=.false.)
6579 
6580  NULLIFY (keyword, print_key)
6581 
6582  CALL keyword_create(keyword, __location__, name="kind", &
6583  description="the interpolator to use", &
6584  usage="kind spline3", &
6585  default_i_val=pw_interp, &
6586  enum_c_vals=s2a("pw", "spline3_nopbc", "spline3"), &
6587  enum_i_vals=(/pw_interp, &
6589  CALL section_add_keyword(section, keyword)
6590  CALL keyword_release(keyword)
6591 
6592  CALL keyword_create(keyword, __location__, name="safe_computation", &
6593  description="if a non unrolled calculation is to be performed in parallel", &
6594  usage="safe_computation OFF", &
6595  default_l_val=.false., &
6596  lone_keyword_l_val=.true.)
6597  CALL section_add_keyword(section, keyword)
6598  CALL keyword_release(keyword)
6599 
6600  CALL keyword_create(keyword, __location__, name="aint_precond", &
6601  description="the approximate inverse to use to get the starting point"// &
6602  " for the linear solver of the spline3 methods", &
6603  usage="aint_precond copy", &
6604  default_i_val=precond_spl3_aint, &
6605  enum_c_vals=s2a("copy", "spl3_nopbc_aint1", "spl3_nopbc_aint2", &
6606  "spl3_nopbc_precond1", "spl3_nopbc_precond2", "spl3_nopbc_precond3"), &
6609  CALL section_add_keyword(section, keyword)
6610  CALL keyword_release(keyword)
6611 
6612  CALL keyword_create(keyword, __location__, name="precond", &
6613  description="The preconditioner used"// &
6614  " for the linear solver of the spline3 methods", &
6615  usage="PRECOND copy", &
6616  default_i_val=precond_spl3_3, &
6617  enum_c_vals=s2a("copy", "spl3_nopbc_aint1", "spl3_nopbc_aint2", &
6618  "spl3_nopbc_precond1", "spl3_nopbc_precond2", "spl3_nopbc_precond3"), &
6621  CALL section_add_keyword(section, keyword)
6622  CALL keyword_release(keyword)
6623 
6624  CALL keyword_create(keyword, __location__, name="eps_x", &
6625  description="accuracy on the solution for spline3 the interpolators", &
6626  usage="eps_x 1.e-15", default_r_val=1.e-10_dp)
6627  CALL section_add_keyword(section, keyword)
6628  CALL keyword_release(keyword)
6629 
6630  CALL keyword_create(keyword, __location__, name="eps_r", &
6631  description="accuracy on the residual for spline3 the interpolators", &
6632  usage="eps_r 1.e-15", default_r_val=1.e-10_dp)
6633  CALL section_add_keyword(section, keyword)
6634  CALL keyword_release(keyword)
6635 
6636  CALL keyword_create(keyword, __location__, name="max_iter", &
6637  variants=(/'maxiter'/), &
6638  description="the maximum number of iterations", &
6639  usage="max_iter 200", default_i_val=100)
6640  CALL section_add_keyword(section, keyword)
6641  CALL keyword_release(keyword)
6642 
6643  NULLIFY (print_key)
6644  CALL cp_print_key_section_create(print_key, __location__, "conv_info", &
6645  description="if convergence information about the linear solver"// &
6646  " of the spline methods should be printed", &
6647  print_level=medium_print_level, each_iter_names=s2a("SPLINE_FIND_COEFFS"), &
6648  each_iter_values=(/10/), filename="__STD_OUT__", &
6649  add_last=add_last_numeric)
6650  CALL section_add_subsection(section, print_key)
6651  CALL section_release(print_key)
6652 
6653  END SUBROUTINE create_interp_section
6654 
6655 ! **************************************************************************************************
6656 !> \brief creates the sic (self interaction correction) section
6657 !> \param section ...
6658 !> \author fawzi
6659 ! **************************************************************************************************
6660  SUBROUTINE create_sic_section(section)
6661  TYPE(section_type), POINTER :: section
6662 
6663  TYPE(keyword_type), POINTER :: keyword
6664 
6665  cpassert(.NOT. ASSOCIATED(section))
6666  CALL section_create(section, __location__, name="sic", &
6667  description="parameters for the self interaction correction", &
6668  n_keywords=6, n_subsections=0, repeats=.false., &
6669  citations=(/vandevondele2005b, perdew1981, avezac2005/))
6670 
6671  NULLIFY (keyword)
6672 
6673  CALL keyword_create(keyword, __location__, name="SIC_SCALING_A", &
6674  description="Scaling of the coulomb term in sic [experimental]", &
6675  usage="SIC_SCALING_A 0.5", &
6676  citations=(/vandevondele2005b/), &
6677  default_r_val=1.0_dp)
6678  CALL section_add_keyword(section, keyword)
6679  CALL keyword_release(keyword)
6680 
6681  CALL keyword_create(keyword, __location__, name="SIC_SCALING_B", &
6682  description="Scaling of the xc term in sic [experimental]", &
6683  usage="SIC_SCALING_B 0.5", &
6684  citations=(/vandevondele2005b/), &
6685  default_r_val=1.0_dp)
6686  CALL section_add_keyword(section, keyword)
6687  CALL keyword_release(keyword)
6688 
6689  CALL keyword_create(keyword, __location__, name="SIC_METHOD", &
6690  description="Method used to remove the self interaction", &
6691  usage="SIC_METHOD MAURI_US", &
6692  default_i_val=sic_none, &
6693  enum_c_vals=s2a("NONE", "MAURI_US", "MAURI_SPZ", "AD", "EXPLICIT_ORBITALS"), &
6694  enum_i_vals=(/sic_none, sic_mauri_us, sic_mauri_spz, sic_ad, sic_eo/), &
6695  enum_desc=s2a("Do not apply a sic correction", &
6696  "Employ a (scaled) correction proposed by Mauri and co-workers"// &
6697  " on the spin density / doublet unpaired orbital", &
6698  "Employ a (scaled) Perdew-Zunger expression"// &
6699  " on the spin density / doublet unpaired orbital", &
6700  "The average density correction", &
6701  "(scaled) Perdew-Zunger correction explicitly on a set of orbitals."), &
6702  citations=(/vandevondele2005b, perdew1981, avezac2005/))
6703  CALL section_add_keyword(section, keyword)
6704  CALL keyword_release(keyword)
6705 
6706  CALL keyword_create(keyword, __location__, name="ORBITAL_SET", &
6707  description="Type of orbitals treated with the SIC", &
6708  usage="ORBITAL_SET ALL", &
6709  default_i_val=sic_list_unpaired, &
6710  enum_c_vals=s2a("UNPAIRED", "ALL"), &
6711  enum_desc=s2a("correction for the unpaired orbitals only, requires a restricted open shell calculation", &
6712  "correction for all orbitals, requires a LSD or ROKS calculation"), &
6713  enum_i_vals=(/sic_list_unpaired, sic_list_all/))
6714  CALL section_add_keyword(section, keyword)
6715  CALL keyword_release(keyword)
6716 
6717  END SUBROUTINE create_sic_section
6718 
6719 ! **************************************************************************************************
6720 !> \brief creates the low spin roks section
6721 !> \param section ...
6722 !> \author Joost VandeVondele
6723 ! **************************************************************************************************
6724  SUBROUTINE create_low_spin_roks_section(section)
6725  TYPE(section_type), POINTER :: section
6726 
6727  TYPE(keyword_type), POINTER :: keyword
6728 
6729  cpassert(.NOT. ASSOCIATED(section))
6730  CALL section_create(section, __location__, name="LOW_SPIN_ROKS", &
6731  description="Specify the details of the low spin ROKS method. "// &
6732  "In particular, one can specify various terms added to the energy of the high spin roks configuration"// &
6733  " with a energy scaling factor, and a prescription of the spin state.", &
6734  n_keywords=6, n_subsections=0, repeats=.false.)
6735 
6736  NULLIFY (keyword)
6737  CALL keyword_create(keyword, __location__, name="ENERGY_SCALING", &
6738  description="The scaling factors for each term added to the total energy. "// &
6739  "This list should contain one number for each term added to the total energy.", &
6740  usage="ENERGY_SCALING 1.0 -1.0 ", &
6741  n_var=-1, type_of_var=real_t, repeats=.false.)
6742  CALL section_add_keyword(section, keyword)
6743  CALL keyword_release(keyword)
6744  CALL keyword_create( &
6745  keyword, __location__, name="SPIN_CONFIGURATION", &
6746  description="For each singly occupied orbital, specify if this should be an alpha (=1) or a beta (=2) orbital. "// &
6747  "This keyword should be repeated, each repetition corresponding to an additional term.", &
6748  usage="SPIN_CONFIGURATION 1 2", &
6749  n_var=-1, type_of_var=integer_t, repeats=.true.)
6750  CALL section_add_keyword(section, keyword)
6751  CALL keyword_release(keyword)
6752 
6753  END SUBROUTINE create_low_spin_roks_section
6754 
6755 ! **************************************************************************************************
6756 !> \brief makes the orbital transformation section
6757 !> \param section ...
6758 !> \par History
6759 !> 11.2004 created [Joost VandeVondele]
6760 ! **************************************************************************************************
6761  SUBROUTINE create_ot_section(section)
6762  TYPE(section_type), POINTER :: section
6763 
6764  TYPE(keyword_type), POINTER :: keyword
6765 
6766  cpassert(.NOT. ASSOCIATED(section))
6767  CALL section_create(section, __location__, name="OT", &
6768  description="Sets the various options for the orbital transformation (OT) method. "// &
6769  "Default settings already provide an efficient, yet robust method. "// &
6770  "Most systems benefit from using the FULL_ALL preconditioner "// &
6771  "combined with a small value (0.001) of ENERGY_GAP. "// &
6772  "Well-behaved systems might benefit from using a DIIS minimizer. "//newline//newline// &
6773  "**Advantages:** "// &
6774  "It's fast, because no expensive diagonalisation is performed. "// &
6775  "If preconditioned correctly, method guaranteed to find minimum. "//newline//newline// &
6776  "**Disadvantages:** "// &
6777  "Sensitive to preconditioning. A good preconditioner can be expensive. "// &
6778  "No smearing, or advanced SCF mixing possible: POOR convergence for metallic systems.", &
6779  n_keywords=27, n_subsections=0, repeats=.false., &
6780  citations=(/vandevondele2003, weber2008/))
6781 
6782  NULLIFY (keyword)
6783 
6784  CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
6785  description="controls the activation of the ot method", &
6786  usage="&OT T", &
6787  default_l_val=.false., &
6788  lone_keyword_l_val=.true.)
6789  CALL section_add_keyword(section, keyword)
6790  CALL keyword_release(keyword)
6791 
6792  CALL keyword_create(keyword, __location__, name="ALGORITHM", &
6793  description="Algorithm to be used for OT", &
6794  usage="ALGORITHM STRICT", &
6795  default_i_val=ot_algo_taylor_or_diag, &
6796  enum_c_vals=s2a("STRICT", "IRAC"), &
6797  enum_desc=s2a("Strict orthogonality: Taylor or diagonalization based algorithm.", &
6798  "Orbital Transformation based Iterative Refinement "// &
6799  "of the Approximative Congruence transformation (OT/IR)."), &
6800  enum_i_vals=(/ot_algo_taylor_or_diag, ot_algo_irac/), &
6802  CALL section_add_keyword(section, keyword)
6803  CALL keyword_release(keyword)
6804 
6805  CALL keyword_create(keyword, __location__, name="IRAC_DEGREE", &
6806  description="The refinement polynomial degree (2, 3 or 4).", &
6807  usage="IRAC_DEGREE 4", &
6808  default_i_val=4)
6809  CALL section_add_keyword(section, keyword)
6810  CALL keyword_release(keyword)
6811 
6812  CALL keyword_create(keyword, __location__, name="MAX_IRAC", &
6813  description="Maximum allowed refinement iteration.", &
6814  usage="MAX_IRAC 5", &
6815  default_i_val=50)
6816  CALL section_add_keyword(section, keyword)
6817  CALL keyword_release(keyword)
6818 
6819  CALL keyword_create(keyword, __location__, name="ORTHO_IRAC", &
6820  description="The orthogonality method.", &
6821  usage="ORTHO_IRAC POLY", &
6822  default_i_val=ot_chol_irac, &
6823  enum_c_vals=s2a("CHOL", "POLY", "LWDN"), &
6824  enum_desc=s2a("Cholesky.", "Polynomial.", "Loewdin."), &
6825  enum_i_vals=(/ot_chol_irac, ot_poly_irac, ot_lwdn_irac/))
6826  CALL section_add_keyword(section, keyword)
6827  CALL keyword_release(keyword)
6828 
6829  CALL keyword_create(keyword, __location__, name="EPS_IRAC_FILTER_MATRIX", &
6830  description="Sets the threshold for filtering the matrices.", &
6831  usage="EPS_IRAC_FILTER_MATRIX 1.0E-5", &
6832  default_r_val=0.0_dp)
6833  CALL section_add_keyword(section, keyword)
6834  CALL keyword_release(keyword)
6835 
6836  CALL keyword_create(keyword, __location__, name="EPS_IRAC", &
6837  description="Targeted accuracy during the refinement iteration.", &
6838  usage="EPS_IRAC 1.0E-5", &
6839  default_r_val=1.0e-10_dp)
6840  CALL section_add_keyword(section, keyword)
6841  CALL keyword_release(keyword)
6842 
6843  CALL keyword_create(keyword, __location__, name="EPS_IRAC_QUICK_EXIT", &
6844  description="Only one extra refinement iteration is "// &
6845  "done when the norm is below this value.", &
6846  usage="EPS_IRAC_QUICK_EXIT 1.0E-2", &
6847  default_r_val=1.0e-5_dp)
6848  CALL section_add_keyword(section, keyword)
6849  CALL keyword_release(keyword)
6850 
6851  CALL keyword_create(keyword, __location__, name="EPS_IRAC_SWITCH", &
6852  description="The algorithm switches to the polynomial "// &
6853  "refinement when the norm is below this value.", &
6854  usage="EPS_IRAC_SWITCH 1.0E-3", &
6855  default_r_val=1.0e-2_dp)
6856  CALL section_add_keyword(section, keyword)
6857  CALL keyword_release(keyword)
6858 
6859  CALL keyword_create(keyword, __location__, name="ON_THE_FLY_LOC", &
6860  description="On the fly localization of the molecular orbitals. "// &
6861  "Can only be used with OT/IRAC.", &
6862  usage="ON_THE_FLY_LOC T", &
6863  default_l_val=.false.)
6864  CALL section_add_keyword(section, keyword)
6865  CALL keyword_release(keyword)
6866 
6867  CALL keyword_create( &
6868  keyword, __location__, name="MINIMIZER", &
6869  description="Minimizer to be used with the OT method", &
6870  usage="MINIMIZER DIIS", &
6871  default_i_val=ot_mini_cg, &
6872  enum_c_vals=s2a("SD", "CG", "DIIS", "BROYDEN"), &
6873  enum_desc=s2a("Steepest descent: not recommended", "Conjugate Gradients: most reliable, use for difficult systems."// &
6874  " The total energy should decrease at every OT CG step if the line search is appropriate.", &
6875  "Direct inversion in the iterative subspace: less reliable than CG, but sometimes about 50% faster", &
6876  "Broyden mixing approximating the inverse Hessian"), &
6878  CALL section_add_keyword(section, keyword)
6879  CALL keyword_release(keyword)
6880 
6881  CALL keyword_create(keyword, __location__, name="SAFE_DIIS", &
6882  variants=(/"SAFER_DIIS"/), &
6883  description="Reject DIIS steps if they point away from the"// &
6884  " minimum, do SD in that case.", &
6885  usage="SAFE_DIIS ON", default_l_val=.true.)
6886  CALL section_add_keyword(section, keyword)
6887  CALL keyword_release(keyword)
6888 
6889  CALL keyword_create(keyword, __location__, name="N_HISTORY_VEC", &
6890  variants=s2a("NDIIS", "N_DIIS", "N_BROYDEN"), &
6891  description="Number of history vectors to be used with DIIS or BROYDEN", &
6892  usage="N_DIIS 4", &
6893  default_i_val=7)
6894  CALL section_add_keyword(section, keyword)
6895  CALL keyword_release(keyword)
6896 
6897  CALL keyword_create(keyword, __location__, name="BROYDEN_BETA", &
6898  description="Underrelaxation for the broyden mixer", &
6899  usage="BROYDEN_BETA 0.9", &
6900  default_r_val=0.9_dp)
6901  CALL section_add_keyword(section, keyword)
6902  CALL keyword_release(keyword)
6903 
6904  CALL keyword_create(keyword, __location__, name="BROYDEN_GAMMA", &
6905  description="Backtracking parameter", &
6906  usage="BROYDEN_GAMMA 0.5", &
6907  default_r_val=0.5_dp)
6908  CALL section_add_keyword(section, keyword)
6909  CALL keyword_release(keyword)
6910 
6911  CALL keyword_create(keyword, __location__, name="BROYDEN_SIGMA", &
6912  description="Curvature of energy functional.", &
6913  usage="BROYDEN_SIGMA 0.25", &
6914  default_r_val=0.25_dp)
6915  CALL section_add_keyword(section, keyword)
6916  CALL keyword_release(keyword)
6917 
6918  CALL keyword_create(keyword, __location__, name="BROYDEN_ETA", &
6919  description="Dampening of estimated energy curvature.", &
6920  usage="BROYDEN_ETA 0.7", &
6921  default_r_val=0.7_dp)
6922  CALL section_add_keyword(section, keyword)
6923  CALL keyword_release(keyword)
6924 
6925  CALL keyword_create(keyword, __location__, name="BROYDEN_OMEGA", &
6926  description="Growth limit of curvature.", &
6927  usage="BROYDEN_OMEGA 1.1", &
6928  default_r_val=1.1_dp)
6929  CALL section_add_keyword(section, keyword)
6930  CALL keyword_release(keyword)
6931 
6932  CALL keyword_create(keyword, __location__, name="BROYDEN_SIGMA_DECREASE", &
6933  description="Reduction of curvature on bad approximation.", &
6934  usage="BROYDEN_SIGMA_DECREASE 0.7", &
6935  default_r_val=0.7_dp)
6936  CALL section_add_keyword(section, keyword)
6937  CALL keyword_release(keyword)
6938 
6939  CALL keyword_create(keyword, __location__, name="BROYDEN_SIGMA_MIN", &
6940  description="Minimum adaptive curvature.", &
6941  usage="BROYDEN_SIGMA_MIN 0.05", &
6942  default_r_val=0.05_dp)
6943  CALL section_add_keyword(section, keyword)
6944  CALL keyword_release(keyword)
6945 
6946  CALL keyword_create(keyword, __location__, name="BROYDEN_FORGET_HISTORY", &
6947  description="Forget history on bad approximation", &
6948  usage="BROYDEN_FORGET_HISTORY OFF", default_l_val=.false., &
6949  lone_keyword_l_val=.true.)
6950  CALL section_add_keyword(section, keyword)
6951  CALL keyword_release(keyword)
6952 
6953  CALL keyword_create(keyword, __location__, name="BROYDEN_ADAPTIVE_SIGMA", &
6954  description="Enable adaptive curvature estimation", &
6955  usage="BROYDEN_ADAPTIVE_SIGMA ON", default_l_val=.true., &
6956  lone_keyword_l_val=.true.)
6957  CALL section_add_keyword(section, keyword)
6958  CALL keyword_release(keyword)
6959 
6960  CALL keyword_create(keyword, __location__, name="BROYDEN_ENABLE_FLIP", &
6961  description="Ensure positive definite update", &
6962  usage="BROYDEN_ENABLE_FLIP ON", default_l_val=.true., &
6963  lone_keyword_l_val=.true.)
6964  CALL section_add_keyword(section, keyword)
6965  CALL keyword_release(keyword)
6966 
6967  CALL keyword_create(keyword, __location__, name="LINESEARCH", &
6968  variants=(/"LINE_SEARCH"/), &
6969  description="1D line search algorithm to be used with the OT minimizer,"// &
6970  " in increasing order of robustness and cost. MINIMIZER CG combined with"// &
6971  " LINESEARCH GOLD should always find an electronic minimum."// &
6972  " Whereas the 2PNT minimizer is almost always OK, 3PNT might be needed for systems"// &
6973  " in which successive OT CG steps do not decrease the total energy.", &
6974  usage="LINESEARCH GOLD", &
6975  default_i_val=ls_2pnt, &
6976  enum_c_vals=s2a("NONE", "2PNT", "3PNT", "GOLD"), &
6977  enum_desc=s2a("take fixed length steps", "extrapolate based on 2 points", &
6978  "... or on 3 points", "perform 1D golden section search of the minimum (very expensive)"), &
6979  enum_i_vals=(/ls_none, ls_2pnt, ls_3pnt, ls_gold/))
6980  CALL section_add_keyword(section, keyword)
6981  CALL keyword_release(keyword)
6982 
6983  CALL keyword_create( &
6984  keyword, __location__, name="STEPSIZE", &
6985  description="Initial stepsize used for the line search, sometimes this parameter can be reduced to stabilize DIIS"// &
6986  " or to improve the CG behavior in the first few steps."// &
6987  " The optimal value depends on the quality of the preconditioner."// &
6988  " A negative values leaves the choice to CP2K depending on the preconditioner.", &
6989  usage="STEPSIZE 0.4", &
6990  default_r_val=-1.0_dp)
6991  CALL section_add_keyword(section, keyword)
6992  CALL keyword_release(keyword)
6993 
6994  CALL keyword_create(keyword, __location__, name="GOLD_TARGET", &
6995  description="Target relative uncertainty in the location of the minimum for LINESEARCH GOLD", &
6996  usage="GOLD_TARGET 0.1", &
6997  default_r_val=0.01_dp)
6998  CALL section_add_keyword(section, keyword)
6999  CALL keyword_release(keyword)
7000 
7001  CALL keyword_create( &
7002  keyword, __location__, name="PRECONDITIONER", &
7003  description="Type of preconditioner to be used with all minimization schemes. "// &
7004  "They differ in effectiveness, cost of construction, cost of application. "// &
7005  "Properly preconditioned minimization can be orders of magnitude faster than doing nothing.", &
7006  usage="PRECONDITIONER FULL_ALL", &
7007  default_i_val=ot_precond_full_kinetic, &
7008  enum_c_vals=s2a("FULL_ALL", "FULL_SINGLE_INVERSE", "FULL_SINGLE", "FULL_KINETIC", "FULL_S_INVERSE", &
7009  "NONE"), &
7010  enum_desc=s2a("Most effective state selective preconditioner based on diagonalization, "// &
7011  "requires the ENERGY_GAP parameter to be an underestimate of the HOMO-LUMO gap. "// &
7012  "This preconditioner is recommended for almost all systems, except very large systems where "// &
7013  "make_preconditioner would dominate the total computational cost.", &
7014  "Based on H-eS cholesky inversion, similar to FULL_SINGLE in preconditioning efficiency "// &
7015  "but cheaper to construct, "// &
7016  "might be somewhat less robust. Recommended for large systems.", &
7017  "Based on H-eS diagonalisation, not as good as FULL_ALL, but somewhat cheaper to apply. ", &
7018  "Cholesky inversion of S and T, fast construction, robust, and relatively good, "// &
7019  "use for very large systems.", &
7020  "Cholesky inversion of S, not as good as FULL_KINETIC, yet equally expensive.", &
7021  "skip preconditioning"), &
7024  citations=(/vandevondele2003, weber2008, schiffmann2015/))
7025  CALL section_add_keyword(section, keyword)
7026  CALL keyword_release(keyword)
7027 
7028  CALL keyword_create(keyword, __location__, name="CHOLESKY", &
7029  description="If FULL_ALL the cholesky decomposition of the S matrix is used. "// &
7030  "Options on the algorithm to be used.", &
7031  usage="CHOLESKY REDUCE", default_i_val=cholesky_reduce, &
7032  enum_c_vals=s2a("OFF", "REDUCE", "RESTORE", "INVERSE", "INVERSE_DBCSR"), &
7033  enum_desc=s2a("The cholesky algorithm is not used", "Reduce is called", &
7034  "Reduce is replaced by two restore", &
7035  "Restore uses operator multiply by inverse of the triangular matrix", &
7036  "Like inverse, but matrix stored as dbcsr, sparce matrix algebra used when possible"), &
7038  CALL section_add_keyword(section, keyword)
7039  CALL keyword_release(keyword)
7040 
7041  CALL keyword_create( &
7042  keyword, __location__, name="PRECOND_SOLVER", &
7043  description="How the preconditioner is applied to the residual.", &
7044  usage="PRECOND_SOLVER DIRECT", &
7045  default_i_val=ot_precond_solver_default, &
7046  enum_c_vals=s2a("DEFAULT", "DIRECT", "INVERSE_CHOLESKY", "INVERSE_UPDATE"), &
7047  enum_desc=s2a("the default", "Cholesky decomposition followed by triangular solve "// &
7048  "(works for FULL_KINETIC/SINGLE_INVERSE/S_INVERSE)", &
7049  "Cholesky decomposition followed by explicit inversion "// &
7050  "(works for FULL_KINETIC/SINGLE_INVERSE/S_INVERSE)", &
7051  "Performs a Hotelling update of the inverse if a previous preconditioner is present. "// &
7052  "Mainly useful for GPU accelerated systems (works for FULL_KINETIC/SINGLE_INVERSE/S_INVERSE)"), &
7053  enum_i_vals=(/ot_precond_solver_default, &
7057  CALL section_add_keyword(section, keyword)
7058  CALL keyword_release(keyword)
7059 
7060  CALL keyword_create( &
7061  keyword, __location__, name="ENERGY_GAP", &
7062  description="Should be an estimate for the energy gap [a.u.] (HOMO-LUMO) and is used in preconditioning, "// &
7063  "especially effective with the FULL_ALL preconditioner, in which case it should be an underestimate "// &
7064  "of the gap (can be a small number, e.g. 0.002)."// &
7065  " FULL_SINGLE_INVERSE takes it as lower bound (values below 0.05 can cause stability issues)."// &
7066  " In general, higher values will tame the preconditioner in case of poor initial guesses."// &
7067  " A negative value will leave the choice to CP2K depending on type of preconditioner.", &
7068  usage="ENERGY_GAP 0.001", &
7069  default_r_val=-1.0_dp)
7070  CALL section_add_keyword(section, keyword)
7071  CALL keyword_release(keyword)
7072 
7073  CALL keyword_create( &
7074  keyword, __location__, name="EPS_TAYLOR", &
7075  variants=(/"EPSTAYLOR"/), &
7076  description="Target accuracy of the taylor expansion for the matrix functions, should normally be kept as is.", &
7077  usage="EPS_TAYLOR 1.0E-15", &
7078  default_r_val=1.0e-16_dp)
7079  CALL section_add_keyword(section, keyword)
7080  CALL keyword_release(keyword)
7081 
7082  CALL keyword_create( &
7083  keyword, __location__, name="MAX_TAYLOR", &
7084  description="Maximum order of the Taylor expansion before diagonalisation is preferred, for large parallel runs"// &
7085  " a slightly higher order could sometimes result in a small speedup.", &
7086  usage="MAX_TAYLOR 5", &
7087  default_i_val=4)
7088  CALL section_add_keyword(section, keyword)
7089  CALL keyword_release(keyword)
7090 
7091  CALL keyword_create(keyword, __location__, name="ROTATION", &
7092  description="Introduce additional variables so that rotations of the occupied"// &
7093  " subspace are allowed as well, only needed for cases where the energy is not invariant under"// &
7094  " a rotation of the occupied subspace such as non-singlet restricted calculations"// &
7095  " or fractional occupations.", &
7096  usage="ROTATION", lone_keyword_l_val=.true., &
7097  default_l_val=.false.)
7098  CALL section_add_keyword(section, keyword)
7099  CALL keyword_release(keyword)
7100 
7101  CALL keyword_create(keyword, __location__, name="ENERGIES", &
7102  description="Optimize orbital energies for use in Fermi-Dirac smearing "// &
7103  "(requires ROTATION and FD smearing to be active).", &
7104  usage="ENERGIES", lone_keyword_l_val=.true., &
7105  default_l_val=.false.)
7106  CALL section_add_keyword(section, keyword)
7107  CALL keyword_release(keyword)
7108 
7109  CALL keyword_create(keyword, __location__, name="OCCUPATION_PRECONDITIONER", &
7110  description="Preconditioner with the occupation numbers (FD smearing)", &
7111  usage="OCCUPATION_PRECONDITIONER", lone_keyword_l_val=.true., &
7112  default_l_val=.false.)
7113  CALL section_add_keyword(section, keyword)
7114  CALL keyword_release(keyword)
7115 
7116  CALL keyword_create(keyword, __location__, name="NONDIAG_ENERGY", &
7117  description="Add a non-diagonal energy penalty (FD smearing)", &
7118  usage="NONDIAG_ENERGY", lone_keyword_l_val=.true., &
7119  default_l_val=.false.)
7120  CALL section_add_keyword(section, keyword)
7121  CALL keyword_release(keyword)
7122 
7123  CALL keyword_create(keyword, __location__, name="NONDIAG_ENERGY_STRENGTH", &
7124  description="The prefactor for the non-diagonal energy penalty (FD smearing)", &
7125  usage="NONDIAG_ENERGY_STRENGTH", default_r_val=1.0_dp)
7126  CALL section_add_keyword(section, keyword)
7127  CALL keyword_release(keyword)
7128 
7129  END SUBROUTINE create_ot_section
7130 
7131 ! **************************************************************************************************
7132 !> \brief creates the diagonalization section
7133 !> \param section ...
7134 !> \par History
7135 !> 10.2008 created [JGH]
7136 ! **************************************************************************************************
7137  SUBROUTINE create_diagonalization_section(section)
7138  TYPE(section_type), POINTER :: section
7139 
7140  TYPE(keyword_type), POINTER :: keyword
7141  TYPE(section_type), POINTER :: subsection
7142 
7143  cpassert(.NOT. ASSOCIATED(section))
7144  CALL section_create(section, __location__, name="DIAGONALIZATION", &
7145  description="Set up type and parameters for Kohn-Sham matrix diagonalization.", &
7146  n_keywords=0, n_subsections=1, repeats=.false.)
7147 
7148  NULLIFY (keyword)
7149 
7150  CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
7151  description="controls the activation of the diagonalization method", &
7152  usage="&DIAGONALIZATION T", &
7153  default_l_val=.false., &
7154  lone_keyword_l_val=.true.)
7155  CALL section_add_keyword(section, keyword)
7156  CALL keyword_release(keyword)
7157 
7158  CALL keyword_create(keyword, __location__, name="ALGORITHM", &
7159  description="Algorithm to be used for diagonalization", &
7160  usage="ALGORITHM STANDARD", &
7161  default_i_val=diag_standard, &
7162  enum_c_vals=s2a("STANDARD", "OT", "LANCZOS", "DAVIDSON", "FILTER_MATRIX"), &
7163  enum_desc=s2a("Standard diagonalization: LAPACK methods or Jacobi.", &
7164  "Iterative diagonalization using OT method", &
7165  "Block Krylov-space approach to self-consistent diagonalisation", &
7166  "Preconditioned blocked Davidson", &
7167  "Filter matrix diagonalization"), &
7170  CALL section_add_keyword(section, keyword)
7171  CALL keyword_release(keyword)
7172 
7173  CALL keyword_create(keyword, __location__, name="JACOBI_THRESHOLD", &
7174  description="Controls the accuracy of the pseudo-diagonalization method using Jacobi rotations", &
7175  usage="JACOBI_THRESHOLD 1.0E-6", &
7176  default_r_val=1.0e-7_dp, &
7177  citations=(/stewart1982/))
7178  CALL section_add_keyword(section, keyword)
7179  CALL keyword_release(keyword)
7180 
7181  CALL keyword_create(keyword, __location__, name="EPS_JACOBI", &
7182  description="Below this threshold value for the SCF convergence the pseudo-diagonalization "// &
7183  "method using Jacobi rotations is activated. This method is much faster than a "// &
7184  "real diagonalization and it is even speeding up while achieving full convergence. "// &
7185  "However, it needs a pre-converged wavefunction obtained by at least one real "// &
7186  "diagonalization which is further optimized while keeping the original eigenvalue "// &
7187  "spectrum. The MO eigenvalues are NOT updated. The method might be useful to speed "// &
7188  "up calculations for large systems e.g. using a semi-empirical method.", &
7189  usage="EPS_JACOBI 1.0E-5", &
7190  default_r_val=0.0_dp, &
7191  citations=(/stewart1982/))
7192  CALL section_add_keyword(section, keyword)
7193  CALL keyword_release(keyword)
7194 
7195  CALL keyword_create(keyword, __location__, name="EPS_ADAPT", &
7196  description="Required accuracy in iterative diagonalization as compared to current SCF convergence", &
7197  usage="EPS_ADAPT 0.01", &
7198  default_r_val=0._dp)
7199  CALL section_add_keyword(section, keyword)
7200  CALL keyword_release(keyword)
7201 
7202  CALL keyword_create(keyword, __location__, name="MAX_ITER", &
7203  description="Maximum number of iterations in iterative diagonalization", &
7204  usage="MAX_ITER 20", &
7205  default_i_val=2)
7206  CALL section_add_keyword(section, keyword)
7207  CALL keyword_release(keyword)
7208 
7209  CALL keyword_create(keyword, __location__, name="EPS_ITER", &
7210  description="Required accuracy in iterative diagonalization", &
7211  usage="EPS_ITER 1.e-8", &
7212  default_r_val=1.e-8_dp)
7213  CALL section_add_keyword(section, keyword)
7214  CALL keyword_release(keyword)
7215 
7216  NULLIFY (subsection)
7217  CALL create_ot_section(subsection)
7218  CALL section_add_subsection(section, subsection)
7219  CALL section_release(subsection)
7220 
7221  NULLIFY (subsection)
7222  CALL create_krylov_section(subsection)
7223  CALL section_add_subsection(section, subsection)
7224  CALL section_release(subsection)
7225 
7226  NULLIFY (subsection)
7227  CALL create_diag_subspace_section(subsection)
7228  CALL section_add_subsection(section, subsection)
7229  CALL section_release(subsection)
7230 
7231  NULLIFY (subsection)
7232  CALL create_davidson_section(subsection)
7233  CALL section_add_subsection(section, subsection)
7234  CALL section_release(subsection)
7235 
7236  NULLIFY (subsection)
7237  CALL create_filtermatrix_section(subsection)
7238  CALL section_add_subsection(section, subsection)
7239  CALL section_release(subsection)
7240 
7241  END SUBROUTINE create_diagonalization_section
7242 
7243 ! **************************************************************************************************
7244 !> \brief ...
7245 !> \param section ...
7246 ! **************************************************************************************************
7247  SUBROUTINE create_davidson_section(section)
7248  TYPE(section_type), POINTER :: section
7249 
7250  TYPE(keyword_type), POINTER :: keyword
7251 
7252  cpassert(.NOT. ASSOCIATED(section))
7253  CALL section_create(section, __location__, name="DAVIDSON", &
7254  description=" ", &
7255  n_keywords=2, n_subsections=0, repeats=.false.)
7256 
7257  NULLIFY (keyword)
7258 
7259  CALL keyword_create( &
7260  keyword, __location__, name="PRECONDITIONER", &
7261  description="Type of preconditioner to be used with all minimization schemes. ", &
7262  usage="PRECONDITIONER FULL_ALL", &
7263  default_i_val=ot_precond_full_all, &
7264  enum_c_vals=s2a("FULL_ALL", "FULL_SINGLE_INVERSE", "NONE"), &
7265  enum_desc=s2a("Most effective state selective preconditioner based on diagonalization ", &
7266  "Based on H-eS cholesky inversion, similar to FULL_SINGLE in preconditioning efficiency "// &
7267  "but cheaper to construct, might be somewhat less robust. Recommended for large systems.", &
7268  "skip preconditioning"), &
7270  citations=(/vandevondele2003/))
7271  CALL section_add_keyword(section, keyword)
7272  CALL keyword_release(keyword)
7273 
7274  CALL keyword_create(keyword, __location__, name="PRECOND_SOLVER", &
7275  description="How the preconditioner is applied to the residual.", &
7276  usage="PRECOND_SOLVER DIRECT", &
7277  default_i_val=ot_precond_solver_default, &
7278  enum_c_vals=s2a("DEFAULT", "DIRECT", "INVERSE_CHOLESKY"), &
7279  enum_desc=s2a("the default", "Cholesky decomposition followed by triangular solve "// &
7280  "(works for FULL_KINETIC/SINGLE_INVERSE/S_INVERSE)", &
7281  "Cholesky decomposition followed by explicit inversion "// &
7282  "(works for FULL_KINETIC/SINGLE_INVERSE/S_INVERSE)"), &
7283  enum_i_vals=(/ot_precond_solver_default, &
7286  CALL section_add_keyword(section, keyword)
7287  CALL keyword_release(keyword)
7288 
7289  CALL keyword_create( &
7290  keyword, __location__, name="ENERGY_GAP", &
7291  description="Should be an estimate for the energy gap [a.u.] (HOMO-LUMO) and is used in preconditioning, "// &
7292  "especially effective with the FULL_ALL preconditioner, in which case it should be an underestimate "// &
7293  "of the gap (0.001 doing normally fine). For the other preconditioners, making this value larger (0.2)"// &
7294  " will tame the preconditioner in case of poor initial guesses.", &
7295  usage="ENERGY_GAP 0.001", &
7296  default_r_val=0.2_dp)
7297  CALL section_add_keyword(section, keyword)
7298  CALL keyword_release(keyword)
7299 
7300  CALL keyword_create(keyword, __location__, name="NEW_PREC_EACH", &
7301  description="Number of SCF iterations after which a new Preconditioner is computed", &
7302  usage="NEW_PREC_EACH 10", default_i_val=20)
7303  CALL section_add_keyword(section, keyword)
7304  CALL keyword_release(keyword)
7305 
7306  CALL keyword_create(keyword, __location__, name="FIRST_PREC", &
7307  description="First SCF iteration at which a Preconditioner is employed", &
7308  usage="FIRST_PREC 1", default_i_val=1)
7309  CALL section_add_keyword(section, keyword)
7310  CALL keyword_release(keyword)
7311 
7312  CALL keyword_create(keyword, __location__, name="CONV_MOS_PERCENT", &
7313  description="Minimal percent of MOS that have to converge within the Davidson loop"// &
7314  " before the SCF iteration is completed and a new Hamiltonian is computed", &
7315  usage="CONV_MOS_PERCENT 0.8", default_r_val=0.5_dp)
7316  CALL section_add_keyword(section, keyword)
7317  CALL keyword_release(keyword)
7318 
7319  CALL keyword_create(keyword, __location__, name="SPARSE_MOS", &
7320  description="Use MOS as sparse matrix and avoid as much as possible multiplications with full matrices", &
7321  usage="SPARSE_MOS", default_l_val=.true., &
7322  lone_keyword_l_val=.true.)
7323  CALL section_add_keyword(section, keyword)
7324  CALL keyword_release(keyword)
7325 
7326  END SUBROUTINE create_davidson_section
7327 
7328 ! **************************************************************************************************
7329 !> \brief ...
7330 !> \param section ...
7331 ! **************************************************************************************************
7332  SUBROUTINE create_krylov_section(section)
7333  TYPE(section_type), POINTER :: section
7334 
7335  TYPE(keyword_type), POINTER :: keyword
7336 
7337  cpassert(.NOT. ASSOCIATED(section))
7338  CALL section_create(section, __location__, name="KRYLOV", &
7339  description=" ", &
7340  n_keywords=2, n_subsections=0, repeats=.false.)
7341 
7342  NULLIFY (keyword)
7343 
7344  CALL keyword_create(keyword, __location__, name="NKRYLOV", &
7345  description="Dimension of the Krylov space used for the Lanczos refinement", &
7346  usage="NKRYLOV 20", &
7347  default_i_val=4)
7348  CALL section_add_keyword(section, keyword)
7349  CALL keyword_release(keyword)
7350 
7351  CALL keyword_create(keyword, __location__, name="NBLOCK", &
7352  description="Size of the block of vectors refined simultaneously by the Lanczos procedure", &
7353  usage="NBLOCK 1", &
7354  default_i_val=32)
7355  CALL section_add_keyword(section, keyword)
7356  CALL keyword_release(keyword)
7357 
7358  CALL keyword_create(keyword, __location__, name="EPS_KRYLOV", &
7359  description="Convergence criterion for the MOs", &
7360  usage="EPS_KRYLOV 0.00001", &
7361  default_r_val=0.0000001_dp)
7362  CALL section_add_keyword(section, keyword)
7363  CALL keyword_release(keyword)
7364 
7365  CALL keyword_create(keyword, __location__, name="EPS_STD_DIAG", &
7366  description="Level of convergence to be reached before starting the Lanczos procedure."// &
7367  " Above this threshold a standard diagonalization method is used."// &
7368  " If negative Lanczos is started at the first iteration", &
7369  usage="EPS_STD_DIAG 0.001", &
7370  default_r_val=-1.0_dp)
7371  CALL section_add_keyword(section, keyword)
7372  CALL keyword_release(keyword)
7373 
7374  CALL keyword_create(keyword, __location__, name="CHECK_MOS_CONV", &
7375  description="This requires to check the convergence of MOS also when standard "// &
7376  "diagonalization steps are performed, if the block krylov approach is active.", &
7377  usage="CHECK_MOS_CONV T", &
7378  default_l_val=.false., &
7379  lone_keyword_l_val=.true.)
7380  CALL section_add_keyword(section, keyword)
7381  CALL keyword_release(keyword)
7382 
7383  END SUBROUTINE create_krylov_section
7384 
7385 ! **************************************************************************************************
7386 !> \brief ...
7387 !> \param section ...
7388 ! **************************************************************************************************
7389  SUBROUTINE create_diag_subspace_section(section)
7390  TYPE(section_type), POINTER :: section
7391 
7392  TYPE(keyword_type), POINTER :: keyword
7393  TYPE(section_type), POINTER :: subsection
7394 
7395  cpassert(.NOT. ASSOCIATED(section))
7396  CALL section_create(section, __location__, name="DIAG_SUB_SCF", &
7397  description="Activation of self-consistenf subspace refinement by diagonalization "// &
7398  "of H by adjusting the occupation but keeping the MOS unchanged.", &
7399  n_keywords=2, n_subsections=1, repeats=.false.)
7400 
7401  NULLIFY (keyword, subsection)
7402 
7403  CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
7404  description="controls the activation of inner SCF loop to refine occupations in MOS subspace", &
7405  usage="&DIAG_SUB_SCF T", &
7406  default_l_val=.false., &
7407  lone_keyword_l_val=.true.)
7408  CALL section_add_keyword(section, keyword)
7409  CALL keyword_release(keyword)
7410 
7411  CALL keyword_create(keyword, __location__, name="MAX_ITER", &
7412  description="Maximum number of iterations for the SCF inner loop", &
7413  usage="MAX_ITER 20", &
7414  default_i_val=2)
7415  CALL section_add_keyword(section, keyword)
7416  CALL keyword_release(keyword)
7417 
7418  CALL keyword_create(keyword, __location__, name="EPS_ENE", &
7419  description="Required energy accuracy for convergence of subspace diagonalization", &
7420  usage="EPS_ENE 1.e-8", &
7421  default_r_val=1.e-4_dp)
7422  CALL section_add_keyword(section, keyword)
7423  CALL keyword_release(keyword)
7424 
7425  CALL keyword_create(keyword, __location__, name="EPS_ADAPT_SCF", &
7426  description="Required density matrix accuracy as compared to current SCF convergence", &
7427  usage="EPS_ADAPT_SCF 1.e-1", &
7428  default_r_val=1._dp)
7429  CALL section_add_keyword(section, keyword)
7430  CALL keyword_release(keyword)
7431 
7432  CALL keyword_create( &
7433  keyword, __location__, name="EPS_SKIP_SUB_DIAG", &
7434  description="Level of convergence to be reached before starting the internal loop of subspace rotations."// &
7435  " Above this threshold only the outer diagonalization method is used."// &
7436  " If negative the subspace rotation is started at the first iteration", &
7437  usage="EPS_SKIP_SUB_DIAG 0.001", &
7438  default_r_val=-1.0_dp)
7439  CALL section_add_keyword(section, keyword)
7440  CALL keyword_release(keyword)
7441 
7442  CALL create_mixing_section(subsection)
7443  CALL section_add_subsection(section, subsection)
7444  CALL section_release(subsection)
7445  END SUBROUTINE create_diag_subspace_section
7446 
7447 ! **************************************************************************************************
7448 !> \brief makes the input section for core-level spectroscopy simulations
7449 !> \param section ...
7450 !> \par History
7451 !> 03.2005 created [MI]
7452 ! **************************************************************************************************
7453  SUBROUTINE create_xas_section(section)
7454  TYPE(section_type), POINTER :: section
7455 
7456  TYPE(keyword_type), POINTER :: keyword
7457  TYPE(section_type), POINTER :: print_key, subsection
7458 
7459  cpassert(.NOT. ASSOCIATED(section))
7460  CALL section_create(section, __location__, name="xas", &
7461  description="Sets the method of choice to calculate core-level excitation spectra. "// &
7462  "The occupied states from which we calculate the "// &
7463  "excitation should be specified. "// &
7464  "Localization of the orbitals may be useful.", &
7465  n_keywords=10, n_subsections=1, repeats=.false., &
7466  citations=(/iannuzzi2007/))
7467 
7468  NULLIFY (keyword, subsection, print_key)
7469 
7470  CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
7471  description="controls the activation of core-level spectroscopy simulations", &
7472  usage="&XAS T", &
7473  default_l_val=.false., &
7474  lone_keyword_l_val=.true.)
7475  CALL section_add_keyword(section, keyword)
7476  CALL keyword_release(keyword)
7477 
7478  CALL keyword_create(keyword, __location__, name="METHOD", &
7479  variants=(/"XAS_METHOD"/), &
7480  description="Method to be used to calculate core-level excitation spectra", &
7481  usage="METHOD TP_HH", &
7482  default_i_val=xas_none, &
7483  enum_c_vals=s2a("NONE", "TP_HH", "TP_FH", "TP_VAL", "TP_XHH", "TP_XFH", "DSCF", "TP_FLEX"), &
7484  enum_desc=s2a( &
7485  "No core electron spectroscopy", "Transition potential half-hole", &
7486  "Transition potential full-hole", "Hole in homo for X-ray emission only ", &
7487  "Transition potential excited half-hole", &
7488  "Transition potential excited full-hole ", &
7489  "DSCF calculations to compute the first (core)excited state", &
7490  "Transition potential with generalized core occupation and total number of electrons"), &
7491  enum_i_vals=(/xas_none, xas_tp_hh, xas_tp_fh, xes_tp_val, xas_tp_xhh, &
7493  CALL section_add_keyword(section, keyword)
7494  CALL keyword_release(keyword)
7495 
7496  CALL keyword_create(keyword, __location__, name="XAS_CORE", &
7497  description="Occupation of the core state in XAS calculation by TP_FLEX.", &
7498  usage="XAS_CORE 0.5", &
7499  default_r_val=0.5_dp)
7500  CALL section_add_keyword(section, keyword)
7501  CALL keyword_release(keyword)
7502 
7503  CALL keyword_create(keyword, __location__, name="XAS_TOT_EL", &
7504  description="Total number of electrons for spin channel alpha, in XAS calculation by TP_FLEX. "// &
7505  "If it is a negative value, the number of electrons is set to GS number of electrons "// &
7506  "minus the amount subtracted from the core state", &
7507  usage="XAS_TOT_EL 10", &
7508  default_r_val=-1._dp)
7509  CALL section_add_keyword(section, keyword)
7510  CALL keyword_release(keyword)
7511 
7512  CALL keyword_create(keyword, __location__, name="XES_CORE", &
7513  description="Occupation of the core state in XES calculation by TP_VAL. "// &
7514  "The HOMO is emptied by the same amount.", &
7515  usage="XES_CORE 0.5", &
7516  default_r_val=1._dp)
7517  CALL section_add_keyword(section, keyword)
7518  CALL keyword_release(keyword)
7519 
7520  CALL keyword_create(keyword, __location__, name="XES_EMPTY_HOMO", &
7521  description="Set the occupation of the HOMO in XES calculation by TP_VAL. "// &
7522  "The HOMO can be emptied or not, if the core is still full.", &
7523  usage="XES_EMPTY_HOMO", &
7524  default_l_val=.false., &
7525  lone_keyword_l_val=.true.)
7526  CALL section_add_keyword(section, keyword)
7527  CALL keyword_release(keyword)
7528 
7529  CALL keyword_create(keyword, __location__, name="DIPOLE_FORM", &
7530  variants=(/"DIP_FORM"/), &
7531  description="Type of integral to get the oscillator strengths "// &
7532  "in the diipole approximation", &
7533  usage="DIPOLE_FORM string", &
7534  default_i_val=xas_dip_vel, &
7535  enum_c_vals=s2a("LENGTH", "VELOCITY"), &
7536  enum_desc=s2a("Length form &lang; i | e r | j &rang;", &
7537  "Velocity form &lang; i | d/dr | j &rang;"), &
7538  enum_i_vals=(/xas_dip_len, xas_dip_vel/))
7539  CALL section_add_keyword(section, keyword)
7540  CALL keyword_release(keyword)
7541 
7542 ! replace the specialized keyword with standard scf section
7543 ! scf_env is added to xas_env
7544 
7545  NULLIFY (subsection)
7546  CALL create_scf_section(subsection)
7547  CALL section_add_subsection(section, subsection)
7548  CALL section_release(subsection)
7549 
7550  CALL keyword_create(keyword, __location__, name="STATE_TYPE", &
7551  variants=(/"TYPE"/), &
7552  description="Type of the orbitals that are excited for the xas spectra calculation", &
7553  usage="STATE_TYPE 1S", &
7554  default_i_val=xas_1s_type, &
7555  enum_c_vals=s2a("1S", "2S", "2P", "3S", "3P", "3D", "4S", "4P", "4D", "4F"), &
7556  enum_desc=s2a("1s orbitals", "2s orbitals", "2p orbitals", "3s orbitals", "3p orbitals", &
7557  "3d orbitals", "4s orbitals", "4p orbitals", "4d orbitals", "4f orbitals"), &
7560  CALL section_add_keyword(section, keyword)
7561  CALL keyword_release(keyword)
7562 
7563  CALL keyword_create(keyword, __location__, name="STATE_SEARCH", &
7564  description="# of states where to look for the one to be excited", &
7565  usage="STATE_SEARCH 1", &
7566  default_i_val=-1)
7567  CALL section_add_keyword(section, keyword)
7568  CALL keyword_release(keyword)
7569 
7570  CALL keyword_create(keyword, __location__, name="SPIN_CHANNEL", &
7571  description="# Spin channel of the excited orbital", &
7572  usage="SPIN_CHANNEL 1", &
7573  default_i_val=1)
7574  CALL section_add_keyword(section, keyword)
7575  CALL keyword_release(keyword)
7576 
7577  CALL keyword_create(keyword, __location__, name="ATOMS_LIST", &
7578  variants=(/"AT_LIST"/), &
7579  description="Indexes of the atoms to be excited. "// &
7580  "This keyword can be repeated several times "// &
7581  "(useful if you have to specify many indexes).", &
7582  usage="ATOMS_LIST {integer} {integer} .. {integer} ", &
7583  n_var=-1, type_of_var=integer_t, repeats=.true.)
7584  CALL section_add_keyword(section, keyword)
7585  CALL keyword_release(keyword)
7586 
7587  CALL keyword_create(keyword, __location__, name="OVERLAP_THRESHOLD", &
7588  description="Threshold for including more than one initial core excited state "// &
7589  "per atom. The threshold is taken relative to the maximum overlap.", &
7590  usage="OVERLAP_THRESHOLD 8.e-1", default_r_val=1.0_dp)
7591  CALL section_add_keyword(section, keyword)
7592  CALL keyword_release(keyword)
7593 
7594  CALL keyword_create(keyword, __location__, name="ORBITAL_LIST", &
7595  variants=(/"ORBITAL_LIST"/), &
7596  description="Indices of the localized orbitals to be excited. "// &
7597  "This keyword can be repeated several times "// &
7598  "(useful if you have to specify many indexes).", &
7599  usage="ORBITAL_LIST {integer} {integer} .. {integer} ", &
7600  n_var=-1, type_of_var=integer_t, repeats=.true.)
7601  CALL section_add_keyword(section, keyword)
7602  CALL keyword_release(keyword)
7603 
7604  CALL keyword_create(keyword, __location__, name="ADDED_MOS", &
7605  description="Number of additional MOS added spin up only", &
7606  usage="ADDED_MOS {integer}", default_i_val=-1)
7607  CALL section_add_keyword(section, keyword)
7608  CALL keyword_release(keyword)
7609 
7610  CALL keyword_create(keyword, __location__, name="MAX_ITER_ADDED", &
7611  description="maximum number of iteration in calculation of added orbitals", &
7612  usage="MAX_ITER_ADDED 100", default_i_val=2999)
7613  CALL section_add_keyword(section, keyword)
7614  CALL keyword_release(keyword)
7615 
7616  CALL keyword_create(keyword, __location__, name="EPS_ADDED", &
7617  description="target accuracy incalculation of the added orbitals", &
7618  usage="EPS_ADDED 1.e-6", default_r_val=1.0e-5_dp)
7619  CALL section_add_keyword(section, keyword)
7620  CALL keyword_release(keyword)
7621 
7622  CALL keyword_create(keyword, __location__, name="NGAUSS", &
7623  description="Number of gto's for the expansion of the STO "// &
7624  "of the type given by STATE_TYPE", &
7625  usage="NGAUSS {integer}", default_i_val=3)
7626  CALL section_add_keyword(section, keyword)
7627  CALL keyword_release(keyword)
7628 
7629  CALL keyword_create(keyword, __location__, name="RESTART", &
7630  description="Restart the excited state if the restart file exists", &
7631  usage="RESTART", &
7632  default_l_val=.false., lone_keyword_l_val=.true.)
7633  CALL section_add_keyword(section, keyword)
7634  CALL keyword_release(keyword)
7635 
7636  CALL keyword_create(keyword, __location__, name="WFN_RESTART_FILE_NAME", &
7637  variants=(/"RESTART_FILE_NAME"/), &
7638  description="Root of the file names where to read the MOS from "// &
7639  "which to restart the calculation of the core level excited states", &
7640  usage="WFN_RESTART_FILE_NAME <FILENAME>", &
7641  type_of_var=lchar_t)
7642  CALL section_add_keyword(section, keyword)
7643  CALL keyword_release(keyword)
7644 
7645  CALL create_localize_section(subsection)
7646  CALL section_add_subsection(section, subsection)
7647  CALL section_release(subsection)
7648 
7649  CALL section_create(subsection, __location__, name="PRINT", &
7650  description="printing of information during the core-level spectroscopy simulation", &
7651  repeats=.false.)
7652 
7653  ! Add printing of wannier infos
7654  CALL print_wanniers(subsection)
7655 
7656  CALL cp_print_key_section_create(print_key, __location__, "iteration_info", &
7657  description="Controls the printing of basic iteration information during the XAS SCF.", &
7658  print_level=low_print_level, filename="__STD_OUT__")
7659  CALL keyword_create(keyword, __location__, name="time_cumul", &
7660  description="If the printkey is activated switches the printing of timings"// &
7661  " to cumulative (over the SCF).", &
7662  default_l_val=.false., lone_keyword_l_val=.true.)
7663  CALL section_add_keyword(print_key, keyword)
7664  CALL keyword_release(keyword)
7665  CALL section_add_subsection(subsection, print_key)
7666  CALL section_release(print_key)
7667 
7668  CALL cp_print_key_section_create(print_key, __location__, "program_run_info", &
7669  description="Controls the printing of basic iteration information in CLS", &
7670  print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
7671  CALL section_add_subsection(subsection, print_key)
7672  CALL section_release(print_key)
7673 
7674  CALL cp_print_key_section_create(print_key, __location__, "XES_SPECTRUM", &
7675  description="Controls the dumping of the CLS output files containing the emission spectra", &
7676  print_level=low_print_level, common_iter_levels=3, filename="")
7677  CALL section_add_subsection(subsection, print_key)
7678  CALL section_release(print_key)
7679 
7681  print_key, __location__, "XAS_SPECTRUM", &
7682  description="Controls the dumping of the CLS output files containing the absorption spectra", &
7683  print_level=low_print_level, common_iter_levels=3, filename="")
7684  CALL section_add_subsection(subsection, print_key)
7685  CALL section_release(print_key)
7686 
7687  CALL create_pdos_section(print_key)
7688  CALL section_add_subsection(subsection, print_key)
7689  CALL section_release(print_key)
7690 
7691  CALL cp_print_key_section_create(print_key, __location__, "RESTART", &
7692  description="Controls the dumping of MO restart file during the SCF. "// &
7693  "of a Core-Level-Spectroscopy calculation. For each new excited atom, "// &
7694  "one different restart file is dumped. These restart files should be "// &
7695  "employed only to restart the same type of CLS calculation, "// &
7696  "i.e. with the same core potential.", &
7697  print_level=low_print_level, common_iter_levels=3, each_iter_names=s2a("XAS_SCF"), &
7698  add_last=add_last_numeric, each_iter_values=(/3/), filename="")
7699  CALL section_add_subsection(subsection, print_key)
7700  CALL section_release(print_key)
7701 
7702  CALL cp_print_key_section_create(print_key, __location__, "FULL_RESTART", &
7703  description="Controls the dumping of a standard MO restart file "// &
7704  "where coefficients and occupation numbers are those of the TP scheme, "// &
7705  "i.e. with emptied core state.", &
7706  print_level=high_print_level, common_iter_levels=3, each_iter_names=s2a("XAS_SCF"), &
7707  add_last=add_last_numeric, each_iter_values=(/3/), filename="")
7708  CALL section_add_subsection(subsection, print_key)
7709  CALL section_release(print_key)
7710 
7711  CALL cp_print_key_section_create(print_key, __location__, "CLS_FUNCTION_CUBES", &
7712  description="Controls the printing of the relaxed orbitals ", &
7713  print_level=high_print_level, common_iter_levels=3, add_last=add_last_numeric, filename="")
7714  CALL keyword_create(keyword, __location__, name="stride", &
7715  description="The stride (X,Y,Z) used to write the cube file "// &
7716  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
7717  " 1 number valid for all components.", &
7718  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
7719  CALL section_add_keyword(print_key, keyword)
7720  CALL keyword_release(keyword)
7721 
7722  CALL keyword_create(keyword, __location__, name="CUBES_LU_BOUNDS", &
7723  variants=(/"CUBES_LU"/), &
7724  description="The lower and upper index of the states to be printed as cube", &
7725  usage="CUBES_LU_BOUNDS integer integer", &
7726  n_var=2, default_i_vals=(/0, -2/), type_of_var=integer_t)
7727  CALL section_add_keyword(print_key, keyword)
7728  CALL keyword_release(keyword)
7729 
7730  CALL keyword_create(keyword, __location__, name="CUBES_LIST", &
7731  description="Indexes of the states to be printed as cube files "// &
7732  "This keyword can be repeated several times "// &
7733  "(useful if you have to specify many indexes).", &
7734  usage="CUBES_LIST 1 2", &
7735  n_var=-1, type_of_var=integer_t, repeats=.true.)
7736  CALL section_add_keyword(print_key, keyword)
7737  CALL keyword_release(keyword)
7738  CALL keyword_create(keyword, __location__, name="APPEND", &
7739  description="append the cube files when they already exist", &
7740  default_l_val=.false., lone_keyword_l_val=.true.)
7741  CALL section_add_keyword(print_key, keyword)
7742  CALL keyword_release(keyword)
7743 
7744  CALL section_add_subsection(subsection, print_key)
7745  CALL section_release(print_key)
7746 
7747  CALL section_add_subsection(section, subsection)
7748  CALL section_release(subsection)
7749 
7750  END SUBROUTINE create_xas_section
7751 
7752 ! **************************************************************************************************
7753 !> \brief makes the input section for core-level spectroscopy simulations using
7754 !> linear response TDDFT
7755 !> \param section ...
7756 !> \par History
7757 !> 11.2017 created [AB]
7758 ! **************************************************************************************************
7759  SUBROUTINE create_xas_tdp_section(section)
7760  TYPE(section_type), POINTER :: section
7761 
7762  TYPE(keyword_type), POINTER :: keyword
7763  TYPE(section_type), POINTER :: print_key, subsection, subsubsection, &
7764  subsubsubsection
7765 
7766  NULLIFY (keyword, print_key, subsection, subsubsection, subsubsubsection)
7767 
7768  cpassert(.NOT. ASSOCIATED(section))
7769  CALL section_create(section, __location__, name="XAS_TDP", &
7770  description="XAS simulations using linear-response TDDFT. Excitation from "// &
7771  "specified core orbitals are considered one at a time. In case of high "// &
7772  "symmetry structures, donor core orbitals should be localized.", &
7773  n_keywords=19, n_subsections=4, repeats=.false.)
7774 
7775  NULLIFY (keyword, subsection, print_key)
7776 
7777  CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
7778  description="controls the activation of XAS simulations with linear "// &
7779  "response TDDFT.", &
7780  usage="&TDP_XAS {logical}", &
7781  default_l_val=.false., &
7782  lone_keyword_l_val=.true.)
7783  CALL section_add_keyword(section, keyword)
7784  CALL keyword_release(keyword)
7785 
7786  CALL keyword_create(keyword, __location__, name="CHECK_ONLY", &
7787  description="This keyword defines whether the full calculation should "// &
7788  "be done or not. If set to .TRUE., only the determination "// &
7789  "of donor MOs is conducted. This run option allows for "// &
7790  "cheap verification of the input parameters", &
7791  usage="CHECK_ONLY {logical}", &
7792  default_l_val=.false., &
7793  lone_keyword_l_val=.true., &
7794  repeats=.false.)
7795  CALL section_add_keyword(section, keyword)
7796  CALL keyword_release(keyword)
7797 
7798  CALL keyword_create(keyword, __location__, name="RESTART_FROM_FILE", &
7799  variants=s2a("RESTART_FILENAME", "RST_FILENAME", "RESTART_FILE", "RST_FILE"), &
7800  description="By providing a RESTART file containing the linear-response "// &
7801  "orbitals and excitations energies from a previous calculation, "// &
7802  "all computations are skipped except for the corresponding "// &
7803  "PDOS and/or CUBE file printing as defined in the PRINT "// &
7804  "subsection. Basis sets and geometry need to be consistent.", &
7805  usage="RESTART_FROM_FILE <FILENAME>", &
7806  type_of_var=char_t, n_var=-1)
7807  CALL section_add_keyword(section, keyword)
7808  CALL keyword_release(keyword)
7809 
7810  CALL keyword_create(keyword, __location__, name="EXCITATIONS", &
7811  variants=(/"EXCITATION"/), &
7812  description="Specify the type of excitation to consider. In case of a "// &
7813  "resctricted closed-shell ground state calculation, "// &
7814  "RCS_SINGLET or/and RCS_TRIPLET can be chosen. In case of a "// &
7815  "open-shell ground state calculation (either UKS or ROKS), "// &
7816  "standard spin conserving excitation (OS_SPIN_CONS) or/and "// &
7817  "spin-flip excitation (OS_SPIN_FLIP) can be chosen.", &
7818  usage="EXCITATIONS {string}", &
7819  repeats=.true., &
7820  default_i_val=tddfpt_singlet, &
7821  enum_c_vals=s2a("RCS_SINGLET", "RCS_TRIPLET", "OS_SPIN_CONS", "OS_SPIN_FLIP"), &
7822  enum_desc=s2a("Singlet excitation on top of restricted closed-shell ground state", &
7823  "Triplet excitation on top of restricted closed-shell ground state", &
7824  "Spin-conserving excitations on top of open-shell ground state", &
7825  "Spin-flip excitation on top of open-shell ground state"), &
7827  CALL section_add_keyword(section, keyword)
7828  CALL keyword_release(keyword)
7829 
7830  CALL keyword_create(keyword, __location__, name="EPS_PGF_XAS", &
7831  variants=s2a("EPS_PGF", "EPS_PGF_XAS_TDP"), &
7832  description="The threshold used to determine the spacial extent of all "// &
7833  "primitive Gaussian functions used for the construction "// &
7834  "of neighbor lists in the XAS_TDP method. "// &
7835  "By default, takes the value of QS%EPS_PGF_ORB. Useful if "// &
7836  "the former value is tiny due to possible ground state HFX "// &
7837  "contributions.", &
7838  usage="EPS_PGS_XAS {real}", &
7839  type_of_var=real_t)
7840  CALL section_add_keyword(section, keyword)
7841  CALL keyword_release(keyword)
7842 
7843  CALL keyword_create(keyword, __location__, name="EPS_FILTER", &
7844  variants=s2a("EPS_FILTER_MATRIX"), &
7845  description="The threshold used for sparse matrix operations", &
7846  usage="EPS_FILTER {real}", &
7847  type_of_var=real_t, &
7848  default_r_val=1.0e-10_dp)
7849  CALL section_add_keyword(section, keyword)
7850  CALL keyword_release(keyword)
7851 
7852  CALL keyword_create(keyword, __location__, name="DIPOLE_FORM", &
7853  variants=(/"DIP_FORM"/), &
7854  description="Type of integral to get the oscillator strengths "// &
7855  "in the dipole approximation", &
7856  usage="DIPOLE_FORM {string}", &
7857  default_i_val=xas_dip_vel, &
7858  enum_c_vals=s2a("LENGTH", "VELOCITY"), &
7859  enum_desc=s2a("Length form &lang; 0 | e r | n &rang;", &
7860  "Velocity form &lang; 0 | d/dr | n &rang;"), &
7861  enum_i_vals=(/xas_dip_len, xas_dip_vel/))
7862  CALL section_add_keyword(section, keyword)
7863  CALL keyword_release(keyword)
7864 
7865  CALL keyword_create(keyword, __location__, name="QUADRUPOLE", &
7866  variants=s2a("DO_QUADRUPOLE", "DO_QUAD", "QUAD"), &
7867  description="Compute the electric quadrupole contribution to the "// &
7868  "oscillator strenghts (in the length representation with "// &
7869  "the origin set on the relevant excited atom)", &
7870  usage="QUADRUPOLE {logical}", &
7871  default_l_val=.false., &
7872  lone_keyword_l_val=.true.)
7873  CALL section_add_keyword(section, keyword)
7874  CALL keyword_release(keyword)
7875 
7876  CALL keyword_create(keyword, __location__, name="XYZ_DIPOLE", &
7877  variants=s2a("DIPOLE_XYZ"), &
7878  description="Whether the detailed contributions of the dipole oscillator "// &
7879  "strengths along the X,Y,Z directions should be printed.", &
7880  usage="XYZ_DIPOLE {logical}", &
7881  default_l_val=.false., &
7882  lone_keyword_l_val=.true.)
7883  CALL section_add_keyword(section, keyword)
7884  CALL keyword_release(keyword)
7885 
7886 ! the GW2X correction subsection
7887  CALL section_create(subsection, __location__, name="GW2X", &
7888  description="Specifications for the GW2X calculation of core "// &
7889  "ionization potentials. Note that donor states need to be actively "// &
7890  "localized using the LOCALIZE keyword in DONOR_STATES. N_SEARCH "// &
7891  "should be kept to the minimum, such that only core states are localized.", &
7892  citations=(/shigeta2001/), &
7893  n_keywords=8, &
7894  n_subsections=0, &
7895  repeats=.false.)
7896 
7897  CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
7898  description="Enables the GW2X correction of the core ionization potentials", &
7899  usage="&GW2X {logical}", &
7900  default_l_val=.false., &
7901  lone_keyword_l_val=.true.)
7902  CALL section_add_keyword(subsection, keyword)
7903  CALL keyword_release(keyword)
7904 
7905  CALL keyword_create(keyword, __location__, name="XPS_ONLY", &
7906  description="If set to .TRUE., only run GW2X calculations for XPS "// &
7907  "spectroscopy and ignore all XAS calculations. It is still "// &
7908  "required to define the DONOR_STATES and KERNEL%EXACT_EXCHANGE "// &
7909  "subsections.", &
7910  default_l_val=.false., &
7911  lone_keyword_l_val=.true.)
7912  CALL section_add_keyword(subsection, keyword)
7913  CALL keyword_release(keyword)
7914 
7915  CALL keyword_create(keyword, __location__, name="BATCH_SIZE", &
7916  description="MOs batch size for batched tensor contraction. Larger "// &
7917  "size is faster, but uses more memory. Default should be safe "// &
7918  "in most cases.", &
7919  default_i_val=64)
7920  CALL section_add_keyword(subsection, keyword)
7921  CALL keyword_release(keyword)
7922 
7923  CALL keyword_create(keyword, __location__, name="EPS_GW2X", &
7924  description="Convergence threshold for GW2X iterations (in eV)", &
7925  default_r_val=1.e-2_dp)
7926  CALL section_add_keyword(subsection, keyword)
7927  CALL keyword_release(keyword)
7928 
7929  CALL keyword_create(keyword, __location__, name="C_OS", &
7930  description="Opposite-spin scling factor. SCS => 6/5, SOS => 1.3", &
7931  default_r_val=1.0_dp)
7932  CALL section_add_keyword(subsection, keyword)
7933  CALL keyword_release(keyword)
7934 
7935  CALL keyword_create(keyword, __location__, name="C_SS", &
7936  description="Same-spin scling factor. SCS => 1/3, SOS => 0.0", &
7937  default_r_val=1.0_dp)
7938  CALL section_add_keyword(subsection, keyword)
7939  CALL keyword_release(keyword)
7940 
7941  CALL keyword_create(keyword, __location__, name="MAX_GW2X_ITER", &
7942  description="Maximum number of iterations for GW2X", &
7943  default_i_val=10)
7944  CALL section_add_keyword(subsection, keyword)
7945  CALL keyword_release(keyword)
7946 
7947  CALL keyword_create(keyword, __location__, name="PSEUDO_CANONICAL", &
7948  variants=(/"PSEUDO_CANO"/), &
7949  description="Whether the pseudo-canonical version of GW2X should be used "// &
7950  "(versus only using the diagonal of the generalized Fock matrix)", &
7951  default_l_val=.true.)
7952  CALL section_add_keyword(subsection, keyword)
7953  CALL keyword_release(keyword)
7954 
7955  CALL section_add_subsection(section, subsection)
7956  CALL section_release(subsection)
7957 
7958 ! The donor state subsection
7959 
7960  CALL section_create(subsection, __location__, name="DONOR_STATES", &
7961  description="Specifications for the donor states from which core "// &
7962  "electrons are excited", &
7963  n_keywords=6, &
7964  n_subsections=0, &
7965  repeats=.false.)
7966 
7967  CALL keyword_create(keyword, __location__, name="DEFINE_EXCITED", &
7968  description="Whether the atoms to be excited should be defined by "// &
7969  "a list of atom indices or by a list of atom kinds.", &
7970  usage="DEFINE_EXCITED {string}", &
7971  default_i_val=xas_tdp_by_index, &
7972  enum_c_vals=s2a("BY_INDEX", "BY_KIND"), &
7973  enum_i_vals=(/xas_tdp_by_index, xas_tdp_by_kind/), &
7974  enum_desc=s2a("Excited atoms are defined by a list of indices", &
7975  "Excited atoms are defined by a list of atomic kinds"))
7976  CALL section_add_keyword(subsection, keyword)
7977  CALL keyword_release(keyword)
7978 
7979  CALL keyword_create(keyword, __location__, name="ATOM_LIST", &
7980  variants=(/"AT_LIST"/), &
7981  description="Indices of the atoms to be excited. "// &
7982  "Keyword only taken into account if DEFINE_EXCITED = BY_INDEX", &
7983  usage="ATOM_LIST {integer} {integer} .. {integer} ", &
7984  n_var=-1, type_of_var=integer_t, repeats=.false.)
7985  CALL section_add_keyword(subsection, keyword)
7986  CALL keyword_release(keyword)
7987 
7988  CALL keyword_create(keyword, __location__, name="KIND_LIST", &
7989  description="Kind of atoms to be excited. "// &
7990  "All atoms of the specified kinds are considered. "// &
7991  "Keyword only taken into account if DEFINE_EXCITED = BY_KIND", &
7992  usage="KIND_LIST {string} {string} .. {string} ", &
7993  n_var=-1, type_of_var=char_t, repeats=.false.)
7994  CALL section_add_keyword(subsection, keyword)
7995  CALL keyword_release(keyword)
7996 
7997  CALL keyword_create(keyword, __location__, name="STATE_TYPES", &
7998  variants=(/"TYPES"/), &
7999  description="Types of orbitals that are excited, for each atom/kind, "// &
8000  "in order to do LR-TDDFT driven xas spectra calculation. "// &
8001  "This keyword MUST have the same number of entries as the relevant "// &
8002  "KIND_LIST or ATOM_LIST. The order of the specified state types must "// &
8003  "correspond to the order of the relevant kinds/indices. "// &
8004  "This keyword can be repeated, useful when multiple orbital types "// &
8005  "should be excited for specific kinds/atoms.", &
8006  n_var=-1, default_i_val=xas_not_excited, repeats=.true., &
8007  usage="STATE_TYPES {string} {string} .. {string}", &
8008  enum_c_vals=s2a("1S", "2S", "2P", "NE"), &
8009  enum_desc=s2a("1s orbital", "2s orbital", "2p orbitals", "not excited"), &
8011  CALL section_add_keyword(subsection, keyword)
8012  CALL keyword_release(keyword)
8013 
8014  CALL keyword_create(keyword, __location__, name="N_SEARCH", &
8015  description="Number of MOs (per spin) to search to find specified donor core "// &
8016  "orbitals, starting from the lowest in energy and upward. By default, "// &
8017  "all HOMOs are searched. If the LOCALIZE keyword is used, "// &
8018  "then all searched states are first localized.", &
8019  usage="N_SEARCH {integer}", &
8020  default_i_val=-1)
8021  CALL section_add_keyword(subsection, keyword)
8022  CALL keyword_release(keyword)
8023 
8024  CALL keyword_create(keyword, __location__, name="LOCALIZE", &
8025  variants=s2a("LOC", "DO_LOC"), &
8026  description="Whether the N_SEARCH potential donor states should be "// &
8027  "actively localized. Necessary in case of excited atoms "// &
8028  "equivalent under symmetry or GW2X correction.", &
8029  usage="LOCALIZE {logical}", &
8030  default_l_val=.false., &
8031  lone_keyword_l_val=.true.)
8032  CALL section_add_keyword(subsection, keyword)
8033  CALL keyword_release(keyword)
8034 
8035  CALL section_add_subsection(section, subsection)
8036  CALL section_release(subsection)
8037 ! End of the donor states subsection
8038 
8039 ! The OT solver subsection
8040  CALL section_create(subsection, __location__, name="OT_SOLVER", &
8041  description="Specifications for the iterative OT solver. Note: only "// &
8042  "available within the Tamm-Dancoff approximation. Recommanded if excitations "// &
8043  "from multiple donor states take place.", &
8044  n_keywords=4, &
8045  n_subsections=0, &
8046  repeats=.false.)
8047 
8048  CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
8049  description="Enables the usage of the OT iterator solver", &
8050  usage="&OT_SOLVER {logical}", &
8051  default_l_val=.false., &
8052  lone_keyword_l_val=.true.)
8053  CALL section_add_keyword(subsection, keyword)
8054  CALL keyword_release(keyword)
8055 
8056  CALL keyword_create(keyword, __location__, name="MAX_ITER", &
8057  description="Maximum number of iterations allowed for the OT solver", &
8058  usage="MAX_ITER {integer}", &
8059  default_i_val=50)
8060  CALL section_add_keyword(subsection, keyword)
8061  CALL keyword_release(keyword)
8062 
8063  CALL keyword_create(keyword, __location__, name="EPS_ITER", &
8064  description="Convergence threshold for the OT solver", &
8065  usage="EPS_ITER {double}", &
8066  default_r_val=1.0e-4_dp)
8067  CALL section_add_keyword(subsection, keyword)
8068  CALL keyword_release(keyword)
8069 
8070  CALL keyword_create(keyword, __location__, name="MINIMIZER", &
8071  description="Minimizer to be used with the OT solver", &
8072  usage="MINIMIZER DIIS", &
8073  default_i_val=ot_mini_diis, &
8074  enum_c_vals=s2a("CG", "DIIS"), &
8075  enum_desc=s2a("Conjugated gradient: safer", &
8076  "Direct inversion of the iterative subspace: faster"), &
8077  enum_i_vals=(/ot_mini_cg, ot_mini_diis/))
8078  CALL section_add_keyword(subsection, keyword)
8079  CALL keyword_release(keyword)
8080 
8081  CALL section_add_subsection(section, subsection)
8082  CALL section_release(subsection)
8083 ! End of the OT solver subsection
8084 
8085  CALL keyword_create(keyword, __location__, name="SPIN_ORBIT_COUPLING", &
8086  variants=(/"SOC"/), &
8087  description="Whether spin-orbit coupling should be added. "// &
8088  "Note: only applies for spin-restricted calculations with "// &
8089  "singlet and triplet excitations OR spin-unrestricted "// &
8090  "calculations with both spin-conserving and spin-flip.", &
8091  usage="SOC {logical}", &
8092  default_l_val=.false., &
8093  lone_keyword_l_val=.true.)
8094  CALL section_add_keyword(section, keyword)
8095  CALL keyword_release(keyword)
8096 
8097  CALL keyword_create(keyword, __location__, name="TAMM_DANCOFF", &
8098  variants=(/"TDA"/), &
8099  description="Whether the Tamm-Dancoff approximation should be used.", &
8100  usage="TAMM_DANCOFF {logical}", &
8101  default_l_val=.true., &
8102  lone_keyword_l_val=.true.)
8103  CALL section_add_keyword(section, keyword)
8104  CALL keyword_release(keyword)
8105 
8106  CALL keyword_create(keyword, __location__, name="GRID", &
8107  variants=(/"ATOMIC_GRID"/), &
8108  description="Specification of the atomic angular and radial grids for "// &
8109  "a given atomic kind. This keyword can/should be repeated "// &
8110  "for each excited kind. The default grid dimensions are "// &
8111  "those set for the GAPW ground state calculation. These "// &
8112  "grids are used for the xc-kernel integration. "// &
8113  "Usage: GRID < KIND > < LEBEDEV_GRID > < RADIAL_GRID >", &
8114  usage="GRID {string} {integer} {integer}", &
8115  n_var=3, type_of_var=char_t, repeats=.true.)
8116  CALL section_add_keyword(section, keyword)
8117  CALL keyword_release(keyword)
8118 
8119  CALL keyword_create(keyword, __location__, name="N_EXCITED", &
8120  variants=(/"N_ROOTS"/), &
8121  description="The number of excited states to compute per donor "// &
8122  "molecular orbital. (e.g. if 2p excitations, "// &
8123  "3*N_EXCITED excited states are considered). "// &
8124  "If N_EXCITED is set to -1, all excitations are considered", &
8125  usage="N_EXCITED {integer}", &
8126  default_i_val=-1)
8127  CALL section_add_keyword(section, keyword)
8128  CALL keyword_release(keyword)
8129 
8130  CALL keyword_create(keyword, __location__, name="ENERGY_RANGE", &
8131  variants=s2a("E_RANGE"), &
8132  description="The energy range in eV for which excitations are considered. "// &
8133  "Only excitated states within the range of: first excitation "// &
8134  "energy + ENERGY_RANGE are kept. If ENERGY_RANGE "// &
8135  "and N_EXCITED are specified, the former has priority. "// &
8136  "Negative values are ignored and N_EXCITED takes over.", &
8137  usage="ENERGY_RANGE {real}", &
8138  default_r_val=-1.0_dp)
8139  CALL section_add_keyword(section, keyword)
8140  CALL keyword_release(keyword)
8141 
8142 ! The KERNEL subsection
8143  CALL section_create(subsection, __location__, name="KERNEL", &
8144  description="Defines how the kernel is built in terms of functionals.", &
8145  n_keywords=1, &
8146  n_subsections=1, &
8147  repeats=.false.)
8148 
8149  CALL keyword_create(keyword, __location__, name="RI_REGION", &
8150  variants=(/"RI_RADIUS"/), &
8151  description="The region defined by a sphere of the given radius around "// &
8152  "the excited atom defining which RI_XAS basis elements are "// &
8153  "considered for the RI projection of the density. Each basis "// &
8154  "element which center is in this region is taken. The density "// &
8155  "for a given excited atom is expressed as : "// &
8156  "sum_ijkl P_ij (ijk) S_kl^-1 xi_l, where P_ij is the density "// &
8157  "matrix, i,j span the orbital basis and k,l the RI_XAS basis "// &
8158  "in the region. The larger the radius, the more basis "// &
8159  "functions to expand the density. However, it is assumed "// &
8160  "that it is a small number and the code does not scale well "// &
8161  "as the number of RI basis elements gets too large. "// &
8162  "Expressed in Angstrom. If the radius is set to 0.0, only "// &
8163  "the RI basis elements centered on the excited atom are used.", &
8164  usage="RI_REGION {real}", &
8165  default_r_val=0.0_dp)
8166  CALL section_add_keyword(subsection, keyword)
8167  CALL keyword_release(keyword)
8168 
8169 ! The XC_FUNCTIONAL subsubsection
8170  CALL create_xc_fun_section(subsubsection)
8171  CALL section_add_subsection(subsection, subsubsection)
8172  CALL section_release(subsubsection)
8173 
8174 ! The EXACT_EXCHANGE subsubsection
8175  CALL section_create(subsubsection, __location__, name="EXACT_EXCHANGE", &
8176  description="Whether exact-exchange should be added to the kernel and "// &
8177  "if so, with which fraction and operator.", &
8178  n_keywords=7, &
8179  n_subsections=1, &
8180  repeats=.false.)
8181 
8182  CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
8183  description="Enables the addition of exact exchange to the kernel.", &
8184  usage="&EXACT_EXCHANGE {logical}", &
8185  default_l_val=.false., &
8186  lone_keyword_l_val=.true.)
8187  CALL section_add_keyword(subsubsection, keyword)
8188  CALL keyword_release(keyword)
8189 
8190  CALL keyword_create(keyword, __location__, name="POTENTIAL_TYPE", &
8191  variants=s2a("OP", "OPERATOR", "POTENTIAL"), &
8192  description="The type of operator used for exact exchange. The standard "// &
8193  "Coulomb operator cannot be used in periodic systems.", &
8194  usage="OPERATOR {string}", &
8195  repeats=.false., &
8196  default_i_val=do_potential_coulomb, &
8197  enum_c_vals=s2a("COULOMB", "TRUNCATED", "SHORTRANGE"), &
8198  enum_desc=s2a("Standard Coulomb operator: 1/r", &
8199  "Truncated Coulomb operator: 1/r if r < R_c, 0 otherwise ", &
8200  "Short range: erfc(omega*r)/r"), &
8203  CALL section_add_keyword(subsubsection, keyword)
8204  CALL keyword_release(keyword)
8205 
8206  CALL keyword_create(keyword, __location__, name="CUTOFF_RADIUS", &
8207  variants=s2a("R_C", "RC", "RANGE"), &
8208  description="The cutoff radius (in Angstrom) for the truncated Coulomb operator.", &
8209  usage="CUTOFF_RADIUS {double}", &
8210  default_r_val=0.0_dp, &
8211  repeats=.false.)
8212  CALL section_add_keyword(subsubsection, keyword)
8213  CALL keyword_release(keyword)
8214 
8215  CALL keyword_create(keyword, __location__, name="T_C_G_DATA", &
8216  description="Location of the file t_c_g.dat that contains the data for the "// &
8217  "evaluation of the truncated gamma function ", &
8218  usage="T_C_G_DATA {string}", &
8219  default_c_val="t_c_g.dat")
8220  CALL section_add_keyword(subsubsection, keyword)
8221  CALL keyword_release(keyword)
8222 
8223  CALL keyword_create(keyword, __location__, name="OMEGA", &
8224  description=operator"The range parameter for the short range (in 1/a0).", &
8225  usage="OMEGA {double}", &
8226  default_r_val=0.0_dp, &
8227  repeats=.false.)
8228  CALL section_add_keyword(subsubsection, keyword)
8229  CALL keyword_release(keyword)
8230 
8231  CALL keyword_create(keyword, __location__, name="EPS_RANGE", &
8232  description="The threshold to determine the effective range of the short range "// &
8233  "operator: erfc(omega*eff_range)/eff_range = EPS_RANGE", &
8234  usage="EPS_RANGE = {double}", &
8235  default_r_val=1.0e-6_dp, &
8236  repeats=.false.)
8237  CALL section_add_keyword(subsubsection, keyword)
8238  CALL keyword_release(keyword)
8239 
8240  CALL keyword_create(keyword, __location__, name="EPS_SCREENING", &
8241  variants=s2a("EPS_SCREEN"), &
8242  description="A threshold to determine which primitive 3-center integrals "// &
8243  "are kept for contraction, as the latter operation can be "// &
8244  "expensive (especially for large basis sets ). "// &
8245  "If |(ab|c)| < EPS_SCREENNING, it is discarded.", &
8246  default_r_val=1.0e-8_dp, &
8247  repeats=.false.)
8248  CALL section_add_keyword(subsubsection, keyword)
8249  CALL keyword_release(keyword)
8250 
8251  CALL keyword_create(keyword, __location__, name="SCALE", &
8252  variants=s2a("FRACTION"), &
8253  description="Scaling of the exact exchange contribution.", &
8254  default_r_val=1.0_dp)
8255  CALL section_add_keyword(subsubsection, keyword)
8256  CALL keyword_release(keyword)
8257 
8258  !The RI metric subsection
8259  CALL section_create(subsubsubsection, __location__, name="RI_METRIC", &
8260  description="This subsection allows for the definition of an exchange "// &
8261  "RI metric that is different from the main exchange potential. "// &
8262  "By default (i.e. if this subsection is ignored), the "// &
8263  "exchange kernel is computed in the V approximation: "// &
8264  "(ab|ij) = (ab|P) V^-1 (Q|ij), where V = (P|Q). With a RI "// &
8265  "metric, we have a 2 step RI involving the metric potential "// &
8266  "for the 3-center integrals: "// &
8267  "(ab|ij) = (ab!P) (P!Q)^-1 (Q|R) (R!S)^-1 (S!ij), where | "// &
8268  "stands for the exchange potential and ! for the metric "// &
8269  "potential. This allows for drastic screening of the "// &
8270  "3-center integrals by selecting shorter range metric.", &
8271  n_keywords=5, &
8272  n_subsections=0, &
8273  repeats=.false.)
8274 
8275  CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
8276  description="Enables the use of a RI metric.", &
8277  usage="&EXACT_EXCHANGE {logical}", &
8278  default_l_val=.false., &
8279  lone_keyword_l_val=.true.)
8280  CALL section_add_keyword(subsubsubsection, keyword)
8281  CALL keyword_release(keyword)
8282 
8283  CALL keyword_create(keyword, __location__, name="POTENTIAL_TYPE", &
8284  variants=s2a("OP", "OPERATOR", "POTENTIAL"), &
8285  description="The type of operator used for the metric.", &
8286  usage="OPERATOR {string}", &
8287  repeats=.false., &
8288  default_i_val=do_potential_id, &
8289  enum_c_vals=s2a("OVERLAP", "TRUNCATED", "SHORTRANGE"), &
8290  enum_desc=s2a(operator"Overlap (=identity)", &
8291  "Truncated Coulomb operator: 1/r if r < R_c, 0 otherwise ", &
8292  "Short range: erfc(omega*r)/r"), &
8293  enum_i_vals=(/do_potential_id, do_potential_truncated, &
8295  CALL section_add_keyword(subsubsubsection, keyword)
8296  CALL keyword_release(keyword)
8297 
8298  CALL keyword_create(keyword, __location__, name="CUTOFF_RADIUS", &
8299  variants=s2a("R_C", "RC", "RANGE"), &
8300  description="The cutoff radius (in Angstrom) for the truncated Coulomb operator.", &
8301  usage="CUTOFF_RADIUS {double}", &
8302  default_r_val=0.0_dp, &
8303  repeats=.false.)
8304  CALL section_add_keyword(subsubsubsection, keyword)
8305  CALL keyword_release(keyword)
8306 
8307  CALL keyword_create(keyword, __location__, name="T_C_G_DATA", &
8308  description="Location of the file t_c_g.dat that contains the data for the "// &
8309  "evaluation of the truncated gamma function ", &
8310  usage="T_C_G_DATA {string}", &
8311  default_c_val="t_c_g.dat")
8312  CALL section_add_keyword(subsubsubsection, keyword)
8313  CALL keyword_release(keyword)
8314 
8315  CALL keyword_create(keyword, __location__, name="OMEGA", &
8316  description=operator"The range parameter for the short range (in 1/a0).", &
8317  usage="OMEGA {double}", &
8318  default_r_val=0.0_dp, &
8319  repeats=.false.)
8320  CALL section_add_keyword(subsubsubsection, keyword)
8321  CALL keyword_release(keyword)
8322 
8323  CALL section_add_subsection(subsubsection, subsubsubsection)
8324  CALL section_release(subsubsubsection)
8325 
8326  CALL section_add_subsection(subsection, subsubsection)
8327  CALL section_release(subsubsection)
8328 
8329  CALL section_add_subsection(section, subsection)
8330  CALL section_release(subsection)
8331 ! End of Kernel subsection
8332 
8333  CALL section_create(subsection, __location__, "PRINT", "Controls the printing of information during "// &
8334  "XAS TDP calculations", repeats=.false.)
8335 
8336  CALL cp_print_key_section_create(print_key, __location__, name="SPECTRUM", &
8337  description="Controles the dumping of the XAS TDP spectrum in output files", &
8338  print_level=low_print_level, filename="", common_iter_levels=3)
8339  CALL section_add_subsection(subsection, print_key)
8340  CALL section_release(print_key)
8341 
8342  CALL cp_print_key_section_create(print_key, __location__, name="RESTART_WFN", &
8343  description="Controles the dumping of a MO restart file for a given "// &
8344  "excited state index. Only for K-edge RKS calculations. "// &
8345  "Can be repeated to get multiple *.wfn files at once.", &
8346  print_level=debug_print_level, filename="", common_iter_levels=1)
8347  CALL keyword_create(keyword, __location__, name="EXCITED_STATE_INDEX", variants=(/"INDEX"/), &
8348  description="The index of the excited state that should be dumped", &
8349  usage="INDEX {int}", default_i_val=1, repeats=.true.)
8350  CALL section_add_keyword(print_key, keyword)
8351  CALL keyword_release(keyword)
8352 
8353  CALL section_add_subsection(subsection, print_key)
8354  CALL section_release(print_key)
8355 
8356  CALL create_pdos_section(print_key)
8357  CALL section_add_subsection(subsection, print_key)
8358  CALL section_release(print_key)
8359 
8360  CALL cp_print_key_section_create(print_key, __location__, "CUBES", &
8361  description="Controls the printing of the linear-response orbitals "// &
8362  "as *.cube files.", &
8363  print_level=high_print_level, common_iter_levels=1, &
8364  add_last=add_last_numeric, filename="")
8365 
8366  CALL keyword_create(keyword, __location__, name="STRIDE", &
8367  description="The stride (X,Y,Z) used to write the cube file "// &
8368  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
8369  " 1 number valid for all components.", &
8370  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
8371  CALL section_add_keyword(print_key, keyword)
8372  CALL keyword_release(keyword)
8373 
8374  CALL keyword_create(keyword, __location__, name="CUBES_LU_BOUNDS", &
8375  variants=(/"CUBES_LU"/), &
8376  description="The lower and upper index of the excited states to be printed as cube", &
8377  usage="CUBES_LU_BOUNDS integer integer", &
8378  n_var=2, default_i_vals=(/1, 0/), type_of_var=integer_t)
8379  CALL section_add_keyword(print_key, keyword)
8380  CALL keyword_release(keyword)
8381 
8382  CALL keyword_create(keyword, __location__, name="CUBES_LIST", &
8383  description="Indexes of the excited states to be printed as cube files "// &
8384  "This keyword can be repeated several times "// &
8385  "(useful if you have to specify many indexes).", &
8386  usage="CUBES_LIST 1 2", &
8387  n_var=-1, type_of_var=integer_t, repeats=.true.)
8388  CALL section_add_keyword(print_key, keyword)
8389  CALL keyword_release(keyword)
8390 
8391  CALL keyword_create(keyword, __location__, name="APPEND", &
8392  description="append the cube files when they already exist", &
8393  default_l_val=.false., lone_keyword_l_val=.true.)
8394  CALL section_add_keyword(print_key, keyword)
8395  CALL keyword_release(keyword)
8396 
8397  CALL section_add_subsection(subsection, print_key)
8398  CALL section_release(print_key)
8399 
8400  CALL cp_print_key_section_create(print_key, __location__, "RESTART", &
8401  description="Controls the dumping of LR-orbitals coefficients "// &
8402  "and corresponding excitation energies such that "// &
8403  "the program can be restarted for PDOS or CUBE "// &
8404  "printing without the heavy computing.", &
8405  print_level=high_print_level, filename="", common_iter_levels=3)
8406  CALL section_add_subsection(subsection, print_key)
8407  CALL section_release(print_key)
8408 
8409  CALL section_add_subsection(section, subsection)
8410  CALL section_release(subsection)
8411 
8412  END SUBROUTINE create_xas_tdp_section
8413 
8414 ! **************************************************************************************************
8415 !> \brief Create CP2K input section for the smearing of occupation numbers
8416 !> \param section ...
8417 !> \date 27.08.2008
8418 !> \author Matthias Krack (MK)
8419 !> \version 1.0
8420 ! **************************************************************************************************
8421  SUBROUTINE create_smear_section(section)
8422 
8423  TYPE(section_type), POINTER :: section
8424 
8425  TYPE(keyword_type), POINTER :: keyword
8426 
8427  cpassert(.NOT. ASSOCIATED(section))
8428 
8429  CALL section_create(section, __location__, &
8430  name="SMEAR", &
8431  description="Define the smearing of the MO occupation numbers", &
8432  n_keywords=6, &
8433  n_subsections=0, &
8434  repeats=.false.)
8435 
8436  NULLIFY (keyword)
8437 
8438  CALL keyword_create(keyword, __location__, &
8439  name="_SECTION_PARAMETERS_", &
8440  description="Controls the activation of smearing", &
8441  usage="&SMEAR ON", &
8442  default_l_val=.false., &
8443  lone_keyword_l_val=.true.)
8444  CALL section_add_keyword(section, keyword)
8445  CALL keyword_release(keyword)
8446 
8447  CALL keyword_create(keyword, __location__, &
8448  name="METHOD", &
8449  description="Smearing method to be applied", &
8450  usage="METHOD Fermi_Dirac", &
8451  default_i_val=smear_energy_window, &
8452  enum_c_vals=s2a("FERMI_DIRAC", "ENERGY_WINDOW", "LIST"), &
8453  enum_i_vals=(/smear_fermi_dirac, smear_energy_window, smear_list/), &
8454  enum_desc=s2a("Fermi-Dirac distribution defined by the keyword ELECTRONIC_TEMPERATURE", &
8455  "Energy window defined by the keyword WINDOW_SIZE", &
8456  "Use a fixed list of occupations"))
8457  CALL section_add_keyword(section, keyword)
8458  CALL keyword_release(keyword)
8459 
8460  CALL keyword_create(keyword, __location__, &
8461  name="LIST", &
8462  description="A list of fractional occupations to use. Must match the number of states "// &
8463  "and sum up to the correct number of electrons", &
8464  repeats=.false., &
8465  n_var=-1, &
8466  type_of_var=real_t, &
8467  usage="LIST 2.0 0.6666 0.6666 0.66666 0.0 0.0")
8468  CALL section_add_keyword(section, keyword)
8469  CALL keyword_release(keyword)
8470 
8471  CALL keyword_create(keyword, __location__, &
8472  name="ELECTRONIC_TEMPERATURE", &
8473  variants=s2a("ELEC_TEMP", "TELEC"), &
8474  description="Electronic temperature in the case of Fermi-Dirac smearing", &
8475  repeats=.false., &
8476  n_var=1, &
8477  type_of_var=real_t, &
8478  default_r_val=cp_unit_to_cp2k(value=300.0_dp, unit_str="K"), &
8479  unit_str="K", &
8480  usage="ELECTRONIC_TEMPERATURE [K] 300")
8481  CALL section_add_keyword(section, keyword)
8482  CALL keyword_release(keyword)
8483 
8484  CALL keyword_create(keyword, __location__, &
8485  name="EPS_FERMI_DIRAC", &
8486  description="Accuracy checks on occupation numbers use this as a tolerance", &
8487  repeats=.false., &
8488  n_var=1, &
8489  type_of_var=real_t, &
8490  default_r_val=1.0e-10_dp, &
8491  usage="EPS_FERMI_DIRAC 1.0E-6")
8492  CALL section_add_keyword(section, keyword)
8493  CALL keyword_release(keyword)
8494 
8495  CALL keyword_create(keyword, __location__, &
8496  name="WINDOW_SIZE", &
8497  description="Size of the energy window centred at the Fermi level", &
8498  repeats=.false., &
8499  n_var=1, &
8500  type_of_var=real_t, &
8501  default_r_val=0.0_dp, &
8502  unit_str="au_e", &
8503  usage="WINDOW_SIZE [eV] 0.3")
8504  CALL section_add_keyword(section, keyword)
8505  CALL keyword_release(keyword)
8506 
8507  CALL keyword_create(keyword, __location__, name="FIXED_MAGNETIC_MOMENT", &
8508  description="Imposed difference between the numbers of electrons of spin up "// &
8509  "and spin down: m = n(up) - n(down). A negative value (default) allows "// &
8510  "for a change of the magnetic moment. -1 specifically keeps an integer "// &
8511  "number of spin up and spin down electrons.", &
8512  repeats=.false., &
8513  n_var=1, &
8514  type_of_var=real_t, &
8515  default_r_val=-100.0_dp, &
8516  usage="FIXED_MAGNETIC_MOMENT 1.5")
8517  CALL section_add_keyword(section, keyword)
8518  CALL keyword_release(keyword)
8519 
8520  END SUBROUTINE create_smear_section
8521 
8522 ! **************************************************************************************************
8523 !> \brief ...
8524 !> \param section ...
8525 ! **************************************************************************************************
8526  SUBROUTINE create_rtp_section(section)
8527  TYPE(section_type), POINTER :: section
8528 
8529  TYPE(keyword_type), POINTER :: keyword
8530  TYPE(section_type), POINTER :: print_key, print_section
8531 
8532  NULLIFY (keyword)
8533  cpassert(.NOT. ASSOCIATED(section))
8534  CALL section_create(section, __location__, name="REAL_TIME_PROPAGATION", &
8535  description="Parameters needed to set up the real time propagation"// &
8536  " for the electron dynamics. This currently works only in the NVE ensemble.", &
8537  n_keywords=4, n_subsections=4, repeats=.false., &
8538  citations=(/kunert2003, andermatt2016/))
8539 
8540  CALL keyword_create(keyword, __location__, name="MAX_ITER", &
8541  description="Maximal number of iterations for the self consistent propagator loop.", &
8542  usage="MAX_ITER 10", &
8543  default_i_val=10)
8544  CALL section_add_keyword(section, keyword)
8545  CALL keyword_release(keyword)
8546 
8547  CALL keyword_create(keyword, __location__, name="EPS_ITER", &
8548  description="Convergence criterion for the self consistent propagator loop.", &
8549  usage="EPS_ITER 1.0E-5", &
8550  default_r_val=1.0e-7_dp)
8551  CALL section_add_keyword(section, keyword)
8552  CALL keyword_release(keyword)
8553 
8554  CALL keyword_create(keyword, __location__, name="ASPC_ORDER", &
8555  description="Speciefies how many steps will be used for extrapolation. "// &
8556  "One will be always used which is means X(t+dt)=X(t)", &
8557  usage="ASPC_ORDER 3", &
8558  default_i_val=3)
8559  CALL section_add_keyword(section, keyword)
8560  CALL keyword_release(keyword)
8561 
8562  CALL keyword_create(keyword, __location__, name="MAT_EXP", &
8563  description="Which method should be used to calculate the exponential"// &
8564  " in the propagator. It is recommended to use BCH when employing density_propagation "// &
8565  "and ARNOLDI otherwise.", &
8566  usage="MAT_EXP TAYLOR", default_i_val=do_arnoldi, &
8567  enum_c_vals=s2a("TAYLOR", "PADE", "ARNOLDI", "BCH"), &
8568  enum_i_vals=(/do_taylor, do_pade, do_arnoldi, do_bch/), &
8569  enum_desc=s2a("exponential is evaluated using scaling and squaring in combination"// &
8570  " with a taylor expansion of the exponential.", &
8571  "uses scaling and squaring together with the pade approximation", &
8572  "uses arnoldi subspace algorithm to compute exp(H)*MO directly, can't be used in "// &
8573  "combination with Crank Nicholson or density propagation", &
8574  "Uses a Baker-Campbell-Hausdorff expansion to propagate the density matrix,"// &
8575  " only works for density propagation"))
8576  CALL section_add_keyword(section, keyword)
8577  CALL keyword_release(keyword)
8578 
8579  CALL keyword_create(keyword, __location__, name="DENSITY_PROPAGATION", &
8580  description="The density matrix is propagated instead of the molecular orbitals. "// &
8581  "This can allow a linear scaling simulation. The density matrix is filtered with "// &
8582  "the threshold based on the EPS_FILTER keyword from the LS_SCF section", &
8583  usage="DENSITY_PROPAGATION .TRUE.", &
8584  default_l_val=.false., lone_keyword_l_val=.true.)
8585  CALL section_add_keyword(section, keyword)
8586  CALL keyword_release(keyword)
8587 
8588  CALL keyword_create(keyword, __location__, name="SC_CHECK_START", &
8589  description="Speciefies how many iteration steps will be done without "// &
8590  "a check for self consistency. Can save some time in big calculations.", &
8591  usage="SC_CHECK_START 3", &
8592  default_i_val=0)
8593  CALL section_add_keyword(section, keyword)
8594  CALL keyword_release(keyword)
8595 
8596  CALL keyword_create(keyword, __location__, name="EXP_ACCURACY", &
8597  description="Accuracy for the taylor and pade approximation. "// &
8598  "This is only an upper bound bound since the norm used for the guess "// &
8599  "is an upper bound for the needed one.", &
8600  usage="EXP_ACCURACY 1.0E-6", &
8601  default_r_val=1.0e-9_dp)
8602  CALL section_add_keyword(section, keyword)
8603  CALL keyword_release(keyword)
8604 
8605  CALL keyword_create(keyword, __location__, name="PROPAGATOR", &
8606  description="Which propagator should be used for the orbitals", &
8607  usage="PROPAGATOR ETRS", default_i_val=do_etrs, &
8608  enum_c_vals=s2a("ETRS", "CN", "EM"), &
8609  enum_i_vals=(/do_etrs, do_cn, do_em/), &
8610  enum_desc=s2a("enforced time reversible symmetry", &
8611  "Crank Nicholson propagator", &
8612  "Exponential midpoint propagator"))
8613  CALL section_add_keyword(section, keyword)
8614  CALL keyword_release(keyword)
8615 
8616  CALL keyword_create(keyword, __location__, name="INITIAL_WFN", &
8617  description="Controls the initial WFN used for propagation. "// &
8618  "Note that some energy contributions may not be "// &
8619  "initialized in the restart cases, for instance "// &
8620  "electronic entropy energy in the case of smearing.", &
8621  usage="INITIAL_WFN SCF_WFN", default_i_val=use_scf_wfn, &
8622  enum_c_vals=s2a("SCF_WFN", "RESTART_WFN", "RT_RESTART"), &
8623  enum_i_vals=(/use_scf_wfn, use_restart_wfn, use_rt_restart/), &
8624  enum_desc=s2a("An SCF run is performed to get the initial state.", &
8625  "A wavefunction from a previous SCF is propagated. Especially useful,"// &
8626  " if electronic constraints or restraints are used in the previous calculation, "// &
8627  "since these do not work in the rtp scheme.", &
8628  "use the wavefunction of a real time propagation/ehrenfest run"))
8629  CALL section_add_keyword(section, keyword)
8630  CALL keyword_release(keyword)
8631 
8632  CALL keyword_create(keyword, __location__, name="APPLY_WFN_MIX_INIT_RESTART", &
8633  description="If set to True and in the case of INITIAL_WFN=RESTART_WFN, call the "// &
8634  "DFT%PRINT%WFN_MIX section to mix the read initial wfn. The starting wave-function of the "// &
8635  "RTP will be the mixed one. Setting this to True without a defined WFN_MIX section will "// &
8636  "not do anything as defining a WFN_MIX section without this keyword for RTP run with "// &
8637  "INITIAL_WFN=RESTART_WFN. Note that if INITIAL_WFN=SCF_WFN, this keyword is not needed to "// &
8638  "apply the mixing defined in the WFN_MIX section. Default is False.", &
8639  usage="APPLY_WFN_MIX_INIT_RESTART", &
8640  default_l_val=.false., lone_keyword_l_val=.true.)
8641  CALL section_add_keyword(section, keyword)
8642  CALL keyword_release(keyword)
8643 
8644  CALL keyword_create(keyword, __location__, name="APPLY_DELTA_PULSE", &
8645  description="Applies a delta kick to the initial wfn (only RTP for now - the EMD"// &
8646  " case is not yet implemented). Only work for INITIAL_WFN=SCF_WFN", &
8647  usage="APPLY_DELTA_PULSE", &
8648  default_l_val=.false., lone_keyword_l_val=.true.)
8649  CALL section_add_keyword(section, keyword)
8650  CALL keyword_release(keyword)
8651 
8652  CALL keyword_create(keyword, __location__, name="APPLY_DELTA_PULSE_MAG", &
8653  description="Applies a magnetic delta kick to the initial wfn (only RTP for now - the EMD"// &
8654  " case is not yet implemented). Only work for INITIAL_WFN=SCF_WFN", &
8655  usage="APPLY_DELTA_PULSE_MAG", &
8656  default_l_val=.false., lone_keyword_l_val=.true.)
8657  CALL section_add_keyword(section, keyword)
8658  CALL keyword_release(keyword)
8659 
8660  CALL keyword_create(keyword, __location__, name="VELOCITY_GAUGE", &
8661  description="Perform propagation in the velocity gauge using the explicit vector potential"// &
8662  " only a constant vector potential as of now (corresonding to a delta-pulse)."// &
8663  " uses DELTA_PULSE_SCALE and DELTA_PULSE_DIRECTION to define the vector potential", &
8664  usage="VELOCITY_GAUGE T", &
8665  default_l_val=.false., lone_keyword_l_val=.true.)
8666  CALL section_add_keyword(section, keyword)
8667  CALL keyword_release(keyword)
8668 
8669  CALL keyword_create(keyword, __location__, name="GAUGE_ORIG", &
8670  description="Define gauge origin for magnetic perturbation", &
8671  usage="GAUGE_ORIG COM", &
8672  enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
8673  enum_desc=s2a("Use Center of Mass", &
8674  "Use Center of Atomic Charges", &
8675  "Use User Defined Point (Keyword:REF_POINT)", &
8676  "Use Origin of Coordinate System"), &
8677  enum_i_vals=(/use_mom_ref_com, &
8678  use_mom_ref_coac, &
8679  use_mom_ref_user, &
8680  use_mom_ref_zero/), &
8681  default_i_val=use_mom_ref_com)
8682  CALL section_add_keyword(section, keyword)
8683  CALL keyword_release(keyword)
8684 
8685  CALL keyword_create(keyword, __location__, name="GAUGE_ORIG_MANUAL", &
8686  description="Manually defined gauge origin for magnetic perturbation [in Bohr!]", &
8687  usage="GAUGE_ORIG_MANUAL x y z", &
8688  repeats=.false., &
8689  n_var=3, default_r_vals=(/0._dp, 0._dp, 0._dp/), &
8690  type_of_var=real_t, &
8691  unit_str='bohr')
8692  CALL section_add_keyword(section, keyword)
8693  CALL keyword_release(keyword)
8694 
8695  CALL keyword_create(keyword, __location__, name="VG_COM_NL", &
8696  description="apply gauge transformed non-local potential term"// &
8697  " only affects VELOCITY_GAUGE=.TRUE.", &
8698  usage="VG_COM_NL T", &
8699  default_l_val=.true., lone_keyword_l_val=.true.)
8700  CALL section_add_keyword(section, keyword)
8701  CALL keyword_release(keyword)
8702 
8703  CALL keyword_create(keyword, __location__, name="COM_NL", &
8704  description="Include non-local commutator for periodic delta pulse."// &
8705  " only affects PERIODIC=.TRUE.", &
8706  usage="COM_NL", &
8707  default_l_val=.true., lone_keyword_l_val=.true.)
8708  CALL section_add_keyword(section, keyword)
8709  CALL keyword_release(keyword)
8710 
8711  CALL keyword_create(keyword, __location__, name="LEN_REP", &
8712  description="Use length representation delta pulse (in conjunction with PERIODIC T)."// &
8713  " This corresponds to a 1st order perturbation in the length gauge."// &
8714  " Note that this is NOT compatible with a periodic calculation!"// &
8715  " Uses the reference point defined in DFT%PRINT%MOMENTS ", &
8716  usage="LEN_REP T", &
8717  default_l_val=.false., lone_keyword_l_val=.true.)
8718  CALL section_add_keyword(section, keyword)
8719  CALL keyword_release(keyword)
8720 
8721  CALL keyword_create(keyword, __location__, name="PERIODIC", &
8722  description="Apply a delta-kick that is compatible with periodic boundary conditions"// &
8723  " for any value of DELTA_PULSE_SCALE. Uses perturbation theory for the preparation of"// &
8724  " the initial wfn with the velocity operator as perturbation."// &
8725  " If LEN_REP is .FALSE. this corresponds to a first order velocity gauge."// &
8726  " Note that the pulse is only applied when INITIAL_WFN is set to SCF_WFN,"// &
8727  " and not for restarts (RT_RESTART).", &
8728  usage="PERIODIC", &
8729  default_l_val=.true., lone_keyword_l_val=.true.)
8730  CALL section_add_keyword(section, keyword)
8731  CALL keyword_release(keyword)
8732 
8733  CALL keyword_create(keyword, __location__, name="DELTA_PULSE_DIRECTION", &
8734  description="Direction of the applied electric field. The k vector is given as"// &
8735  " 2*Pi*[i,j,k]*inv(h_mat), which for PERIODIC .FALSE. yields exp(ikr) periodic with"// &
8736  " the unit cell, only if DELTA_PULSE_SCALE is set to unity. For an orthorhombic cell"// &
8737  " [1,0,0] yields [2*Pi/L_x,0,0]. For small cells, this results in a very large kick.", &
8738  usage="DELTA_PULSE_DIRECTION 1 1 1", n_var=3, default_i_vals=(/1, 0, 0/), &
8739  type_of_var=integer_t)
8740  CALL section_add_keyword(section, keyword)
8741  CALL keyword_release(keyword)
8742 
8743  CALL keyword_create(keyword, __location__, name="DELTA_PULSE_SCALE", &
8744  description="Scale the k vector, which for PERIODIC .FALSE. results in exp(ikr) no"// &
8745  " longer being periodic with the unit cell. The norm of k is the strength of the"// &
8746  " applied electric field in atomic units.", &
8747  usage="DELTA_PULSE_SCALE 0.01 ", n_var=1, default_r_val=0.001_dp)
8748  CALL section_add_keyword(section, keyword)
8749  CALL keyword_release(keyword)
8750 
8751  CALL keyword_create(keyword, __location__, name="HFX_BALANCE_IN_CORE", &
8752  description="If HFX is used, this keyword forces a redistribution/recalculation"// &
8753  " of the integrals, balanced with respect to the in core steps.", &
8754  usage="HFX_BALANCE_IN_CORE", &
8755  default_l_val=.false., lone_keyword_l_val=.true.)
8756  CALL section_add_keyword(section, keyword)
8757  CALL keyword_release(keyword)
8758 
8759  CALL keyword_create(keyword, __location__, name="MCWEENY_MAX_ITER", &
8760  description="Determines the maximum amount of McWeeny steps used after each converged"// &
8761  " step in density propagation", &
8762  usage="MCWEENY_MAX_ITER 2", default_i_val=1)
8763  CALL section_add_keyword(section, keyword)
8764  CALL keyword_release(keyword)
8765 
8766  CALL keyword_create( &
8767  keyword, __location__, name="ACCURACY_REFINEMENT", &
8768  description="If using density propagation some parts should be calculated with a higher accuracy than the rest"// &
8769  " to reduce numerical noise. This factor determines by how much the filtering threshold is"// &
8770  " reduced for these calculations.", &
8771  usage="ACCURACY_REFINEMENT", default_i_val=100)
8772  CALL section_add_keyword(section, keyword)
8773  CALL keyword_release(keyword)
8774 
8775  CALL keyword_create(keyword, __location__, name="MCWEENY_EPS", &
8776  description="Threshold after which McWeeny is terminated", &
8777  usage="MCWEENY_EPS 0.00001", &
8778  default_r_val=0.0_dp)
8779  CALL section_add_keyword(section, keyword)
8780  CALL keyword_release(keyword)
8781 
8782  NULLIFY (print_section)
8783  CALL section_create(print_section, __location__, name="PRINT", &
8784  description="Section of possible print options for an RTP runs", &
8785  repeats=.false.)
8786 
8787  NULLIFY (print_key)
8788  CALL cp_print_key_section_create(print_key, __location__, "PROGRAM_RUN_INFO", &
8789  description="Controls the printing within real time propagation and Eherenfest dynamics", &
8790  print_level=low_print_level, filename="__STD_OUT__")
8791  CALL section_add_subsection(print_section, print_key)
8792  CALL section_release(print_key)
8793 
8794  CALL cp_print_key_section_create(print_key, __location__, "RESTART", &
8795  description="Controls the dumping of the MO restart file during rtp. "// &
8796  "By default keeps a short history of three restarts. "// &
8797  "See also RESTART_HISTORY. In density propagation this controls the printing of P.", &
8798  print_level=low_print_level, common_iter_levels=3, &
8799  each_iter_names=s2a("MD"), each_iter_values=(/20/), &
8800  add_last=add_last_numeric, filename="RESTART")
8801  CALL keyword_create(keyword, __location__, name="BACKUP_COPIES", &
8802  description="Specifies the maximum number of backup copies.", &
8803  usage="BACKUP_COPIES {int}", &
8804  default_i_val=1)
8805  CALL section_add_keyword(print_key, keyword)
8806  CALL keyword_release(keyword)
8807  CALL section_add_subsection(print_section, print_key)
8808  CALL section_release(print_key)
8809 
8810  CALL cp_print_key_section_create(print_key, __location__, "RESTART_HISTORY", &
8811  description="Dumps unique MO restart files during the run keeping all of them. "// &
8812  "In density propagation it dumps the density matrix instead", &
8813  print_level=low_print_level, common_iter_levels=0, &
8814  each_iter_names=s2a("MD"), &
8815  each_iter_values=(/500/), &
8816  filename="RESTART")
8817  CALL keyword_create(keyword, __location__, name="BACKUP_COPIES", &
8818  description="Specifies the maximum number of backup copies.", &
8819  usage="BACKUP_COPIES {int}", &
8820  default_i_val=1)
8821  CALL section_add_keyword(print_key, keyword)
8822  CALL keyword_release(keyword)
8823  CALL section_add_subsection(print_section, print_key)
8824  CALL section_release(print_key)
8825 
8826  CALL cp_print_key_section_create(print_key, __location__, "FIELD", &
8827  description="Print the time-dependent field applied during an EMD simulation in "// &
8828  "atomic unit.", &
8829  print_level=high_print_level, common_iter_levels=-1, &
8830  each_iter_names=s2a("MD"), &
8831  each_iter_values=(/1/), &
8832  filename="applied_field")
8833  CALL section_add_subsection(print_section, print_key)
8834  CALL section_release(print_key)
8835 
8836  CALL create_projection_rtp_section(print_key)
8837  CALL section_add_subsection(print_section, print_key)
8838  CALL section_release(print_key)
8839 
8840  CALL cp_print_key_section_create(print_key, __location__, "CURRENT", &
8841  description="Print the current during an EMD simulation to cube files.", &
8842  print_level=high_print_level, common_iter_levels=0, &
8843  each_iter_names=s2a("MD"), &
8844  each_iter_values=(/20/), &
8845  filename="current")
8846  CALL keyword_create(keyword, __location__, name="BACKUP_COPIES", &
8847  description="Specifies the maximum number of backup copies.", &
8848  usage="BACKUP_COPIES {int}", &
8849  default_i_val=1)
8850  CALL section_add_keyword(print_key, keyword)
8851  CALL keyword_release(keyword)
8852  CALL keyword_create(keyword, __location__, name="STRIDE", &
8853  description="The stride (X,Y,Z) used to write the cube file "// &
8854  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
8855  " 1 number valid for all components.", &
8856  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
8857  CALL section_add_keyword(print_key, keyword)
8858  CALL keyword_release(keyword)
8859 
8860  CALL section_add_subsection(print_section, print_key)
8861  CALL section_release(print_key)
8862 
8863  CALL cp_print_key_section_create(print_key, __location__, "E_CONSTITUENTS", &
8864  description="Print the energy constituents (relevant to RTP) which make up "// &
8865  "the Total Energy", &
8866  print_level=high_print_level, common_iter_levels=1, &
8867  each_iter_names=s2a("MD"), &
8868  each_iter_values=(/1/), &
8869  filename="rtp")
8870  CALL section_add_subsection(print_section, print_key)
8871  CALL section_release(print_key)
8872 
8873  CALL section_add_subsection(section, print_section)
8874  CALL section_release(print_section)
8875 
8876  END SUBROUTINE create_rtp_section
8877 
8878 ! **************************************************************************************************
8879 !> \brief Create CP2K input section for the SCCS model
8880 !> \param section ...
8881 !> \par History:
8882 !> - Creation (10.10.2013,MK)
8883 !> \author Matthias Krack (MK)
8884 !> \version 1.0
8885 ! **************************************************************************************************
8886  SUBROUTINE create_sccs_section(section)
8887 
8888  TYPE(section_type), POINTER :: section
8889 
8890  TYPE(keyword_type), POINTER :: keyword
8891  TYPE(section_type), POINTER :: subsection
8892 
8893  cpassert(.NOT. ASSOCIATED(section))
8894 
8895  CALL section_create(section, __location__, &
8896  name="SCCS", &
8897  description="Define the parameters for self-consistent continuum solvation (SCCS) model", &
8898  citations=(/fattebert2002, andreussi2012, yin2017/), &
8899  n_keywords=8, &
8900  n_subsections=2, &
8901  repeats=.false.)
8902 
8903  NULLIFY (keyword)
8904 
8905  CALL keyword_create(keyword, __location__, &
8906  name="_SECTION_PARAMETERS_", &
8907  description="Controls the activation of the SCCS section", &
8908  usage="&SCCS ON", &
8909  default_l_val=.false., &
8910  lone_keyword_l_val=.true.)
8911  CALL section_add_keyword(section, keyword)
8912  CALL keyword_release(keyword)
8913 
8914  CALL keyword_create(keyword, __location__, &
8915  name="ALPHA", &
8916  description="Solvent specific tunable parameter for the calculation of "// &
8917  "the repulsion term $G^\text{rep} = \alpha S$ "// &
8918  "where $S$ is the (quantum) surface of the cavity", &
8919  repeats=.false., &
8920  n_var=1, &
8921  type_of_var=real_t, &
8922  default_r_val=0.0_dp, &
8923  unit_str="mN/m")
8924  CALL section_add_keyword(section, keyword)
8925  CALL keyword_release(keyword)
8926 
8927  CALL keyword_create(keyword, __location__, &
8928  name="BETA", &
8929  description="Solvent specific tunable parameter for the calculation of "// &
8930  "the dispersion term $G^\text{dis} = \beta V$ "// &
8931  "where $V$ is the (quantum) volume of the cavity", &
8932  repeats=.false., &
8933  n_var=1, &
8934  type_of_var=real_t, &
8935  default_r_val=0.0_dp, &
8936  unit_str="GPa")
8937  CALL section_add_keyword(section, keyword)
8938  CALL keyword_release(keyword)
8939 
8940  CALL keyword_create(keyword, __location__, &
8941  name="DELTA_RHO", &
8942  description="Numerical increment for the calculation of the (quantum) "// &
8943  "surface of the solute cavity", &
8944  repeats=.false., &
8945  n_var=1, &
8946  type_of_var=real_t, &
8947  default_r_val=2.0e-5_dp)
8948  CALL section_add_keyword(section, keyword)
8949  CALL keyword_release(keyword)
8950 
8951  CALL keyword_create(keyword, __location__, &
8952  name="DERIVATIVE_METHOD", &
8953  description="Method for the calculation of the numerical derivatives on the real-space grids", &
8954  usage="DERIVATIVE_METHOD cd5", &
8955  repeats=.false., &
8956  n_var=1, &
8957  default_i_val=sccs_derivative_fft, &
8958  enum_c_vals=s2a("FFT", "CD3", "CD5", "CD7"), &
8959  enum_i_vals=(/sccs_derivative_fft, &
8962  sccs_derivative_cd7/), &
8963  enum_desc=s2a("Fast Fourier transformation", &
8964  "3-point stencil central differences", &
8965  "5-point stencil central differences", &
8966  "7-point stencil central differences"))
8967  CALL section_add_keyword(section, keyword)
8968  CALL keyword_release(keyword)
8969 
8970  CALL keyword_create(keyword, __location__, &
8971  name="RELATIVE_PERMITTIVITY", &
8972  variants=s2a("DIELECTRIC_CONSTANT", "EPSILON_RELATIVE", "EPSILON_SOLVENT"), &
8973  description="Relative permittivity (dielectric constant) of the solvent (medium)", &
8974  repeats=.false., &
8975  n_var=1, &
8976  type_of_var=real_t, &
8977  default_r_val=80.0_dp, &
8978  usage="RELATIVE_PERMITTIVITY 78.36")
8979  CALL section_add_keyword(section, keyword)
8980  CALL keyword_release(keyword)
8981 
8982  CALL keyword_create(keyword, __location__, &
8983  name="EPS_SCCS", &
8984  variants=s2a("EPS_ITER", "TAU_POL"), &
8985  description="Tolerance for the convergence of the polarisation density, "// &
8986  "i.e. requested accuracy for the SCCS iteration cycle", &
8987  repeats=.false., &
8988  n_var=1, &
8989  type_of_var=real_t, &
8990  default_r_val=1.0e-6_dp, &
8991  usage="EPS_ITER 1.0E-7")
8992  CALL section_add_keyword(section, keyword)
8993  CALL keyword_release(keyword)
8994 
8995  CALL keyword_create(keyword, __location__, &
8996  name="EPS_SCF", &
8997  description="The SCCS iteration cycle is activated only if the SCF iteration cycle "// &
8998  "is converged to this threshold value", &
8999  repeats=.false., &
9000  n_var=1, &
9001  type_of_var=real_t, &
9002  default_r_val=0.5_dp, &
9003  usage="EPS_SCF 1.0E-2")
9004  CALL section_add_keyword(section, keyword)
9005  CALL keyword_release(keyword)
9006 
9007  CALL keyword_create(keyword, __location__, &
9008  name="GAMMA", &
9009  variants=s2a("SURFACE_TENSION"), &
9010  description="Surface tension of the solvent used for the calculation of "// &
9011  "the cavitation term $G^\text{cav} = \gamma S$ "// &
9012  "where $S$ is the (quantum) surface of the cavity", &
9013  repeats=.false., &
9014  n_var=1, &
9015  type_of_var=real_t, &
9016  default_r_val=0.0_dp, &
9017  unit_str="mN/m")
9018  CALL section_add_keyword(section, keyword)
9019  CALL keyword_release(keyword)
9020 
9021  CALL keyword_create(keyword, __location__, &
9022  name="MAX_ITER", &
9023  description="Maximum number of SCCS iteration steps performed to converge "// &
9024  "within the given tolerance", &
9025  repeats=.false., &
9026  n_var=1, &
9027  type_of_var=integer_t, &
9028  default_i_val=100, &
9029  usage="MAX_ITER 50")
9030  CALL section_add_keyword(section, keyword)
9031  CALL keyword_release(keyword)
9032 
9033  CALL keyword_create(keyword, __location__, &
9034  name="METHOD", &
9035  description="Method used for the smoothing of the dielectric function", &
9036  usage="METHOD Fattebert-Gygi", &
9037  default_i_val=sccs_andreussi, &
9038  enum_c_vals=s2a("ANDREUSSI", "FATTEBERT-GYGI"), &
9039  enum_i_vals=(/sccs_andreussi, sccs_fattebert_gygi/), &
9040  enum_desc=s2a("Smoothing function proposed by Andreussi et al.", &
9041  "Smoothing function proposed by Fattebert and Gygi"))
9042  CALL section_add_keyword(section, keyword)
9043  CALL keyword_release(keyword)
9044 
9045  CALL keyword_create(keyword, __location__, &
9046  name="MIXING", &
9047  variants=(/"ETA"/), &
9048  description="Mixing parameter (Hartree damping) employed during the iteration procedure", &
9049  repeats=.false., &
9050  n_var=1, &
9051  type_of_var=real_t, &
9052  default_r_val=0.6_dp, &
9053  usage="MIXING 0.2")
9054  CALL section_add_keyword(section, keyword)
9055  CALL keyword_release(keyword)
9056 
9057  NULLIFY (subsection)
9058 
9059  CALL section_create(subsection, __location__, &
9060  name="ANDREUSSI", &
9061  description="Define the parameters of the dielectric smoothing function proposed by "// &
9062  "Andreussi et al.", &
9063  citations=(/andreussi2012/), &
9064  n_keywords=2, &
9065  n_subsections=0, &
9066  repeats=.false.)
9067 
9068  CALL keyword_create(keyword, __location__, &
9069  name="RHO_MAX", &
9070  description="Maximum density value used for the smoothing of the dielectric function", &
9071  repeats=.false., &
9072  n_var=1, &
9073  type_of_var=real_t, &
9074  default_r_val=0.0035_dp, &
9075  usage="RHO_MAX 0.01")
9076  CALL section_add_keyword(subsection, keyword)
9077  CALL keyword_release(keyword)
9078 
9079  CALL keyword_create(keyword, __location__, &
9080  name="RHO_MIN", &
9081  description="Minimum density value used for the smoothing of the dielectric function", &
9082  repeats=.false., &
9083  n_var=1, &
9084  type_of_var=real_t, &
9085  default_r_val=0.0001_dp, &
9086  usage="RHO_MIN 0.0003")
9087  CALL section_add_keyword(subsection, keyword)
9088  CALL keyword_release(keyword)
9089 
9090  CALL section_add_subsection(section, subsection)
9091  CALL section_release(subsection)
9092 
9093  CALL section_create(subsection, __location__, &
9094  name="FATTEBERT-GYGI", &
9095  description="Define the parameters of the dielectric smoothing function proposed by "// &
9096  "Fattebert and Gygi", &
9097  citations=(/fattebert2002/), &
9098  n_keywords=2, &
9099  n_subsections=0, &
9100  repeats=.false.)
9101 
9102  CALL keyword_create(keyword, __location__, &
9103  name="BETA", &
9104  description="Parameter &beta; changes the width of the interface solute-solvent", &
9105  repeats=.false., &
9106  n_var=1, &
9107  type_of_var=real_t, &
9108  default_r_val=1.7_dp, &
9109  usage="BETA 1.3")
9110  CALL section_add_keyword(subsection, keyword)
9111  CALL keyword_release(keyword)
9112 
9113  CALL keyword_create(keyword, __location__, &
9114  name="RHO_ZERO", &
9115  variants=(/"RHO0"/), &
9116  description="Parameter $\rho_0$ defines the critical density in the middle "// &
9117  "of the interface solute-solvent", &
9118  repeats=.false., &
9119  n_var=1, &
9120  type_of_var=real_t, &
9121  default_r_val=0.0006_dp, &
9122  usage="RHO_ZERO 0.0004")
9123  CALL section_add_keyword(subsection, keyword)
9124  CALL keyword_release(keyword)
9125 
9126  CALL section_add_subsection(section, subsection)
9127  CALL section_release(subsection)
9128 
9129  END SUBROUTINE create_sccs_section
9130 
9131 ! **************************************************************************************************
9132 !> \brief Create CP2K input section for the calculation of an active space Hamiltonian
9133 !> \param section ...
9134 !> \par History:
9135 !> - Creation 06.04.2016
9136 !> \author JHU
9137 ! **************************************************************************************************
9138  SUBROUTINE create_active_space_section(section)
9139 
9140  TYPE(section_type), POINTER :: section
9141 
9142  TYPE(keyword_type), POINTER :: keyword
9143  TYPE(section_type), POINTER :: print_key, subsection
9144 
9145  cpassert(.NOT. ASSOCIATED(section))
9146 
9147  CALL section_create(section, __location__, name="ACTIVE_SPACE", &
9148  description="Define parameters and method to calculate an electronic active space", &
9149  n_keywords=1, n_subsections=0, repeats=.false.)
9150 
9151  NULLIFY (keyword, subsection, print_key)
9152 
9153  CALL keyword_create(keyword, __location__, &
9154  name="_SECTION_PARAMETERS_", &
9155  description="Controls the activation of the ACTIVE_SPACE section", &
9156  usage="&ACTIVE_SPACE ON", &
9157  default_l_val=.false., &
9158  lone_keyword_l_val=.true.)
9159  CALL section_add_keyword(section, keyword)
9160  CALL keyword_release(keyword)
9161 
9162  CALL keyword_create(keyword, __location__, name="MODEL", &
9163  description="Model used to calculate active space interaction Hamiltonian.", &
9164  usage="MODEL HARTREE-FOCK", &
9165  default_i_val=hf_model, &
9166  enum_c_vals=s2a("HARTREE-FOCK", "RSDFT", "DMFT"), &
9167  enum_i_vals=(/hf_model, rsdft_model, dmft_model/), &
9168  enum_desc=s2a("Hartree-Fock model for interaction Hamiltonian", &
9169  "Range-separated DFT model for interaction Hamiltonian", &
9170  "DMFT model Hamiltonian"))
9171  CALL section_add_keyword(section, keyword)
9172  CALL keyword_release(keyword)
9173 
9174  CALL keyword_create(keyword, __location__, name="ACTIVE_ELECTRONS", &
9175  description="The number of active electrons in the CAS space", &
9176  usage="ACTIVE_ELECTRONS 4", n_var=1, default_i_val=-1, type_of_var=integer_t)
9177  CALL section_add_keyword(section, keyword)
9178  CALL keyword_release(keyword)
9179 
9180  CALL keyword_create(keyword, __location__, name="ACTIVE_ORBITALS", &
9181  description="The number of active orbitals defining the CAS space.", &
9182  usage="ACTIVE_ORBITALS 2", n_var=1, default_i_val=-1, type_of_var=integer_t)
9183  CALL section_add_keyword(section, keyword)
9184  CALL keyword_release(keyword)
9185 
9186  CALL keyword_create(keyword, __location__, name="ACTIVE_ORBITAL_INDICES", &
9187  description="The indices of the active orbitals. Requires ORBITAL_SELECTION MANUAL!", &
9188  usage="ACTIVE_ORBITAL_INDICES 2 3 {...}", n_var=-1, default_i_vals=(/-1/), &
9189  type_of_var=integer_t)
9190  CALL section_add_keyword(section, keyword)
9191  CALL keyword_release(keyword)
9192 
9193  CALL keyword_create(keyword, __location__, name="ISOLATED_SYSTEM", &
9194  description="System is treated without any periodic boundary conditions.", &
9195  default_l_val=.false., lone_keyword_l_val=.true.)
9196  CALL section_add_keyword(section, keyword)
9197  CALL keyword_release(keyword)
9198 
9199  CALL cp_print_key_section_create(print_key, __location__, "FCIDUMP", &
9200  description="Controls the writing of a file in FCIDUMP format.", &
9201  print_level=high_print_level, filename="")
9202  CALL section_add_subsection(section, print_key)
9203  CALL section_release(print_key)
9204 
9205  CALL keyword_create(keyword, __location__, name="ORBITAL_SELECTION", &
9206  description="Method used to select active space orbitals.", &
9207  usage="ORBITAL_SELECTION CANONICAL", &
9208  default_i_val=casci_canonical, &
9209  enum_c_vals=s2a("CANONICAL", "WANNIER_PROJECTION", "MAO", "MANUAL"), &
9211  enum_desc=s2a("Select orbitals using energy ordering of canoncial orbitals", &
9212  "Select orbitals from projected Wannier functions", &
9213  "Select orbitals from modified atomic orbitals", &
9214  "Select orbitals manually via ACTIVE_ORBITAL_INDICES"))
9215 
9216  CALL section_add_keyword(section, keyword)
9217  CALL keyword_release(keyword)
9218 
9219  CALL keyword_create(keyword, __location__, name="SUBSPACE_ATOM", &
9220  description="Number of atom that defines the subspace to be projected on.", &
9221  usage="SUBSPACE_ATOM x", default_i_val=-1, &
9222  type_of_var=integer_t)
9223  CALL section_add_keyword(section, keyword)
9224  CALL keyword_release(keyword)
9225 
9226  CALL keyword_create(keyword, __location__, name="SUBSPACE_SHELL", &
9227  description="Shell definition for subsapce.", &
9228  usage="SUBSPACE_SHELL 3d4s", default_c_val="X", &
9229  type_of_var=char_t)
9230  CALL section_add_keyword(section, keyword)
9231  CALL keyword_release(keyword)
9232 
9233  CALL keyword_create(keyword, __location__, name="SCF_EMBEDDING", &
9234  description="Whether to turn on the self-consistent embedding scheme", &
9235  default_l_val=.false., lone_keyword_l_val=.false.)
9236  CALL section_add_keyword(section, keyword)
9237  CALL keyword_release(keyword)
9238 
9239  CALL keyword_create(keyword, __location__, name="QCSCHEMA", &
9240  description="Name of the QCSchema file, may include a path", &
9241  usage="QCSCHEMA <FILENAME>", &
9242  type_of_var=lchar_t, repeats=.false., &
9243  default_lc_val="")
9244  CALL section_add_keyword(section, keyword)
9245  CALL keyword_release(keyword)
9246 
9247  CALL keyword_create(keyword, __location__, name="AS_SOLVER", &
9248  description="The external active space solver for the embedding approach", &
9249  usage="AS_SOLVER QISKIT", &
9250  default_i_val=no_solver, &
9251  enum_c_vals=s2a("NONE", "QISKIT"), &
9252  enum_i_vals=(/no_solver, qiskit_solver/), &
9253  enum_desc=s2a("NO solver, used to produce FCIDUMP/QCSchema files", &
9254  "QISKIT active space solver"))
9255  CALL section_add_keyword(section, keyword)
9256  CALL keyword_release(keyword)
9257 
9258  CALL keyword_create(keyword, __location__, name="EPS_ITER", &
9259  description="Energy convergence threshold of the DFT embedding scheme.", &
9260  usage="EPS_ITER 1.0E-6 ", type_of_var=real_t, &
9261  default_r_val=1.0e-6_dp)
9262  CALL section_add_keyword(section, keyword)
9263  CALL keyword_release(keyword)
9264 
9265  CALL keyword_create(keyword, __location__, name="MAX_ITER", &
9266  description="Max number of iterations for the DFT embedding scheme.", &
9267  usage="MAX_ITER 50", type_of_var=integer_t, &
9268  default_i_val=50)
9269  CALL section_add_keyword(section, keyword)
9270  CALL keyword_release(keyword)
9271 
9272  CALL create_print_orb_section(subsection)
9273  CALL section_add_subsection(section, subsection)
9274  CALL section_release(subsection)
9275 
9276  CALL create_eri_section(subsection)
9277  CALL section_add_subsection(section, subsection)
9278  CALL section_release(subsection)
9279 
9280  CALL create_eri_gpw(subsection)
9281  CALL section_add_subsection(section, subsection)
9282  CALL section_release(subsection)
9283 
9284  CALL create_localize_section(subsection)
9285  CALL section_add_subsection(section, subsection)
9286  CALL section_release(subsection)
9287 
9288  CALL create_socket_section(subsection)
9289  CALL section_add_subsection(section, subsection)
9290  CALL section_release(subsection)
9291 
9292  END SUBROUTINE create_active_space_section
9293 
9294 ! **************************************************************************************************
9295 !> \brief ...
9296 !> \param section ...
9297 ! **************************************************************************************************
9298  SUBROUTINE create_socket_section(section)
9299  TYPE(section_type), POINTER :: section
9300 
9301  TYPE(keyword_type), POINTER :: keyword
9302 
9303  cpassert(.NOT. ASSOCIATED(section))
9304  CALL section_create(section, __location__, name="SOCKET", &
9305  description="Parameters to set up the socket communicating to the external active space solver.", &
9306  n_keywords=3, n_subsections=0, repeats=.false.)
9307 
9308  NULLIFY (keyword)
9309  CALL keyword_create(keyword, __location__, name="INET", &
9310  description="Use an INET socket rather than a UNIX socket.", &
9311  usage="INET <LOGICAL>", &
9312  default_l_val=.false., lone_keyword_l_val=.true.)
9313  CALL section_add_keyword(section, keyword)
9314  CALL keyword_release(keyword)
9315 
9316  CALL keyword_create(keyword, __location__, name="PORT", &
9317  description="Port number for the socket client.", &
9318  usage="port <INTEGER>", &
9319  default_i_val=12345)
9320  CALL section_add_keyword(section, keyword)
9321  CALL keyword_release(keyword)
9322 
9323  CALL keyword_create(keyword, __location__, name="HOST", &
9324  description="Host name for the socket client.", &
9325  usage="host <HOSTNAME>", &
9326  default_c_val="embedding_socket")
9327  CALL section_add_keyword(section, keyword)
9328  CALL keyword_release(keyword)
9329 
9330  END SUBROUTINE create_socket_section
9331 
9332 ! **************************************************************************************************
9333 !> \brief ...
9334 !> \param section ...
9335 ! **************************************************************************************************
9336  SUBROUTINE create_print_orb_section(section)
9337  TYPE(section_type), POINTER :: section
9338 
9339  TYPE(keyword_type), POINTER :: keyword
9340 
9341  cpassert(.NOT. ASSOCIATED(section))
9342  CALL section_create(section, __location__, name="PRINT_ORBITAL_CUBES", &
9343  description="Controls printing of active orbital cube files.", &
9344  n_keywords=5, n_subsections=0, repeats=.false.)
9345 
9346  NULLIFY (keyword)
9347  CALL keyword_create(keyword, __location__, name="FILENAME", &
9348  description="Body of Filename for the cube files.", &
9349  usage="FILENAME {name}", default_c_val="ActiveOrbital", &
9350  type_of_var=char_t)
9351  CALL section_add_keyword(section, keyword)
9352  CALL keyword_release(keyword)
9353 
9354  CALL keyword_create(keyword, __location__, name="ALIST", &
9355  description="List of alpha orbitals to be printed. -1 defaults to all values", &
9356  usage="ALIST {1 2 3 ...}", n_var=-1, default_i_vals=(/-1/), &
9357  lone_keyword_i_val=-1, type_of_var=integer_t)
9358  CALL section_add_keyword(section, keyword)
9359  CALL keyword_release(keyword)
9360 
9361  CALL keyword_create(keyword, __location__, name="BLIST", &
9362  description="List of beta orbitals to be printed. -1 defaults to all values", &
9363  usage="ALIST {1 2 3 ...}", n_var=-1, default_i_vals=(/-1/), &
9364  lone_keyword_i_val=-1, type_of_var=integer_t)
9365  CALL section_add_keyword(section, keyword)
9366  CALL keyword_release(keyword)
9367 
9368  CALL keyword_create(keyword, __location__, name="STRIDE", &
9369  description="The stride (X,Y,Z) used to write the cube file"// &
9370  " (larger values result in smaller cube files)."// &
9371  " You can provide 3 numbers (for X,Y,Z) or 1 number valid for all components", &
9372  usage="STRIDE {2 2 2}", n_var=-1, default_i_vals=(/2, 2, 2/), &
9373  type_of_var=integer_t)
9374  CALL section_add_keyword(section, keyword)
9375  CALL keyword_release(keyword)
9376 
9377  CALL keyword_create(keyword, __location__, name="STOP_AFTER_CUBES", &
9378  description="Whether to stop the computation after printing the cubes.", &
9379  default_l_val=.false., lone_keyword_l_val=.false.)
9380  CALL section_add_keyword(section, keyword)
9381  CALL keyword_release(keyword)
9382 
9383  END SUBROUTINE create_print_orb_section
9384 
9385 ! **************************************************************************************************
9386 !> \brief ...
9387 !> \param section ...
9388 ! **************************************************************************************************
9389  SUBROUTINE create_eri_section(section)
9390  TYPE(section_type), POINTER :: section
9391 
9392  TYPE(keyword_type), POINTER :: keyword
9393 
9394  cpassert(.NOT. ASSOCIATED(section))
9395  CALL section_create(section, __location__, name="ERI", &
9396  description="Parameters for the electron repulsion integrals.", &
9397  n_keywords=5, n_subsections=0, repeats=.false.)
9398 
9399  NULLIFY (keyword)
9400  CALL keyword_create(keyword, __location__, name="METHOD", &
9401  description="Method used in ERI calculation.", &
9402  usage="METHOD FULL_GPW", &
9403  enum_c_vals=s2a("FULL_GPW", "GPW_HALF_TRANSFORM"), &
9404  enum_i_vals=(/eri_method_full_gpw, eri_method_gpw_ht/), &
9405  enum_desc=s2a("Use the GPW approach with MOs", &
9406  "Use the GPW approach for half-transformed MO ERIs"), &
9407  default_i_val=eri_method_full_gpw)
9408  CALL section_add_keyword(section, keyword)
9409  CALL keyword_release(keyword)
9410 
9411  CALL keyword_create(keyword, __location__, name="OPERATOR", &
9412  description="Operator used in ERI calculation.", &
9413  usage="OPERATOR <1/R>", &
9414  enum_c_vals=s2a("<1/R>", "<EXP(-A*R)/R>", "<ERF(A*R)/R>", &
9415  "<ERFC(A*R)/R>", "<EXP(-A*R2)/R>", "<H(A-R)/R>"), &
9416  enum_i_vals=(/eri_operator_coulomb, eri_operator_yukawa, &
9418  enum_desc=s2a("Coulomb operator", &
9419  "Yukawa potential operator", &
9420  "Error function potential operator", &
9421  "Complementary error function potential operator", &
9422  "Gaussian potential operator", &
9423  "Truncated Coulomb potential"), &
9424  default_i_val=eri_operator_coulomb)
9425  CALL section_add_keyword(section, keyword)
9426  CALL keyword_release(keyword)
9427 
9428  CALL keyword_create(keyword, __location__, name="OPERATOR_PARAMETER", &
9429  description="Range parameter for ERI operator.", &
9430  usage="OPERATOR_PARAMETER 4.0", type_of_var=real_t, &
9431  default_r_val=0.5_dp)
9432  CALL section_add_keyword(section, keyword)
9433  CALL keyword_release(keyword)
9434 
9435  CALL keyword_create(keyword, __location__, name="PERIODICITY", &
9436  description="Periodicity used for operators in ERI calclulation.", &
9437  usage="PERIODICITY {1 1 1}", n_var=-1, default_i_vals=(/1, 1, 1/), &
9438  type_of_var=integer_t)
9439  CALL section_add_keyword(section, keyword)
9440  CALL keyword_release(keyword)
9441 
9442  CALL keyword_create(keyword, __location__, name="CUTOFF_RADIUS", &
9443  description="Radius of operator interactions in non-periodic cases.", &
9444  usage="CUTOFF_RADIUS 20", type_of_var=real_t, &
9445  default_r_val=-1.0_dp)
9446  CALL section_add_keyword(section, keyword)
9447  CALL keyword_release(keyword)
9448 
9449  CALL keyword_create( &
9450  keyword, __location__, name="EPS_INTEGRAL", &
9451  description="Accuracy of ERIs that will be stored.", &
9452  usage="EPS_INTEGRAL 1.0E-10 ", type_of_var=real_t, &
9453  default_r_val=1.0e-12_dp)
9454  CALL section_add_keyword(section, keyword)
9455  CALL keyword_release(keyword)
9456 
9457  END SUBROUTINE create_eri_section
9458 
9459 ! **************************************************************************************************
9460 !> \brief ...
9461 !> \param section ...
9462 ! **************************************************************************************************
9463  SUBROUTINE create_eri_gpw(section)
9464  TYPE(section_type), POINTER :: section
9465 
9466  TYPE(keyword_type), POINTER :: keyword
9467 
9468  cpassert(.NOT. ASSOCIATED(section))
9469  CALL section_create(section, __location__, name="ERI_GPW", &
9470  description="Parameters for the GPW approach to electron repulsion integrals.", &
9471  n_keywords=5, n_subsections=0, repeats=.false.)
9472 
9473  NULLIFY (keyword)
9474  CALL keyword_create(keyword, __location__, name="EPS_GRID", &
9475  description="Determines a threshold for the GPW based integration", &
9476  usage="EPS_GRID 1.0E-9 ", type_of_var=real_t, &
9477  default_r_val=1.0e-8_dp)
9478  CALL section_add_keyword(section, keyword)
9479  CALL keyword_release(keyword)
9480 
9481  CALL keyword_create(keyword, __location__, name="EPS_FILTER", &
9482  description="Determines a threshold for the sparse matrix multiplications if METHOD "// &
9483  "GPW_HALF_TRANSFORM is used", &
9484  usage="EPS_FILTER 1.0E-9 ", type_of_var=real_t, &
9485  default_r_val=1.0e-9_dp)
9486  CALL section_add_keyword(section, keyword)
9487  CALL keyword_release(keyword)
9488 
9489  CALL keyword_create(keyword, __location__, name="CUTOFF", &
9490  description="The cutoff of the finest grid level in the GPW integration.", &
9491  usage="CUTOFF 300", type_of_var=real_t, &
9492  default_r_val=300.0_dp)
9493  CALL section_add_keyword(section, keyword)
9494  CALL keyword_release(keyword)
9495 
9496  CALL keyword_create(keyword, __location__, name="REL_CUTOFF", &
9497  variants=(/"RELATIVE_CUTOFF"/), &
9498  description="Determines the grid at which a Gaussian is mapped.", &
9499  usage="REL_CUTOFF 50", type_of_var=real_t, &
9500  default_r_val=50.0_dp)
9501  CALL section_add_keyword(section, keyword)
9502  CALL keyword_release(keyword)
9503 
9504  CALL keyword_create(keyword, __location__, name="STORE_WFN", &
9505  variants=(/"STORE_WAVEFUNCTION"/), &
9506  description="Store wavefunction in real space representation for integration.", &
9507  usage="STORE_WFN T", type_of_var=logical_t, &
9508  default_l_val=.true., lone_keyword_l_val=.true.)
9509  CALL section_add_keyword(section, keyword)
9510  CALL keyword_release(keyword)
9511 
9512  CALL keyword_create(keyword, __location__, name="GROUP_SIZE", &
9513  description="Sets the size of a subgroup for ERI calculation, "// &
9514  "each of which with a full set of work grids, arrays or orbitals "// &
9515  "depending on the method of grids (work grids, arrays, orbitals). "// &
9516  "Small numbers reduce communication but increase the memory demands. "// &
9517  "A negative number indicates all processes (default).", &
9518  usage="GROUP_SIZE 2", type_of_var=integer_t, &
9519  default_i_val=-1)
9520  CALL section_add_keyword(section, keyword)
9521  CALL keyword_release(keyword)
9522 
9523  CALL keyword_create(keyword, __location__, name="PRINT_LEVEL", &
9524  variants=(/"IOLEVEL"/), &
9525  description="How much output is written by the individual groups.", &
9526  usage="PRINT_LEVEL HIGH", &
9527  default_i_val=silent_print_level, enum_c_vals= &
9528  s2a("SILENT", "LOW", "MEDIUM", "HIGH", "DEBUG"), &
9529  enum_desc=s2a("Almost no output", &
9530  "Little output", "Quite some output", "Lots of output", &
9531  "Everything is written out, useful for debugging purposes only"), &
9534  CALL section_add_keyword(section, keyword)
9535  CALL keyword_release(keyword)
9536 
9537  END SUBROUTINE create_eri_gpw
9538 
9539 ! **************************************************************************************************
9540 !> \brief Creates the section for cube files related to the implicit Poisson solver.
9541 !> \param section the section to be created
9542 !> \par History
9543 !> 03.2016 refactored from create_print_dft_section [Hossein Bani-Hashemian]
9544 !> \author Mohammad Hossein Bani-Hashemian
9545 ! **************************************************************************************************
9546  SUBROUTINE create_implicit_psolver_section(section)
9547  TYPE(section_type), POINTER :: section
9548 
9549  TYPE(keyword_type), POINTER :: keyword
9550  TYPE(section_type), POINTER :: print_key
9551 
9552  cpassert(.NOT. ASSOCIATED(section))
9553  CALL section_create(section, __location__, name="IMPLICIT_PSOLVER", &
9554  description="Controls printing of cube files for data from the implicit "// &
9555  "(generalized) Poisson solver.", &
9556  citations=(/banihashemian2016/), &
9557  n_keywords=0, n_subsections=3, repeats=.false.)
9558 
9559  NULLIFY (keyword, print_key)
9560 
9561  ! dielectric constant function
9562  CALL cp_print_key_section_create(print_key, __location__, "DIELECTRIC_CUBE", &
9563  description="Controls the printing of a cube file with dielectric constant from "// &
9564  "the implicit (generalized) Poisson solver.", &
9565  print_level=high_print_level, filename="")
9566 
9567  CALL keyword_create(keyword, __location__, name="stride", &
9568  description="The stride (X,Y,Z) used to write the cube file "// &
9569  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
9570  " 1 number valid for all components.", &
9571  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
9572  CALL section_add_keyword(print_key, keyword)
9573  CALL keyword_release(keyword)
9574  CALL keyword_create(keyword, __location__, name="APPEND", &
9575  description="append the cube files when they already exist", &
9576  default_l_val=.false., lone_keyword_l_val=.true.)
9577  CALL section_add_keyword(print_key, keyword)
9578  CALL keyword_release(keyword)
9579 
9580  CALL section_add_subsection(section, print_key)
9581  CALL section_release(print_key)
9582 
9583  ! dirichlet type constraints
9585  print_key, __location__, "DIRICHLET_BC_CUBE", &
9586  description="Controls the printing of cube files with unit step functions (constraints)"// &
9587  " representing Dirichlet-type (boundary) regions defined in the implicit (generalized) Poisson"// &
9588  " solver section. The regions remain unchanged throughout the calculations. If the Dirichlet"// &
9589  " regions are relatively large and/or the number of partitions is quite high, in order to save memory,"// &
9590  " generate the cube files in early steps and perform the rest of the calculations with this keyword"// &
9591  " switched off.", &
9592  print_level=high_print_level, filename="")
9593 
9594  CALL keyword_create(keyword, __location__, name="TILE_CUBES", &
9595  description="Print tiles that tessellate the Dirichlet regions into cube files. If TRUE, "// &
9596  "generates cube files as many as the total number of tiles.", &
9597  usage="TILE_CUBES <logical>", &
9598  default_l_val=.false., lone_keyword_l_val=.true.)
9599  CALL section_add_keyword(print_key, keyword)
9600  CALL keyword_release(keyword)
9601  CALL keyword_create(keyword, __location__, name="stride", &
9602  description="The stride (X,Y,Z) used to write the cube file "// &
9603  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
9604  " 1 number valid for all components.", &
9605  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
9606  CALL section_add_keyword(print_key, keyword)
9607  CALL keyword_release(keyword)
9608  CALL keyword_create(keyword, __location__, name="APPEND", &
9609  description="append the cube files when they already exist", &
9610  default_l_val=.false., lone_keyword_l_val=.true.)
9611  CALL section_add_keyword(print_key, keyword)
9612  CALL keyword_release(keyword)
9613 
9614  CALL section_add_subsection(section, print_key)
9615  CALL section_release(print_key)
9616 
9617  ! charge introduced by Lagrange multipliers
9618  CALL cp_print_key_section_create(print_key, __location__, "DIRICHLET_CSTR_CHARGE_CUBE", &
9619  description="Controls the printing of cube files with penalty charges induced to "// &
9620  "Dirichlet regions by Lagrange multipliers (implicit Poisson solver).", &
9621  print_level=high_print_level, filename="")
9622 
9623  CALL keyword_create(keyword, __location__, name="stride", &
9624  description="The stride (X,Y,Z) used to write the cube file "// &
9625  "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
9626  " 1 number valid for all components.", &
9627  usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
9628  CALL section_add_keyword(print_key, keyword)
9629  CALL keyword_release(keyword)
9630  CALL keyword_create(keyword, __location__, name="APPEND", &
9631  description="append the cube files when they already exist", &
9632  default_l_val=.false., lone_keyword_l_val=.true.)
9633  CALL section_add_keyword(print_key, keyword)
9634  CALL keyword_release(keyword)
9635 
9636  CALL section_add_subsection(section, print_key)
9637  CALL section_release(print_key)
9638 
9639  END SUBROUTINE create_implicit_psolver_section
9640 
9641 ! **************************************************************************************************
9642 !> \brief creates the input section for parameters related to CDFT specific optimizers
9643 !> \param section the section to be created
9644 !> \par History
9645 !> 03.2018 separated from create_outer_scf_section [Nico Holmberg]
9646 !> \author Nico Holmberg
9647 ! **************************************************************************************************
9648  SUBROUTINE create_cdft_opt_section(section)
9649  TYPE(section_type), POINTER :: section
9650 
9651  TYPE(keyword_type), POINTER :: keyword
9652 
9653  cpassert(.NOT. ASSOCIATED(section))
9654  CALL section_create(section, __location__, name="CDFT_OPT", &
9655  description="Parameters controlling optimization methods that are compatible "// &
9656  "only with CDFT based constraints (i.e. CDFT SCF is active). Specifically, "// &
9657  "the control parameters for the Broyden and Newton optimizers are defined in this "// &
9658  "section.", &
9659  n_keywords=10, n_subsections=0, repeats=.false.)
9660 
9661  NULLIFY (keyword)
9662 
9663  CALL keyword_create(keyword, __location__, name="BROYDEN_TYPE", &
9664  description="Specifies the Broyden optimizer variant to use.", &
9665  usage="BROYDEN_TYPE BT1", &
9666  default_i_val=broyden_type_1, &
9667  enum_c_vals=s2a("BT1", "BT1_EXPLICIT", "BT2", "BT2_EXPLICIT", &
9668  "BT1_LS", "BT1_EXPLICIT_LS", "BT2_LS", "BT2_EXPLICIT_LS"), &
9669  enum_desc=s2a("Broyden's first method, also known as the good method. The initial Jacobian"// &
9670  " is built from MD history if available. Otherwise switches to SD for one"// &
9671  " SCF iteration until a Jacobian can be built from the SCF history.", &
9672  "Same as BT1, but computes the explicit Jacobian with finite differences. "// &
9673  "Requires a CDFT SCF procedure to be active.", &
9674  "Same as BT1, but uses Broyden's second method, also known as the bad method.", &
9675  "Same as BT1_EXPLICIT, but using Broyden's second method.", &
9676  "Same as BT1, but uses backtracking line search for optimizing the step size "// &
9677  "(see optimizer NEWTON_LS).", &
9678  "Same as BT1_EXPLICIT, but uses backtracking line search for optimizing the step size.", &
9679  "Same as BT2, but uses backtracking line search for optimizing the step size.", &
9680  "Same as BT2_EXPLICIT, but uses backtracking line search for optimizing the step size."), &
9684  CALL section_add_keyword(section, keyword)
9685  CALL keyword_release(keyword)
9686 
9687  CALL keyword_create(keyword, __location__, name="JACOBIAN_TYPE", &
9688  description="Finite difference method used to calculate the inverse Jacobian "// &
9689  "needed by some optimizers. Compatible only with CDFT constraints.", &
9690  usage="JACOBIAN_TYPE FD1", &
9691  default_i_val=jacobian_fd1, &
9692  enum_c_vals=s2a("FD1", "FD1_BACKWARD", "FD2", "FD2_BACKWARD", "FD1_CENTRAL"), &
9693  enum_desc=s2a("First order forward difference (one extra energy evaluation per constraint).", &
9694  "First order backward difference (one extra energy evaluation per constraint).", &
9695  "Second order forward difference (two extra energy evaluations per constraint).", &
9696  "Second order backward difference (two extra energy evaluations per constraint).", &
9697  "First order central difference (two extra energy evaluations per constraint)."), &
9700  CALL section_add_keyword(section, keyword)
9701  CALL keyword_release(keyword)
9702 
9703  CALL keyword_create(keyword, __location__, name="JACOBIAN_STEP", &
9704  description="Step size to use in the calculation of the inverse Jacobian with finite differences. "// &
9705  "Expects one value for all constraints, or one value per constraint.", &
9706  usage="JACOBIAN_STEP 5.0E-3 ", n_var=-1, default_r_val=5.0e-3_dp)
9707  CALL section_add_keyword(section, keyword)
9708  CALL keyword_release(keyword)
9709 
9710  CALL keyword_create(keyword, __location__, name="JACOBIAN_FREQ", &
9711  description="Defines parameters that control how often the explicit Jacobian is built,"// &
9712  " which is needed by some optimizers. Expects two values. The first value"// &
9713  " determines how many consecutive CDFT SCF iterations should skip a rebuild,"// &
9714  " whereas the latter how many MD steps. The values can be zero (meaning never"// &
9715  " rebuild) or positive. Both values cannot be zero.", &
9716  usage="JACOBIAN_FREQ 1 1", n_var=2, &
9717  default_i_vals=(/1, 1/), type_of_var=integer_t)
9718  CALL section_add_keyword(section, keyword)
9719  CALL keyword_release(keyword)
9720 
9721  CALL keyword_create(keyword, __location__, name="JACOBIAN_RESTART", &
9722  description="Restart the inverse Jacobian using the vector defined with keyword JACOBIAN_VECTOR.", &
9723  usage="JACOBIAN_RESTART TRUE", &
9724  default_l_val=.false., lone_keyword_l_val=.true.)
9725  CALL section_add_keyword(section, keyword)
9726  CALL keyword_release(keyword)
9727 
9728  CALL keyword_create(keyword, __location__, name="JACOBIAN_VECTOR", &
9729  description="Defines the inverse Jacobian matrix. Useful for restarting calculations. "// &
9730  "Expects n^2 values where n is the total number of constraints. "// &
9731  "The matrix should be given in row major order.", &
9732  usage="JACOBIAN_VECTOR 1.0 0.0", n_var=-1, type_of_var=real_t)
9733  CALL section_add_keyword(section, keyword)
9734  CALL keyword_release(keyword)
9735 
9736  CALL keyword_create(keyword, __location__, name="MAX_LS", &
9737  description="The maximum number of backtracking line search steps to perform.", &
9738  usage="MAX_LS 5", default_i_val=5)
9739  CALL section_add_keyword(section, keyword)
9740  CALL keyword_release(keyword)
9741 
9742  CALL keyword_create(keyword, __location__, name="FACTOR_LS", &
9743  description="Control parameter for backtracking line search. The step size is reduced by "// &
9744  "this factor on every line search iteration. Value must be between 0 and 1 (exclusive).", &
9745  usage="FACTOR_LS 0.5", default_r_val=0.5_dp)
9746  CALL section_add_keyword(section, keyword)
9747  CALL keyword_release(keyword)
9748 
9749  CALL keyword_create(keyword, __location__, name="CONTINUE_LS", &
9750  description="Continue backtracking line search until MAX_LS steps are reached or the "// &
9751  "norm of the CDFT gradient no longer decreases. Default (false) behavior exits the "// &
9752  "line search procedure on the first step that the gradient decreases.", &
9753  usage="CONTINUE_LS TRUE", &
9754  default_l_val=.false., lone_keyword_l_val=.true.)
9755  CALL section_add_keyword(section, keyword)
9756  CALL keyword_release(keyword)
9757 
9758  END SUBROUTINE create_cdft_opt_section
9759 
9760 END MODULE input_cp2k_dft
integer, parameter, public basis_sort_zet
integer, parameter, public basis_sort_default
collects all references to literature in CP2K as new algorithms / method are included from literature...
Definition: bibliography.F:28
integer, save, public vandevondele2005b
Definition: bibliography.F:43
integer, save, public blochl1995
Definition: bibliography.F:43
integer, save, public guidon2010
Definition: bibliography.F:43
integer, save, public vandevondele2003
Definition: bibliography.F:43
integer, save, public bengtsson1999
Definition: bibliography.F:43
integer, save, public kunert2003
Definition: bibliography.F:43
integer, save, public iannuzzi2007
Definition: bibliography.F:43
integer, save, public yin2017
Definition: bibliography.F:43
integer, save, public stewart2007
Definition: bibliography.F:43
integer, save, public holmberg2017
Definition: bibliography.F:43
integer, save, public vandevondele2006
Definition: bibliography.F:43
integer, save, public golze2017b
Definition: bibliography.F:43
integer, save, public krack2002
Definition: bibliography.F:43
integer, save, public vandevondele2005a
Definition: bibliography.F:43
integer, save, public kuhne2007
Definition: bibliography.F:43
integer, save, public golze2017a
Definition: bibliography.F:43
integer, save, public schiffmann2015
Definition: bibliography.F:43
integer, save, public lippert1999
Definition: bibliography.F:43
integer, save, public eriksen2020
Definition: bibliography.F:43
integer, save, public dewar1977
Definition: bibliography.F:43
integer, save, public avezac2005
Definition: bibliography.F:43
integer, save, public vanvoorhis2015
Definition: bibliography.F:43
integer, save, public repasky2002
Definition: bibliography.F:43
integer, save, public weber2008
Definition: bibliography.F:43
integer, save, public andreussi2012
Definition: bibliography.F:43
integer, save, public iannuzzi2006
Definition: bibliography.F:43
integer, save, public iannuzzi2005
Definition: bibliography.F:43
integer, save, public rocha2006
Definition: bibliography.F:43
integer, save, public lippert1997
Definition: bibliography.F:43
integer, save, public holmberg2018
Definition: bibliography.F:43
integer, save, public fattebert2002
Definition: bibliography.F:43
integer, save, public andermatt2016
Definition: bibliography.F:43
integer, save, public merlot2014
Definition: bibliography.F:43
integer, save, public thiel1992
Definition: bibliography.F:43
integer, save, public ehrhardt1985
Definition: bibliography.F:43
integer, save, public becke1988b
Definition: bibliography.F:43
integer, save, public perdew1981
Definition: bibliography.F:43
integer, save, public knizia2013
Definition: bibliography.F:43
integer, save, public shigeta2001
Definition: bibliography.F:43
integer, save, public stewart1982
Definition: bibliography.F:43
integer, save, public schenter2008
Definition: bibliography.F:43
integer, save, public lu2004
Definition: bibliography.F:43
integer, save, public dudarev1997
Definition: bibliography.F:43
integer, save, public heinzmann1976
Definition: bibliography.F:43
integer, save, public brelaz1979
Definition: bibliography.F:43
integer, save, public krack2000
Definition: bibliography.F:43
integer, save, public dewar1985
Definition: bibliography.F:43
integer, save, public banihashemian2016
Definition: bibliography.F:43
integer, save, public stewart1989
Definition: bibliography.F:43
integer, save, public brehm2018
Definition: bibliography.F:43
integer, save, public kolafa2004
Definition: bibliography.F:43
integer, save, public dudarev1998
Definition: bibliography.F:43
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer, parameter, public debug_print_level
integer, parameter, public low_print_level
integer, parameter, public medium_print_level
integer, parameter, public high_print_level
integer, parameter, public add_last_numeric
integer, parameter, public silent_print_level
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)
creates a print_key section
utils to manipulate splines on the regular grid of a pw
integer, parameter, public pw_interp
integer, parameter, public spline3_nopbc_interp
integer, parameter, public spline3_pbc_interp
unit conversion facility
Definition: cp_units.F:30
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
Definition: cp_units.F:1150
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public use_mom_ref_coac
integer, parameter, public sic_list_unpaired
integer, parameter, public sic_mauri_spz
integer, parameter, public jacobian_fd1_central
integer, parameter, public smear_fermi_dirac
integer, parameter, public e_dens_total_hard_approx
integer, parameter, public xas_1s_type
integer, parameter, public core_guess
integer, parameter, public embed_grid_angstrom
integer, parameter, public bqb_opt_quick
integer, parameter, public do_method_ofgpw
integer, parameter, public do_bch
integer, parameter, public do_admm_purify_mo_no_diag
integer, parameter, public do_etrs
integer, parameter, public do_iaoloc_energy
integer, parameter, public xas_4p_type
integer, parameter, public do_se_lr_ewald_gks
integer, parameter, public mopac_guess
integer, parameter, public oe_saop
integer, parameter, public do_admm_aux_exch_func_opt_libxc
integer, parameter, public do_gapw_gct
integer, parameter, public do_gapw_gcs
integer, parameter, public rel_zora_full
integer, parameter, public ref_charge_atomic
integer, parameter, public xas_3s_type
integer, parameter, public do_pade
integer, parameter, public embed_steep_desc
integer, parameter, public radius_vdw
integer, parameter, public eri_operator_erf
integer, parameter, public outer_scf_optimizer_sd
integer, parameter, public do_s2_restraint
integer, parameter, public do_admm_purify_none
integer, parameter, public orb_dxy
integer, parameter, public do_method_rigpw
integer, parameter, public cholesky_restore
integer, parameter, public do_s2_constraint
integer, parameter, public ot_chol_irac
integer, parameter, public cdft_beta_constraint
integer, parameter, public use_mom_ref_user
integer, parameter, public broyden_type_2_explicit_ls
integer, parameter, public rel_pot_full
integer, parameter, public cdft_magnetization_constraint
integer, parameter, public outer_scf_optimizer_bisect
integer, parameter, public outer_scf_optimizer_secant
integer, parameter, public orb_pz
integer, parameter, public wfi_frozen_method_nr
integer, parameter, public smear_energy_window
integer, parameter, public do_method_gpw
integer, parameter, public ls_3pnt
integer, parameter, public diag_block_krylov
integer, parameter, public qiskit_solver
integer, parameter, public becke_cutoff_element
integer, parameter, public gapw_1c_large
integer, parameter, public do_method_pdg
integer, parameter, public do_admm_purify_none_dm
integer, parameter, public wfi_linear_wf_method_nr
integer, parameter, public no_solver
integer, parameter, public xas_3d_type
integer, parameter, public wfi_linear_p_method_nr
integer, parameter, public outer_scf_cdft_constraint
integer, parameter, public wfi_linear_ps_method_nr
integer, parameter, public do_method_pnnl
integer, parameter, public wannier_projection
integer, parameter, public do_ddapc_constraint
integer, parameter, public mao_projection
integer, parameter, public broyden_type_1_explicit
integer, parameter, public xas_not_excited
integer, parameter, public use_mom_ref_com
integer, parameter, public do_se_lr_none
integer, parameter, public ehrenfest
integer, parameter, public no_guess
integer, parameter, public eri_method_full_gpw
integer, parameter, public wfn_mix_orig_virtual
integer, parameter, public xas_dscf
integer, parameter, public casci_canonical
integer, parameter, public wfi_use_prev_rho_r_method_nr
integer, parameter, public broyden_type_2_ls
integer, parameter, public use_restart_wfn
integer, parameter, public do_admm_purify_mcweeny
integer, parameter, public jacobian_fd2
integer, parameter, public broyden_type_1
integer, parameter, public tddfpt_singlet
integer, parameter, public xas_none
integer, parameter, public do_lri_inv_auto
integer, parameter, public radius_default
integer, parameter, public do_se_lr_ewald
integer, parameter, public outer_scf_optimizer_broyden
integer, parameter, public atomic_guess
integer, parameter, public do_admm_blocking_purify_full
integer, parameter, public plus_u_lowdin
integer, parameter, public broyden_type_1_explicit_ls
integer, parameter, public ot_algo_irac
integer, parameter, public gto_cartesian
integer, parameter, public outer_scf_basis_center_opt
integer, parameter, public gto_spherical
integer, parameter, public cholesky_dbcsr
integer, parameter, public broyden_type_2_explicit
integer, parameter, public kg_tnadd_none
integer, parameter, public do_se_is_kdso_d
integer, parameter, public gapw_1c_medium
integer, parameter, public do_admm_aux_exch_func_sx_libxc
integer, parameter, public xas_4s_type
integer, parameter, public admm2_type
integer, parameter, public xas_tp_xhh
integer, parameter, public outer_scf_s2_constraint
integer, parameter, public manual_selection
integer, parameter, public do_lri_opt_coeff
integer, parameter, public ot_algo_taylor_or_diag
integer, parameter, public sic_list_all
integer, parameter, public wfi_use_guess_method_nr
integer, parameter, public ot_poly_irac
integer, parameter, public history_guess
integer, parameter, public cholesky_off
integer, parameter, public cdft_charge_constraint
integer, parameter, public do_cn
integer, parameter, public smear_list
integer, parameter, public kg_tnadd_embed_ri
integer, parameter, public tddfpt_excitations
integer, parameter, public orb_dz2
integer, parameter, public jacobian_fd1
integer, parameter, public oe_none
integer, parameter, public broyden_type_2
integer, parameter, public kg_tnadd_embed
integer, parameter, public sic_eo
integer, parameter, public xas_2p_type
integer, parameter, public sccs_derivative_cd5
integer, parameter, public ot_mini_cg
integer, parameter, public xas_dip_len
integer, parameter, public do_admm_aux_exch_func_bee
integer, parameter, public bqb_opt_normal
integer, parameter, public ot_precond_full_kinetic
integer, parameter, public cholesky_reduce
integer, parameter, public bqb_opt_off
integer, parameter, public xas_dip_vel
integer, parameter, public rel_zora_mp
integer, parameter, public eri_operator_gaussian
integer, parameter, public mao_basis_orb
integer, parameter, public plus_u_mulliken_charges
integer, parameter, public high_spin_roks
integer, parameter, public tddfpt_lanczos
integer, parameter, public hf_model
integer, parameter, public tddfpt_triplet
integer, parameter, public use_scf_wfn
integer, parameter, public cholesky_inverse
integer, parameter, public no_admm_type
integer, parameter, public do_lri_opt_all
integer, parameter, public rel_zora
integer, parameter, public do_admm_blocked_projection
integer, parameter, public kg_tnadd_atomic
integer, parameter, public orb_s
integer, parameter, public ot_mini_diis
integer, parameter, public do_admm_basis_projection
integer, parameter, public do_ppl_grid
integer, parameter, public embed_level_shift
integer, parameter, public wfn_mix_orig_external
integer, parameter, public diag_ot
integer, parameter, public xas_2s_type
integer, parameter, public xas_tp_xfh
integer, parameter, public tddfpt_spin_flip
integer, parameter, public do_method_rm1
integer, parameter, public outer_scf_ddapc_constraint
integer, parameter, public orb_py
integer, parameter, public ot_precond_solver_default
integer, parameter, public do_admm_aux_exch_func_default_libxc
integer, parameter, public xas_tdp_by_kind
integer, parameter, public e_dens_total_density
integer, parameter, public do_admm_aux_exch_func_opt
integer, parameter, public gapw_1c_small
integer, parameter, public dmft_model
integer, parameter, public do_admm_aux_exch_func_none
integer, parameter, public outer_scf_becke_constraint
integer, parameter, public bqb_opt_exhaustive
integer, parameter, public do_admm_purify_cauchy_subspace
integer, parameter, public do_method_pm3
integer, parameter, public plus_u_mulliken
integer, parameter, public mao_basis_ext
integer, parameter, public radius_user
integer, parameter, public embed_resp
integer, parameter, public kg_color_greedy
integer, parameter, public random_guess
integer, parameter, public xas_3p_type
integer, parameter, public xas_tp_fh
integer, parameter, public do_admm_aux_exch_func_bee_libxc
integer, parameter, public eri_method_gpw_ht
integer, parameter, public xas_tp_flex
integer, parameter, public do_iaoloc_pm4
integer, parameter, public ot_precond_full_single
integer, parameter, public admm1_type
integer, parameter, public do_iaoloc_l1
integer, parameter, public embed_quasi_newton
integer, parameter, public do_admm_aux_exch_func_pbex_libxc
integer, parameter, public do_iaoloc_enone
integer, parameter, public xas_4f_type
integer, parameter, public ot_precond_solver_inv_chol
integer, parameter, public kg_color_dsatur
integer, parameter, public do_lri_opt_exps
integer, parameter, public shape_function_density
integer, parameter, public rsdft_model
integer, parameter, public do_method_mndo
integer, parameter, public outer_scf_hirshfeld_constraint
integer, parameter, public radius_covalent
integer, parameter, public gapw_1c_orb
integer, parameter, public do_admm_aux_exch_func_default
integer, parameter, public do_potential_truncated
integer, parameter, public jacobian_fd1_backward
integer, parameter, public do_pwgrid_ns_fullspace
integer, parameter, public mao_basis_prim
integer, parameter, public gapw_1c_very_large
integer, parameter, public orb_dyz
integer, parameter, public weight_type_unit
integer, parameter, public do_method_gapw
integer, parameter, public ot_precond_none
integer, parameter, public admms_type
integer, parameter, public do_admm_charge_constrained_projection
integer, parameter, public jacobian_fd2_backward
integer, parameter, public eri_operator_erfc
integer, parameter, public ls_2pnt
integer, parameter, public rel_dkh
integer, parameter, public ls_none
integer, parameter, public do_admm_purify_cauchy
integer, parameter, public embed_none
integer, parameter, public do_iaoloc_pm2
integer, parameter, public embed_fa
integer, parameter, public ot_precond_full_single_inverse
integer, parameter, public sccs_fattebert_gygi
integer, parameter, public do_potential_id
integer, parameter, public rel_trans_full
integer, parameter, public sccs_derivative_cd7
integer, parameter, public rel_trans_molecule
integer, parameter, public ot_lwdn_irac
integer, parameter, public xas_4d_type
integer, parameter, public tddfpt_davidson
integer, parameter, public diag_filter_matrix
integer, parameter, public do_lri_pseudoinv_svd
integer, parameter, public do_method_mndod
integer, parameter, public rel_trans_atom
integer, parameter, public ls_gold
integer, parameter, public do_gapw_log
integer, parameter, public do_method_am1
integer, parameter, public embed_diff
integer, parameter, public weight_type_mass
integer, parameter, public use_rt_restart
integer, parameter, public xas_tdp_by_index
integer, parameter, public do_method_dftb
integer, parameter, public do_iaoloc_occ
integer, parameter, public sparse_guess
integer, parameter, public orb_px
integer, parameter, public diag_block_davidson
integer, parameter, public shape_function_gaussian
integer, parameter, public wfi_use_prev_wf_method_nr
integer, parameter, public radius_single
integer, parameter, public do_spin_density
integer, parameter, public sccs_derivative_fft
integer, parameter, public use_mom_ref_zero
integer, parameter, public outer_scf_optimizer_newton_ls
integer, parameter, public do_potential_coulomb
integer, parameter, public gaussian
integer, parameter, public outer_scf_optimizer_none
integer, parameter, public outer_scf_optimizer_newton
integer, parameter, public oe_lb
integer, parameter, public rel_pot_erfc
integer, parameter, public wfi_ps_method_nr
integer, parameter, public rel_none
integer, parameter, public do_pwgrid_spherical
integer, parameter, public ref_charge_mulliken
integer, parameter, public general_roks
integer, parameter, public orb_dzx
integer, parameter, public xas_tp_hh
integer, parameter, public do_se_lr_ewald_r3
integer, parameter, public do_taylor
integer, parameter, public eri_operator_trunc
integer, parameter, public do_se_is_kdso
integer, parameter, public embed_grid_bohr
integer, parameter, public outer_scf_none
integer, parameter, public do_admm_purify_mo_diag
integer, parameter, public do_method_lrigpw
integer, parameter, public diag_standard
integer, parameter, public do_em
integer, parameter, public sic_mauri_us
integer, parameter, public orb_dy2
integer, parameter, public do_potential_short
integer, parameter, public sic_none
integer, parameter, public do_ppl_analytic
integer, parameter, public do_se_is_slater
integer, parameter, public eri_operator_coulomb
integer, parameter, public becke_cutoff_global
integer, parameter, public wfi_aspc_nr
integer, parameter, public cdft_alpha_constraint
integer, parameter, public do_lri_inv
integer, parameter, public do_method_xtb
integer, parameter, public broyden_type_1_ls
integer, parameter, public do_ddapc_restraint
integer, parameter, public wfn_mix_orig_occ
integer, parameter, public restart_guess
integer, parameter, public oe_sic
integer, parameter, public bqb_opt_patient
integer, parameter, public do_pwgrid_ns_halfspace
integer, parameter, public eri_operator_yukawa
integer, parameter, public sccs_derivative_cd3
integer, parameter, public do_method_pm6fm
integer, parameter, public rel_sczora_mp
integer, parameter, public tddfpt_spin_cons
integer, parameter, public admmq_type
integer, parameter, public e_dens_soft_density
integer, parameter, public sccs_andreussi
integer, parameter, public ot_precond_s_inverse
integer, parameter, public sic_ad
integer, parameter, public ot_mini_broyden
integer, parameter, public do_admm_exch_scaling_none
integer, parameter, public orb_dx2
integer, parameter, public do_arnoldi
integer, parameter, public ot_precond_solver_update
integer, parameter, public xes_tp_val
integer, parameter, public do_full_density
integer, parameter, public admmp_type
integer, parameter, public do_method_gapw_xc
integer, parameter, public outer_scf_optimizer_diis
integer, parameter, public ot_mini_sd
integer, parameter, public do_admm_exch_scaling_merlot
integer, parameter, public real_time_propagation
integer, parameter, public numerical
integer, parameter, public do_method_pm6
integer, parameter, public oe_gllb
integer, parameter, public ot_precond_full_all
integer, parameter, public ot_precond_solver_direct
integer, parameter, public wfi_use_prev_p_method_nr
integer, parameter, public no_excitations
integer, parameter, public do_lri_pseudoinv_diag
integer, parameter, public do_admm_aux_exch_func_pbex
integer, parameter, public slater
input for the ALMO SCF section
subroutine, public create_almo_scf_section(section)
create the almo scf section
function that build the dft section of the input
subroutine, public create_bsse_section(section)
Create the BSSE section for counterpoise correction.
subroutine, public create_mgrid_section(section, create_subsections)
creates the multigrid
subroutine, public create_dft_section(section)
creates the dft section
subroutine, public create_scf_section(section)
creates the structure of the section with the DFT SCF parameters
subroutine, public create_qs_section(section)
creates the input section for the qs part
subroutine, public create_interp_section(section)
creates the interpolation section
subroutine, public create_lrigpw_section(section)
input section for optional parameters for LRIGPW LRI: local resolution of identity
subroutine, public create_ddapc_restraint_section(section, section_name)
...
function that builds the distribution section of the input
subroutine, public create_distribution_section(section)
Creates the distribution section.
function that build the dft section of the input
Definition: input_cp2k_ec.F:14
subroutine, public create_ec_section(section)
creates the ENERGY CORRECTION section
Definition: input_cp2k_ec.F:62
Excited state input section.
subroutine, public create_exstate_section(section)
creates the EXCITED ENERGY section
function that build the input sections for external [potential, density VXC]
subroutine, public create_ext_pot_section(section)
Creates the section for applying an electrostatic external potential.
subroutine, public create_ext_vxc_section(section)
ZMP Creates the section for creating the external v_xc.
subroutine, public create_ext_den_section(section)
ZMP Creates the section for reading user supplied external density.
function that build the field section of the input
subroutine, public create_efield_section(section)
creates the section for time dependent nonperiodic fields
subroutine, public create_per_efield_section(section)
creates the section for static periodic fields
function that build the kpoints section of the input
subroutine, public create_kpoints_section(section)
Creates the Kpoints section SECTION: &kpoint... &end SCHEME [None, Gamma, Monkhorst-Pack,...
subroutine, public create_kpoint_set_section(section, section_name)
...
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.
input for the linear scaling (LS) section
Definition: input_cp2k_ls.F:12
subroutine, public create_ls_scf_section(section)
creates the linear scaling scf section
Definition: input_cp2k_ls.F:59
creates the mm section of the input
Definition: input_cp2k_mm.F:16
subroutine, public create_dipoles_section(print_key, label, print_level)
creates the input section for the qs part
subroutine, public create_neighbor_lists_section(section)
This section specifies the input parameters for generation of neighbor lists.
function that build the poisson section of the input
subroutine, public create_poisson_section(section)
Creates the Poisson section.
function that builds the projection of MO in RTP section of the input
subroutine, public create_projection_rtp_section(section)
creates the section for time dependent projection of the MOs
subroutine, public create_rsgrid_section(section)
...
function that build the dft section of the input
Definition: input_cp2k_tb.F:14
subroutine, public create_dftb_control_section(section)
...
Definition: input_cp2k_tb.F:56
subroutine, public create_xtb_control_section(section)
...
input section for NEGF based quantum transport calculations (integration with the quantum transport c...
subroutine, public create_transport_section(section)
creates the TRANSPORT section
function that build the dft section of the input
subroutine, public create_print_voronoi_section(print_key)
Create the print voronoi section.
function that build the xc section of the input
Definition: input_cp2k_xc.F:14
subroutine, public create_xc_section(section)
creates the input section for the xc part
subroutine, public create_xc_fun_section(section)
creates the structure of the section needed to select the xc functional
Definition: input_cp2k_xc.F:73
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)
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 logical_t
integer, parameter, public char_t
integer, parameter, public integer_t
Defines the basic variable types.
Definition: kinds.F:23
integer, parameter, public dp
Definition: kinds.F:34
This module defines the grid data type and some basic operations on it.
Definition: pw_grids.F:36
integer, parameter, public do_pw_grid_blocked_false
Definition: pw_grids.F:78
integer, parameter, public do_pw_grid_blocked_true
Definition: pw_grids.F:78
integer, parameter, public do_pw_grid_blocked_free
Definition: pw_grids.F:78
different utils that are useful to manipulate splines on the regular grid of a pw
integer, parameter, public precond_spl3_3
integer, parameter, public precond_spl3_aint
integer, parameter, public no_precond
integer, parameter, public precond_spl3_2
integer, parameter, public precond_spl3_aint2
integer, parameter, public precond_spl3_1
module that contains the definitions of the scf types
subroutine, public create_mixing_section(section, ls_scf)
Create CP2K input section for the mixing of the density matrix to be used only with diagonalization m...
subroutine, public create_filtermatrix_section(section)
Input section for filter matrix diagonalisation method.
Definition: qs_fb_input.F:37
manage control variables for the maximum overlap method
Definition: qs_mom_types.F:11
subroutine, public create_mom_section(section)
Create CP2K input section for variable occupancy using the Maximum Overlap Method....
Definition: qs_mom_types.F:52
Utilities for string manipulations.
character(len=1), parameter, public newline