1!--------------------------------------------------------------------------------------------------!
2!   CP2K: A general program to perform molecular dynamics simulations                              !
3!   Copyright (C) 2000 - 2020  CP2K developers group                                               !
4!--------------------------------------------------------------------------------------------------!
5
6! **************************************************************************************************
7!> \brief function that build the dft section of the input
8!> \par History
9!>      01.2013 moved out of input_cp2k_dft [MI]
10!> \author MI
11! **************************************************************************************************
12MODULE input_cp2k_properties_dft
13
14   USE bibliography,                    ONLY: Futera2017,&
15                                              Iannuzzi2005,&
16                                              Kondov2007,&
17                                              Luber2014,&
18                                              Putrino2000,&
19                                              Putrino2002,&
20                                              Sebastiani2001,&
21                                              Weber2009
22   USE cp_output_handling,              ONLY: add_last_numeric,&
23                                              cp_print_key_section_create,&
24                                              debug_print_level,&
25                                              high_print_level,&
26                                              low_print_level,&
27                                              medium_print_level,&
28                                              silent_print_level
29   USE cp_units,                        ONLY: cp_unit_to_cp2k
30   USE input_constants,                 ONLY: &
31        current_gauge_atom, current_gauge_r, current_gauge_r_and_step_func, &
32        current_orb_center_atom, current_orb_center_box, current_orb_center_common, &
33        current_orb_center_wannier, do_et_ddapc, do_full_density, do_no_et, do_spin_density, &
34        gto_cartesian, gto_spherical, oe_gllb, oe_lb, oe_none, oe_saop, oe_shift, &
35        ot_precond_full_all, ot_precond_full_kinetic, ot_precond_full_single, &
36        ot_precond_full_single_inverse, ot_precond_none, ot_precond_s_inverse, &
37        tddfpt_dipole_berry, tddfpt_dipole_length, tddfpt_dipole_velocity, tddfpt_kernel_full, &
38        tddfpt_kernel_stda, use_mom_ref_coac, use_mom_ref_com, use_mom_ref_user, use_mom_ref_zero
39   USE input_cp2k_atprop,               ONLY: create_atprop_section
40   USE input_cp2k_dft,                  ONLY: create_ddapc_restraint_section,&
41                                              create_interp_section,&
42                                              create_mgrid_section
43   USE input_cp2k_loc,                  ONLY: create_localize_section
44   USE input_cp2k_resp,                 ONLY: create_resp_section
45   USE input_cp2k_xc,                   ONLY: create_xc_section
46   USE input_keyword_types,             ONLY: keyword_create,&
47                                              keyword_release,&
48                                              keyword_type
49   USE input_section_types,             ONLY: section_add_keyword,&
50                                              section_add_subsection,&
51                                              section_create,&
52                                              section_release,&
53                                              section_type
54   USE input_val_types,                 ONLY: integer_t,&
55                                              lchar_t,&
56                                              logical_t,&
57                                              real_t
58   USE kinds,                           ONLY: dp
59   USE string_utilities,                ONLY: s2a
60#include "./base/base_uses.f90"
61
62   IMPLICIT NONE
63   PRIVATE
64
65   LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
66   CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_properties_dft'
67
68   PUBLIC :: create_properties_section
69
70CONTAINS
71
72! **************************************************************************************************
73!> \brief Create the PROPERTIES section
74!> \param section the section to create
75!> \author teo
76! **************************************************************************************************
77   SUBROUTINE create_properties_section(section)
78      TYPE(section_type), POINTER                        :: section
79
80      CHARACTER(len=*), PARAMETER :: routineN = 'create_properties_section', &
81         routineP = moduleN//':'//routineN
82
83      TYPE(keyword_type), POINTER                        :: keyword
84      TYPE(section_type), POINTER                        :: subsection
85
86      CPASSERT(.NOT. ASSOCIATED(section))
87      CALL section_create(section, __LOCATION__, name="PROPERTIES", &
88                          description="This section is used to set up the PROPERTIES calculation.", &
89                          n_keywords=0, n_subsections=6, repeats=.FALSE.)
90
91      NULLIFY (subsection, keyword)
92
93      CALL create_linres_section(subsection)
94      CALL section_add_subsection(section, subsection)
95      CALL section_release(subsection)
96
97      CALL create_et_coupling_section(subsection)
98      CALL section_add_subsection(section, subsection)
99      CALL section_release(subsection)
100
101      CALL create_resp_section(subsection)
102      CALL section_add_subsection(section, subsection)
103      CALL section_release(subsection)
104
105      CALL create_atprop_section(subsection)
106      CALL section_add_subsection(section, subsection)
107      CALL section_release(subsection)
108
109      CALL cp_print_key_section_create(subsection, __LOCATION__, name="FIT_CHARGE", &
110                                       description="This section is used to print the density derived atomic point charges."// &
111                                       "The fit of the charges is controlled through the DENSITY_FITTING section", &
112                                       print_level=high_print_level, filename="__STD_OUT__")
113      CALL keyword_create(keyword, __LOCATION__, name="TYPE_OF_DENSITY", &
114                          description="Specifies the type of density used for the fitting", &
115                          usage="TYPE_OF_DENSITY (FULL|SPIN)", &
116                          enum_c_vals=s2a("FULL", "SPIN"), &
117                          enum_i_vals=(/do_full_density, do_spin_density/), &
118                          enum_desc=s2a("Full density", "Spin density"), &
119                          default_i_val=do_full_density)
120      CALL section_add_keyword(subsection, keyword)
121      CALL keyword_release(keyword)
122      CALL section_add_subsection(section, subsection)
123      CALL section_release(subsection)
124
125      CALL create_tddfpt2_section(subsection)
126      CALL section_add_subsection(section, subsection)
127      CALL section_release(subsection)
128
129   END SUBROUTINE create_properties_section
130
131! **************************************************************************************************
132!> \brief creates the input structure used to activate
133!>      a linear response calculation
134!>      Available properties : none
135!> \param section the section to create
136!> \author MI
137! **************************************************************************************************
138   SUBROUTINE create_linres_section(section)
139      TYPE(section_type), POINTER                        :: section
140
141      CHARACTER(len=*), PARAMETER :: routineN = 'create_linres_section', &
142         routineP = moduleN//':'//routineN
143
144      TYPE(keyword_type), POINTER                        :: keyword
145      TYPE(section_type), POINTER                        :: print_key, subsection
146
147      NULLIFY (keyword, subsection, print_key)
148
149      CPASSERT(.NOT. ASSOCIATED(section))
150      CALL section_create(section, __LOCATION__, name="linres", &
151                          description="The linear response is used to calculate one of the "// &
152                          " following properties: nmr, epr, raman, ... ", &
153                          n_keywords=5, n_subsections=2, repeats=.FALSE., &
154                          citations=(/Putrino2000/))
155
156      CALL keyword_create(keyword, __LOCATION__, name="EPS", &
157                          description="target accuracy for the convergence of the conjugate gradient.", &
158                          usage="EPS 1.e-6", default_r_val=1.e-6_dp)
159      CALL section_add_keyword(section, keyword)
160      CALL keyword_release(keyword)
161
162      CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
163                          description="Filter threshold for response density matrix.", &
164                          usage="EPS 1.e-8", default_r_val=0.0_dp)
165      CALL section_add_keyword(section, keyword)
166      CALL keyword_release(keyword)
167
168      CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
169                          description="Maximum number of conjugate gradient iteration to be performed for one optimization.", &
170                          usage="MAX_ITER 200", default_i_val=50)
171      CALL section_add_keyword(section, keyword)
172      CALL keyword_release(keyword)
173
174      CALL keyword_create(keyword, __LOCATION__, name="RESTART_EVERY", &
175                          description="Restart the conjugate gradient after the specified number of iterations.", &
176                          usage="RESTART_EVERY 200", default_i_val=50)
177      CALL section_add_keyword(section, keyword)
178      CALL keyword_release(keyword)
179
180      CALL keyword_create( &
181         keyword, __LOCATION__, name="PRECONDITIONER", &
182         description="Type of preconditioner to be used with all minimization schemes. "// &
183         "They differ in effectiveness, cost of construction, cost of application. "// &
184         "Properly preconditioned minimization can be orders of magnitude faster than doing nothing.", &
185         usage="PRECONDITIONER FULL_ALL", &
186         default_i_val=ot_precond_none, &
187         enum_c_vals=s2a("FULL_ALL", "FULL_SINGLE_INVERSE", "FULL_SINGLE", "FULL_KINETIC", "FULL_S_INVERSE", &
188                         "NONE"), &
189         enum_desc=s2a("Most effective state selective preconditioner based on diagonalization, "// &
190                       "requires the ENERGY_GAP parameter to be an underestimate of the HOMO-LUMO gap. "// &
191                       "This preconditioner is recommended for almost all systems, except very large systems where "// &
192                       "make_preconditioner would dominate the total computational cost.", &
193                       "Based on H-eS cholesky inversion, similar to FULL_SINGLE in preconditioning efficiency "// &
194                       "but cheaper to construct, "// &
195                       "might be somewhat less robust. Recommended for large systems.", &
196                       "Based on H-eS diagonalisation, not as good as FULL_ALL, but somewhat cheaper to apply. ", &
197                       "Cholesky inversion of S and T, fast construction, robust, and relatively good, "// &
198                       "use for very large systems.", &
199                       "Cholesky inversion of S, not as good as FULL_KINETIC, yet equally expensive.", &
200                       "skip preconditioning"), &
201         enum_i_vals=(/ot_precond_full_all, ot_precond_full_single_inverse, ot_precond_full_single, &
202                       ot_precond_full_kinetic, ot_precond_s_inverse, ot_precond_none/))
203      CALL section_add_keyword(section, keyword)
204      CALL keyword_release(keyword)
205
206      CALL keyword_create(keyword, __LOCATION__, name="ENERGY_GAP", &
207                          description="Energy gap estimate [a.u.] for preconditioning", &
208                          usage="ENERGY_GAP 0.1", &
209                          default_r_val=0.2_dp)
210      CALL section_add_keyword(section, keyword)
211      CALL keyword_release(keyword)
212
213      CALL keyword_create(keyword, __LOCATION__, name="RESTART", &
214                          description="Restart the response calculation if the restart file exists", &
215                          usage="RESTART", &
216                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
217      CALL section_add_keyword(section, keyword)
218      CALL keyword_release(keyword)
219
220      CALL keyword_create(keyword, __LOCATION__, name="WFN_RESTART_FILE_NAME", &
221                          variants=(/"RESTART_FILE_NAME"/), &
222                          description="Root of the file names where to read the response functions from"// &
223                          "which to restart the calculation of the linear response", &
224                          usage="WFN_RESTART_FILE_NAME <FILENAME>", &
225                          type_of_var=lchar_t)
226      CALL section_add_keyword(section, keyword)
227      CALL keyword_release(keyword)
228
229      CALL create_localize_section(subsection)
230      CALL section_add_subsection(section, subsection)
231      CALL section_release(subsection)
232
233      CALL create_current_section(subsection)
234      CALL section_add_subsection(section, subsection)
235      CALL section_release(subsection)
236
237      CALL create_nmr_section(subsection)
238      CALL section_add_subsection(section, subsection)
239      CALL section_release(subsection)
240
241      CALL create_spin_spin_section(subsection)
242      CALL section_add_subsection(section, subsection)
243      CALL section_release(subsection)
244
245      CALL create_epr_section(subsection)
246      CALL section_add_subsection(section, subsection)
247      CALL section_release(subsection)
248
249      CALL create_polarizability_section(subsection)
250      CALL section_add_subsection(section, subsection)
251      CALL section_release(subsection)
252
253      CALL section_create(subsection, __LOCATION__, name="PRINT", &
254                          description="printing of information during the linear response calculation", &
255                          repeats=.FALSE.)
256
257      CALL cp_print_key_section_create( &
258         print_key, __LOCATION__, "program_run_info", &
259         description="Controls the printing of basic iteration information during the LINRES calculation", &
260         print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
261      CALL section_add_subsection(subsection, print_key)
262      CALL section_release(print_key)
263
264      CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
265                                       description="Controls the dumping of restart file of the response wavefunction."// &
266                                       "For each set of response functions, i.e. for each perturbation,"// &
267                                       "one different restart file is dumped. These restart files should be"// &
268                                       "employed only to restart the same type of LINRES calculation, "// &
269                                       "i.e. with the same perturbation.", &
270                                       print_level=low_print_level, common_iter_levels=3, each_iter_names=s2a("ITER"), &
271                                       add_last=add_last_numeric, each_iter_values=(/3/), filename="")
272      CALL section_add_subsection(subsection, print_key)
273      CALL section_release(print_key)
274
275      CALL section_add_subsection(section, subsection)
276      CALL section_release(subsection)
277
278   END SUBROUTINE create_linres_section
279
280! **************************************************************************************************
281!> \brief creates the input structure used to activate
282!>      calculation of induced current  DFPT
283!>      Available properties : none
284!> \param section the section to create
285!> \author  MI/VW
286! **************************************************************************************************
287   SUBROUTINE create_current_section(section)
288      TYPE(section_type), POINTER                        :: section
289
290      CHARACTER(len=*), PARAMETER :: routineN = 'create_current_section', &
291         routineP = moduleN//':'//routineN
292
293      TYPE(keyword_type), POINTER                        :: keyword
294      TYPE(section_type), POINTER                        :: print_key, subsection
295
296      NULLIFY (keyword, print_key, subsection)
297
298      CPASSERT(.NOT. ASSOCIATED(section))
299      CALL section_create(section, __LOCATION__, name="current", &
300                          description="The induced current density is calculated by DFPT.", &
301                          n_keywords=4, n_subsections=1, repeats=.FALSE., &
302                          citations=(/Sebastiani2001, Weber2009/))
303
304      CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
305                          description="controls the activation of the induced current calculation", &
306                          usage="&CURRENT T", &
307                          default_l_val=.FALSE., &
308                          lone_keyword_l_val=.TRUE.)
309      CALL section_add_keyword(section, keyword)
310      CALL keyword_release(keyword)
311
312      CALL keyword_create(keyword, __LOCATION__, name="GAUGE", &
313                          description="The gauge used to compute the induced current within GAPW.", &
314                          usage="GAUGE R", &
315                          default_i_val=current_gauge_r_and_step_func, &
316                          enum_c_vals=s2a("R", "R_AND_STEP_FUNCTION", "ATOM"), &
317                          enum_desc=s2a("Position gauge (doesnt work well).", &
318                                        "Position and step function for the soft and the local parts, respectively.", &
319                                        "Atoms."), &
320                          enum_i_vals=(/current_gauge_r, current_gauge_r_and_step_func, current_gauge_atom/))
321      CALL section_add_keyword(section, keyword)
322      CALL keyword_release(keyword)
323
324      CALL keyword_create(keyword, __LOCATION__, name="GAUGE_ATOM_RADIUS", &
325                          description="Build the gauge=atom using only the atoms within this radius.", &
326                          usage="GAUGE_ATOM_RADIUS 10.0", &
327                          type_of_var=real_t, &
328                          default_r_val=cp_unit_to_cp2k(value=4.0_dp, unit_str="angstrom"), &
329                          unit_str="angstrom")
330      CALL section_add_keyword(section, keyword)
331      CALL keyword_release(keyword)
332
333      CALL keyword_create(keyword, __LOCATION__, name="USE_OLD_GAUGE_ATOM", &
334                          description="Use the old way to compute the gauge.", &
335                          usage="USE_OLD_GAUGE_ATOM T", &
336                          default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
337      CALL section_add_keyword(section, keyword)
338      CALL keyword_release(keyword)
339
340      CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_CENTER", &
341                          description="The orbital center.", &
342                          usage="ORBITAL_CENTER WANNIER", &
343                          default_i_val=current_orb_center_wannier, &
344                          enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
345                          enum_desc=s2a("Use the Wannier centers.", &
346                                        "Use a common center (works only for an isolate molecule).", &
347                                        "Use the atoms as center.", &
348                                        "Boxing."), &
349                          enum_i_vals=(/current_orb_center_wannier, current_orb_center_common, &
350                                        current_orb_center_atom, current_orb_center_box/))
351      CALL section_add_keyword(section, keyword)
352      CALL keyword_release(keyword)
353
354      CALL keyword_create(keyword, __LOCATION__, name="COMMON_CENTER", &
355                          description="The common center ", usage="COMMON_CENTER 0.0 1.0 0.0", &
356                          n_var=3, default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp/), type_of_var=real_t, &
357                          unit_str="angstrom")
358      CALL section_add_keyword(section, keyword)
359      CALL keyword_release(keyword)
360
361      CALL keyword_create(keyword, __LOCATION__, name="NBOX", &
362                          description="How many boxes along each directions ", usage="NBOX 6 6 5", &
363                          n_var=3, default_i_vals=(/4, 4, 4/), type_of_var=integer_t)
364      CALL section_add_keyword(section, keyword)
365      CALL keyword_release(keyword)
366
367      CALL keyword_create(keyword, __LOCATION__, name="CHI_PBC", &
368                          description="Calculate the succeptibility correction to the shift with PBC", &
369                          usage="CHI_PBC T", &
370                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
371      CALL section_add_keyword(section, keyword)
372      CALL keyword_release(keyword)
373
374      CALL keyword_create(keyword, __LOCATION__, name="FORCE_NO_FULL", &
375                          description="Avoid the calculation of the state dependent perturbation term, "// &
376                          "even if the orbital centers are set at Wannier centers or at Atom centers", &
377                          usage="FORCE_NO_FULL T", &
378                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
379      CALL section_add_keyword(section, keyword)
380      CALL keyword_release(keyword)
381
382      CALL keyword_create(keyword, __LOCATION__, name="SELECTED_STATES_ON_ATOM_LIST", &
383                          description="Indexes of the atoms for selecting"// &
384                          " the states to be used for the response calculations.", &
385                          usage="SELECTED_STATES_ON_ATOM_LIST 1 2 10", &
386                          n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
387      CALL section_add_keyword(section, keyword)
388      CALL keyword_release(keyword)
389
390      CALL keyword_create(keyword, __LOCATION__, name="SELECTED_STATES_ATOM_RADIUS", &
391                          description="Select all the states included in the given radius around each atoms "// &
392                          "in SELECTED_STATES_ON_ATOM_LIST.", &
393                          usage="SELECTED_STATES_ATOM_RADIUS 2.0", &
394                          type_of_var=real_t, &
395                          default_r_val=cp_unit_to_cp2k(value=4.0_dp, unit_str="angstrom"), &
396                          unit_str="angstrom")
397      CALL section_add_keyword(section, keyword)
398      CALL keyword_release(keyword)
399
400      CALL keyword_create(keyword, __LOCATION__, name="RESTART_CURRENT", &
401                          description="Restart the induced current density calculation"// &
402                          " from a previous run (not working yet).", &
403                          usage="RESTART_CURRENT", default_l_val=.FALSE., &
404                          lone_keyword_l_val=.TRUE.)
405      CALL section_add_keyword(section, keyword)
406      CALL keyword_release(keyword)
407
408      NULLIFY (subsection)
409      CALL section_create(subsection, __LOCATION__, name="PRINT", &
410                          description="print results of induced current density calculation", &
411                          repeats=.FALSE.)
412
413      CALL cp_print_key_section_create(print_key, __LOCATION__, "CURRENT_CUBES", &
414                                       description="Controls the printing of the induced current density (not working yet).", &
415                                       print_level=high_print_level, add_last=add_last_numeric, filename="")
416      CALL keyword_create(keyword, __LOCATION__, name="stride", &
417                          description="The stride (X,Y,Z) used to write the cube file "// &
418                          "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
419                          " 1 number valid for all components (not working yet).", &
420                          usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
421      CALL section_add_keyword(print_key, keyword)
422      CALL keyword_release(keyword)
423      CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
424                          description="append the cube files when they already exist", &
425                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
426      CALL section_add_keyword(print_key, keyword)
427      CALL keyword_release(keyword)
428
429      CALL section_add_subsection(subsection, print_key)
430      CALL section_release(print_key)
431
432      CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_FUNCTION_CUBES", &
433                                       description="Controls the printing of the response functions (not working yet).", &
434                                       print_level=high_print_level, add_last=add_last_numeric, filename="")
435      CALL keyword_create(keyword, __LOCATION__, name="stride", &
436                          description="The stride (X,Y,Z) used to write the cube file "// &
437                          "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
438                          " 1 number valid for all components (not working yet).", &
439                          usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
440      CALL section_add_keyword(print_key, keyword)
441      CALL keyword_release(keyword)
442
443      CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
444                          variants=(/"CUBES_LU"/), &
445                          description="The lower and upper index of the states to be printed as cube (not working yet).", &
446                          usage="CUBES_LU_BOUNDS integer integer", &
447                          n_var=2, default_i_vals=(/0, -2/), type_of_var=integer_t)
448      CALL section_add_keyword(print_key, keyword)
449      CALL keyword_release(keyword)
450
451      CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
452                          description="Indexes of the states to be printed as cube files"// &
453                          "This keyword can be repeated several times"// &
454                          "(useful if you have to specify many indexes) (not working yet).", &
455                          usage="CUBES_LIST 1 2", &
456                          n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
457      CALL section_add_keyword(print_key, keyword)
458      CALL keyword_release(keyword)
459      CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
460                          description="append the cube files when they already exist", &
461                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
462      CALL section_add_keyword(print_key, keyword)
463      CALL keyword_release(keyword)
464
465      CALL section_add_subsection(subsection, print_key)
466      CALL section_release(print_key)
467
468      CALL section_add_subsection(section, subsection)
469      CALL section_release(subsection)
470
471      NULLIFY (subsection)
472      CALL create_interp_section(subsection)
473      CALL section_add_subsection(section, subsection)
474      CALL section_release(subsection)
475
476   END SUBROUTINE create_current_section
477
478! **************************************************************************************************
479!> \brief creates the input structure used to activate
480!>         calculation of NMR chemical shift using
481!>         the induced current obtained from DFPT
482!>      Available properties : none
483!> \param section the section to create
484!> \author  MI/VW
485! **************************************************************************************************
486   SUBROUTINE create_nmr_section(section)
487      TYPE(section_type), POINTER                        :: section
488
489      CHARACTER(len=*), PARAMETER :: routineN = 'create_nmr_section', &
490         routineP = moduleN//':'//routineN
491
492      TYPE(keyword_type), POINTER                        :: keyword
493      TYPE(section_type), POINTER                        :: print_key, subsection
494
495      NULLIFY (keyword, print_key, subsection)
496
497      CPASSERT(.NOT. ASSOCIATED(section))
498      CALL section_create(section, __LOCATION__, name="nmr", &
499                          description="The chemical shift is calculated by DFPT.", &
500                          n_keywords=5, n_subsections=1, repeats=.FALSE., &
501                          citations=(/Weber2009/))
502
503      CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
504                          description="controls the activation of the nmr calculation", &
505                          usage="&NMR T", &
506                          default_l_val=.FALSE., &
507                          lone_keyword_l_val=.TRUE.)
508      CALL section_add_keyword(section, keyword)
509      CALL keyword_release(keyword)
510
511      CALL keyword_create(keyword, __LOCATION__, name="INTERPOLATE_SHIFT", &
512                          description="Calculate the soft part of the chemical shift by interpolation ", &
513                          usage="INTERPOLATE_SHIFT T", &
514                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
515      CALL section_add_keyword(section, keyword)
516      CALL keyword_release(keyword)
517
518      CALL keyword_create(keyword, __LOCATION__, name="NICS", &
519                          description="Calculate the chemical shift in a set of points  "// &
520                          " given from an external file", usage="NICS", &
521                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
522      CALL section_add_keyword(section, keyword)
523      CALL keyword_release(keyword)
524
525      CALL keyword_create(keyword, __LOCATION__, name="NICS_FILE_NAME", &
526                          description="Name of the file with the NICS points coordinates", &
527                          usage="NICS_FILE_NAME nics_file", &
528                          default_lc_val="nics_file")
529      CALL section_add_keyword(section, keyword)
530      CALL keyword_release(keyword)
531
532      CALL keyword_create(keyword, __LOCATION__, name="RESTART_NMR", &
533                          description="Restart the NMR calculation from a previous run (NOT WORKING YET)", &
534                          usage="RESTART_NMR", default_l_val=.FALSE., &
535                          lone_keyword_l_val=.TRUE.)
536      CALL section_add_keyword(section, keyword)
537      CALL keyword_release(keyword)
538
539      CALL keyword_create(keyword, __LOCATION__, name="SHIFT_GAPW_RADIUS", &
540                          description="While computing the local part of the shift (GAPW), "// &
541                          "the integration is restricted to nuclei that are within this radius.", &
542                          usage="SHIFT_GAPW_RADIUS 20.0", &
543                          type_of_var=real_t, &
544                          default_r_val=cp_unit_to_cp2k(value=60.0_dp, unit_str="angstrom"), &
545                          unit_str="angstrom")
546      CALL section_add_keyword(section, keyword)
547      CALL keyword_release(keyword)
548
549      NULLIFY (subsection)
550      CALL section_create(subsection, __LOCATION__, name="PRINT", &
551                          description="print results of nmr calculation", &
552                          repeats=.FALSE.)
553
554      CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_FUNCTION_CUBES", &
555                                       description="Controls the printing of the response functions ", &
556                                       print_level=high_print_level, add_last=add_last_numeric, filename="")
557      CALL keyword_create(keyword, __LOCATION__, name="stride", &
558                          description="The stride (X,Y,Z) used to write the cube file "// &
559                          "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
560                          " 1 number valid for all components.", &
561                          usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
562      CALL section_add_keyword(print_key, keyword)
563      CALL keyword_release(keyword)
564
565      CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
566                          variants=(/"CUBES_LU"/), &
567                          description="The lower and upper index of the states to be printed as cube", &
568                          usage="CUBES_LU_BOUNDS integer integer", &
569                          n_var=2, default_i_vals=(/0, -2/), type_of_var=integer_t)
570      CALL section_add_keyword(print_key, keyword)
571      CALL keyword_release(keyword)
572
573      CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
574                          description="Indexes of the states to be printed as cube files"// &
575                          "This keyword can be repeated several times"// &
576                          "(useful if you have to specify many indexes).", &
577                          usage="CUBES_LIST 1 2", &
578                          n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
579      CALL section_add_keyword(print_key, keyword)
580      CALL keyword_release(keyword)
581      CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
582                          description="append the cube files when they already exist", &
583                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
584      CALL section_add_keyword(print_key, keyword)
585      CALL keyword_release(keyword)
586
587      CALL section_add_subsection(subsection, print_key)
588      CALL section_release(print_key)
589
590      CALL cp_print_key_section_create(print_key, __LOCATION__, "CHI_TENSOR", &
591                                       description="Controls the printing of susceptibility", &
592                                       print_level=high_print_level, add_last=add_last_numeric, filename="")
593      CALL section_add_subsection(subsection, print_key)
594      CALL section_release(print_key)
595
596      CALL cp_print_key_section_create(print_key, __LOCATION__, "SHIELDING_TENSOR", &
597                                       description="Controls the printing of the chemical shift", &
598                                       print_level=low_print_level, add_last=add_last_numeric, filename="")
599
600      CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LU_BOUNDS", &
601                          variants=(/"ATOMS_LU"/), &
602                          description="The lower and upper atomic index for which the tensor is printed", &
603                          usage="ATOMS_LU_BOUNDS integer integer", &
604                          n_var=2, default_i_vals=(/0, -2/), type_of_var=integer_t)
605      CALL section_add_keyword(print_key, keyword)
606      CALL keyword_release(keyword)
607
608      CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LIST", &
609                          description="list of atoms for which the shift is printed into a file ", &
610                          usage="LIST_ATOMS 1 2", n_var=-1, &
611                          type_of_var=integer_t, repeats=.TRUE.)
612      CALL section_add_keyword(print_key, keyword)
613      CALL keyword_release(keyword)
614
615      CALL section_add_subsection(subsection, print_key)
616      CALL section_release(print_key)
617
618      CALL section_add_subsection(section, subsection)
619      CALL section_release(subsection)
620
621      NULLIFY (subsection)
622      CALL create_interp_section(subsection)
623      CALL section_add_subsection(section, subsection)
624      CALL section_release(subsection)
625
626   END SUBROUTINE create_nmr_section
627
628! **************************************************************************************************
629!> \brief creates the input structure used to activate
630!>      calculation of NMR spin-spin coupling (implementation not operating)
631!>      Available properties : none
632!> \param section the section to create
633!> \author  VW
634! **************************************************************************************************
635   SUBROUTINE create_spin_spin_section(section)
636      TYPE(section_type), POINTER                        :: section
637
638      CHARACTER(len=*), PARAMETER :: routineN = 'create_spin_spin_section', &
639         routineP = moduleN//':'//routineN
640
641      TYPE(keyword_type), POINTER                        :: keyword
642      TYPE(section_type), POINTER                        :: print_key, subsection
643
644      NULLIFY (keyword, print_key, subsection)
645
646      CPASSERT(.NOT. ASSOCIATED(section))
647      CALL section_create(section, __LOCATION__, name="spinspin", &
648                          description="Compute indirect spin-spin coupling constants.", &
649                          n_keywords=5, n_subsections=1, repeats=.FALSE.)
650
651      CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
652                          description="controls the activation of the nmr calculation", &
653                          usage="&SPINSPIN T", &
654                          default_l_val=.FALSE., &
655                          lone_keyword_l_val=.TRUE.)
656      CALL section_add_keyword(section, keyword)
657      CALL keyword_release(keyword)
658
659      CALL keyword_create(keyword, __LOCATION__, name="RESTART_SPINSPIN", &
660                          description="Restart the spin-spin calculation from a previous run (NOT WORKING YET)", &
661                          usage="RESTART_SPINSPIN", default_l_val=.FALSE., &
662                          lone_keyword_l_val=.TRUE.)
663      CALL section_add_keyword(section, keyword)
664      CALL keyword_release(keyword)
665
666      CALL keyword_create(keyword, __LOCATION__, name="ISSC_ON_ATOM_LIST", &
667                          description="Atoms for which the issc is computed.", &
668                          usage="ISSC_ON_ATOM_LIST 1 2 10", &
669                          n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
670      CALL section_add_keyword(section, keyword)
671      CALL keyword_release(keyword)
672
673      CALL keyword_create(keyword, __LOCATION__, name="DO_FC", &
674                          description="Compute the Fermi contact contribution", &
675                          usage="DO_FC F", &
676                          default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
677      CALL section_add_keyword(section, keyword)
678      CALL keyword_release(keyword)
679
680      CALL keyword_create(keyword, __LOCATION__, name="DO_SD", &
681                          description="Compute the spin-dipolar contribution", &
682                          usage="DO_SD F", &
683                          default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
684      CALL section_add_keyword(section, keyword)
685      CALL keyword_release(keyword)
686
687      CALL keyword_create(keyword, __LOCATION__, name="DO_PSO", &
688                          description="Compute the paramagnetic spin-orbit contribution", &
689                          usage="DO_PSO F", &
690                          default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
691      CALL section_add_keyword(section, keyword)
692      CALL keyword_release(keyword)
693
694      CALL keyword_create(keyword, __LOCATION__, name="DO_DSO", &
695                          description="Compute the diamagnetic spin-orbit contribution (NOT YET IMPLEMENTED)", &
696                          usage="DO_DSO F", &
697                          default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
698      CALL section_add_keyword(section, keyword)
699      CALL keyword_release(keyword)
700
701      NULLIFY (subsection)
702      CALL section_create(subsection, __LOCATION__, name="PRINT", &
703                          description="print results of the indirect spin-spin calculation", &
704                          repeats=.FALSE.)
705
706      CALL cp_print_key_section_create(print_key, __LOCATION__, "K_MATRIX", &
707                                       description="Controls the printing of the indirect spin-spin matrix", &
708                                       print_level=low_print_level, add_last=add_last_numeric, filename="")
709
710      CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LIST", &
711                          description="list of atoms for which the indirect spin-spin is printed into a file ", &
712                          usage="LIST_ATOMS 1 2", n_var=-1, &
713                          type_of_var=integer_t, repeats=.TRUE.)
714      CALL section_add_keyword(print_key, keyword)
715      CALL keyword_release(keyword)
716
717      CALL section_add_subsection(subsection, print_key)
718      CALL section_release(print_key)
719
720      CALL section_add_subsection(section, subsection)
721      CALL section_release(subsection)
722
723      NULLIFY (subsection)
724      CALL create_interp_section(subsection)
725      CALL section_add_subsection(section, subsection)
726      CALL section_release(subsection)
727
728   END SUBROUTINE create_spin_spin_section
729
730! **************************************************************************************************
731!> \brief creates the input structure used to activate
732!>         calculation of EPR using
733!>         the induced current obtained from DFPT
734!>      Available properties : none
735!> \param section the section to create
736!> \author  VW
737! **************************************************************************************************
738   SUBROUTINE create_epr_section(section)
739      TYPE(section_type), POINTER                        :: section
740
741      CHARACTER(len=*), PARAMETER :: routineN = 'create_epr_section', &
742         routineP = moduleN//':'//routineN
743
744      TYPE(keyword_type), POINTER                        :: keyword
745      TYPE(section_type), POINTER                        :: print_key, subsection, subsubsection
746
747      NULLIFY (keyword, print_key, subsection, subsubsection)
748
749      CPASSERT(.NOT. ASSOCIATED(section))
750      CALL section_create(section, __LOCATION__, name="EPR", &
751                          description="The g tensor is calculated by DFPT ", &
752                          n_keywords=5, n_subsections=1, repeats=.FALSE., &
753                          citations=(/Weber2009/))
754
755      CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
756                          description="controls the activation of the epr calculation", &
757                          usage="&EPR T", &
758                          default_l_val=.FALSE., &
759                          lone_keyword_l_val=.TRUE.)
760      CALL section_add_keyword(section, keyword)
761      CALL keyword_release(keyword)
762
763      CALL keyword_create(keyword, __LOCATION__, name="RESTART_EPR", &
764                          description="Restart the EPR calculation from a previous run (NOT WORKING)", &
765                          usage="RESTART_EPR", default_l_val=.FALSE., &
766                          lone_keyword_l_val=.TRUE.)
767      CALL section_add_keyword(section, keyword)
768      CALL keyword_release(keyword)
769
770      NULLIFY (subsection)
771      CALL section_create(subsection, __LOCATION__, name="PRINT", &
772                          description="print results of epr calculation", &
773                          repeats=.FALSE.)
774
775      CALL cp_print_key_section_create(print_key, __LOCATION__, "NABLAVKS_CUBES", &
776                                       description="Controls the printing of the components of nabla v_ks ", &
777                                       print_level=high_print_level, add_last=add_last_numeric, filename="")
778      CALL keyword_create(keyword, __LOCATION__, name="stride", &
779                          description="The stride (X,Y,Z) used to write the cube file "// &
780                          "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
781                          " 1 number valid for all components.", &
782                          usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
783      CALL section_add_keyword(print_key, keyword)
784      CALL keyword_release(keyword)
785      CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
786                          description="append the cube files when they already exist", &
787                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
788      CALL section_add_keyword(print_key, keyword)
789      CALL keyword_release(keyword)
790
791      CALL section_add_subsection(subsection, print_key)
792      CALL section_release(print_key)
793
794      CALL cp_print_key_section_create(print_key, __LOCATION__, "G_TENSOR", &
795                                       description="Controls the printing of the g tensor", &
796                                       print_level=high_print_level, add_last=add_last_numeric, filename="")
797      CALL create_xc_section(subsubsection)
798      CALL section_add_subsection(print_key, subsubsection)
799      CALL section_release(subsubsection)
800
801      CALL keyword_create(keyword, __LOCATION__, name="GAPW_MAX_ALPHA", &
802                          description="Maximum alpha of GTH potentials allowed on the soft grids ", &
803                          usage="GAPW_MAX_ALPHA real", default_r_val=5.0_dp)
804      CALL section_add_keyword(print_key, keyword)
805      CALL keyword_release(keyword)
806
807      CALL keyword_create(keyword, __LOCATION__, name="SOO_RHO_HARD", &
808                          description="Whether or not to include the atomic parts of the density "// &
809                          "in the SOO part of the g tensor", usage="SOO_RHO_HARD", &
810                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
811      CALL section_add_keyword(print_key, keyword)
812      CALL keyword_release(keyword)
813
814      CALL section_add_subsection(subsection, print_key)
815      CALL section_release(print_key)
816
817      CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_FUNCTION_CUBES", &
818                                       description="Controls the printing of the response functions ", &
819                                       print_level=high_print_level, add_last=add_last_numeric, filename="")
820      CALL keyword_create(keyword, __LOCATION__, name="stride", &
821                          description="The stride (X,Y,Z) used to write the cube file "// &
822                          "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
823                          " 1 number valid for all components.", &
824                          usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
825      CALL section_add_keyword(print_key, keyword)
826      CALL keyword_release(keyword)
827
828      CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
829                          variants=(/"CUBES_LU"/), &
830                          description="The lower and upper index of the states to be printed as cube", &
831                          usage="CUBES_LU_BOUNDS integer integer", &
832                          n_var=2, default_i_vals=(/0, -2/), type_of_var=integer_t)
833      CALL section_add_keyword(print_key, keyword)
834      CALL keyword_release(keyword)
835
836      CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
837                          description="Indexes of the states to be printed as cube files"// &
838                          "This keyword can be repeated several times"// &
839                          "(useful if you have to specify many indexes).", &
840                          usage="CUBES_LIST 1 2", &
841                          n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
842      CALL section_add_keyword(print_key, keyword)
843      CALL keyword_release(keyword)
844      CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
845                          description="append the cube files when they already exist", &
846                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
847      CALL section_add_keyword(print_key, keyword)
848      CALL keyword_release(keyword)
849
850      CALL section_add_subsection(subsection, print_key)
851      CALL section_release(print_key)
852
853      CALL section_add_subsection(section, subsection)
854      CALL section_release(subsection)
855
856      NULLIFY (subsection)
857      CALL create_interp_section(subsection)
858      CALL section_add_subsection(section, subsection)
859      CALL section_release(subsection)
860
861   END SUBROUTINE create_epr_section
862
863! **************************************************************************************************
864!> \brief creates the input structure used to activate
865!>      calculation of polarizability tensor DFPT
866!>      Available properties : none
867!> \param section the section to create
868!> \author SL
869! **************************************************************************************************
870   SUBROUTINE create_polarizability_section(section)
871
872      TYPE(section_type), POINTER                        :: section
873
874      CHARACTER(len=*), PARAMETER :: routineN = 'create_polarizability_section', &
875         routineP = moduleN//':'//routineN
876
877      TYPE(keyword_type), POINTER                        :: keyword
878      TYPE(section_type), POINTER                        :: print_key, subsection
879
880      NULLIFY (keyword, print_key, subsection)
881
882      CPASSERT(.NOT. ASSOCIATED(section))
883      CALL section_create(section, __LOCATION__, name="POLAR", &
884                          description="Compute polarizabilities.", &
885                          n_keywords=5, n_subsections=1, repeats=.FALSE., &
886                          citations=(/Putrino2002/))
887
888      CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
889                          description="controls the activation of the polarizability calculation", &
890                          usage="&POLAR T", &
891                          default_l_val=.FALSE., &
892                          lone_keyword_l_val=.TRUE.)
893      CALL section_add_keyword(section, keyword)
894      CALL keyword_release(keyword)
895
896      CALL keyword_create(keyword, __LOCATION__, name="DO_RAMAN", &
897                          description="Compute the electric-dipole--electric-dipole polarizability", &
898                          usage="DO_RAMAN F", &
899                          citations=(/Luber2014/), &
900                          default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
901      CALL section_add_keyword(section, keyword)
902      CALL keyword_release(keyword)
903
904      CALL keyword_create(keyword, __LOCATION__, name="PERIODIC_DIPOLE_OPERATOR", &
905                          description="Type of dipole operator: Berry phase(T) or Local(F)", &
906                          usage="PERIODIC_DIPOLE_OPERATOR T", &
907                          default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
908      CALL section_add_keyword(section, keyword)
909      CALL keyword_release(keyword)
910
911      NULLIFY (subsection)
912      CALL section_create(subsection, __LOCATION__, name="PRINT", &
913                          description="print results of the polarizability calculation", &
914                          repeats=.FALSE.)
915
916      CALL cp_print_key_section_create(print_key, __LOCATION__, "POLAR_MATRIX", &
917                                       description="Controls the printing of the polarizabilities", &
918                                       print_level=low_print_level, add_last=add_last_numeric, filename="")
919
920      CALL section_add_subsection(subsection, print_key)
921      CALL section_release(print_key)
922      CALL section_add_subsection(section, subsection)
923      CALL section_release(subsection)
924
925      NULLIFY (subsection)
926      CALL create_interp_section(subsection)
927      CALL section_add_subsection(section, subsection)
928      CALL section_release(subsection)
929
930   END SUBROUTINE create_polarizability_section
931
932! **************************************************************************************************
933!> \brief creates the section for electron transfer coupling
934!> \param section ...
935!> \author fschiff
936! **************************************************************************************************
937   SUBROUTINE create_et_coupling_section(section)
938      TYPE(section_type), POINTER                        :: section
939
940      CHARACTER(len=*), PARAMETER :: routineN = 'create_et_coupling_section', &
941         routineP = moduleN//':'//routineN
942
943      TYPE(keyword_type), POINTER                        :: keyword
944      TYPE(section_type), POINTER                        :: print_key, subsection
945
946      NULLIFY (keyword)
947      CPASSERT(.NOT. ASSOCIATED(section))
948      CALL section_create(section, __LOCATION__, name="ET_COUPLING", &
949                          description="specifies the two constraints/restraints for extracting ET coupling elements", &
950                          n_keywords=1, n_subsections=4, repeats=.FALSE., citations=(/Kondov2007, Futera2017/))
951
952      NULLIFY (subsection)
953      CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT_A")
954      CALL section_add_subsection(section, subsection)
955      CALL section_release(subsection)
956
957      NULLIFY (subsection)
958      CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT_B")
959      CALL section_add_subsection(section, subsection)
960      CALL section_release(subsection)
961
962      NULLIFY (subsection)
963      CALL create_projection(subsection, "PROJECTION")
964      CALL section_add_subsection(section, subsection)
965      CALL section_release(subsection)
966
967      CALL keyword_create(keyword, __LOCATION__, name="TYPE_OF_CONSTRAINT", &
968                          description="Specifies the type of constraint", &
969                          usage="TYPE_OF_CONSTRAINT DDAPC", &
970                          enum_c_vals=s2a("NONE", "DDAPC"), &
971                          enum_i_vals=(/do_no_et, do_et_ddapc/), &
972                          enum_desc=s2a("NONE", "DDAPC Constraint"), &
973                          default_i_val=do_no_et)
974      CALL section_add_keyword(section, keyword)
975      CALL keyword_release(keyword)
976
977      NULLIFY (print_key)
978      CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
979                                       description="Controls the printing basic info about the method", &
980                                       print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
981      CALL section_add_subsection(section, print_key)
982      CALL section_release(print_key)
983
984   END SUBROUTINE create_et_coupling_section
985
986! **************************************************************************************************
987!> \brief defines input sections for specification of Hilbert space partitioning
988!>        in projection-operator approach of electronic coupling calulation
989!> \param section pointer to the section data structure
990!> \param section_name name of the projection section
991!> \author Z. Futera (02.2017)
992! **************************************************************************************************
993   SUBROUTINE create_projection(section, section_name)
994
995      ! Routine arguments
996      TYPE(section_type), POINTER                        :: section
997      CHARACTER(len=*), INTENT(in)                       :: section_name
998
999      CHARACTER(len=*), PARAMETER :: routineN = 'create_projection', &
1000         routineP = moduleN//':'//routineN
1001
1002      TYPE(keyword_type), POINTER                        :: keyword
1003      TYPE(section_type), POINTER                        :: print_key, section_block, section_print
1004
1005! Routine name for dubug purposes
1006
1007      ! Sanity check
1008      CPASSERT(.NOT. ASSOCIATED(section))
1009
1010      ! Initialization
1011      NULLIFY (keyword)
1012      NULLIFY (print_key)
1013      NULLIFY (section_block)
1014      NULLIFY (section_print)
1015
1016      ! Input-file section definition
1017      CALL section_create(section, __LOCATION__, name=TRIM(ADJUSTL(section_name)), &
1018                          description="Projection-operator approach fo ET coupling calculation", &
1019                          n_keywords=0, n_subsections=2, repeats=.FALSE.)
1020
1021      ! Subsection #0: Log printing
1022      CALL cp_print_key_section_create(print_key, __LOCATION__, 'PROGRAM_RUN_INFO', &
1023                                       description="Controls printing of data and informations to log file", &
1024                                       print_level=low_print_level, filename="__STD_OUT__")
1025      CALL section_add_subsection(section, print_key)
1026      CALL section_release(print_key)
1027
1028      ! Subsection #1: Atomic blocks
1029      CALL section_create(section_block, __LOCATION__, name='BLOCK', &
1030                          description="Part of the system (donor, acceptor, bridge,...)", &
1031                          n_keywords=2, n_subsections=1, repeats=.TRUE.)
1032      CALL section_add_subsection(section, section_block)
1033
1034      ! S#1 - Keyword #1: Atom IDs defining a Hilbert space block
1035      CALL keyword_create(keyword, __LOCATION__, name='ATOMS', &
1036                          description="Array of atom IDs in the system part", &
1037                          usage="ATOMS {integer} {integer} .. {integer}", &
1038                          n_var=-1, type_of_var=integer_t, repeats=.FALSE.)
1039      CALL section_add_keyword(section_block, keyword)
1040      CALL keyword_release(keyword)
1041
1042      ! S#1 - Keyword #1: Atom IDs defining a Hilbert space block
1043      CALL keyword_create(keyword, __LOCATION__, name='NELECTRON', &
1044                          description="Number of electrons expected in the system part", &
1045                          usage="NELECTRON {integer}", default_i_val=0)
1046      CALL section_add_keyword(section_block, keyword)
1047      CALL keyword_release(keyword)
1048
1049      ! S#1 - Subsection #1: Printing setting
1050      CALL section_create(section_print, __LOCATION__, name='PRINT', &
1051                          description="Possible printing options in ET system part", &
1052                          n_keywords=0, n_subsections=0, repeats=.FALSE.)
1053      CALL section_add_subsection(section_block, section_print)
1054
1055      ! S#1 - S#1 - Keyword #1: MO coefficient on specific atom
1056      CALL keyword_create(keyword, __LOCATION__, name='MO_COEFF_ATOM', &
1057                          description="Print out MO coeffiecients on given atom", &
1058                          usage="MO_COEFF_ATOM {integer} {integer} .. {integer}", &
1059                          type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
1060      CALL section_add_keyword(section_print, keyword)
1061      CALL keyword_release(keyword)
1062
1063      ! S#1 - S#1 - Keyword #1: MO coefficient of specific state
1064      CALL keyword_create(keyword, __LOCATION__, name='MO_COEFF_ATOM_STATE', &
1065                          description="Print out MO coeffiecients of specific state", &
1066                          usage="MO_COEFF_ATOM_STATE {integer} {integer} .. {integer}", &
1067                          type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
1068      CALL section_add_keyword(section_print, keyword)
1069      CALL keyword_release(keyword)
1070
1071      ! S#1 - S#1 - Subsection #1: Saving MOs to CUBE files
1072      CALL cp_print_key_section_create(print_key, __LOCATION__, 'MO_CUBES', &
1073                                       description="Controls saving of MO cube files", &
1074                                       print_level=high_print_level, filename="")
1075
1076      ! S#1 - S#1 - S#1 - Keyword #1: Stride
1077      CALL keyword_create(keyword, __LOCATION__, name='STRIDE', &
1078                          description="The stride (X,Y,Z) used to write the cube file", &
1079                          usage="STRIDE {integer} {integer} {integer}", n_var=-1, &
1080                          default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
1081      CALL section_add_keyword(print_key, keyword)
1082      CALL keyword_release(keyword)
1083
1084      ! S#1 - S#1 - S#1 - Keyword #2: List of MO IDs
1085      CALL keyword_create(keyword, __LOCATION__, name='MO_LIST', &
1086                          description="Indices of molecular orbitals to save", &
1087                          usage="MO_LIST {integer} {integer} .. {integer}", &
1088                          type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
1089      CALL section_add_keyword(print_key, keyword)
1090      CALL keyword_release(keyword)
1091
1092      ! S#1 - S#1 - S#1 - Keyword #2: Number of unoccupied states
1093      CALL keyword_create(keyword, __LOCATION__, name='NLUMO', &
1094                          description="Number of unoccupied molecular orbitals to save", &
1095                          usage="NLUMO {integer}", default_i_val=1)
1096      CALL section_add_keyword(print_key, keyword)
1097      CALL keyword_release(keyword)
1098
1099      ! S#1 - S#1 - S#1 - Keyword #3: Number of occupied states
1100      CALL keyword_create(keyword, __LOCATION__, name='NHOMO', &
1101                          description="Number of occupied molecular orbitals to save", &
1102                          usage="NHOMO {integer}", default_i_val=1)
1103      CALL section_add_keyword(print_key, keyword)
1104      CALL keyword_release(keyword)
1105
1106      CALL section_add_subsection(section_print, print_key)
1107      CALL section_release(print_key)
1108
1109      ! S#1 - S#1 - Clean
1110      CALL section_release(section_print)
1111
1112      ! S#1 - Clean
1113      CALL section_release(section_block)
1114
1115      ! S#1 - Subsection #1: Printing setting
1116      CALL section_create(section_print, __LOCATION__, name='PRINT', &
1117                          description="Possible printing options in ET", &
1118                          n_keywords=0, n_subsections=0, repeats=.FALSE.)
1119      CALL section_add_subsection(section, section_print)
1120
1121      ! Print couplings
1122      CALL cp_print_key_section_create(print_key, __LOCATION__, 'COUPLINGS', &
1123                                       description="Controls printing couplings onto file", &
1124                                       print_level=low_print_level, filename="")
1125
1126      CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
1127                          description="append the files when they already exist", &
1128                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1129      CALL section_add_keyword(print_key, keyword)
1130      CALL keyword_release(keyword)
1131
1132      CALL section_add_subsection(section_print, print_key)
1133      CALL section_release(print_key)
1134
1135      CALL section_release(section_print)
1136
1137   END SUBROUTINE create_projection
1138
1139! **************************************************************************************************
1140!> \brief creates an input section for tddfpt calculation
1141!> \param section section to create
1142!> \par History
1143!>    * 05.2016 forked from create_tddfpt_section [Sergey Chulkov]
1144!>    * 08.2016 moved from module input_cp2k_dft [Sergey Chulkov]
1145! **************************************************************************************************
1146   SUBROUTINE create_tddfpt2_section(section)
1147      TYPE(section_type), POINTER                        :: section
1148
1149      CHARACTER(len=*), PARAMETER :: routineN = 'create_tddfpt2_section', &
1150         routineP = moduleN//':'//routineN
1151
1152      TYPE(keyword_type), POINTER                        :: keyword
1153      TYPE(section_type), POINTER                        :: print_key, subsection
1154
1155      CPASSERT(.NOT. ASSOCIATED(section))
1156      CALL section_create(section, __LOCATION__, name="TDDFPT", &
1157                          description="Parameters needed to set up the Time-Dependent "// &
1158                          "Density Functional Perturbation Theory. "// &
1159                          "Current implementation works for hybrid functionals. "// &
1160                          "Can be used with Gaussian and Plane Waves (GPW) method only.", &
1161                          n_keywords=12, n_subsections=4, repeats=.FALSE., &
1162                          citations=(/Iannuzzi2005/))
1163
1164      NULLIFY (keyword, print_key, subsection)
1165
1166      CALL keyword_create(keyword, __LOCATION__, &
1167                          name="_SECTION_PARAMETERS_", &
1168                          description="Controls the activation of the TDDFPT procedure", &
1169                          default_l_val=.FALSE., &
1170                          lone_keyword_l_val=.TRUE.)
1171      CALL section_add_keyword(section, keyword)
1172      CALL keyword_release(keyword)
1173
1174      ! Integer
1175      CALL keyword_create(keyword, __LOCATION__, name="NSTATES", &
1176                          description="Number of excited states to converge.", &
1177                          n_var=1, type_of_var=integer_t, &
1178                          default_i_val=1)
1179      CALL section_add_keyword(section, keyword)
1180      CALL keyword_release(keyword)
1181
1182      CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
1183                          description="Maximal number of iterations to be performed.", &
1184                          n_var=1, type_of_var=integer_t, &
1185                          default_i_val=50)
1186      CALL section_add_keyword(section, keyword)
1187      CALL keyword_release(keyword)
1188
1189      CALL keyword_create(keyword, __LOCATION__, name="MAX_KV", &
1190                          description="Maximal number of Krylov space vectors. "// &
1191                          "Davidson iterations will be restarted upon reaching this limit.", &
1192                          n_var=1, type_of_var=integer_t, &
1193                          default_i_val=5000)
1194      CALL section_add_keyword(section, keyword)
1195      CALL keyword_release(keyword)
1196
1197      CALL keyword_create(keyword, __LOCATION__, name="NLUMO", &
1198                          description="Number of unoccupied orbitals to consider. "// &
1199                          " Default is to use all unoccupied orbitals (-1).", &
1200                          n_var=1, type_of_var=integer_t, &
1201                          default_i_val=-1)
1202      CALL section_add_keyword(section, keyword)
1203      CALL keyword_release(keyword)
1204
1205      CALL keyword_create(keyword, __LOCATION__, name="NPROC_STATE", &
1206                          description="Number of MPI processes to be used per excited state. "// &
1207                          " Default is to use all processors (0).", &
1208                          n_var=1, type_of_var=integer_t, &
1209                          default_i_val=0)
1210      CALL section_add_keyword(section, keyword)
1211      CALL keyword_release(keyword)
1212
1213      ! kernel type
1214      CALL keyword_create(keyword, __LOCATION__, name="KERNEL", &
1215                          description="Options to compute the kernel", &
1216                          usage="KERNEL FULL", &
1217                          enum_c_vals=s2a("FULL", "sTDA"), &
1218                          enum_i_vals=(/tddfpt_kernel_full, tddfpt_kernel_stda/), &
1219                          default_i_val=tddfpt_kernel_full)
1220      CALL section_add_keyword(section, keyword)
1221      CALL keyword_release(keyword)
1222
1223      CALL keyword_create(keyword, __LOCATION__, name="OE_CORR", &
1224                          description="Orbital energy correction potential.", &
1225                          enum_c_vals=s2a("NONE", "LB94", "GLLB", "SAOP", "SHIFT"), &
1226                          enum_i_vals=(/oe_none, oe_lb, oe_gllb, oe_saop, oe_shift/), &
1227                          enum_desc=s2a("No orbital correction scheme is used", &
1228                                        "van Leeuwen and Baerends. PRA, 49:2421, 1994", &
1229                                        "Gritsenko, van Leeuwen, van Lenthe, Baerends. PRA, 51:1944, 1995", &
1230                                        "Gritsenko, Schipper, Baerends. Chem. Phys. Lett., 302:199, 1999", &
1231                                        "Constant shift of virtual and/or open-shell orbitals"), &
1232                          default_i_val=oe_none)
1233      CALL section_add_keyword(section, keyword)
1234      CALL keyword_release(keyword)
1235
1236      ! SHIFTS
1237      CALL keyword_create(keyword, __LOCATION__, name="EV_SHIFT", &
1238                          variants=s2a("VIRTUAL_SHIFT"), &
1239                          description="Constant shift of virtual state eigenvalues.", &
1240                          usage="EV_SHIFT 0.500", &
1241                          n_var=1, type_of_var=real_t, &
1242                          unit_str="eV", &
1243                          default_r_val=0.0_dp)
1244      CALL section_add_keyword(section, keyword)
1245      CALL keyword_release(keyword)
1246      !
1247      CALL keyword_create(keyword, __LOCATION__, name="EOS_SHIFT", &
1248                          variants=s2a("OPEN_SHELL_SHIFT"), &
1249                          description="Constant shift of open shell eigenvalues.", &
1250                          usage="EOS_SHIFT 0.200", &
1251                          n_var=1, type_of_var=real_t, &
1252                          unit_str="eV", &
1253                          default_r_val=0.0_dp)
1254      CALL section_add_keyword(section, keyword)
1255      CALL keyword_release(keyword)
1256
1257      ! Real
1258      CALL keyword_create(keyword, __LOCATION__, name="CONVERGENCE", &
1259                          description="Target accuracy for excited state energies.", &
1260                          n_var=1, type_of_var=real_t, unit_str="hartree", &
1261                          default_r_val=1.0e-5_dp)
1262      CALL section_add_keyword(section, keyword)
1263      CALL keyword_release(keyword)
1264
1265      CALL keyword_create(keyword, __LOCATION__, name="MIN_AMPLITUDE", &
1266                          description="The smallest excitation amplitude to print.", &
1267                          n_var=1, type_of_var=real_t, &
1268                          default_r_val=5.0e-2_dp)
1269      CALL section_add_keyword(section, keyword)
1270      CALL keyword_release(keyword)
1271
1272      CALL keyword_create(keyword, __LOCATION__, name="ORTHOGONAL_EPS", &
1273                          description="The largest possible overlap between the ground state and "// &
1274                          "orthogonalised excited state wave-functions. Davidson iterations "// &
1275                          "will be restarted when the overlap goes beyond this threshold in "// &
1276                          "order to prevent numerical instability.", &
1277                          n_var=1, type_of_var=real_t, &
1278                          default_r_val=1.0e-4_dp)
1279      CALL section_add_keyword(section, keyword)
1280      CALL keyword_release(keyword)
1281
1282      ! Logical
1283      CALL keyword_create(keyword, __LOCATION__, name="RESTART", &
1284                          description="Restart the TDDFPT calculation if a restart file exists", &
1285                          n_var=1, type_of_var=logical_t, &
1286                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1287      CALL section_add_keyword(section, keyword)
1288      CALL keyword_release(keyword)
1289
1290      CALL keyword_create(keyword, __LOCATION__, name="RKS_TRIPLETS", &
1291                          description="Compute triplet excited states using spin-unpolarised molecular orbitals.", &
1292                          n_var=1, type_of_var=logical_t, &
1293                          default_l_val=.FALSE.)
1294      CALL section_add_keyword(section, keyword)
1295      CALL keyword_release(keyword)
1296
1297      ! Strings
1298      CALL keyword_create(keyword, __LOCATION__, name="WFN_RESTART_FILE_NAME", &
1299                          variants=(/"RESTART_FILE_NAME"/), &
1300                          description="Name of the wave function restart file, may include a path."// &
1301                          " If no file is specified, the default is to open the file as generated by"// &
1302                          " the wave function restart print key.", &
1303                          usage="WFN_RESTART_FILE_NAME <FILENAME>", &
1304                          type_of_var=lchar_t)
1305      CALL section_add_keyword(section, keyword)
1306      CALL keyword_release(keyword)
1307
1308      ! DIPOLE subsection
1309      CALL section_create(subsection, __LOCATION__, name="DIPOLE_MOMENTS", &
1310                          description="Parameters to compute oscillator strengths in the dipole approximation.", &
1311                          n_keywords=3, n_subsections=0, repeats=.FALSE.)
1312
1313      CALL keyword_create(keyword, __LOCATION__, name="DIPOLE_FORM", &
1314                          description="Form of dipole transition integrals.", &
1315                          default_i_val=tddfpt_dipole_velocity, &
1316                          enum_c_vals=s2a("BERRY", "LENGTH", "VELOCITY"), &
1317                          enum_desc=s2a("Based on Berry phase formula (valid for fully periodic molecular systems only)", &
1318                                        "Length form &lang; i | r | j &rang; (valid for non-periodic molecular systems only)", &
1319                                        "Velocity form &lang; i | d/dr | j &rang;"), &
1320                          enum_i_vals=(/tddfpt_dipole_berry, tddfpt_dipole_length, tddfpt_dipole_velocity/))
1321      CALL section_add_keyword(subsection, keyword)
1322      CALL keyword_release(keyword)
1323
1324      CALL keyword_create(keyword, __LOCATION__, name="REFERENCE", &
1325                          description="Reference point to calculate electric "// &
1326                          "dipole moments using the dipole integrals in the length form.", &
1327                          enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
1328                          enum_desc=s2a("Use Center of Mass", &
1329                                        "Use Center of Atomic Charges", &
1330                                        "Use User-defined Point", &
1331                                        "Use Origin of Coordinate System"), &
1332                          enum_i_vals=(/use_mom_ref_com, &
1333                                        use_mom_ref_coac, &
1334                                        use_mom_ref_user, &
1335                                        use_mom_ref_zero/), &
1336                          default_i_val=use_mom_ref_com)
1337      CALL section_add_keyword(subsection, keyword)
1338      CALL keyword_release(keyword)
1339
1340      CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
1341                          description="User-defined reference point.", &
1342                          usage="REFERENCE_POINT x y z", &
1343                          repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
1344      CALL section_add_keyword(subsection, keyword)
1345      CALL keyword_release(keyword)
1346
1347      CALL section_add_subsection(section, subsection)
1348      CALL section_release(subsection)
1349
1350      ! kernel XC functional
1351      CALL create_xc_section(subsection)
1352      CALL section_add_subsection(section, subsection)
1353      CALL section_release(subsection)
1354
1355      ! MGRID subsection
1356      CALL create_mgrid_section(subsection, create_subsections=.FALSE.)
1357      CALL section_add_subsection(section, subsection)
1358      CALL section_release(subsection)
1359
1360      ! sTDA subsection
1361      CALL create_stda_section(subsection)
1362      CALL section_add_subsection(section, subsection)
1363      CALL section_release(subsection)
1364
1365      ! PRINT subsection
1366      CALL section_create(subsection, __LOCATION__, name="PRINT", &
1367                          description="Printing of information during the TDDFT run.", repeats=.FALSE.)
1368
1369      CALL cp_print_key_section_create(print_key, __LOCATION__, name="PROGRAM_BANNER", &
1370                                       description="Controls the printing of the banner for TDDFPT program", &
1371                                       print_level=silent_print_level, filename="__STD_OUT__")
1372      CALL section_add_subsection(subsection, print_key)
1373      CALL section_release(print_key)
1374
1375      CALL cp_print_key_section_create(print_key, __LOCATION__, name="GUESS_VECTORS", &
1376                                       description="Controls the printing of initial guess vectors.", &
1377                                       print_level=low_print_level, filename="__STD_OUT__")
1378      CALL section_add_subsection(subsection, print_key)
1379      CALL section_release(print_key)
1380
1381      CALL cp_print_key_section_create(print_key, __LOCATION__, name="ITERATION_INFO", &
1382                                       description="Controls the printing of basic iteration information "// &
1383                                       "during the TDDFT run.", &
1384                                       print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
1385      CALL section_add_subsection(subsection, print_key)
1386      CALL section_release(print_key)
1387
1388      CALL cp_print_key_section_create(print_key, __LOCATION__, name="DETAILED_ENERGY", &
1389                                       description="Controls the printing of detailed energy information "// &
1390                                       "during the TDDFT run.", &
1391                                       print_level=medium_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
1392      CALL section_add_subsection(subsection, print_key)
1393      CALL section_release(print_key)
1394
1395      CALL cp_print_key_section_create(print_key, __LOCATION__, name="RESTART", &
1396                                       description="Controls the dumping of the MO restart file during TDDFPT. "// &
1397                                       "By default keeps a short history of three restarts.", &
1398                                       print_level=low_print_level, common_iter_levels=3, &
1399                                       each_iter_names=s2a("TDDFT_SCF"), each_iter_values=(/10/), &
1400                                       add_last=add_last_numeric, filename="RESTART")
1401      CALL keyword_create(keyword, __LOCATION__, name="BACKUP_COPIES", &
1402                          description="Specifies the maximum index of backup copies.", &
1403                          usage="BACKUP_COPIES {int}", &
1404                          default_i_val=3)
1405      CALL section_add_keyword(print_key, keyword)
1406      CALL keyword_release(keyword)
1407      CALL section_add_subsection(subsection, print_key)
1408      CALL section_release(print_key)
1409
1410      CALL cp_print_key_section_create(print_key, __LOCATION__, name="NTO_ANALYSIS", &
1411                                       description="Perform a natural transition orbital analysis.", &
1412                                       print_level=medium_print_level)
1413      CALL keyword_create(keyword, __LOCATION__, name="THRESHOLD", &
1414                          description="Threshold for sum of NTO eigenvalues considered", &
1415                          usage="Threshold 0.95", &
1416                          n_var=1, &
1417                          type_of_var=real_t, &
1418                          default_r_val=0.975_dp)
1419      CALL section_add_keyword(print_key, keyword)
1420      CALL keyword_release(keyword)
1421      CALL keyword_create(keyword, __LOCATION__, name="CUBE_FILES", &
1422                          description="Print NTOs on Cube Files", &
1423                          usage="CUBE_FILES {logical}", repeats=.FALSE., n_var=1, &
1424                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE., type_of_var=logical_t)
1425      CALL section_add_keyword(print_key, keyword)
1426      CALL keyword_release(keyword)
1427      CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
1428                          description="The stride (X,Y,Z) used to write the cube file "// &
1429                          "(larger values result in smaller cube files). Provide 3 numbers (for X,Y,Z) or"// &
1430                          " 1 number valid for all components.", &
1431                          usage="STRIDE 2 2 2", n_var=-1, default_i_vals=(/2, 2, 2/), type_of_var=integer_t)
1432      CALL section_add_keyword(print_key, keyword)
1433      CALL keyword_release(keyword)
1434      CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
1435                          description="append the cube files when they already exist", &
1436                          default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1437      CALL section_add_keyword(print_key, keyword)
1438      CALL keyword_release(keyword)
1439      CALL section_add_subsection(subsection, print_key)
1440      CALL section_release(print_key)
1441
1442      CALL cp_print_key_section_create(print_key, __LOCATION__, "MOS_MOLDEN", &
1443                                       description="Write the NTO in Molden file format, for visualisation.", &
1444                                       print_level=debug_print_level + 1, add_last=add_last_numeric, filename="MOS")
1445      CALL keyword_create(keyword, __LOCATION__, name="NDIGITS", &
1446                          description="Specifies the number of significant digits retained. 3 is OK for visualization.", &
1447                          usage="NDIGITS {int}", &
1448                          default_i_val=3)
1449      CALL section_add_keyword(print_key, keyword)
1450      CALL keyword_release(keyword)
1451      CALL keyword_create(keyword, __LOCATION__, name="GTO_KIND", &
1452                          description="Representation of Gaussian-type orbitals", &
1453                          default_i_val=gto_spherical, &
1454                          enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
1455                          enum_desc=s2a( &
1456                          "Cartesian Gaussian orbitals. Use with caution", &
1457                          "Spherical Gaussian orbitals. Incompatible with VMD"), &
1458                          enum_i_vals=(/gto_cartesian, gto_spherical/))
1459      CALL section_add_keyword(print_key, keyword)
1460      CALL keyword_release(keyword)
1461      CALL section_add_subsection(subsection, print_key)
1462      CALL section_release(print_key)
1463
1464      CALL section_add_subsection(section, subsection)
1465      CALL section_release(subsection)
1466
1467   END SUBROUTINE create_tddfpt2_section
1468
1469! **************************************************************************************************
1470!> \brief creates the stda input section (simplified Tamm Dancoff Approximation)
1471!> \param section the section to create
1472! **************************************************************************************************
1473   SUBROUTINE create_stda_section(section)
1474      TYPE(section_type), POINTER                        :: section
1475
1476      CHARACTER(len=*), PARAMETER :: routineN = 'create_stda_section', &
1477         routineP = moduleN//':'//routineN
1478
1479      TYPE(keyword_type), POINTER                        :: keyword
1480
1481      CPASSERT(.NOT. ASSOCIATED(section))
1482      CALL section_create(section, __LOCATION__, name="sTDA", &
1483                          description="parameters needed and setup for sTDA calculations", &
1484                          n_keywords=3, n_subsections=0, repeats=.FALSE.)
1485      NULLIFY (keyword)
1486
1487      CALL keyword_create(keyword, __LOCATION__, name="FRACTION", &
1488                          variants=(/"HFX_FRACTION"/), &
1489                          description="The fraction of Hartree-Fock to add to the total energy. "// &
1490                          "1.0 implies standard Hartree-Fock if used with XC_FUNCTIONAL NONE. "// &
1491                          "NOTE: In a mixed potential calculation this should be set to 1.0, otherwise "// &
1492                          "all parts are multiplied with this factor. ", &
1493                          usage="FRACTION 0.0", default_r_val=0.0_dp)
1494      CALL section_add_keyword(section, keyword)
1495      CALL keyword_release(keyword)
1496
1497      CALL keyword_create(keyword, __LOCATION__, name="DO_EWALD", &
1498                          description="Use Ewald type method for Coulomb interaction", &
1499                          usage="DO_EWALD", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1500      CALL section_add_keyword(section, keyword)
1501      CALL keyword_release(keyword)
1502
1503      CALL keyword_create(keyword, __LOCATION__, name="EPS_TD_FILTER", &
1504                          description="Threshold for filtering the transition density matrix", &
1505                          usage="EPS_TD_FILTER", default_r_val=1.e-10_dp)
1506      CALL section_add_keyword(section, keyword)
1507      CALL keyword_release(keyword)
1508
1509   END SUBROUTINE create_stda_section
1510
1511END MODULE input_cp2k_properties_dft
1512