Line data Source code
1 : !--------------------------------------------------------------------------------------------------!
2 : ! CP2K: A general program to perform molecular dynamics simulations !
3 : ! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4 : ! !
5 : ! SPDX-License-Identifier: GPL-2.0-or-later !
6 : !--------------------------------------------------------------------------------------------------!
7 :
8 : ! **************************************************************************************************
9 : !> \brief function that build the dft section of the input
10 : !> \par History
11 : !> 01.2013 moved out of input_cp2k_dft [MI]
12 : !> \author MI
13 : ! **************************************************************************************************
14 : MODULE input_cp2k_properties_dft
15 : USE bibliography, ONLY: Futera2017, &
16 : Hernandez2025, &
17 : Iannuzzi2005, &
18 : Kondov2007, &
19 : Luber2014, &
20 : Putrino2000, &
21 : Putrino2002, &
22 : Sebastiani2001, &
23 : Weber2009, &
24 : VazdaCruz2021
25 : USE cp_output_handling, ONLY: add_last_numeric, &
26 : cp_print_key_section_create, &
27 : debug_print_level, &
28 : high_print_level, &
29 : low_print_level, &
30 : medium_print_level, &
31 : silent_print_level
32 : USE cp_units, ONLY: cp_unit_to_cp2k
33 : USE input_constants, ONLY: &
34 : current_gauge_atom, current_gauge_r, current_gauge_r_and_step_func, &
35 : current_orb_center_atom, current_orb_center_box, current_orb_center_common, &
36 : current_orb_center_wannier, do_et_ddapc, do_full_density, do_no_et, do_spin_density, &
37 : gto_cartesian, gto_spherical, int_ldos_none, int_ldos_x, int_ldos_y, int_ldos_z, oe_gllb, &
38 : oe_lb, oe_none, oe_saop, oe_shift, ot_precond_full_all, ot_precond_full_kinetic, &
39 : ot_precond_full_single, ot_precond_full_single_inverse, ot_precond_none, &
40 : ot_precond_s_inverse, scan_x, scan_xy, scan_xyz, scan_xz, scan_y, scan_yz, scan_z, &
41 : tddfpt_dipole_berry, tddfpt_dipole_length, tddfpt_dipole_velocity, tddfpt_kernel_full, &
42 : tddfpt_kernel_none, tddfpt_kernel_stda, no_sf_tddfpt, tddfpt_sf_col, tddfpt_sf_noncol, &
43 : use_mom_ref_coac, use_mom_ref_com, use_mom_ref_user, use_mom_ref_zero
44 : USE input_cp2k_atprop, ONLY: create_atprop_section
45 : USE input_cp2k_dft, ONLY: create_interp_section, &
46 : create_mgrid_section
47 : USE input_cp2k_qs, ONLY: create_ddapc_restraint_section, &
48 : create_lrigpw_section
49 : USE input_cp2k_kpoints, ONLY: create_kpoint_set_section
50 : USE input_cp2k_loc, ONLY: create_localize_section
51 : USE input_cp2k_resp, ONLY: create_resp_section
52 : USE input_cp2k_xc, ONLY: create_xc_section
53 : USE input_keyword_types, ONLY: keyword_create, &
54 : keyword_release, &
55 : keyword_type
56 : USE input_section_types, ONLY: section_add_keyword, &
57 : section_add_subsection, &
58 : section_create, &
59 : section_release, &
60 : section_type
61 : USE input_val_types, ONLY: char_t, &
62 : integer_t, &
63 : lchar_t, &
64 : logical_t, &
65 : real_t
66 : USE input_cp2k_xas, ONLY: create_xas_tdp_section
67 : USE kinds, ONLY: dp
68 : USE string_utilities, ONLY: s2a
69 : #include "./base/base_uses.f90"
70 :
71 : IMPLICIT NONE
72 : PRIVATE
73 :
74 : LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
75 : CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_properties_dft'
76 :
77 : PUBLIC :: create_properties_section
78 :
79 : CONTAINS
80 :
81 : ! **************************************************************************************************
82 : !> \brief Create the PROPERTIES section
83 : !> \param section the section to create
84 : !> \author teo
85 : ! **************************************************************************************************
86 9514 : SUBROUTINE create_properties_section(section)
87 : TYPE(section_type), POINTER :: section
88 :
89 : TYPE(keyword_type), POINTER :: keyword
90 : TYPE(section_type), POINTER :: subsection
91 :
92 9514 : CPASSERT(.NOT. ASSOCIATED(section))
93 : CALL section_create(section, __LOCATION__, name="PROPERTIES", &
94 : description="This section is used to set up the PROPERTIES calculation.", &
95 9514 : n_keywords=0, n_subsections=6, repeats=.FALSE.)
96 :
97 9514 : NULLIFY (subsection, keyword)
98 :
99 9514 : CALL create_linres_section(subsection, create_subsections=.TRUE.)
100 9514 : CALL section_add_subsection(section, subsection)
101 9514 : CALL section_release(subsection)
102 :
103 9514 : CALL create_et_coupling_section(subsection)
104 9514 : CALL section_add_subsection(section, subsection)
105 9514 : CALL section_release(subsection)
106 :
107 9514 : CALL create_resp_section(subsection)
108 9514 : CALL section_add_subsection(section, subsection)
109 9514 : CALL section_release(subsection)
110 :
111 9514 : CALL create_atprop_section(subsection)
112 9514 : CALL section_add_subsection(section, subsection)
113 9514 : CALL section_release(subsection)
114 :
115 : CALL cp_print_key_section_create(subsection, __LOCATION__, name="FIT_CHARGE", &
116 : description="This section is used to print the density derived atomic point charges. "// &
117 : "The fit of the charges is controlled through the DENSITY_FITTING section", &
118 9514 : print_level=high_print_level, filename="__STD_OUT__")
119 : CALL keyword_create(keyword, __LOCATION__, name="TYPE_OF_DENSITY", &
120 : description="Specifies the type of density used for the fitting", &
121 : usage="TYPE_OF_DENSITY (FULL|SPIN)", &
122 : enum_c_vals=s2a("FULL", "SPIN"), &
123 : enum_i_vals=[do_full_density, do_spin_density], &
124 : enum_desc=s2a("Full density", "Spin density"), &
125 9514 : default_i_val=do_full_density)
126 9514 : CALL section_add_keyword(subsection, keyword)
127 9514 : CALL keyword_release(keyword)
128 9514 : CALL section_add_subsection(section, subsection)
129 9514 : CALL section_release(subsection)
130 :
131 9514 : CALL create_tddfpt2_section(subsection)
132 9514 : CALL section_add_subsection(section, subsection)
133 9514 : CALL section_release(subsection)
134 :
135 9514 : CALL create_rixs_section(subsection)
136 9514 : CALL section_add_subsection(section, subsection)
137 9514 : CALL section_release(subsection)
138 :
139 9514 : CALL create_bandstructure_section(subsection)
140 9514 : CALL section_add_subsection(section, subsection)
141 9514 : CALL section_release(subsection)
142 :
143 9514 : CALL create_tipscan_section(subsection)
144 9514 : CALL section_add_subsection(section, subsection)
145 9514 : CALL section_release(subsection)
146 :
147 9514 : END SUBROUTINE create_properties_section
148 :
149 : ! **************************************************************************************************
150 : !> \brief creates the input structure used to activate
151 : !> a resonant inelastic xray scattering (RIXS) calculation
152 : ! **************************************************************************************************
153 :
154 9514 : SUBROUTINE create_rixs_section(section)
155 : TYPE(section_type), POINTER :: section
156 : TYPE(section_type), POINTER :: subsection, print_key
157 : TYPE(keyword_type), POINTER :: keyword
158 :
159 9514 : CPASSERT(.NOT. ASSOCIATED(section))
160 :
161 9514 : NULLIFY (keyword, subsection, print_key)
162 :
163 : CALL section_create(section, __LOCATION__, name="RIXS", &
164 : description="Resonant Inelastic Xray Scattering using XAS_TDP and TDDFPT.", &
165 : n_keywords=1, n_subsections=3, repeats=.FALSE., &
166 19028 : citations=[VazdaCruz2021])
167 :
168 : CALL keyword_create(keyword, __LOCATION__, &
169 : name="_SECTION_PARAMETERS_", &
170 : description="Controls the activation of the RIXS procedure", &
171 : default_l_val=.FALSE., &
172 9514 : lone_keyword_l_val=.TRUE.)
173 9514 : CALL section_add_keyword(section, keyword)
174 9514 : CALL keyword_release(keyword)
175 :
176 : CALL keyword_create(keyword, __LOCATION__, name="CORE_STATES", &
177 : description="Number of core excited states to be used in the RIXS "// &
178 : "calculation. Restricting this number reduces computational cost. "// &
179 : "-1 means all available core states will be used.", &
180 9514 : n_var=1, type_of_var=integer_t, default_i_val=-1)
181 9514 : CALL section_add_keyword(section, keyword)
182 9514 : CALL keyword_release(keyword)
183 :
184 : CALL keyword_create(keyword, __LOCATION__, name="VALENCE_STATES", &
185 : description="Number of valence excited states to be used in the RIXS "// &
186 : "calculation. Restricting this number reduces computational cost, but "// &
187 : "removes spectral features corresponding to higher excitations. Should be "// &
188 : "used with care. -1 means all available valence states will be used.", &
189 9514 : n_var=1, type_of_var=integer_t, default_i_val=-1)
190 9514 : CALL section_add_keyword(section, keyword)
191 9514 : CALL keyword_release(keyword)
192 :
193 9514 : CALL create_tddfpt2_section(subsection)
194 9514 : CALL section_add_subsection(section, subsection)
195 9514 : CALL section_release(subsection)
196 :
197 9514 : CALL create_xas_tdp_section(subsection)
198 9514 : CALL section_add_subsection(section, subsection)
199 9514 : CALL section_release(subsection)
200 :
201 : CALL section_create(subsection, __LOCATION__, "PRINT", "Controls the printing of information "// &
202 9514 : "during RIXS calculations", repeats=.FALSE.)
203 :
204 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="SPECTRUM", &
205 : description="Controles the printing of the RIXS spectrum "// &
206 : "in output files", &
207 : print_level=low_print_level, filename="", &
208 9514 : common_iter_levels=3)
209 9514 : CALL section_add_subsection(subsection, print_key)
210 9514 : CALL section_release(print_key)
211 :
212 9514 : CALL section_add_subsection(section, subsection)
213 9514 : CALL section_release(subsection)
214 :
215 9514 : END SUBROUTINE create_rixs_section
216 :
217 : ! **************************************************************************************************
218 : !> \brief creates the input structure used to activate
219 : !> a linear response calculation
220 : !> Available properties : none
221 : !> \param section the section to create
222 : !> \param create_subsections indicates whether or not subsections should be created
223 : !> \param default_set_tdlr default parameters to be used if called from TDDFPT
224 : !> \author MI
225 : ! **************************************************************************************************
226 28542 : SUBROUTINE create_linres_section(section, create_subsections, default_set_tdlr)
227 : TYPE(section_type), POINTER :: section
228 : LOGICAL, INTENT(in) :: create_subsections
229 : LOGICAL, INTENT(IN), OPTIONAL :: default_set_tdlr
230 :
231 : INTEGER :: def_max_iter, def_precond
232 : REAL(KIND=DP) :: def_egap, def_eps, def_eps_filter
233 : TYPE(keyword_type), POINTER :: keyword
234 : TYPE(section_type), POINTER :: print_key, subsection
235 :
236 : CHARACTER(len=256) :: desc
237 :
238 28542 : NULLIFY (keyword, print_key)
239 :
240 28542 : IF (PRESENT(default_set_tdlr)) THEN
241 19028 : def_egap = 0.02_dp
242 19028 : def_eps = 1.0e-10_dp
243 19028 : def_eps_filter = 1.0e-15_dp
244 19028 : def_max_iter = 100
245 19028 : def_precond = ot_precond_full_single_inverse
246 19028 : desc = "Controls the parameters of the LINRES force calculations for excited states."
247 : ELSE
248 9514 : def_egap = 0.2_dp
249 9514 : def_eps = 1.e-6_dp
250 9514 : def_eps_filter = 0.0_dp
251 9514 : def_max_iter = 50
252 9514 : def_precond = ot_precond_none
253 9514 : desc = "The linear response is used to calculate one of the following properties: nmr, epr, raman, ..."
254 : END IF
255 :
256 28542 : CPASSERT(.NOT. ASSOCIATED(section))
257 : CALL section_create(section, __LOCATION__, name="linres", &
258 : description=desc, n_keywords=5, n_subsections=2, repeats=.FALSE., &
259 57084 : citations=[Putrino2000])
260 :
261 : CALL keyword_create(keyword, __LOCATION__, name="EPS", &
262 : description="target accuracy for the convergence of the conjugate gradient.", &
263 28542 : usage="EPS 1.e-6", default_r_val=def_eps)
264 28542 : CALL section_add_keyword(section, keyword)
265 28542 : CALL keyword_release(keyword)
266 :
267 : CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
268 : description="Filter threshold for response density matrix.", &
269 28542 : usage="EPS_FILTER 1.e-8", default_r_val=def_eps_filter)
270 28542 : CALL section_add_keyword(section, keyword)
271 28542 : CALL keyword_release(keyword)
272 :
273 : CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
274 : description="Maximum number of conjugate gradient iteration to be performed for one optimization.", &
275 28542 : usage="MAX_ITER 200", default_i_val=def_max_iter)
276 28542 : CALL section_add_keyword(section, keyword)
277 28542 : CALL keyword_release(keyword)
278 :
279 : CALL keyword_create(keyword, __LOCATION__, name="RESTART_EVERY", &
280 : description="Restart the conjugate gradient after the specified number of iterations.", &
281 28542 : usage="RESTART_EVERY 200", default_i_val=50)
282 28542 : CALL section_add_keyword(section, keyword)
283 28542 : CALL keyword_release(keyword)
284 :
285 : CALL keyword_create( &
286 : keyword, __LOCATION__, name="PRECONDITIONER", &
287 : description="Type of preconditioner to be used with all minimization schemes. "// &
288 : "They differ in effectiveness, cost of construction, cost of application. "// &
289 : "Properly preconditioned minimization can be orders of magnitude faster than doing nothing.", &
290 : usage="PRECONDITIONER FULL_ALL", &
291 : default_i_val=def_precond, &
292 : enum_c_vals=s2a("FULL_ALL", "FULL_SINGLE_INVERSE", "FULL_SINGLE", "FULL_KINETIC", "FULL_S_INVERSE", &
293 : "NONE"), &
294 : enum_desc=s2a("Most effective state selective preconditioner based on diagonalization, "// &
295 : "requires the ENERGY_GAP parameter to be an underestimate of the HOMO-LUMO gap. "// &
296 : "This preconditioner is recommended for almost all systems, except very large systems where "// &
297 : "make_preconditioner would dominate the total computational cost.", &
298 : "Based on H-eS cholesky inversion, similar to FULL_SINGLE in preconditioning efficiency "// &
299 : "but cheaper to construct, "// &
300 : "might be somewhat less robust. Recommended for large systems.", &
301 : "Based on H-eS diagonalisation, not as good as FULL_ALL, but somewhat cheaper to apply. ", &
302 : "Cholesky inversion of S and T, fast construction, robust, and relatively good, "// &
303 : "use for very large systems.", &
304 : "Cholesky inversion of S, not as good as FULL_KINETIC, yet equally expensive.", &
305 : "skip preconditioning"), &
306 : enum_i_vals=[ot_precond_full_all, ot_precond_full_single_inverse, ot_precond_full_single, &
307 28542 : ot_precond_full_kinetic, ot_precond_s_inverse, ot_precond_none])
308 28542 : CALL section_add_keyword(section, keyword)
309 28542 : CALL keyword_release(keyword)
310 :
311 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_GAP", &
312 : description="Energy gap estimate [a.u.] for preconditioning", &
313 : usage="ENERGY_GAP 0.1", &
314 28542 : default_r_val=def_egap)
315 28542 : CALL section_add_keyword(section, keyword)
316 28542 : CALL keyword_release(keyword)
317 :
318 : CALL keyword_create(keyword, __LOCATION__, name="EVERY_N_STEP", &
319 : description="Perform a linear response calculation every N-th step for MD run", &
320 28542 : usage="EVERY_N_STEP 50", default_i_val=1)
321 28542 : CALL section_add_keyword(section, keyword)
322 28542 : CALL keyword_release(keyword)
323 :
324 : CALL keyword_create(keyword, __LOCATION__, name="RESTART", &
325 : description="Restart the response calculation if the restart file exists", &
326 : usage="RESTART", &
327 28542 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
328 28542 : CALL section_add_keyword(section, keyword)
329 28542 : CALL keyword_release(keyword)
330 :
331 : CALL keyword_create(keyword, __LOCATION__, name="WFN_RESTART_FILE_NAME", &
332 : variants=["RESTART_FILE_NAME"], &
333 : description="Root of the file names where to read the response functions from "// &
334 : "which to restart the calculation of the linear response", &
335 : usage="WFN_RESTART_FILE_NAME <FILENAME>", &
336 57084 : type_of_var=lchar_t)
337 28542 : CALL section_add_keyword(section, keyword)
338 28542 : CALL keyword_release(keyword)
339 :
340 28542 : IF (create_subsections) THEN
341 9514 : NULLIFY (subsection)
342 :
343 9514 : CALL create_localize_section(subsection)
344 9514 : CALL section_add_subsection(section, subsection)
345 9514 : CALL section_release(subsection)
346 :
347 9514 : CALL create_current_section(subsection)
348 9514 : CALL section_add_subsection(section, subsection)
349 9514 : CALL section_release(subsection)
350 :
351 9514 : CALL create_nmr_section(subsection)
352 9514 : CALL section_add_subsection(section, subsection)
353 9514 : CALL section_release(subsection)
354 :
355 9514 : CALL create_spin_spin_section(subsection)
356 9514 : CALL section_add_subsection(section, subsection)
357 9514 : CALL section_release(subsection)
358 :
359 9514 : CALL create_epr_section(subsection)
360 9514 : CALL section_add_subsection(section, subsection)
361 9514 : CALL section_release(subsection)
362 :
363 9514 : CALL create_polarizability_section(subsection)
364 9514 : CALL section_add_subsection(section, subsection)
365 9514 : CALL section_release(subsection)
366 :
367 9514 : CALL create_dcdr_section(subsection)
368 9514 : CALL section_add_subsection(section, subsection)
369 9514 : CALL section_release(subsection)
370 :
371 9514 : CALL create_vcd_section(subsection)
372 9514 : CALL section_add_subsection(section, subsection)
373 9514 : CALL section_release(subsection)
374 :
375 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
376 : description="printing of information during the linear response calculation", &
377 9514 : repeats=.FALSE.)
378 :
379 : CALL cp_print_key_section_create( &
380 : print_key, __LOCATION__, "program_run_info", &
381 : description="Controls the printing of basic iteration information during the LINRES calculation", &
382 9514 : print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
383 9514 : CALL section_add_subsection(subsection, print_key)
384 9514 : CALL section_release(print_key)
385 :
386 : CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
387 : description="Controls the dumping of restart file of the response wavefunction. "// &
388 : "For each set of response functions, i.e. for each perturbation, "// &
389 : "one different restart file is dumped. These restart files should be "// &
390 : "employed only to restart the same type of LINRES calculation, "// &
391 : "i.e. with the same perturbation.", &
392 : print_level=low_print_level, common_iter_levels=3, each_iter_names=s2a("ITER"), &
393 9514 : add_last=add_last_numeric, each_iter_values=[3], filename="")
394 9514 : CALL section_add_subsection(subsection, print_key)
395 9514 : CALL section_release(print_key)
396 :
397 9514 : CALL section_add_subsection(section, subsection)
398 9514 : CALL section_release(subsection)
399 :
400 : END IF
401 :
402 28542 : END SUBROUTINE create_linres_section
403 :
404 : ! **************************************************************************************************
405 : !> \brief creates the input structure used to activate
406 : !> calculation of position perturbation DFPT
407 : !> \param section ...
408 : !> \author Sandra Luber, Edward Ditler
409 : ! **************************************************************************************************
410 9514 : SUBROUTINE create_dcdr_section(section)
411 :
412 : TYPE(section_type), POINTER :: section
413 :
414 : LOGICAL :: failure
415 : TYPE(keyword_type), POINTER :: keyword
416 : TYPE(section_type), POINTER :: print_key, subsection
417 :
418 9514 : failure = .FALSE.
419 9514 : NULLIFY (keyword, print_key, subsection)
420 :
421 9514 : CPASSERT(.NOT. ASSOCIATED(section))
422 :
423 : IF (.NOT. failure) THEN
424 : CALL section_create(section, __LOCATION__, name="DCDR", &
425 : description="Compute analytical gradients the dipole moments.", &
426 9514 : n_keywords=50, n_subsections=1, repeats=.FALSE.)
427 :
428 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
429 : description="controls the activation of the APT calculation", &
430 : usage="&DCDR T", &
431 : default_l_val=.FALSE., &
432 9514 : lone_keyword_l_val=.TRUE.)
433 9514 : CALL section_add_keyword(section, keyword)
434 9514 : CALL keyword_release(keyword)
435 :
436 : CALL keyword_create(keyword, __LOCATION__, name="LIST_OF_ATOMS", &
437 : description="Specifies a list of atoms.", &
438 : usage="LIST_OF_ATOMS {integer} {integer} .. {integer}", repeats=.TRUE., &
439 9514 : n_var=-1, type_of_var=integer_t)
440 9514 : CALL section_add_keyword(section, keyword)
441 9514 : CALL keyword_release(keyword)
442 :
443 : CALL keyword_create(keyword, __LOCATION__, name="DISTRIBUTED_ORIGIN", &
444 : variants=["DO_GAUGE"], &
445 : description="Use the distributed origin (DO) gauge?", &
446 : usage="DISTRIBUTED_ORIGIN T", &
447 19028 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
448 9514 : CALL section_add_keyword(section, keyword)
449 9514 : CALL keyword_release(keyword)
450 :
451 : CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_CENTER", &
452 : description="The orbital center.", &
453 : usage="ORBITAL_CENTER WANNIER", &
454 : default_i_val=current_orb_center_wannier, &
455 : enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
456 : enum_desc=s2a("Use the Wannier centers.", &
457 : "Use a common center (works only for an isolate molecule).", &
458 : "Use the atoms as center.", &
459 : "Boxing."), &
460 : enum_i_vals=[current_orb_center_wannier, current_orb_center_common, &
461 9514 : current_orb_center_atom, current_orb_center_box])
462 9514 : CALL section_add_keyword(section, keyword)
463 9514 : CALL keyword_release(keyword)
464 :
465 : CALL keyword_create(keyword, __LOCATION__, name="REFERENCE", &
466 : description="Gauge origin of the velocity gauge factor.", &
467 : enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
468 : enum_desc=s2a("Use Center of Mass", &
469 : "Use Center of Atomic Charges", &
470 : "Use User-defined Point", &
471 : "Use Origin of Coordinate System"), &
472 : enum_i_vals=[use_mom_ref_com, &
473 : use_mom_ref_coac, &
474 : use_mom_ref_user, &
475 : use_mom_ref_zero], &
476 9514 : default_i_val=use_mom_ref_zero)
477 9514 : CALL section_add_keyword(section, keyword)
478 9514 : CALL keyword_release(keyword)
479 :
480 : CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
481 : description="User-defined reference point of the velocity gauge factor.", &
482 : usage="REFERENCE_POINT x y z", &
483 9514 : repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
484 9514 : CALL section_add_keyword(section, keyword)
485 9514 : CALL keyword_release(keyword)
486 :
487 : CALL keyword_create(keyword, __LOCATION__, name="Z_MATRIX_METHOD", &
488 : description="Use Z_matrix method to solve the response equation", &
489 : usage="Z_MATRIX_METHOD T", &
490 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
491 9514 : CALL section_add_keyword(section, keyword)
492 9514 : CALL keyword_release(keyword)
493 :
494 : CALL keyword_create(keyword, __LOCATION__, name="APT_FD", &
495 : description="Use numerical differentiation to compute the APT, "// &
496 : "switches off the calculation of dcdr analytical derivatives. "// &
497 : "Requires RUN_TYPE = ENERGY_FORCE or MD.", &
498 : usage="APT_FD T", &
499 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
500 9514 : CALL section_add_keyword(section, keyword)
501 9514 : CALL keyword_release(keyword)
502 :
503 : CALL keyword_create(keyword, __LOCATION__, name="APT_FD_DE", &
504 : description="Electric field strength (atomic units) to use for finite differences", &
505 : repeats=.FALSE., &
506 : n_var=1, &
507 : type_of_var=real_t, &
508 : default_r_val=0.0003_dp, &
509 9514 : usage="APT_FD_DE 1.0E-4")
510 9514 : CALL section_add_keyword(section, keyword)
511 9514 : CALL keyword_release(keyword)
512 :
513 : CALL keyword_create(keyword, __LOCATION__, name="APT_FD_METHOD", &
514 : description="Numerical differentiation method", &
515 : usage="APT_FD_METHOD FD", &
516 : default_i_val=1, &
517 : !enum_c_vals=s2a("FD", "2PNT"), &
518 : enum_c_vals=s2a("2PNT"), &
519 : !enum_desc=s2a("Forward differences.", &
520 : ! "Symmetric two-point differences."), &
521 : enum_desc=s2a("Symmetric two-point differences."), &
522 : !enum_i_vals=(/0, 1/))
523 9514 : enum_i_vals=[1])
524 9514 : CALL section_add_keyword(section, keyword)
525 9514 : CALL keyword_release(keyword)
526 :
527 9514 : NULLIFY (subsection)
528 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
529 : description="print results of the magnetic dipole moment calculation", &
530 9514 : repeats=.FALSE.)
531 :
532 : CALL cp_print_key_section_create(print_key, __LOCATION__, "APT", &
533 : description="Controls the printing of the electric dipole gradient", &
534 9514 : print_level=low_print_level, add_last=add_last_numeric, filename="")
535 9514 : CALL section_add_subsection(subsection, print_key)
536 9514 : CALL section_release(print_key)
537 :
538 9514 : CALL section_add_subsection(section, subsection)
539 9514 : CALL section_release(subsection)
540 :
541 9514 : NULLIFY (subsection)
542 9514 : CALL create_interp_section(subsection)
543 9514 : CALL section_add_subsection(section, subsection)
544 9514 : CALL section_release(subsection)
545 :
546 : END IF
547 :
548 9514 : END SUBROUTINE create_dcdr_section
549 :
550 : ! **************************************************************************************************
551 : !> \brief creates the input structure used to activate
552 : !> calculation of VCD spectra using DFPT
553 : !> \param section ...
554 : !> \author Sandra Luber, Tomas Zimmermann, Edward Ditler
555 : ! **************************************************************************************************
556 9514 : SUBROUTINE create_vcd_section(section)
557 :
558 : TYPE(section_type), POINTER :: section
559 :
560 : TYPE(keyword_type), POINTER :: keyword
561 : TYPE(section_type), POINTER :: print_key, subsection
562 :
563 9514 : NULLIFY (keyword, print_key, subsection)
564 :
565 9514 : CPASSERT(.NOT. ASSOCIATED(section))
566 :
567 : CALL section_create(section, __LOCATION__, name="VCD", &
568 : description="Carry out a VCD calculation.", &
569 9514 : n_keywords=50, n_subsections=1, repeats=.FALSE.)
570 :
571 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
572 : description="controls the activation of the APT/AAT calculation", &
573 : usage="&VCD T", &
574 : default_l_val=.FALSE., &
575 9514 : lone_keyword_l_val=.TRUE.)
576 9514 : CALL section_add_keyword(section, keyword)
577 9514 : CALL keyword_release(keyword)
578 :
579 : CALL keyword_create(keyword, __LOCATION__, name="LIST_OF_ATOMS", &
580 : description="Specifies a list of atoms.", &
581 : usage="LIST_OF_ATOMS {integer} {integer} .. {integer}", repeats=.TRUE., &
582 9514 : n_var=-1, type_of_var=integer_t)
583 9514 : CALL section_add_keyword(section, keyword)
584 9514 : CALL keyword_release(keyword)
585 :
586 : CALL keyword_create(keyword, __LOCATION__, name="DISTRIBUTED_ORIGIN", &
587 : variants=["DO_GAUGE"], &
588 : description="Use the distributed origin (DO) gauge?", &
589 : usage="DISTRIBUTED_ORIGIN T", &
590 19028 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
591 9514 : CALL section_add_keyword(section, keyword)
592 9514 : CALL keyword_release(keyword)
593 :
594 : CALL keyword_create(keyword, __LOCATION__, name="ORIGIN_DEPENDENT_MFP", &
595 : description="Use the origin dependent MFP operator.", &
596 : usage="ORIGIN_DEPENDENT_MFP T", &
597 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
598 9514 : CALL section_add_keyword(section, keyword)
599 9514 : CALL keyword_release(keyword)
600 :
601 : CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_CENTER", &
602 : description="The orbital center.", &
603 : usage="ORBITAL_CENTER WANNIER", &
604 : default_i_val=current_orb_center_wannier, &
605 : enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
606 : enum_desc=s2a("Use the Wannier centers.", &
607 : "Use a common center (works only for an isolate molecule).", &
608 : "Use the atoms as center.", &
609 : "Boxing."), &
610 : enum_i_vals=[current_orb_center_wannier, current_orb_center_common, &
611 9514 : current_orb_center_atom, current_orb_center_box])
612 9514 : CALL section_add_keyword(section, keyword)
613 9514 : CALL keyword_release(keyword)
614 :
615 : ! The origin of the magnetic dipole operator (r - MAGNETIC_ORIGIN) x momentum
616 : CALL keyword_create(keyword, __LOCATION__, name="MAGNETIC_ORIGIN", &
617 : description="Gauge origin of the magnetic dipole operator.", &
618 : enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
619 : enum_desc=s2a("Use Center of Mass", &
620 : "Use Center of Atomic Charges", &
621 : "Use User-defined Point", &
622 : "Use Origin of Coordinate System"), &
623 : enum_i_vals=[use_mom_ref_com, &
624 : use_mom_ref_coac, &
625 : use_mom_ref_user, &
626 : use_mom_ref_zero], &
627 9514 : default_i_val=use_mom_ref_zero)
628 9514 : CALL section_add_keyword(section, keyword)
629 9514 : CALL keyword_release(keyword)
630 :
631 : CALL keyword_create(keyword, __LOCATION__, name="MAGNETIC_ORIGIN_REFERENCE", &
632 : description="User-defined reference point of the magnetic dipole operator.", &
633 : usage="MAGNETIC_ORIGIN_REFERENCE x y z", &
634 9514 : repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
635 9514 : CALL section_add_keyword(section, keyword)
636 9514 : CALL keyword_release(keyword)
637 :
638 : ! The origin of the coordinate system
639 : CALL keyword_create(keyword, __LOCATION__, name="SPATIAL_ORIGIN", &
640 : description="Gauge origin of the velocity gauge factor/spatial origin.", &
641 : enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
642 : enum_desc=s2a("Use Center of Mass", &
643 : "Use Center of Atomic Charges", &
644 : "Use User-defined Point", &
645 : "Use Origin of Coordinate System"), &
646 : enum_i_vals=[use_mom_ref_com, &
647 : use_mom_ref_coac, &
648 : use_mom_ref_user, &
649 : use_mom_ref_zero], &
650 9514 : default_i_val=use_mom_ref_zero)
651 9514 : CALL section_add_keyword(section, keyword)
652 9514 : CALL keyword_release(keyword)
653 :
654 : CALL keyword_create(keyword, __LOCATION__, name="SPATIAL_ORIGIN_REFERENCE", &
655 : description="User-defined reference point of the velocity gauge factor/spatial origin.", &
656 : usage="SPATIAL_ORIGIN_REFERENCE x y z", &
657 9514 : repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
658 9514 : CALL section_add_keyword(section, keyword)
659 9514 : CALL keyword_release(keyword)
660 :
661 9514 : NULLIFY (subsection)
662 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
663 : description="print results of the magnetic dipole moment calculation", &
664 9514 : repeats=.FALSE.)
665 :
666 : CALL cp_print_key_section_create(print_key, __LOCATION__, "VCD", &
667 : description="Controls the printing of the APTs and AATs", &
668 9514 : print_level=low_print_level, add_last=add_last_numeric, filename="")
669 9514 : CALL section_add_subsection(subsection, print_key)
670 9514 : CALL section_release(print_key)
671 :
672 9514 : CALL section_add_subsection(section, subsection)
673 9514 : CALL section_release(subsection)
674 :
675 9514 : NULLIFY (subsection)
676 9514 : CALL create_interp_section(subsection)
677 9514 : CALL section_add_subsection(section, subsection)
678 9514 : CALL section_release(subsection)
679 :
680 9514 : END SUBROUTINE create_vcd_section
681 :
682 : ! **************************************************************************************************
683 : !> \brief creates the input structure used to activate
684 : !> calculation of induced current DFPT
685 : !> Available properties : none
686 : !> \param section the section to create
687 : !> \author MI/VW
688 : ! **************************************************************************************************
689 9514 : SUBROUTINE create_current_section(section)
690 : TYPE(section_type), POINTER :: section
691 :
692 : TYPE(keyword_type), POINTER :: keyword
693 : TYPE(section_type), POINTER :: print_key, subsection
694 :
695 9514 : NULLIFY (keyword, print_key, subsection)
696 :
697 9514 : CPASSERT(.NOT. ASSOCIATED(section))
698 : CALL section_create(section, __LOCATION__, name="current", &
699 : description="The induced current density is calculated by DFPT.", &
700 : n_keywords=4, n_subsections=1, repeats=.FALSE., &
701 28542 : citations=[Sebastiani2001, Weber2009])
702 :
703 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
704 : description="controls the activation of the induced current calculation", &
705 : usage="&CURRENT T", &
706 : default_l_val=.FALSE., &
707 9514 : lone_keyword_l_val=.TRUE.)
708 9514 : CALL section_add_keyword(section, keyword)
709 9514 : CALL keyword_release(keyword)
710 :
711 : CALL keyword_create(keyword, __LOCATION__, name="GAUGE", &
712 : description="The gauge used to compute the induced current within GAPW.", &
713 : usage="GAUGE R", &
714 : default_i_val=current_gauge_r_and_step_func, &
715 : enum_c_vals=s2a("R", "R_AND_STEP_FUNCTION", "ATOM"), &
716 : enum_desc=s2a("Position gauge (doesnt work well).", &
717 : "Position and step function for the soft and the local parts, respectively.", &
718 : "Atoms."), &
719 9514 : enum_i_vals=[current_gauge_r, current_gauge_r_and_step_func, current_gauge_atom])
720 9514 : CALL section_add_keyword(section, keyword)
721 9514 : CALL keyword_release(keyword)
722 :
723 : CALL keyword_create(keyword, __LOCATION__, name="GAUGE_ATOM_RADIUS", &
724 : description="Build the gauge=atom using only the atoms within this radius.", &
725 : usage="GAUGE_ATOM_RADIUS 10.0", &
726 : type_of_var=real_t, &
727 : default_r_val=cp_unit_to_cp2k(value=4.0_dp, unit_str="angstrom"), &
728 9514 : unit_str="angstrom")
729 9514 : CALL section_add_keyword(section, keyword)
730 9514 : CALL keyword_release(keyword)
731 :
732 : CALL keyword_create(keyword, __LOCATION__, name="USE_OLD_GAUGE_ATOM", &
733 : description="Use the old way to compute the gauge.", &
734 : usage="USE_OLD_GAUGE_ATOM T", &
735 9514 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
736 9514 : CALL section_add_keyword(section, keyword)
737 9514 : CALL keyword_release(keyword)
738 :
739 : CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_CENTER", &
740 : description="The orbital center.", &
741 : usage="ORBITAL_CENTER WANNIER", &
742 : default_i_val=current_orb_center_wannier, &
743 : enum_c_vals=s2a("WANNIER", "COMMON", "ATOM", "BOX"), &
744 : enum_desc=s2a("Use the Wannier centers.", &
745 : "Use a common center (works only for an isolate molecule).", &
746 : "Use the atoms as center.", &
747 : "Boxing."), &
748 : enum_i_vals=[current_orb_center_wannier, current_orb_center_common, &
749 9514 : current_orb_center_atom, current_orb_center_box])
750 9514 : CALL section_add_keyword(section, keyword)
751 9514 : CALL keyword_release(keyword)
752 :
753 : CALL keyword_create(keyword, __LOCATION__, name="COMMON_CENTER", &
754 : description="The common center ", usage="COMMON_CENTER 0.0 1.0 0.0", &
755 : n_var=3, default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp], type_of_var=real_t, &
756 9514 : unit_str="angstrom")
757 9514 : CALL section_add_keyword(section, keyword)
758 9514 : CALL keyword_release(keyword)
759 :
760 : CALL keyword_create(keyword, __LOCATION__, name="NBOX", &
761 : description="How many boxes along each directions ", usage="NBOX 6 6 5", &
762 9514 : n_var=3, default_i_vals=[4, 4, 4], type_of_var=integer_t)
763 9514 : CALL section_add_keyword(section, keyword)
764 9514 : CALL keyword_release(keyword)
765 :
766 : CALL keyword_create(keyword, __LOCATION__, name="CHI_PBC", &
767 : description="Calculate the succeptibility correction to the shift with PBC", &
768 : usage="CHI_PBC T", &
769 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
770 9514 : CALL section_add_keyword(section, keyword)
771 9514 : CALL keyword_release(keyword)
772 :
773 : CALL keyword_create(keyword, __LOCATION__, name="FORCE_NO_FULL", &
774 : description="Avoid the calculation of the state dependent perturbation term, "// &
775 : "even if the orbital centers are set at Wannier centers or at Atom centers", &
776 : usage="FORCE_NO_FULL T", &
777 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
778 9514 : CALL section_add_keyword(section, keyword)
779 9514 : CALL keyword_release(keyword)
780 :
781 : CALL keyword_create(keyword, __LOCATION__, name="SELECTED_STATES_ON_ATOM_LIST", &
782 : description="Indexes of the atoms for selecting"// &
783 : " the states to be used for the response calculations.", &
784 : usage="SELECTED_STATES_ON_ATOM_LIST 1 2 10", &
785 9514 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
786 9514 : CALL section_add_keyword(section, keyword)
787 9514 : CALL keyword_release(keyword)
788 :
789 : CALL keyword_create(keyword, __LOCATION__, name="SELECTED_STATES_ATOM_RADIUS", &
790 : description="Select all the states included in the given radius around each atoms "// &
791 : "in SELECTED_STATES_ON_ATOM_LIST.", &
792 : usage="SELECTED_STATES_ATOM_RADIUS 2.0", &
793 : type_of_var=real_t, &
794 : default_r_val=cp_unit_to_cp2k(value=4.0_dp, unit_str="angstrom"), &
795 9514 : unit_str="angstrom")
796 9514 : CALL section_add_keyword(section, keyword)
797 9514 : CALL keyword_release(keyword)
798 :
799 : CALL keyword_create(keyword, __LOCATION__, name="RESTART_CURRENT", &
800 : description="Restart the induced current density calculation"// &
801 : " from a previous run (not working yet).", &
802 : usage="RESTART_CURRENT", default_l_val=.FALSE., &
803 9514 : lone_keyword_l_val=.TRUE.)
804 9514 : CALL section_add_keyword(section, keyword)
805 9514 : CALL keyword_release(keyword)
806 :
807 9514 : NULLIFY (subsection)
808 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
809 : description="print results of induced current density calculation", &
810 9514 : repeats=.FALSE.)
811 :
812 : CALL cp_print_key_section_create(print_key, __LOCATION__, "CURRENT_CUBES", &
813 : description="Controls the printing of the induced current density (not working yet).", &
814 9514 : print_level=high_print_level, add_last=add_last_numeric, filename="")
815 : CALL keyword_create(keyword, __LOCATION__, name="stride", &
816 : description="The stride (X,Y,Z) used to write the cube file "// &
817 : "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
818 : " 1 number valid for all components (not working yet).", &
819 9514 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
820 9514 : CALL section_add_keyword(print_key, keyword)
821 9514 : CALL keyword_release(keyword)
822 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
823 : description="append the cube files when they already exist", &
824 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
825 9514 : CALL section_add_keyword(print_key, keyword)
826 9514 : CALL keyword_release(keyword)
827 :
828 9514 : CALL section_add_subsection(subsection, print_key)
829 9514 : CALL section_release(print_key)
830 :
831 : CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_FUNCTION_CUBES", &
832 : description="Controls the printing of the response functions (not working yet).", &
833 9514 : print_level=high_print_level, add_last=add_last_numeric, filename="")
834 : CALL keyword_create(keyword, __LOCATION__, name="stride", &
835 : description="The stride (X,Y,Z) used to write the cube file "// &
836 : "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
837 : " 1 number valid for all components (not working yet).", &
838 9514 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
839 9514 : CALL section_add_keyword(print_key, keyword)
840 9514 : CALL keyword_release(keyword)
841 :
842 : CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
843 : variants=["CUBES_LU"], &
844 : description="The lower and upper index of the states to be printed as cube (not working yet).", &
845 : usage="CUBES_LU_BOUNDS integer integer", &
846 19028 : n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
847 9514 : CALL section_add_keyword(print_key, keyword)
848 9514 : CALL keyword_release(keyword)
849 :
850 : CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
851 : description="Indexes of the states to be printed as cube files "// &
852 : "This keyword can be repeated several times "// &
853 : "(useful if you have to specify many indexes) (not working yet).", &
854 : usage="CUBES_LIST 1 2", &
855 9514 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
856 9514 : CALL section_add_keyword(print_key, keyword)
857 9514 : CALL keyword_release(keyword)
858 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
859 : description="append the cube files when they already exist", &
860 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
861 9514 : CALL section_add_keyword(print_key, keyword)
862 9514 : CALL keyword_release(keyword)
863 :
864 9514 : CALL section_add_subsection(subsection, print_key)
865 9514 : CALL section_release(print_key)
866 :
867 9514 : CALL section_add_subsection(section, subsection)
868 9514 : CALL section_release(subsection)
869 :
870 9514 : NULLIFY (subsection)
871 9514 : CALL create_interp_section(subsection)
872 9514 : CALL section_add_subsection(section, subsection)
873 9514 : CALL section_release(subsection)
874 :
875 9514 : END SUBROUTINE create_current_section
876 :
877 : ! **************************************************************************************************
878 : !> \brief creates the input structure used to activate
879 : !> calculation of NMR chemical shift using
880 : !> the induced current obtained from DFPT
881 : !> Available properties : none
882 : !> \param section the section to create
883 : !> \author MI/VW
884 : ! **************************************************************************************************
885 9514 : SUBROUTINE create_nmr_section(section)
886 : TYPE(section_type), POINTER :: section
887 :
888 : TYPE(keyword_type), POINTER :: keyword
889 : TYPE(section_type), POINTER :: print_key, subsection
890 :
891 9514 : NULLIFY (keyword, print_key, subsection)
892 :
893 9514 : CPASSERT(.NOT. ASSOCIATED(section))
894 : CALL section_create(section, __LOCATION__, name="nmr", &
895 : description="The chemical shift is calculated by DFPT.", &
896 : n_keywords=5, n_subsections=1, repeats=.FALSE., &
897 19028 : citations=[Weber2009])
898 :
899 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
900 : description="controls the activation of the nmr calculation", &
901 : usage="&NMR T", &
902 : default_l_val=.FALSE., &
903 9514 : lone_keyword_l_val=.TRUE.)
904 9514 : CALL section_add_keyword(section, keyword)
905 9514 : CALL keyword_release(keyword)
906 :
907 : CALL keyword_create(keyword, __LOCATION__, name="INTERPOLATE_SHIFT", &
908 : description="Calculate the soft part of the chemical shift by interpolation ", &
909 : usage="INTERPOLATE_SHIFT T", &
910 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
911 9514 : CALL section_add_keyword(section, keyword)
912 9514 : CALL keyword_release(keyword)
913 :
914 : CALL keyword_create(keyword, __LOCATION__, name="NICS", &
915 : description="Calculate the chemical shift in a set of points"// &
916 : " given from an external file", usage="NICS", &
917 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
918 9514 : CALL section_add_keyword(section, keyword)
919 9514 : CALL keyword_release(keyword)
920 :
921 : CALL keyword_create(keyword, __LOCATION__, name="NICS_FILE_NAME", &
922 : description="Name of the file with the NICS points coordinates", &
923 : usage="NICS_FILE_NAME nics_file", &
924 9514 : default_lc_val="nics_file")
925 9514 : CALL section_add_keyword(section, keyword)
926 9514 : CALL keyword_release(keyword)
927 :
928 : CALL keyword_create(keyword, __LOCATION__, name="RESTART_NMR", &
929 : description="Restart the NMR calculation from a previous run (NOT WORKING YET)", &
930 : usage="RESTART_NMR", default_l_val=.FALSE., &
931 9514 : lone_keyword_l_val=.TRUE.)
932 9514 : CALL section_add_keyword(section, keyword)
933 9514 : CALL keyword_release(keyword)
934 :
935 : CALL keyword_create(keyword, __LOCATION__, name="SHIFT_GAPW_RADIUS", &
936 : description="While computing the local part of the shift (GAPW), "// &
937 : "the integration is restricted to nuclei that are within this radius.", &
938 : usage="SHIFT_GAPW_RADIUS 20.0", &
939 : type_of_var=real_t, &
940 : default_r_val=cp_unit_to_cp2k(value=60.0_dp, unit_str="angstrom"), &
941 9514 : unit_str="angstrom")
942 9514 : CALL section_add_keyword(section, keyword)
943 9514 : CALL keyword_release(keyword)
944 :
945 9514 : NULLIFY (subsection)
946 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
947 : description="print results of nmr calculation", &
948 9514 : repeats=.FALSE.)
949 :
950 : CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_FUNCTION_CUBES", &
951 : description="Controls the printing of the response functions ", &
952 9514 : print_level=high_print_level, add_last=add_last_numeric, filename="")
953 : CALL keyword_create(keyword, __LOCATION__, name="stride", &
954 : description="The stride (X,Y,Z) used to write the cube file "// &
955 : "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
956 : " 1 number valid for all components.", &
957 9514 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
958 9514 : CALL section_add_keyword(print_key, keyword)
959 9514 : CALL keyword_release(keyword)
960 :
961 : CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
962 : variants=["CUBES_LU"], &
963 : description="The lower and upper index of the states to be printed as cube", &
964 : usage="CUBES_LU_BOUNDS integer integer", &
965 19028 : n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
966 9514 : CALL section_add_keyword(print_key, keyword)
967 9514 : CALL keyword_release(keyword)
968 :
969 : CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
970 : description="Indexes of the states to be printed as cube files "// &
971 : "This keyword can be repeated several times "// &
972 : "(useful if you have to specify many indexes).", &
973 : usage="CUBES_LIST 1 2", &
974 9514 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
975 9514 : CALL section_add_keyword(print_key, keyword)
976 9514 : CALL keyword_release(keyword)
977 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
978 : description="append the cube files when they already exist", &
979 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
980 9514 : CALL section_add_keyword(print_key, keyword)
981 9514 : CALL keyword_release(keyword)
982 :
983 9514 : CALL section_add_subsection(subsection, print_key)
984 9514 : CALL section_release(print_key)
985 :
986 : CALL cp_print_key_section_create(print_key, __LOCATION__, "CHI_TENSOR", &
987 : description="Controls the printing of susceptibility", &
988 9514 : print_level=high_print_level, add_last=add_last_numeric, filename="")
989 9514 : CALL section_add_subsection(subsection, print_key)
990 9514 : CALL section_release(print_key)
991 :
992 : CALL cp_print_key_section_create(print_key, __LOCATION__, "SHIELDING_TENSOR", &
993 : description="Controls the printing of the chemical shift", &
994 9514 : print_level=low_print_level, add_last=add_last_numeric, filename="")
995 :
996 : CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LU_BOUNDS", &
997 : variants=["ATOMS_LU"], &
998 : description="The lower and upper atomic index for which the tensor is printed", &
999 : usage="ATOMS_LU_BOUNDS integer integer", &
1000 19028 : n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
1001 9514 : CALL section_add_keyword(print_key, keyword)
1002 9514 : CALL keyword_release(keyword)
1003 :
1004 : CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LIST", &
1005 : description="list of atoms for which the shift is printed into a file ", &
1006 : usage="ATOMS_LIST 1 2", n_var=-1, &
1007 9514 : type_of_var=integer_t, repeats=.TRUE.)
1008 9514 : CALL section_add_keyword(print_key, keyword)
1009 9514 : CALL keyword_release(keyword)
1010 :
1011 9514 : CALL section_add_subsection(subsection, print_key)
1012 9514 : CALL section_release(print_key)
1013 :
1014 9514 : CALL section_add_subsection(section, subsection)
1015 9514 : CALL section_release(subsection)
1016 :
1017 9514 : NULLIFY (subsection)
1018 9514 : CALL create_interp_section(subsection)
1019 9514 : CALL section_add_subsection(section, subsection)
1020 9514 : CALL section_release(subsection)
1021 :
1022 9514 : END SUBROUTINE create_nmr_section
1023 :
1024 : ! **************************************************************************************************
1025 : !> \brief creates the input structure used to activate
1026 : !> calculation of NMR spin-spin coupling (implementation not operating)
1027 : !> Available properties : none
1028 : !> \param section the section to create
1029 : !> \author VW
1030 : ! **************************************************************************************************
1031 9514 : SUBROUTINE create_spin_spin_section(section)
1032 : TYPE(section_type), POINTER :: section
1033 :
1034 : TYPE(keyword_type), POINTER :: keyword
1035 : TYPE(section_type), POINTER :: print_key, subsection
1036 :
1037 9514 : NULLIFY (keyword, print_key, subsection)
1038 :
1039 9514 : CPASSERT(.NOT. ASSOCIATED(section))
1040 : CALL section_create(section, __LOCATION__, name="spinspin", &
1041 : description="Compute indirect spin-spin coupling constants.", &
1042 9514 : n_keywords=5, n_subsections=1, repeats=.FALSE.)
1043 :
1044 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
1045 : description="controls the activation of the nmr calculation", &
1046 : usage="&SPINSPIN T", &
1047 : default_l_val=.FALSE., &
1048 9514 : lone_keyword_l_val=.TRUE.)
1049 9514 : CALL section_add_keyword(section, keyword)
1050 9514 : CALL keyword_release(keyword)
1051 :
1052 : CALL keyword_create(keyword, __LOCATION__, name="RESTART_SPINSPIN", &
1053 : description="Restart the spin-spin calculation from a previous run (NOT WORKING YET)", &
1054 : usage="RESTART_SPINSPIN", default_l_val=.FALSE., &
1055 9514 : lone_keyword_l_val=.TRUE.)
1056 9514 : CALL section_add_keyword(section, keyword)
1057 9514 : CALL keyword_release(keyword)
1058 :
1059 : CALL keyword_create(keyword, __LOCATION__, name="ISSC_ON_ATOM_LIST", &
1060 : description="Atoms for which the issc is computed.", &
1061 : usage="ISSC_ON_ATOM_LIST 1 2 10", &
1062 9514 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
1063 9514 : CALL section_add_keyword(section, keyword)
1064 9514 : CALL keyword_release(keyword)
1065 :
1066 : CALL keyword_create(keyword, __LOCATION__, name="DO_FC", &
1067 : description="Compute the Fermi contact contribution", &
1068 : usage="DO_FC F", &
1069 9514 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1070 9514 : CALL section_add_keyword(section, keyword)
1071 9514 : CALL keyword_release(keyword)
1072 :
1073 : CALL keyword_create(keyword, __LOCATION__, name="DO_SD", &
1074 : description="Compute the spin-dipolar contribution", &
1075 : usage="DO_SD F", &
1076 9514 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1077 9514 : CALL section_add_keyword(section, keyword)
1078 9514 : CALL keyword_release(keyword)
1079 :
1080 : CALL keyword_create(keyword, __LOCATION__, name="DO_PSO", &
1081 : description="Compute the paramagnetic spin-orbit contribution", &
1082 : usage="DO_PSO F", &
1083 9514 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1084 9514 : CALL section_add_keyword(section, keyword)
1085 9514 : CALL keyword_release(keyword)
1086 :
1087 : CALL keyword_create(keyword, __LOCATION__, name="DO_DSO", &
1088 : description="Compute the diamagnetic spin-orbit contribution (NOT YET IMPLEMENTED)", &
1089 : usage="DO_DSO F", &
1090 9514 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1091 9514 : CALL section_add_keyword(section, keyword)
1092 9514 : CALL keyword_release(keyword)
1093 :
1094 9514 : NULLIFY (subsection)
1095 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
1096 : description="print results of the indirect spin-spin calculation", &
1097 9514 : repeats=.FALSE.)
1098 :
1099 : CALL cp_print_key_section_create(print_key, __LOCATION__, "K_MATRIX", &
1100 : description="Controls the printing of the indirect spin-spin matrix", &
1101 9514 : print_level=low_print_level, add_last=add_last_numeric, filename="")
1102 :
1103 : CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LIST", &
1104 : description="list of atoms for which the indirect spin-spin is printed into a file ", &
1105 : usage="ATOMS_LIST 1 2", n_var=-1, &
1106 9514 : type_of_var=integer_t, repeats=.TRUE.)
1107 9514 : CALL section_add_keyword(print_key, keyword)
1108 9514 : CALL keyword_release(keyword)
1109 :
1110 9514 : CALL section_add_subsection(subsection, print_key)
1111 9514 : CALL section_release(print_key)
1112 :
1113 9514 : CALL section_add_subsection(section, subsection)
1114 9514 : CALL section_release(subsection)
1115 :
1116 9514 : NULLIFY (subsection)
1117 9514 : CALL create_interp_section(subsection)
1118 9514 : CALL section_add_subsection(section, subsection)
1119 9514 : CALL section_release(subsection)
1120 :
1121 9514 : END SUBROUTINE create_spin_spin_section
1122 :
1123 : ! **************************************************************************************************
1124 : !> \brief creates the input structure used to activate
1125 : !> calculation of EPR using
1126 : !> the induced current obtained from DFPT
1127 : !> Available properties : none
1128 : !> \param section the section to create
1129 : !> \author VW
1130 : ! **************************************************************************************************
1131 9514 : SUBROUTINE create_epr_section(section)
1132 : TYPE(section_type), POINTER :: section
1133 :
1134 : TYPE(keyword_type), POINTER :: keyword
1135 : TYPE(section_type), POINTER :: print_key, subsection, subsubsection
1136 :
1137 9514 : NULLIFY (keyword, print_key, subsection, subsubsection)
1138 :
1139 9514 : CPASSERT(.NOT. ASSOCIATED(section))
1140 : CALL section_create(section, __LOCATION__, name="EPR", &
1141 : description="The g tensor is calculated by DFPT ", &
1142 : n_keywords=5, n_subsections=1, repeats=.FALSE., &
1143 19028 : citations=[Weber2009])
1144 :
1145 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
1146 : description="controls the activation of the epr calculation", &
1147 : usage="&EPR T", &
1148 : default_l_val=.FALSE., &
1149 9514 : lone_keyword_l_val=.TRUE.)
1150 9514 : CALL section_add_keyword(section, keyword)
1151 9514 : CALL keyword_release(keyword)
1152 :
1153 : CALL keyword_create(keyword, __LOCATION__, name="RESTART_EPR", &
1154 : description="Restart the EPR calculation from a previous run (NOT WORKING)", &
1155 : usage="RESTART_EPR", default_l_val=.FALSE., &
1156 9514 : lone_keyword_l_val=.TRUE.)
1157 9514 : CALL section_add_keyword(section, keyword)
1158 9514 : CALL keyword_release(keyword)
1159 :
1160 9514 : NULLIFY (subsection)
1161 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
1162 : description="print results of epr calculation", &
1163 9514 : repeats=.FALSE.)
1164 :
1165 : CALL cp_print_key_section_create(print_key, __LOCATION__, "NABLAVKS_CUBES", &
1166 : description="Controls the printing of the components of nabla v_ks ", &
1167 9514 : print_level=high_print_level, add_last=add_last_numeric, filename="")
1168 : CALL keyword_create(keyword, __LOCATION__, name="stride", &
1169 : description="The stride (X,Y,Z) used to write the cube file "// &
1170 : "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1171 : " 1 number valid for all components.", &
1172 9514 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
1173 9514 : CALL section_add_keyword(print_key, keyword)
1174 9514 : CALL keyword_release(keyword)
1175 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
1176 : description="append the cube files when they already exist", &
1177 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1178 9514 : CALL section_add_keyword(print_key, keyword)
1179 9514 : CALL keyword_release(keyword)
1180 :
1181 9514 : CALL section_add_subsection(subsection, print_key)
1182 9514 : CALL section_release(print_key)
1183 :
1184 : CALL cp_print_key_section_create(print_key, __LOCATION__, "G_TENSOR", &
1185 : description="Controls the printing of the g tensor", &
1186 9514 : print_level=high_print_level, add_last=add_last_numeric, filename="")
1187 9514 : CALL create_xc_section(subsubsection)
1188 9514 : CALL section_add_subsection(print_key, subsubsection)
1189 9514 : CALL section_release(subsubsection)
1190 :
1191 : CALL keyword_create(keyword, __LOCATION__, name="GAPW_MAX_ALPHA", &
1192 : description="Maximum alpha of GTH potentials allowed on the soft grids ", &
1193 9514 : usage="GAPW_MAX_ALPHA real", default_r_val=5.0_dp)
1194 9514 : CALL section_add_keyword(print_key, keyword)
1195 9514 : CALL keyword_release(keyword)
1196 :
1197 : CALL keyword_create(keyword, __LOCATION__, name="SOO_RHO_HARD", &
1198 : description="Whether or not to include the atomic parts of the density "// &
1199 : "in the SOO part of the g tensor", usage="SOO_RHO_HARD", &
1200 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1201 9514 : CALL section_add_keyword(print_key, keyword)
1202 9514 : CALL keyword_release(keyword)
1203 :
1204 9514 : CALL section_add_subsection(subsection, print_key)
1205 9514 : CALL section_release(print_key)
1206 :
1207 : CALL cp_print_key_section_create(print_key, __LOCATION__, "RESPONSE_FUNCTION_CUBES", &
1208 : description="Controls the printing of the response functions ", &
1209 9514 : print_level=high_print_level, add_last=add_last_numeric, filename="")
1210 : CALL keyword_create(keyword, __LOCATION__, name="stride", &
1211 : description="The stride (X,Y,Z) used to write the cube file "// &
1212 : "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1213 : " 1 number valid for all components.", &
1214 9514 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
1215 9514 : CALL section_add_keyword(print_key, keyword)
1216 9514 : CALL keyword_release(keyword)
1217 :
1218 : CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
1219 : variants=["CUBES_LU"], &
1220 : description="The lower and upper index of the states to be printed as cube", &
1221 : usage="CUBES_LU_BOUNDS integer integer", &
1222 19028 : n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
1223 9514 : CALL section_add_keyword(print_key, keyword)
1224 9514 : CALL keyword_release(keyword)
1225 :
1226 : CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
1227 : description="Indexes of the states to be printed as cube files "// &
1228 : "This keyword can be repeated several times "// &
1229 : "(useful if you have to specify many indexes).", &
1230 : usage="CUBES_LIST 1 2", &
1231 9514 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
1232 9514 : CALL section_add_keyword(print_key, keyword)
1233 9514 : CALL keyword_release(keyword)
1234 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
1235 : description="append the cube files when they already exist", &
1236 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1237 9514 : CALL section_add_keyword(print_key, keyword)
1238 9514 : CALL keyword_release(keyword)
1239 :
1240 9514 : CALL section_add_subsection(subsection, print_key)
1241 9514 : CALL section_release(print_key)
1242 :
1243 9514 : CALL section_add_subsection(section, subsection)
1244 9514 : CALL section_release(subsection)
1245 :
1246 9514 : NULLIFY (subsection)
1247 9514 : CALL create_interp_section(subsection)
1248 9514 : CALL section_add_subsection(section, subsection)
1249 9514 : CALL section_release(subsection)
1250 :
1251 9514 : END SUBROUTINE create_epr_section
1252 :
1253 : ! **************************************************************************************************
1254 : !> \brief creates the input structure used to activate
1255 : !> calculation of polarizability tensor DFPT
1256 : !> Available properties : none
1257 : !> \param section the section to create
1258 : !> \author SL
1259 : ! **************************************************************************************************
1260 9514 : SUBROUTINE create_polarizability_section(section)
1261 :
1262 : TYPE(section_type), POINTER :: section
1263 :
1264 : TYPE(keyword_type), POINTER :: keyword
1265 : TYPE(section_type), POINTER :: print_key, subsection
1266 :
1267 9514 : NULLIFY (keyword, print_key, subsection)
1268 :
1269 9514 : CPASSERT(.NOT. ASSOCIATED(section))
1270 : CALL section_create(section, __LOCATION__, name="POLAR", &
1271 : description="Compute polarizabilities.", &
1272 : n_keywords=5, n_subsections=1, repeats=.FALSE., &
1273 19028 : citations=[Putrino2002])
1274 :
1275 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
1276 : description="controls the activation of the polarizability calculation", &
1277 : usage="&POLAR T", &
1278 : default_l_val=.FALSE., &
1279 9514 : lone_keyword_l_val=.TRUE.)
1280 9514 : CALL section_add_keyword(section, keyword)
1281 9514 : CALL keyword_release(keyword)
1282 :
1283 : CALL keyword_create(keyword, __LOCATION__, name="DO_RAMAN", &
1284 : description="Compute the electric-dipole--electric-dipole polarizability", &
1285 : usage="DO_RAMAN F", &
1286 : citations=[Luber2014], &
1287 19028 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1288 9514 : CALL section_add_keyword(section, keyword)
1289 9514 : CALL keyword_release(keyword)
1290 :
1291 : CALL keyword_create(keyword, __LOCATION__, name="PERIODIC_DIPOLE_OPERATOR", &
1292 : description="Type of dipole operator: Berry phase(T) or Local(F)", &
1293 : usage="PERIODIC_DIPOLE_OPERATOR T", &
1294 9514 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1295 9514 : CALL section_add_keyword(section, keyword)
1296 9514 : CALL keyword_release(keyword)
1297 :
1298 9514 : NULLIFY (subsection)
1299 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
1300 : description="print results of the polarizability calculation", &
1301 9514 : repeats=.FALSE.)
1302 :
1303 : CALL cp_print_key_section_create(print_key, __LOCATION__, "POLAR_MATRIX", &
1304 : description="Controls the printing of the polarizabilities", &
1305 9514 : print_level=low_print_level, add_last=add_last_numeric, filename="")
1306 :
1307 9514 : CALL section_add_subsection(subsection, print_key)
1308 9514 : CALL section_release(print_key)
1309 9514 : CALL section_add_subsection(section, subsection)
1310 9514 : CALL section_release(subsection)
1311 :
1312 9514 : NULLIFY (subsection)
1313 9514 : CALL create_interp_section(subsection)
1314 9514 : CALL section_add_subsection(section, subsection)
1315 9514 : CALL section_release(subsection)
1316 :
1317 9514 : END SUBROUTINE create_polarizability_section
1318 :
1319 : ! **************************************************************************************************
1320 : !> \brief creates the section for electron transfer coupling
1321 : !> \param section ...
1322 : !> \author fschiff
1323 : ! **************************************************************************************************
1324 9514 : SUBROUTINE create_et_coupling_section(section)
1325 : TYPE(section_type), POINTER :: section
1326 :
1327 : TYPE(keyword_type), POINTER :: keyword
1328 : TYPE(section_type), POINTER :: print_key, subsection
1329 :
1330 9514 : NULLIFY (keyword)
1331 9514 : CPASSERT(.NOT. ASSOCIATED(section))
1332 : CALL section_create(section, __LOCATION__, name="ET_COUPLING", &
1333 : description="specifies the two constraints/restraints for extracting ET coupling elements", &
1334 28542 : n_keywords=1, n_subsections=4, repeats=.FALSE., citations=[Kondov2007, Futera2017])
1335 :
1336 9514 : NULLIFY (subsection)
1337 9514 : CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT_A")
1338 9514 : CALL section_add_subsection(section, subsection)
1339 9514 : CALL section_release(subsection)
1340 :
1341 9514 : NULLIFY (subsection)
1342 9514 : CALL create_ddapc_restraint_section(subsection, "DDAPC_RESTRAINT_B")
1343 9514 : CALL section_add_subsection(section, subsection)
1344 9514 : CALL section_release(subsection)
1345 :
1346 9514 : NULLIFY (subsection)
1347 9514 : CALL create_projection(subsection, "PROJECTION")
1348 9514 : CALL section_add_subsection(section, subsection)
1349 9514 : CALL section_release(subsection)
1350 :
1351 : CALL keyword_create(keyword, __LOCATION__, name="TYPE_OF_CONSTRAINT", &
1352 : description="Specifies the type of constraint", &
1353 : usage="TYPE_OF_CONSTRAINT DDAPC", &
1354 : enum_c_vals=s2a("NONE", "DDAPC"), &
1355 : enum_i_vals=[do_no_et, do_et_ddapc], &
1356 : enum_desc=s2a("NONE", "DDAPC Constraint"), &
1357 9514 : default_i_val=do_no_et)
1358 9514 : CALL section_add_keyword(section, keyword)
1359 9514 : CALL keyword_release(keyword)
1360 :
1361 9514 : NULLIFY (print_key)
1362 : CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
1363 : description="Controls the printing basic info about the method", &
1364 9514 : print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
1365 9514 : CALL section_add_subsection(section, print_key)
1366 9514 : CALL section_release(print_key)
1367 :
1368 9514 : END SUBROUTINE create_et_coupling_section
1369 :
1370 : ! **************************************************************************************************
1371 : !> \brief defines input sections for specification of Hilbert space partitioning
1372 : !> in projection-operator approach of electronic coupling calulation
1373 : !> \param section pointer to the section data structure
1374 : !> \param section_name name of the projection section
1375 : !> \author Z. Futera (02.2017)
1376 : ! **************************************************************************************************
1377 9514 : SUBROUTINE create_projection(section, section_name)
1378 :
1379 : ! Routine arguments
1380 : TYPE(section_type), POINTER :: section
1381 : CHARACTER(len=*), INTENT(in) :: section_name
1382 :
1383 : TYPE(keyword_type), POINTER :: keyword
1384 : TYPE(section_type), POINTER :: print_key, section_block, section_print
1385 :
1386 : ! Routine name for dubug purposes
1387 :
1388 : ! Sanity check
1389 0 : CPASSERT(.NOT. ASSOCIATED(section))
1390 :
1391 : ! Initialization
1392 9514 : NULLIFY (keyword)
1393 9514 : NULLIFY (print_key)
1394 9514 : NULLIFY (section_block)
1395 9514 : NULLIFY (section_print)
1396 :
1397 : ! Input-file section definition
1398 : CALL section_create(section, __LOCATION__, name=TRIM(ADJUSTL(section_name)), &
1399 : description="Projection-operator approach fo ET coupling calculation", &
1400 9514 : n_keywords=0, n_subsections=2, repeats=.FALSE.)
1401 :
1402 : ! Subsection #0: Log printing
1403 : CALL cp_print_key_section_create(print_key, __LOCATION__, 'PROGRAM_RUN_INFO', &
1404 : description="Controls printing of data and informations to log file", &
1405 9514 : print_level=low_print_level, filename="__STD_OUT__")
1406 9514 : CALL section_add_subsection(section, print_key)
1407 9514 : CALL section_release(print_key)
1408 :
1409 : ! Subsection #1: Atomic blocks
1410 : CALL section_create(section_block, __LOCATION__, name='BLOCK', &
1411 : description="Part of the system (donor, acceptor, bridge,...)", &
1412 9514 : n_keywords=2, n_subsections=1, repeats=.TRUE.)
1413 9514 : CALL section_add_subsection(section, section_block)
1414 :
1415 : ! S#1 - Keyword #1: Atom IDs defining a Hilbert space block
1416 : CALL keyword_create(keyword, __LOCATION__, name='ATOMS', &
1417 : description="Array of atom IDs in the system part", &
1418 : usage="ATOMS {integer} {integer} .. {integer}", &
1419 9514 : n_var=-1, type_of_var=integer_t, repeats=.FALSE.)
1420 9514 : CALL section_add_keyword(section_block, keyword)
1421 9514 : CALL keyword_release(keyword)
1422 :
1423 : ! S#1 - Keyword #1: Atom IDs defining a Hilbert space block
1424 : CALL keyword_create(keyword, __LOCATION__, name='NELECTRON', &
1425 : description="Number of electrons expected in the system part", &
1426 9514 : usage="NELECTRON {integer}", default_i_val=0)
1427 9514 : CALL section_add_keyword(section_block, keyword)
1428 9514 : CALL keyword_release(keyword)
1429 :
1430 : ! S#1 - Subsection #1: Printing setting
1431 : CALL section_create(section_print, __LOCATION__, name='PRINT', &
1432 : description="Possible printing options in ET system part", &
1433 9514 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
1434 9514 : CALL section_add_subsection(section_block, section_print)
1435 :
1436 : ! S#1 - S#1 - Keyword #1: MO coefficient on specific atom
1437 : CALL keyword_create(keyword, __LOCATION__, name='MO_COEFF_ATOM', &
1438 : description="Print out MO coeffiecients on given atom", &
1439 : usage="MO_COEFF_ATOM {integer} {integer} .. {integer}", &
1440 9514 : type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
1441 9514 : CALL section_add_keyword(section_print, keyword)
1442 9514 : CALL keyword_release(keyword)
1443 :
1444 : ! S#1 - S#1 - Keyword #1: MO coefficient of specific state
1445 : CALL keyword_create(keyword, __LOCATION__, name='MO_COEFF_ATOM_STATE', &
1446 : description="Print out MO coeffiecients of specific state", &
1447 : usage="MO_COEFF_ATOM_STATE {integer} {integer} .. {integer}", &
1448 9514 : type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
1449 9514 : CALL section_add_keyword(section_print, keyword)
1450 9514 : CALL keyword_release(keyword)
1451 :
1452 : ! S#1 - S#1 - Subsection #1: Saving MOs to CUBE files
1453 : CALL cp_print_key_section_create(print_key, __LOCATION__, 'MO_CUBES', &
1454 : description="Controls saving of MO cube files", &
1455 9514 : print_level=high_print_level, filename="")
1456 :
1457 : ! S#1 - S#1 - S#1 - Keyword #1: Stride
1458 : CALL keyword_create(keyword, __LOCATION__, name='STRIDE', &
1459 : description="The stride (X,Y,Z) used to write the cube file", &
1460 : usage="STRIDE {integer} {integer} {integer}", n_var=-1, &
1461 9514 : default_i_vals=[2, 2, 2], type_of_var=integer_t)
1462 9514 : CALL section_add_keyword(print_key, keyword)
1463 9514 : CALL keyword_release(keyword)
1464 :
1465 : ! S#1 - S#1 - S#1 - Keyword #2: List of MO IDs
1466 : CALL keyword_create(keyword, __LOCATION__, name='MO_LIST', &
1467 : description="Indices of molecular orbitals to save", &
1468 : usage="MO_LIST {integer} {integer} .. {integer}", &
1469 9514 : type_of_var=integer_t, n_var=-1, repeats=.TRUE.)
1470 9514 : CALL section_add_keyword(print_key, keyword)
1471 9514 : CALL keyword_release(keyword)
1472 :
1473 : ! S#1 - S#1 - S#1 - Keyword #2: Number of unoccupied states
1474 : CALL keyword_create(keyword, __LOCATION__, name='NLUMO', &
1475 : description="Number of unoccupied molecular orbitals to save", &
1476 9514 : usage="NLUMO {integer}", default_i_val=1)
1477 9514 : CALL section_add_keyword(print_key, keyword)
1478 9514 : CALL keyword_release(keyword)
1479 :
1480 : ! S#1 - S#1 - S#1 - Keyword #3: Number of occupied states
1481 : CALL keyword_create(keyword, __LOCATION__, name='NHOMO', &
1482 : description="Number of occupied molecular orbitals to save", &
1483 9514 : usage="NHOMO {integer}", default_i_val=1)
1484 9514 : CALL section_add_keyword(print_key, keyword)
1485 9514 : CALL keyword_release(keyword)
1486 :
1487 9514 : CALL section_add_subsection(section_print, print_key)
1488 9514 : CALL section_release(print_key)
1489 :
1490 : ! S#1 - S#1 - Clean
1491 9514 : CALL section_release(section_print)
1492 :
1493 : ! S#1 - Clean
1494 9514 : CALL section_release(section_block)
1495 :
1496 : ! S#1 - Subsection #1: Printing setting
1497 : CALL section_create(section_print, __LOCATION__, name='PRINT', &
1498 : description="Possible printing options in ET", &
1499 9514 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
1500 9514 : CALL section_add_subsection(section, section_print)
1501 :
1502 : ! Print couplings
1503 : CALL cp_print_key_section_create(print_key, __LOCATION__, 'COUPLINGS', &
1504 : description="Controls printing couplings onto file", &
1505 9514 : print_level=low_print_level, filename="")
1506 :
1507 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
1508 : description="append the files when they already exist", &
1509 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1510 9514 : CALL section_add_keyword(print_key, keyword)
1511 9514 : CALL keyword_release(keyword)
1512 :
1513 9514 : CALL section_add_subsection(section_print, print_key)
1514 9514 : CALL section_release(print_key)
1515 :
1516 9514 : CALL section_release(section_print)
1517 :
1518 9514 : END SUBROUTINE create_projection
1519 :
1520 : ! **************************************************************************************************
1521 : !> \brief creates an input section for tddfpt calculation
1522 : !> \param section section to create
1523 : !> \par History
1524 : !> * 05.2016 forked from create_tddfpt_section [Sergey Chulkov]
1525 : !> * 08.2016 moved from module input_cp2k_dft [Sergey Chulkov]
1526 : ! **************************************************************************************************
1527 19028 : SUBROUTINE create_tddfpt2_section(section)
1528 : TYPE(section_type), POINTER :: section
1529 :
1530 : TYPE(keyword_type), POINTER :: keyword
1531 : TYPE(section_type), POINTER :: print_key, subsection
1532 :
1533 19028 : CPASSERT(.NOT. ASSOCIATED(section))
1534 : CALL section_create(section, __LOCATION__, name="TDDFPT", &
1535 : description="Parameters needed to set up the Time-Dependent "// &
1536 : "Density Functional Perturbation Theory. "// &
1537 : "Current implementation works for hybrid functionals. ", &
1538 : n_keywords=14, n_subsections=4, repeats=.FALSE., &
1539 38056 : citations=[Iannuzzi2005])
1540 :
1541 19028 : NULLIFY (keyword, print_key, subsection)
1542 :
1543 : CALL keyword_create(keyword, __LOCATION__, &
1544 : name="_SECTION_PARAMETERS_", &
1545 : description="Controls the activation of the TDDFPT procedure", &
1546 : default_l_val=.FALSE., &
1547 19028 : lone_keyword_l_val=.TRUE.)
1548 19028 : CALL section_add_keyword(section, keyword)
1549 19028 : CALL keyword_release(keyword)
1550 :
1551 : ! Integer
1552 : CALL keyword_create(keyword, __LOCATION__, name="NSTATES", &
1553 : description="Number of excited states to converge.", &
1554 : n_var=1, type_of_var=integer_t, &
1555 19028 : default_i_val=1)
1556 19028 : CALL section_add_keyword(section, keyword)
1557 19028 : CALL keyword_release(keyword)
1558 :
1559 : CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
1560 : description="Maximal number of iterations to be performed.", &
1561 : n_var=1, type_of_var=integer_t, &
1562 19028 : default_i_val=50)
1563 19028 : CALL section_add_keyword(section, keyword)
1564 19028 : CALL keyword_release(keyword)
1565 :
1566 : CALL keyword_create(keyword, __LOCATION__, name="MAX_KV", &
1567 : description="Maximal number of Krylov space vectors. "// &
1568 : "Davidson iterations will be restarted upon reaching this limit.", &
1569 : n_var=1, type_of_var=integer_t, &
1570 19028 : default_i_val=5000)
1571 19028 : CALL section_add_keyword(section, keyword)
1572 19028 : CALL keyword_release(keyword)
1573 :
1574 : CALL keyword_create(keyword, __LOCATION__, name="NLUMO", &
1575 : description="Number of unoccupied orbitals to consider. "// &
1576 : "Default is to use all unoccupied orbitals (-1).", &
1577 : n_var=1, type_of_var=integer_t, &
1578 19028 : default_i_val=-1)
1579 19028 : CALL section_add_keyword(section, keyword)
1580 19028 : CALL keyword_release(keyword)
1581 :
1582 : CALL keyword_create(keyword, __LOCATION__, name="NPROC_STATE", &
1583 : description="Number of MPI processes to be used per excited state. "// &
1584 : "Default is to use all processors (0).", &
1585 : n_var=1, type_of_var=integer_t, &
1586 19028 : default_i_val=0)
1587 19028 : CALL section_add_keyword(section, keyword)
1588 19028 : CALL keyword_release(keyword)
1589 :
1590 : ! kernel type
1591 : CALL keyword_create(keyword, __LOCATION__, name="KERNEL", &
1592 : description="Options to compute the kernel", &
1593 : usage="KERNEL FULL", &
1594 : enum_c_vals=s2a("FULL", "sTDA", "NONE"), &
1595 : enum_i_vals=[tddfpt_kernel_full, tddfpt_kernel_stda, tddfpt_kernel_none], &
1596 19028 : default_i_val=tddfpt_kernel_full)
1597 19028 : CALL section_add_keyword(section, keyword)
1598 19028 : CALL keyword_release(keyword)
1599 :
1600 : ! spin-flip TDDFPT options
1601 : CALL keyword_create(keyword, __LOCATION__, name="SPINFLIP", &
1602 : description="Selects the type of spin-flip TDDFPT kernel", &
1603 : usage="SPINFLIP NONCOLLINEAR", &
1604 : enum_c_vals=s2a("NONE", "COLLINEAR", "NONCOLLINEAR"), &
1605 : enum_i_vals=[no_sf_tddfpt, tddfpt_sf_col, tddfpt_sf_noncol], &
1606 38056 : default_i_val=no_sf_tddfpt, citations=[Hernandez2025])
1607 19028 : CALL section_add_keyword(section, keyword)
1608 19028 : CALL keyword_release(keyword)
1609 :
1610 : CALL keyword_create(keyword, __LOCATION__, name="OE_CORR", &
1611 : description="Orbital energy correction potential.", &
1612 : enum_c_vals=s2a("NONE", "LB94", "GLLB", "SAOP", "SHIFT"), &
1613 : enum_i_vals=[oe_none, oe_lb, oe_gllb, oe_saop, oe_shift], &
1614 : enum_desc=s2a("No orbital correction scheme is used", &
1615 : "van Leeuwen and Baerends. PRA, 49:2421, 1994", &
1616 : "Gritsenko, van Leeuwen, van Lenthe, Baerends. PRA, 51:1944, 1995", &
1617 : "Gritsenko, Schipper, Baerends. Chem. Phys. Lett., 302:199, 1999", &
1618 : "Constant shift of virtual and/or open-shell orbitals"), &
1619 19028 : default_i_val=oe_none)
1620 19028 : CALL section_add_keyword(section, keyword)
1621 19028 : CALL keyword_release(keyword)
1622 :
1623 : ! SHIFTS
1624 : CALL keyword_create(keyword, __LOCATION__, name="EV_SHIFT", &
1625 : variants=s2a("VIRTUAL_SHIFT"), &
1626 : description="Constant shift of virtual state eigenvalues.", &
1627 : usage="EV_SHIFT 0.500", &
1628 : n_var=1, type_of_var=real_t, &
1629 : unit_str="eV", &
1630 19028 : default_r_val=0.0_dp)
1631 19028 : CALL section_add_keyword(section, keyword)
1632 19028 : CALL keyword_release(keyword)
1633 : !
1634 : CALL keyword_create(keyword, __LOCATION__, name="EOS_SHIFT", &
1635 : variants=s2a("OPEN_SHELL_SHIFT"), &
1636 : description="Constant shift of open shell eigenvalues.", &
1637 : usage="EOS_SHIFT 0.200", &
1638 : n_var=1, type_of_var=real_t, &
1639 : unit_str="eV", &
1640 19028 : default_r_val=0.0_dp)
1641 19028 : CALL section_add_keyword(section, keyword)
1642 19028 : CALL keyword_release(keyword)
1643 :
1644 : ! Real
1645 : CALL keyword_create(keyword, __LOCATION__, name="CONVERGENCE", &
1646 : description="Target accuracy for excited state energies.", &
1647 : n_var=1, type_of_var=real_t, unit_str="hartree", &
1648 19028 : default_r_val=1.0e-5_dp)
1649 19028 : CALL section_add_keyword(section, keyword)
1650 19028 : CALL keyword_release(keyword)
1651 :
1652 : CALL keyword_create(keyword, __LOCATION__, name="MIN_AMPLITUDE", &
1653 : description="The smallest excitation amplitude to print.", &
1654 : n_var=1, type_of_var=real_t, &
1655 19028 : default_r_val=5.0e-2_dp)
1656 19028 : CALL section_add_keyword(section, keyword)
1657 19028 : CALL keyword_release(keyword)
1658 :
1659 : CALL keyword_create(keyword, __LOCATION__, name="ORTHOGONAL_EPS", &
1660 : description="The largest possible overlap between the ground state and "// &
1661 : "orthogonalised excited state wave-functions. Davidson iterations "// &
1662 : "will be restarted when the overlap goes beyond this threshold in "// &
1663 : "order to prevent numerical instability.", &
1664 : n_var=1, type_of_var=real_t, &
1665 19028 : default_r_val=1.0e-4_dp)
1666 19028 : CALL section_add_keyword(section, keyword)
1667 19028 : CALL keyword_release(keyword)
1668 :
1669 : ! Logical
1670 : CALL keyword_create(keyword, __LOCATION__, name="RESTART", &
1671 : description="Restart the TDDFPT calculation if a restart file exists", &
1672 : n_var=1, type_of_var=logical_t, &
1673 19028 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1674 19028 : CALL section_add_keyword(section, keyword)
1675 19028 : CALL keyword_release(keyword)
1676 :
1677 : CALL keyword_create(keyword, __LOCATION__, name="RKS_TRIPLETS", &
1678 : description="Compute triplet excited states using spin-unpolarised molecular orbitals.", &
1679 : n_var=1, type_of_var=logical_t, &
1680 19028 : default_l_val=.FALSE.)
1681 19028 : CALL section_add_keyword(section, keyword)
1682 19028 : CALL keyword_release(keyword)
1683 :
1684 : CALL keyword_create(keyword, __LOCATION__, name="ADMM_KERNEL_XC_CORRECTION", &
1685 : description="Use/Ignore ADMM correction xc functional for TD kernel. "// &
1686 : "XC correction functional is defined in ground state XC section.", &
1687 : n_var=1, type_of_var=logical_t, &
1688 19028 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1689 19028 : CALL section_add_keyword(section, keyword)
1690 19028 : CALL keyword_release(keyword)
1691 :
1692 : CALL keyword_create(keyword, __LOCATION__, name="ADMM_KERNEL_CORRECTION_SYMMETRIC", &
1693 : description="ADMM correction functional in kernel is applied symmetrically. "// &
1694 : "Original implementation is using a non-symmetric formula.", &
1695 : n_var=1, type_of_var=logical_t, &
1696 19028 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1697 19028 : CALL section_add_keyword(section, keyword)
1698 19028 : CALL keyword_release(keyword)
1699 :
1700 : CALL keyword_create(keyword, __LOCATION__, name="DO_LRIGPW", &
1701 : description="Local resolution of identity for Coulomb contribution.", &
1702 : n_var=1, type_of_var=logical_t, &
1703 19028 : default_l_val=.FALSE.)
1704 19028 : CALL section_add_keyword(section, keyword)
1705 19028 : CALL keyword_release(keyword)
1706 :
1707 : CALL keyword_create(keyword, __LOCATION__, name="AUTO_BASIS", &
1708 : description="Specify size of automatically generated auxiliary basis sets: "// &
1709 : "Options={small,medium,large,huge}", &
1710 : usage="AUTO_BASIS {basis_type} {basis_size}", &
1711 57084 : type_of_var=char_t, repeats=.TRUE., n_var=-1, default_c_vals=["X", "X"])
1712 19028 : CALL section_add_keyword(section, keyword)
1713 19028 : CALL keyword_release(keyword)
1714 :
1715 : CALL keyword_create(keyword, __LOCATION__, name="DO_SMEARING", &
1716 : description="Implying smeared occupation. ", &
1717 : n_var=1, type_of_var=logical_t, &
1718 19028 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1719 19028 : CALL section_add_keyword(section, keyword)
1720 19028 : CALL keyword_release(keyword)
1721 :
1722 : CALL keyword_create(keyword, __LOCATION__, name="EXCITON_DESCRIPTORS", &
1723 : description="Compute exciton descriptors. "// &
1724 : "Details given in Manual section about Bethe Salpeter equation.", &
1725 : n_var=1, type_of_var=logical_t, &
1726 19028 : default_l_val=.FALSE.)
1727 19028 : CALL section_add_keyword(section, keyword)
1728 19028 : CALL keyword_release(keyword)
1729 :
1730 : CALL keyword_create(keyword, __LOCATION__, name="DIRECTIONAL_EXCITON_DESCRIPTORS", &
1731 : description="Print cartesian components of exciton descriptors.", &
1732 : n_var=1, type_of_var=logical_t, &
1733 19028 : default_l_val=.FALSE.)
1734 19028 : CALL section_add_keyword(section, keyword)
1735 19028 : CALL keyword_release(keyword)
1736 :
1737 : ! Strings
1738 : CALL keyword_create(keyword, __LOCATION__, name="WFN_RESTART_FILE_NAME", &
1739 : variants=["RESTART_FILE_NAME"], &
1740 : description="Name of the wave function restart file, may include a path."// &
1741 : " If no file is specified, the default is to open the file as generated by"// &
1742 : " the wave function restart print key.", &
1743 : usage="WFN_RESTART_FILE_NAME <FILENAME>", &
1744 38056 : type_of_var=lchar_t)
1745 19028 : CALL section_add_keyword(section, keyword)
1746 19028 : CALL keyword_release(keyword)
1747 :
1748 : ! DIPOLE subsection
1749 : CALL section_create(subsection, __LOCATION__, name="DIPOLE_MOMENTS", &
1750 : description="Parameters to compute oscillator strengths in the dipole approximation.", &
1751 19028 : n_keywords=3, n_subsections=0, repeats=.FALSE.)
1752 :
1753 : CALL keyword_create(keyword, __LOCATION__, name="DIPOLE_FORM", &
1754 : description="Form of dipole transition integrals.", &
1755 : enum_c_vals=s2a("BERRY", "LENGTH", "VELOCITY"), &
1756 : enum_desc=s2a("Based on Berry phase formula (valid for fully periodic molecular systems only)", &
1757 : "Length form ⟨ i | r | j ⟩ (valid for non-periodic molecular systems only)", &
1758 : "Velocity form ⟨ i | d/dr | j ⟩"), &
1759 : enum_i_vals=[tddfpt_dipole_berry, tddfpt_dipole_length, tddfpt_dipole_velocity], &
1760 19028 : default_i_val=tddfpt_dipole_velocity)
1761 19028 : CALL section_add_keyword(subsection, keyword)
1762 19028 : CALL keyword_release(keyword)
1763 :
1764 : CALL keyword_create(keyword, __LOCATION__, name="REFERENCE", &
1765 : description="Reference point to calculate electric "// &
1766 : "dipole moments using the dipole integrals in the length form.", &
1767 : enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
1768 : enum_desc=s2a("Use Center of Mass", &
1769 : "Use Center of Atomic Charges", &
1770 : "Use User-defined Point", &
1771 : "Use Origin of Coordinate System"), &
1772 : enum_i_vals=[use_mom_ref_com, &
1773 : use_mom_ref_coac, &
1774 : use_mom_ref_user, &
1775 : use_mom_ref_zero], &
1776 19028 : default_i_val=use_mom_ref_com)
1777 19028 : CALL section_add_keyword(subsection, keyword)
1778 19028 : CALL keyword_release(keyword)
1779 :
1780 : CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
1781 : description="User-defined reference point.", &
1782 : usage="REFERENCE_POINT x y z", &
1783 19028 : repeats=.FALSE., n_var=3, type_of_var=real_t, unit_str='bohr')
1784 19028 : CALL section_add_keyword(subsection, keyword)
1785 19028 : CALL keyword_release(keyword)
1786 :
1787 19028 : CALL section_add_subsection(section, subsection)
1788 19028 : CALL section_release(subsection)
1789 :
1790 : ! SOC functional
1791 :
1792 : CALL section_create(subsection, __LOCATION__, name="SOC", &
1793 : description="Is jet to be implemented", &
1794 19028 : n_keywords=2, n_subsections=0, repeats=.FALSE.)
1795 :
1796 : CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
1797 : variants=s2a("EPS_FILTER_MATRIX"), &
1798 : description="The threshold used for sparse matrix operations", &
1799 : usage="EPS_FILTER {real}", &
1800 : type_of_var=real_t, &
1801 19028 : default_r_val=1.0E-10_dp)
1802 19028 : CALL section_add_keyword(subsection, keyword)
1803 19028 : CALL keyword_release(keyword)
1804 :
1805 : CALL keyword_create(keyword, __LOCATION__, name="GRID", &
1806 : variants=["ATOMIC_GRID"], &
1807 : description="Specification of the atomic angular and radial grids for "// &
1808 : "a atomic kind. This keyword must be repeated for all kinds! "// &
1809 : "Usage: GRID < LEBEDEV_GRID > < RADIAL_GRID >", &
1810 : usage="GRID {string} {integer} {integer}", &
1811 38056 : n_var=3, type_of_var=char_t, repeats=.TRUE.)
1812 19028 : CALL section_add_keyword(subsection, keyword)
1813 19028 : CALL keyword_release(keyword)
1814 :
1815 19028 : CALL section_add_subsection(section, subsection)
1816 19028 : CALL section_release(subsection)
1817 :
1818 : ! kernel XC functional
1819 19028 : CALL create_xc_section(subsection)
1820 19028 : CALL section_add_subsection(section, subsection)
1821 19028 : CALL section_release(subsection)
1822 :
1823 : ! MGRID subsection
1824 19028 : CALL create_mgrid_section(subsection, create_subsections=.FALSE.)
1825 19028 : CALL section_add_subsection(section, subsection)
1826 19028 : CALL section_release(subsection)
1827 :
1828 : ! sTDA subsection
1829 19028 : CALL create_stda_section(subsection)
1830 19028 : CALL section_add_subsection(section, subsection)
1831 19028 : CALL section_release(subsection)
1832 :
1833 : ! RSE subsection
1834 19028 : CALL create_res_section(subsection)
1835 19028 : CALL section_add_subsection(section, subsection)
1836 19028 : CALL section_release(subsection)
1837 :
1838 : CALL keyword_create(keyword, __LOCATION__, name="DO_BSE", &
1839 : description="Choosing BSE kernel.", &
1840 19028 : usage="DO_BSE", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1841 19028 : CALL section_add_keyword(section, keyword)
1842 19028 : CALL keyword_release(keyword)
1843 :
1844 : ! LRI subsection
1845 19028 : CALL create_lrigpw_section(subsection)
1846 19028 : CALL section_add_subsection(section, subsection)
1847 19028 : CALL section_release(subsection)
1848 :
1849 : ! LINRES section
1850 19028 : CALL create_linres_section(subsection, create_subsections=.FALSE., default_set_tdlr=.TRUE.)
1851 19028 : CALL section_add_subsection(section, subsection)
1852 19028 : CALL section_release(subsection)
1853 :
1854 : ! PRINT subsection
1855 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
1856 19028 : description="Printing of information during the TDDFT run.", repeats=.FALSE.)
1857 :
1858 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="PROGRAM_BANNER", &
1859 : description="Controls the printing of the banner for TDDFPT program", &
1860 19028 : print_level=silent_print_level, filename="__STD_OUT__")
1861 19028 : CALL section_add_subsection(subsection, print_key)
1862 19028 : CALL section_release(print_key)
1863 :
1864 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="GUESS_VECTORS", &
1865 : description="Controls the printing of initial guess vectors.", &
1866 19028 : print_level=low_print_level, filename="__STD_OUT__")
1867 19028 : CALL section_add_subsection(subsection, print_key)
1868 19028 : CALL section_release(print_key)
1869 :
1870 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="ITERATION_INFO", &
1871 : description="Controls the printing of basic iteration information "// &
1872 : "during the TDDFT run.", &
1873 19028 : print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
1874 19028 : CALL section_add_subsection(subsection, print_key)
1875 19028 : CALL section_release(print_key)
1876 :
1877 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="DETAILED_ENERGY", &
1878 : description="Controls the printing of detailed energy information "// &
1879 : "during the TDDFT run.", &
1880 19028 : print_level=medium_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
1881 19028 : CALL section_add_subsection(subsection, print_key)
1882 19028 : CALL section_release(print_key)
1883 :
1884 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="BASIS_SET_FILE", &
1885 : description="Controls the printing of a file with all basis sets used.", &
1886 19028 : print_level=debug_print_level, filename="BASIS_SETS")
1887 19028 : CALL section_add_subsection(subsection, print_key)
1888 19028 : CALL section_release(print_key)
1889 :
1890 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="RESTART", &
1891 : description="Controls the dumping of the MO restart file during TDDFPT. "// &
1892 : "By default keeps a short history of three restarts.", &
1893 : print_level=low_print_level, common_iter_levels=3, &
1894 : each_iter_names=s2a("TDDFT_SCF"), each_iter_values=[10], &
1895 19028 : add_last=add_last_numeric, filename="RESTART")
1896 : CALL keyword_create(keyword, __LOCATION__, name="BACKUP_COPIES", &
1897 : description="Specifies the maximum number of backup copies.", &
1898 : usage="BACKUP_COPIES {int}", &
1899 19028 : default_i_val=1)
1900 19028 : CALL section_add_keyword(print_key, keyword)
1901 19028 : CALL keyword_release(keyword)
1902 19028 : CALL section_add_subsection(subsection, print_key)
1903 19028 : CALL section_release(print_key)
1904 :
1905 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="NTO_ANALYSIS", &
1906 : description="Perform a natural transition orbital analysis.", &
1907 19028 : print_level=medium_print_level)
1908 : CALL keyword_create(keyword, __LOCATION__, name="THRESHOLD", &
1909 : description="Threshold for sum of NTO eigenvalues considered", &
1910 : usage="Threshold 0.95", &
1911 : n_var=1, &
1912 : type_of_var=real_t, &
1913 19028 : default_r_val=0.975_dp)
1914 19028 : CALL section_add_keyword(print_key, keyword)
1915 19028 : CALL keyword_release(keyword)
1916 : CALL keyword_create(keyword, __LOCATION__, name="INTENSITY_THRESHOLD", &
1917 : description="Threshold for oscillator strength to screen states.", &
1918 : usage="Intensity_threshold 0.01", &
1919 : n_var=1, &
1920 : type_of_var=real_t, &
1921 19028 : default_r_val=0.0_dp)
1922 19028 : CALL section_add_keyword(print_key, keyword)
1923 19028 : CALL keyword_release(keyword)
1924 : CALL keyword_create(keyword, __LOCATION__, name="STATE_LIST", &
1925 : description="Specifies a list of states for the NTO calculations.", &
1926 : usage="STATE_LIST {integer} {integer} .. {integer}", &
1927 19028 : n_var=-1, type_of_var=integer_t)
1928 19028 : CALL section_add_keyword(print_key, keyword)
1929 19028 : CALL keyword_release(keyword)
1930 : CALL keyword_create(keyword, __LOCATION__, name="CUBE_FILES", &
1931 : description="Print NTOs on Cube Files", &
1932 : usage="CUBE_FILES {logical}", repeats=.FALSE., n_var=1, &
1933 19028 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE., type_of_var=logical_t)
1934 19028 : CALL section_add_keyword(print_key, keyword)
1935 19028 : CALL keyword_release(keyword)
1936 : CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
1937 : description="The stride (X,Y,Z) used to write the cube file "// &
1938 : "(larger values result in smaller cube files). Provide 3 numbers (for X,Y,Z) or"// &
1939 : " 1 number valid for all components.", &
1940 19028 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
1941 19028 : CALL section_add_keyword(print_key, keyword)
1942 19028 : CALL keyword_release(keyword)
1943 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
1944 : description="append the cube files when they already exist", &
1945 19028 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1946 19028 : CALL section_add_keyword(print_key, keyword)
1947 19028 : CALL keyword_release(keyword)
1948 19028 : CALL section_add_subsection(subsection, print_key)
1949 19028 : CALL section_release(print_key)
1950 :
1951 : CALL cp_print_key_section_create(print_key, __LOCATION__, "MOS_MOLDEN", &
1952 : description="Write the NTO in Molden file format, for visualisation.", &
1953 19028 : print_level=debug_print_level + 1, add_last=add_last_numeric, filename="MOS")
1954 : CALL keyword_create(keyword, __LOCATION__, name="NDIGITS", &
1955 : description="Specifies the number of significant digits retained. 3 is OK for visualization.", &
1956 : usage="NDIGITS {int}", &
1957 19028 : default_i_val=3)
1958 19028 : CALL section_add_keyword(print_key, keyword)
1959 19028 : CALL keyword_release(keyword)
1960 : CALL keyword_create(keyword, __LOCATION__, name="GTO_KIND", &
1961 : description="Representation of Gaussian-type orbitals", &
1962 : default_i_val=gto_spherical, &
1963 : enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
1964 : enum_desc=s2a( &
1965 : "Cartesian Gaussian orbitals. Use with caution", &
1966 : "Spherical Gaussian orbitals. Incompatible with VMD"), &
1967 19028 : enum_i_vals=[gto_cartesian, gto_spherical])
1968 19028 : CALL section_add_keyword(print_key, keyword)
1969 19028 : CALL keyword_release(keyword)
1970 19028 : CALL section_add_subsection(subsection, print_key)
1971 19028 : CALL section_release(print_key)
1972 :
1973 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="NAMD_PRINT", &
1974 : description="Controls the printout required for NAMD with NEWTONX.", &
1975 19028 : print_level=debug_print_level + 1, filename="CP2K_NEWTONX")
1976 : CALL keyword_create(keyword, __LOCATION__, name="PRINT_VIRTUALS", &
1977 : description="Print occupied AND virtual molecular orbital coefficients", &
1978 19028 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1979 19028 : CALL section_add_keyword(print_key, keyword)
1980 19028 : CALL keyword_release(keyword)
1981 : CALL keyword_create(keyword, __LOCATION__, name="PRINT_PHASES", &
1982 : description="Print phases of occupied and virtuals MOs.", &
1983 19028 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1984 19028 : CALL section_add_keyword(print_key, keyword)
1985 19028 : CALL keyword_release(keyword)
1986 : CALL keyword_create(keyword, __LOCATION__, name="SCALE_WITH_PHASES", &
1987 : description="Scale ES eigenvectors with phases of occupied and virtuals MOs.", &
1988 19028 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1989 19028 : CALL section_add_keyword(print_key, keyword)
1990 19028 : CALL keyword_release(keyword)
1991 19028 : CALL section_add_subsection(subsection, print_key)
1992 19028 : CALL section_release(print_key)
1993 :
1994 : !! SOC PRINT SECTION
1995 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="SOC_PRINT", &
1996 : description="Controls the printout of the tddfpt2_soc modul", &
1997 19028 : print_level=debug_print_level + 1, filename="SOC")
1998 : CALL keyword_create(keyword, __LOCATION__, name="UNIT_eV", &
1999 : description="Will detrement if output in eVolt will be printef.", &
2000 19028 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
2001 19028 : CALL section_add_keyword(print_key, keyword)
2002 19028 : CALL keyword_release(keyword)
2003 : CALL keyword_create(keyword, __LOCATION__, name="UNIT_wn", &
2004 : description="Will detrement if output in wavenumbers will be printed.", &
2005 19028 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2006 19028 : CALL section_add_keyword(print_key, keyword)
2007 19028 : CALL keyword_release(keyword)
2008 : CALL keyword_create(keyword, __LOCATION__, name="SPLITTING", &
2009 : description="Will add the SOC-Splitting as additional output", &
2010 19028 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2011 19028 : CALL section_add_keyword(print_key, keyword)
2012 19028 : CALL keyword_release(keyword)
2013 : CALL keyword_create(keyword, __LOCATION__, name="SOME", &
2014 : description="Will add the SOC-Matrix as additional output in a different file", &
2015 19028 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2016 19028 : CALL section_add_keyword(print_key, keyword)
2017 19028 : CALL keyword_release(keyword)
2018 19028 : CALL section_add_subsection(subsection, print_key)
2019 19028 : CALL section_release(print_key)
2020 :
2021 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="FORCES", &
2022 : description="Controls the calculation and printing of excited state forces. "// &
2023 : "This needs a RUN_TYPE that includes force evaluation, e.g. ENERGY_FORCE", &
2024 19028 : print_level=debug_print_level, filename="TDFORCE")
2025 : CALL keyword_create(keyword, __LOCATION__, name="LIST", &
2026 : description="Specifies a list of states for the force calculations.", &
2027 : usage="LIST {integer} {integer} .. {integer}", repeats=.TRUE., &
2028 19028 : n_var=-1, type_of_var=integer_t)
2029 19028 : CALL section_add_keyword(print_key, keyword)
2030 19028 : CALL keyword_release(keyword)
2031 : CALL keyword_create(keyword, __LOCATION__, name="THRESHOLD", &
2032 : description="Threshold for oszillator strength to screen states.", &
2033 : usage="Threshold 0.01", &
2034 : n_var=1, &
2035 : type_of_var=real_t, &
2036 19028 : default_r_val=0.0_dp)
2037 19028 : CALL section_add_keyword(print_key, keyword)
2038 19028 : CALL keyword_release(keyword)
2039 19028 : CALL section_add_subsection(subsection, print_key)
2040 19028 : CALL section_release(print_key)
2041 :
2042 19028 : CALL section_add_subsection(section, subsection)
2043 19028 : CALL section_release(subsection)
2044 :
2045 19028 : END SUBROUTINE create_tddfpt2_section
2046 :
2047 : ! **************************************************************************************************
2048 : !> \brief creates the stda input section (simplified Tamm Dancoff Approximation)
2049 : !> \param section the section to create
2050 : ! **************************************************************************************************
2051 19028 : SUBROUTINE create_stda_section(section)
2052 : TYPE(section_type), POINTER :: section
2053 :
2054 : TYPE(keyword_type), POINTER :: keyword
2055 :
2056 19028 : CPASSERT(.NOT. ASSOCIATED(section))
2057 : CALL section_create(section, __LOCATION__, name="sTDA", &
2058 : description="parameters needed and setup for sTDA calculations", &
2059 19028 : n_keywords=3, n_subsections=0, repeats=.FALSE.)
2060 19028 : NULLIFY (keyword)
2061 :
2062 : CALL keyword_create(keyword, __LOCATION__, name="FRACTION", &
2063 : variants=["HFX_FRACTION"], &
2064 : description="The fraction of TB Hartree-Fock exchange to use in the Kernel. "// &
2065 : "0.0 implies no HFX part is used in the kernel. ", &
2066 38056 : usage="FRACTION 0.0", default_r_val=0.0_dp)
2067 19028 : CALL section_add_keyword(section, keyword)
2068 19028 : CALL keyword_release(keyword)
2069 :
2070 : ! even if scaling parameter for exchange FRACTION (see above) is zero, the semi-empirical electron repulsion
2071 : ! operator for exchange is not, so that a keyword is required to switch off sTDA exchange (if wanted)
2072 : CALL keyword_create(keyword, __LOCATION__, name="DO_EXCHANGE", &
2073 : description="Explicitly including or switching off sTDA exchange", &
2074 19028 : usage="DO_EXCHANGE", default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
2075 19028 : CALL section_add_keyword(section, keyword)
2076 19028 : CALL keyword_release(keyword)
2077 :
2078 : CALL keyword_create(keyword, __LOCATION__, name="DO_EWALD", &
2079 : description="Use Ewald type method for Coulomb interaction", &
2080 19028 : usage="DO_EWALD", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2081 19028 : CALL section_add_keyword(section, keyword)
2082 19028 : CALL keyword_release(keyword)
2083 :
2084 : CALL keyword_create(keyword, __LOCATION__, name="EPS_TD_FILTER", &
2085 : description="Threshold for filtering the transition density matrix", &
2086 19028 : usage="EPS_TD_FILTER epsf", default_r_val=1.e-10_dp)
2087 19028 : CALL section_add_keyword(section, keyword)
2088 19028 : CALL keyword_release(keyword)
2089 :
2090 : CALL keyword_create(keyword, __LOCATION__, name="MATAGA_NISHIMOTO_CEXP", &
2091 : description="Exponent used in Mataga-Nishimoto formula for Coulomb (alpha). "// &
2092 : "Default value is method dependent!", &
2093 19028 : usage="MATAGA_NISHIMOTO_CEXP cexp", default_r_val=-99.0_dp)
2094 19028 : CALL section_add_keyword(section, keyword)
2095 19028 : CALL keyword_release(keyword)
2096 :
2097 : CALL keyword_create(keyword, __LOCATION__, name="MATAGA_NISHIMOTO_XEXP", &
2098 : description="Exponent used in Mataga-Nishimoto formula for Exchange (beta). "// &
2099 : "Default value is method dependent!", &
2100 19028 : usage="MATAGA_NISHIMOTO_XEXP xexp", default_r_val=-99.0_dp)
2101 19028 : CALL section_add_keyword(section, keyword)
2102 19028 : CALL keyword_release(keyword)
2103 :
2104 : CALL keyword_create(keyword, __LOCATION__, name="COULOMB_SR_CUT", &
2105 : description="Maximum range of short range part of Coulomb interaction.", &
2106 19028 : usage="COULOMB_SR_CUT rcut", default_r_val=20.0_dp)
2107 19028 : CALL section_add_keyword(section, keyword)
2108 19028 : CALL keyword_release(keyword)
2109 :
2110 : CALL keyword_create(keyword, __LOCATION__, name="COULOMB_SR_EPS", &
2111 : description="Threshold for short range part of Coulomb interaction.", &
2112 19028 : usage="COULOMB_SR_EPS sreps", default_r_val=1.e-03_dp)
2113 19028 : CALL section_add_keyword(section, keyword)
2114 19028 : CALL keyword_release(keyword)
2115 :
2116 19028 : END SUBROUTINE create_stda_section
2117 :
2118 : ! **************************************************************************************************
2119 : !> \brief creates the RES input section (Reduced Excitation Space)
2120 : !> \param section the section to create
2121 : ! **************************************************************************************************
2122 19028 : SUBROUTINE create_res_section(section)
2123 : TYPE(section_type), POINTER :: section
2124 :
2125 : TYPE(keyword_type), POINTER :: keyword
2126 :
2127 19028 : CPASSERT(.NOT. ASSOCIATED(section))
2128 : CALL section_create(section, __LOCATION__, name="REDUCED_EXCITATION_SPACE", &
2129 : description="Sets up a restricted (reduced) excitation space for TDDFT", &
2130 19028 : n_keywords=3, n_subsections=0, repeats=.FALSE.)
2131 :
2132 19028 : NULLIFY (keyword)
2133 : CALL keyword_create(keyword, __LOCATION__, &
2134 : name="_SECTION_PARAMETERS_", &
2135 : description="Controls the activation of RES calculation.", &
2136 : default_l_val=.FALSE., &
2137 19028 : lone_keyword_l_val=.TRUE.)
2138 19028 : CALL section_add_keyword(section, keyword)
2139 19028 : CALL keyword_release(keyword)
2140 :
2141 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_WINDOW", &
2142 : description="Upper and lower cutoffs [eV] for orbitals to be included for excitations. ", &
2143 : usage="ENERGY_WINDOW -5.0 0.0", default_r_vals=[-1.0E10_dp, 1.0E10_dp], &
2144 19028 : type_of_var=real_t, unit_str="eV")
2145 19028 : CALL section_add_keyword(section, keyword)
2146 19028 : CALL keyword_release(keyword)
2147 :
2148 : CALL keyword_create(keyword, __LOCATION__, name="UPPER_ENERGY_CUTOFF", &
2149 : description="Upper energy cutoff [eV] for orbitals to be included in excitations.", &
2150 : usage="UPPER_ENERGY_CUTOFF -5.0", default_r_val=1.0E10_dp, &
2151 19028 : type_of_var=real_t, unit_str="eV")
2152 19028 : CALL section_add_keyword(section, keyword)
2153 19028 : CALL keyword_release(keyword)
2154 :
2155 : CALL keyword_create(keyword, __LOCATION__, name="LOWER_ENERGY_CUTOFF", &
2156 : description="Lower energy cutoff [eV] for orbitals to be included in excitations.", &
2157 : usage="LOWER_ENERGY_CUTOFF -5.0", default_r_val=-1.0E10_dp, &
2158 19028 : type_of_var=real_t, unit_str="eV")
2159 19028 : CALL section_add_keyword(section, keyword)
2160 19028 : CALL keyword_release(keyword)
2161 :
2162 : CALL keyword_create(keyword, __LOCATION__, name="MOLECULE_LIST", &
2163 : description="Indices of molecules to be excited. "// &
2164 : "This implies the calculation of molecular states through orbital location "// &
2165 : "and subspace diagonalization.", &
2166 : usage="MOLECULE_LIST {integer} {integer} .. {integer} ", &
2167 19028 : n_var=-1, type_of_var=integer_t, repeats=.FALSE.)
2168 19028 : CALL section_add_keyword(section, keyword)
2169 19028 : CALL keyword_release(keyword)
2170 :
2171 19028 : END SUBROUTINE create_res_section
2172 :
2173 : ! **************************************************************************************************
2174 : !> \brief creates an input section for electronic band structure calculations
2175 : !> \param section section to create
2176 : !> \par History
2177 : !> * 07.2023 created [Jan Wilhelm]
2178 : ! **************************************************************************************************
2179 9514 : SUBROUTINE create_bandstructure_section(section)
2180 : TYPE(section_type), POINTER :: section
2181 :
2182 : TYPE(keyword_type), POINTER :: keyword
2183 : TYPE(section_type), POINTER :: subsection
2184 :
2185 9514 : CPASSERT(.NOT. ASSOCIATED(section))
2186 : CALL section_create(section, __LOCATION__, name="BANDSTRUCTURE", &
2187 : description="Parameters needed to set up a calculation for "// &
2188 : "electronic level energies of molecules and the electronic band "// &
2189 : "structure of materials from post-SCF schemes (GW, perturbative "// &
2190 : "spin-orbit coupling). Also, the density of states (DOS), "// &
2191 : "projected density of states (PDOS), local density of states (LDOS), "// &
2192 : "local valence band maximum (LVBM), local conduction band minimum "// &
2193 : "(LCBM) and local band gap can be calculated. Please note that "// &
2194 : "all methods in this section start from a Gamma-only DFT SCF. "// &
2195 : "You need to make sure that the cell chosen in the DFT SCF is "// &
2196 : "converged in the cell size. Band structures are computed "// &
2197 : "for the primitive cell (i.e. the smallest possible unit cell of "// &
2198 : "the input structure which is detected automatically). Moreover, "// &
2199 : "spin-orbit coupling (SOC) on eigenvalues and band structures is "// &
2200 : "available using Hartwigsen-Goedecker-Hutter "// &
2201 : "pseudopotentials.", &
2202 9514 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
2203 :
2204 9514 : NULLIFY (keyword, subsection)
2205 : CALL keyword_create(keyword, __LOCATION__, &
2206 : name="_SECTION_PARAMETERS_", &
2207 : description="Controls the activation of the band structure calculation.", &
2208 : default_l_val=.FALSE., &
2209 9514 : lone_keyword_l_val=.TRUE.)
2210 9514 : CALL section_add_keyword(section, keyword)
2211 9514 : CALL keyword_release(keyword)
2212 :
2213 : ! here we generate a subsection for getting a k-point path for the bandstructure
2214 9514 : CALL create_kpoint_set_section(subsection, "BANDSTRUCTURE_PATH")
2215 9514 : CALL section_add_subsection(section, subsection)
2216 9514 : CALL section_release(subsection)
2217 :
2218 9514 : CALL create_gw_section(subsection)
2219 9514 : CALL section_add_subsection(section, subsection)
2220 9514 : CALL section_release(subsection)
2221 :
2222 9514 : CALL create_soc_section(subsection)
2223 9514 : CALL section_add_subsection(section, subsection)
2224 9514 : CALL section_release(subsection)
2225 :
2226 9514 : CALL create_dos_section(subsection)
2227 9514 : CALL section_add_subsection(section, subsection)
2228 9514 : CALL section_release(subsection)
2229 :
2230 9514 : END SUBROUTINE create_bandstructure_section
2231 :
2232 : ! **************************************************************************************************
2233 : !> \brief creates an input section for a GW calculation for the electronic band structure
2234 : !> \param section section to create
2235 : !> \par History
2236 : !> * 07.2023 created [Jan Wilhelm]
2237 : ! **************************************************************************************************
2238 9514 : SUBROUTINE create_gw_section(section)
2239 : TYPE(section_type), POINTER :: section
2240 :
2241 : TYPE(keyword_type), POINTER :: keyword
2242 : TYPE(section_type), POINTER :: print_key, subsection
2243 :
2244 9514 : CPASSERT(.NOT. ASSOCIATED(section))
2245 : CALL section_create(section, __LOCATION__, name="GW", &
2246 : description="Parameters needed to set up a GW calculation for "// &
2247 : "electronic level energies $\varepsilon_{n\mathbf{k}}^{G_0W_0}$ "// &
2248 : "of molecules and the band structure of materials: "// &
2249 : "$\varepsilon_{n\mathbf{k}}^{G_0W_0}= "// &
2250 : "\varepsilon_{n\mathbf{k}}^\text{DFT}+\Sigma_{n\mathbf{k}} "// &
2251 : "-v^\text{xc}_{n\mathbf{k}}$. "// &
2252 : "For the GW algorithm for molecules, see "// &
2253 : "<https://doi.org/10.1021/acs.jctc.0c01282>. "// &
2254 : "For 2D materials, see <https://doi.org/10.1021/acs.jctc.3c01230>.", &
2255 9514 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
2256 :
2257 9514 : NULLIFY (keyword)
2258 : CALL keyword_create(keyword, __LOCATION__, &
2259 : name="_SECTION_PARAMETERS_", &
2260 : description="Controls the activation of the GW calculation.", &
2261 : default_l_val=.FALSE., &
2262 9514 : lone_keyword_l_val=.TRUE.)
2263 9514 : CALL section_add_keyword(section, keyword)
2264 9514 : CALL keyword_release(keyword)
2265 :
2266 : CALL keyword_create(keyword, __LOCATION__, name="NUM_TIME_FREQ_POINTS", &
2267 : description="Number of discrete points for the imaginary-time "// &
2268 : "grid and the imaginary-frequency grid. The more points, the more "// &
2269 : "precise is the calculation. Typically, 10 points are good "// &
2270 : "for 0.1 eV precision of band structures and molecular energy "// &
2271 : "levels, 20 points for 0.03 eV precision, "// &
2272 : "and 30 points for 0.01 eV precision, see Table I in "// &
2273 : "<https://doi.org/10.1021/acs.jctc.0c01282>. GW computation time "// &
2274 : "increases linearly with `NUM_TIME_FREQ_POINTS`.", &
2275 : usage="NUM_TIME_FREQ_POINTS 30", &
2276 9514 : default_i_val=30)
2277 9514 : CALL section_add_keyword(section, keyword)
2278 9514 : CALL keyword_release(keyword)
2279 :
2280 : CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
2281 : description="Determines a threshold for the DBCSR based sparse "// &
2282 : "multiplications. Normally, `EPS_FILTER` determines accuracy "// &
2283 : "and timing of low-scaling GW calculations. (Lower filter means "// &
2284 : "higher numerical precision, but higher computational cost.)", &
2285 : usage="EPS_FILTER 1.0E-6", &
2286 9514 : default_r_val=1.0E-8_dp)
2287 9514 : CALL section_add_keyword(section, keyword)
2288 9514 : CALL keyword_release(keyword)
2289 :
2290 : CALL keyword_create(keyword, __LOCATION__, name="REGULARIZATION_MINIMAX", &
2291 : description="Parameter to regularize the Fourier transformation with minimax grids. "// &
2292 : "In case the parameter 0.0 is chosen, no regularization is performed.", &
2293 : usage="REGULARIZATION_MINIMAX 1.0E-4", &
2294 9514 : default_r_val=-1.0_dp)
2295 9514 : CALL section_add_keyword(section, keyword)
2296 9514 : CALL keyword_release(keyword)
2297 :
2298 : CALL keyword_create(keyword, __LOCATION__, name="REGULARIZATION_RI", &
2299 : description="Parameter for RI regularization, setting a negative "// &
2300 : "value triggers the default value. Affects RI basis set convergence "// &
2301 : "but in any case large RI basis will give RI basis set convergence.", &
2302 : usage="REGULARIZATION_RI 1.0E-4", &
2303 9514 : default_r_val=-1.0_dp)
2304 9514 : CALL section_add_keyword(section, keyword)
2305 9514 : CALL keyword_release(keyword)
2306 :
2307 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS_RI", &
2308 : description="The cutoff radius (in Angstrom) for the truncated "// &
2309 : "Coulomb operator. The larger the cutoff radius, the faster "// &
2310 : "converges the resolution of the identity (RI) with respect to the "// &
2311 : "RI basis set size. Larger cutoff radius means higher computational "// &
2312 : "cost.", &
2313 : usage="CUTOFF_RADIUS_RI 3.0", &
2314 : default_r_val=cp_unit_to_cp2k(value=3.0_dp, unit_str="angstrom"), &
2315 9514 : type_of_var=real_t, unit_str="angstrom")
2316 9514 : CALL section_add_keyword(section, keyword)
2317 9514 : CALL keyword_release(keyword)
2318 :
2319 : CALL keyword_create(keyword, __LOCATION__, name="MEMORY_PER_PROC", &
2320 : description="Specify the available memory per MPI process. Set "// &
2321 : "`MEMORY_PER_PROC` as accurately as possible for good performance. If "// &
2322 : "`MEMORY_PER_PROC` is set lower as the actually available "// &
2323 : "memory per MPI process, the performance will be "// &
2324 : "bad; if `MEMORY_PER_PROC` is set higher as the actually "// &
2325 : "available memory per MPI process, the program might run out of "// &
2326 : "memory. You can calculate `MEMORY_PER_PROC` as follows: "// &
2327 : "Get the memory per node on your machine, mem_per_node "// &
2328 : "(for example, from a supercomputer website, typically between "// &
2329 : "100 GB and 2 TB), get the number of "// &
2330 : "MPI processes per node, n_MPI_proc_per_node"// &
2331 : " (for example from your run-script; if you "// &
2332 : "use slurm, the number behind '--ntasks-per-node' is the number "// &
2333 : "of MPI processes per node). Then calculate "// &
2334 : "`MEMORY_PER_PROC` = mem_per_node / n_MPI_proc_per_node "// &
2335 : "(typically between 2 GB and 50 GB). Unit of keyword: Gigabyte (GB).", &
2336 : usage="MEMORY_PER_PROC 16", &
2337 9514 : default_r_val=2.0_dp)
2338 9514 : CALL section_add_keyword(section, keyword)
2339 9514 : CALL keyword_release(keyword)
2340 :
2341 : CALL keyword_create(keyword, __LOCATION__, name="APPROX_KP_EXTRAPOL", &
2342 : description="If true, use only a 4x4 kpoint mesh for frequency "// &
2343 : "points $\omega_j, j \ge 2$ (instead of a 4x4 and 6x6 k-point mesh). "// &
2344 : "The k-point extrapolation of $W_{PQ}(i\omega_j,\mathbf{q})$ "// &
2345 : "is done approximately from $W_{PQ}(i\omega_1,\mathbf{q})$.", &
2346 : usage="APPROX_KP_EXTRAPOL", &
2347 9514 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
2348 9514 : CALL section_add_keyword(section, keyword)
2349 9514 : CALL keyword_release(keyword)
2350 :
2351 : CALL keyword_create(keyword, __LOCATION__, name="SIZE_LATTICE_SUM", &
2352 : description="Parameter determines how many neighbor cells $\mathbf{R}$ "// &
2353 : "are used for computing "// &
2354 : "$V_{PQ}(\mathbf{k}) = "// &
2355 : "\sum_{\mathbf{R}} e^{i\mathbf{k}\cdot\mathbf{R}}\,\langle P, "// &
2356 : "\text{cell}{=}\mathbf{0}|1/r|Q,\text{cell}{=}\mathbf{R}\rangle$. "// &
2357 : "Normally, parameter does not need to be touched.", &
2358 : usage="SIZE_LATTICE_SUM 4", &
2359 9514 : default_i_val=3)
2360 9514 : CALL section_add_keyword(section, keyword)
2361 9514 : CALL keyword_release(keyword)
2362 :
2363 : CALL keyword_create( &
2364 : keyword, __LOCATION__, name="KPOINTS_W", &
2365 : description="Monkhorst-Pack k-point mesh of size N_x, N_y, N_z for calculating "// &
2366 : "$W_{PQ}^\mathbf{R}=\int_\text{BZ}\frac{d\mathbf{k}}{\Omega_\text{BZ}}\, "// &
2367 : "e^{-i\mathbf{k}\cdot\mathbf{R}}\,W_{PQ}(\mathbf{k})$. "// &
2368 : "For non-periodic directions α, choose N_α = 1. "// &
2369 : "Automatic choice of the k-point mesh for negative "// &
2370 : "values, i.e. KPOINTS_W -1 -1 -1. "// &
2371 : "K-point extrapolation of W is automatically switched on.", &
2372 : usage="KPOINTS_W N_x N_y N_z", &
2373 9514 : n_var=3, type_of_var=integer_t, default_i_vals=[-1, -1, -1])
2374 9514 : CALL section_add_keyword(section, keyword)
2375 9514 : CALL keyword_release(keyword)
2376 :
2377 : CALL keyword_create(keyword, __LOCATION__, name="HEDIN_SHIFT", &
2378 : description="If true, use Hedin's shift in G0W0, evGW and evGW0. "// &
2379 : "Details see in Li et al. JCTC 18, 7570 "// &
2380 : "(2022), Figure 1. G0W0 with Hedin's shift should give "// &
2381 : "similar GW eigenvalues as evGW0; at a lower "// &
2382 : "computational cost.", &
2383 : usage="HEDIN_SHIFT", &
2384 : default_l_val=.FALSE., &
2385 9514 : lone_keyword_l_val=.TRUE.)
2386 9514 : CALL section_add_keyword(section, keyword)
2387 9514 : CALL keyword_release(keyword)
2388 :
2389 : CALL keyword_create(keyword, __LOCATION__, name="FREQ_MAX_FIT", &
2390 : description="For analytic continuation, a fit on Σ(iω) is performed. "// &
2391 : "This fit is then evaluated at a real frequency, Σ(ω), which is used "// &
2392 : "in the quasiparticle equation "// &
2393 : "$\varepsilon_{n\mathbf{k}}^{G_0W_0}= "// &
2394 : "\varepsilon_{n\mathbf{k}}^\text{DFT}+\Sigma_{n\mathbf{k}} "// &
2395 : "-v^\text{xc}_{n\mathbf{k}}$. The keyword FREQ_MAX_FIT "// &
2396 : "determines fitting range for the self-energy Σ(iω) on "// &
2397 : "imaginary axis: i*[0, ω_max] for empty orbitals/bands, i*[-ω_max,0] "// &
2398 : "for occ orbitals. A smaller ω_max might lead to better numerical "// &
2399 : "stability (i.e., if you observe clearly wrong GW eigenvalues/bands "// &
2400 : "around HOMO/LUMO, decreasing ω_max might fix this issue). "// &
2401 : "A small benchmark of ω_max is contained in Fig. 5 of "// &
2402 : "J. Wilhelm et al., JCTC 12, 3623-3635 (2016). "// &
2403 : "Note that we used ω_max = 1 Ha = 27.211 eV in the benchmark "// &
2404 : "M. Azizi et al., PRB 109, 245101 (2024).", &
2405 : unit_str="eV", &
2406 : usage="FREQ_MAX_FIT 20.0", &
2407 9514 : default_r_val=cp_unit_to_cp2k(value=10.0_dp, unit_str="eV"))
2408 9514 : CALL section_add_keyword(section, keyword)
2409 9514 : CALL keyword_release(keyword)
2410 :
2411 9514 : NULLIFY (subsection, print_key)
2412 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
2413 : description="Printing of GW restarts.", &
2414 9514 : n_keywords=2, n_subsections=1, repeats=.FALSE.)
2415 : CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
2416 : description="Controls the printing of restart files "// &
2417 : "for χ, W, Σ.", &
2418 : filename="", print_level=low_print_level, &
2419 9514 : common_iter_levels=3)
2420 9514 : CALL section_add_subsection(subsection, print_key)
2421 9514 : CALL section_release(print_key)
2422 :
2423 : CALL keyword_create(keyword, __LOCATION__, name="PRINT_DBT_CONTRACT", &
2424 : description="Prints information of contraction routines.", &
2425 : usage="PRINT_DBT_CONTRACT", &
2426 : default_l_val=.FALSE., &
2427 9514 : lone_keyword_l_val=.TRUE.)
2428 9514 : CALL section_add_keyword(subsection, keyword)
2429 9514 : CALL keyword_release(keyword)
2430 :
2431 : CALL keyword_create(keyword, __LOCATION__, name="PRINT_DBT_CONTRACT_VERBOSE", &
2432 : description="Prints verbose information of contraction routines.", &
2433 : usage="PRINT_DBT_CONTRACT_VERBOSE", &
2434 : default_l_val=.FALSE., &
2435 9514 : lone_keyword_l_val=.TRUE.)
2436 9514 : CALL section_add_keyword(subsection, keyword)
2437 9514 : CALL keyword_release(keyword)
2438 :
2439 9514 : CALL section_add_subsection(section, subsection)
2440 9514 : CALL section_release(subsection)
2441 :
2442 9514 : END SUBROUTINE create_gw_section
2443 :
2444 : ! **************************************************************************************************
2445 : !> \brief creates an input section for calculation SOC for the electronic band structure
2446 : !> \param section section to create
2447 : !> \par History
2448 : !> * 09.2023 created [Jan Wilhelm]
2449 : ! **************************************************************************************************
2450 9514 : SUBROUTINE create_soc_section(section)
2451 : TYPE(section_type), POINTER :: section
2452 :
2453 : TYPE(keyword_type), POINTER :: keyword
2454 :
2455 9514 : CPASSERT(.NOT. ASSOCIATED(section))
2456 : CALL section_create(section, __LOCATION__, name="SOC", &
2457 : description="Switch on or off spin-orbit coupling. Use SOC "// &
2458 : "parameters from non-local pseudopotentials as given in "// &
2459 : "Hartwigsen, Goedecker, Hutter, Eq.(18), (19), "// &
2460 : "<https://doi.org/10.1103/PhysRevB.58.3641>, "// &
2461 : "$V_{\mu\nu}^{\mathrm{SOC}, (\alpha)} = "// &
2462 : "(\hbar/2) \langle \phi_\mu | \sum_l \Delta "// &
2463 : "V_l^\mathrm{SO}(\mathbf{r},\mathbf{r}') "// &
2464 : "L^{(\alpha)} | \phi_\nu \rangle, "// &
2465 : "\alpha = x, y, z$.", &
2466 9514 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
2467 :
2468 9514 : NULLIFY (keyword)
2469 : CALL keyword_create(keyword, __LOCATION__, &
2470 : name="_SECTION_PARAMETERS_", &
2471 : description="Controls the activation of the SOC calculation.", &
2472 : default_l_val=.FALSE., &
2473 9514 : lone_keyword_l_val=.TRUE.)
2474 9514 : CALL section_add_keyword(section, keyword)
2475 9514 : CALL keyword_release(keyword)
2476 :
2477 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_WINDOW", &
2478 : description="Apply SOC only for states with eigenvalues in the "// &
2479 : "interval $[\varepsilon_\mathrm{VBM}-E_\mathrm{window}/2, "// &
2480 : "\varepsilon_\mathrm{CBM}+E_\mathrm{window}/2]$. Might be necessary "// &
2481 : "to use for large systems to prevent numerical instabilities.", &
2482 : usage="ENERGY_WINDOW 5.0", &
2483 : default_r_val=cp_unit_to_cp2k(value=40.0_dp, unit_str="eV"), &
2484 9514 : unit_str="eV")
2485 9514 : CALL section_add_keyword(section, keyword)
2486 9514 : CALL keyword_release(keyword)
2487 :
2488 9514 : END SUBROUTINE create_soc_section
2489 :
2490 : ! **************************************************************************************************
2491 : !> \brief input section for computing the density of states and the projected density of states
2492 : !> \param section section to create
2493 : !> \par History
2494 : !> * 09.2023 created [Jan Wilhelm]
2495 : ! **************************************************************************************************
2496 9514 : SUBROUTINE create_dos_section(section)
2497 : TYPE(section_type), POINTER :: section
2498 :
2499 : TYPE(keyword_type), POINTER :: keyword
2500 : TYPE(section_type), POINTER :: subsection
2501 :
2502 9514 : CPASSERT(.NOT. ASSOCIATED(section))
2503 : CALL section_create(section, __LOCATION__, name="DOS", &
2504 : description="Parameters needed to calculate the density of states "// &
2505 : "(DOS) and the projected density of states (PDOS).", &
2506 9514 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
2507 :
2508 9514 : NULLIFY (keyword)
2509 : CALL keyword_create(keyword, __LOCATION__, &
2510 : name="_SECTION_PARAMETERS_", &
2511 : description="Controls the activation of the DOS calculation.", &
2512 : default_l_val=.FALSE., &
2513 9514 : lone_keyword_l_val=.TRUE.)
2514 9514 : CALL section_add_keyword(section, keyword)
2515 9514 : CALL keyword_release(keyword)
2516 :
2517 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_WINDOW", &
2518 : description="Print DOS and PDOS in the energy window "// &
2519 : "$[\varepsilon_\mathrm{VBM}-E_\mathrm{window}/2, "// &
2520 : "\varepsilon_\mathrm{CBM}+E_\mathrm{window}/2]$,"// &
2521 : " where VBM is the valence "// &
2522 : "band maximum (or highest occupied molecular orbital, HOMO, for "// &
2523 : "molecules) and CBM the conduction band minimum (or lowest "// &
2524 : "unoccupied molecular orbital, LUMO, for molecules).", &
2525 : usage="ENERGY_WINDOW 5.0", &
2526 : default_r_val=cp_unit_to_cp2k(value=10.0_dp, unit_str="eV"), &
2527 9514 : unit_str="eV")
2528 9514 : CALL section_add_keyword(section, keyword)
2529 9514 : CALL keyword_release(keyword)
2530 :
2531 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_STEP", &
2532 : description="Resolution of the energy E when computing the $\rho(E)$.", &
2533 : usage="ENERGY_STEP 0.01", &
2534 : default_r_val=cp_unit_to_cp2k(value=0.01_dp, unit_str="eV"), &
2535 9514 : unit_str="eV")
2536 9514 : CALL section_add_keyword(section, keyword)
2537 9514 : CALL keyword_release(keyword)
2538 :
2539 : CALL keyword_create(keyword, __LOCATION__, name="BROADENING", &
2540 : description="Broadening α in Gaussians used in the DOS; "// &
2541 : "$\rho(E) = \sum_n \exp(((E-\varepsilon_n)/\alpha)^2)/("// &
2542 : " \sqrt{2\pi} \alpha)$.", &
2543 : usage="BROADENING 0.01", &
2544 : default_r_val=cp_unit_to_cp2k(value=0.01_dp, unit_str="eV"), &
2545 9514 : unit_str="eV")
2546 9514 : CALL section_add_keyword(section, keyword)
2547 9514 : CALL keyword_release(keyword)
2548 :
2549 : CALL keyword_create( &
2550 : keyword, __LOCATION__, name="KPOINTS", &
2551 : description="Monkhorst-Pack k-point mesh of size N_x, N_y, N_z for calculating "// &
2552 : "the density of states (DOS). In GW, the KPOINT_DOS mesh is thus used as k-point "// &
2553 : "mesh for the self-energy. For non-periodic directions α, choose N_α = 1. "// &
2554 : "Automatic choice of the k-point mesh for negative "// &
2555 : "values, i.e. KPOINTS_DOS -1 -1 -1 (automatic choice: N_α = 1 in non-periodic "// &
2556 : "direction, 8 k-points in periodic direction). If you like to compute a "// &
2557 : "band structure along a k-path, you can specify the k-path in "// &
2558 : "&KPOINT_SET.", &
2559 : usage="KPOINTS N_x N_y N_z", &
2560 9514 : n_var=3, type_of_var=integer_t, default_i_vals=[-1, -1, -1])
2561 9514 : CALL section_add_keyword(section, keyword)
2562 9514 : CALL keyword_release(keyword)
2563 :
2564 9514 : NULLIFY (subsection)
2565 9514 : CALL create_ldos_section(subsection)
2566 9514 : CALL section_add_subsection(section, subsection)
2567 9514 : CALL section_release(subsection)
2568 :
2569 9514 : END SUBROUTINE create_dos_section
2570 :
2571 : ! **************************************************************************************************
2572 : !> \brief ...
2573 : !> \param section ...
2574 : ! **************************************************************************************************
2575 9514 : SUBROUTINE create_ldos_section(section)
2576 : TYPE(section_type), POINTER :: section
2577 :
2578 : TYPE(keyword_type), POINTER :: keyword
2579 :
2580 9514 : CPASSERT(.NOT. ASSOCIATED(section))
2581 : CALL section_create(section, __LOCATION__, name="LDOS", &
2582 : description="Parameters needed to calculate the local density "// &
2583 : "of states (LDOS). "// &
2584 : "The LDOS is computed as $\rho(\mathbf{r},E) = "// &
2585 : "\sum\limits_{n,\mathbf{k}}"// &
2586 : " |\psi_{n\mathbf{k}}(r)|^2\, w_\mathbf{k}\, g(E-\varepsilon_{n\mathbf{k}})$ "// &
2587 : "using the Gaussian weight function "// &
2588 : "$g(x) = \exp(x^2/\alpha^2)/(\sqrt{2\pi}\alpha)$, $\alpha$ is the broadening "// &
2589 : "from the &DOS section, and the k-point weight "// &
2590 : "$w_\mathbf{k}$. The k-mesh is taken from the &DOS section.", &
2591 9514 : n_keywords=2, repeats=.FALSE.)
2592 :
2593 9514 : NULLIFY (keyword)
2594 : CALL keyword_create(keyword, __LOCATION__, &
2595 : name="_SECTION_PARAMETERS_", &
2596 : description="Activates the local VBM CBM gap calculation.", &
2597 : default_l_val=.FALSE., &
2598 9514 : lone_keyword_l_val=.TRUE.)
2599 9514 : CALL section_add_keyword(section, keyword)
2600 9514 : CALL keyword_release(keyword)
2601 :
2602 : CALL keyword_create(keyword, __LOCATION__, name="INTEGRATION", &
2603 : description="Defines whether the LDOS is integrated along a "// &
2604 : "coordinate. As an example, for INTEGRATION Z, the LDOS "// &
2605 : "$\rho(x,y,E) = \int dz\, \rho(x,y,z,E)$ is computed.", &
2606 : usage="INTEGRATION Z", &
2607 : enum_c_vals=s2a("X", "Y", "Z", "NONE"), &
2608 : enum_i_vals=[int_ldos_x, int_ldos_y, int_ldos_z, int_ldos_none], &
2609 : enum_desc=s2a("Integrate over x coordinate (not yet implemented).", &
2610 : "Integrate over y coordinate (not yet implemented).", &
2611 : "Integrate over z coordinate.", &
2612 : "No integration, print cube file as function "// &
2613 : "of x,y,z (not yet implemented)."), &
2614 9514 : default_i_val=int_ldos_z)
2615 9514 : CALL section_add_keyword(section, keyword)
2616 9514 : CALL keyword_release(keyword)
2617 :
2618 : CALL keyword_create( &
2619 : keyword, __LOCATION__, name="BIN_MESH", &
2620 : description="Mesh of size n x m for binning the space coordinates x and y of "// &
2621 : "the LDOS $\rho(x,y,E)$. If -1, no binning is performed and the "// &
2622 : "fine x, y resolution of the electron density from SCF is used.", &
2623 : usage="BIN_MESH n m", &
2624 9514 : n_var=2, type_of_var=integer_t, default_i_vals=[10, 10])
2625 9514 : CALL section_add_keyword(section, keyword)
2626 9514 : CALL keyword_release(keyword)
2627 :
2628 9514 : END SUBROUTINE create_ldos_section
2629 :
2630 : ! **************************************************************************************************
2631 : !> \brief creates an input section for a tip scan calculation
2632 : !> \param section section to create
2633 : !> \par History
2634 : !> * 04.2021 created [JGH]
2635 : ! **************************************************************************************************
2636 9514 : SUBROUTINE create_tipscan_section(section)
2637 : TYPE(section_type), POINTER :: section
2638 :
2639 : TYPE(keyword_type), POINTER :: keyword
2640 :
2641 9514 : CPASSERT(.NOT. ASSOCIATED(section))
2642 : CALL section_create(section, __LOCATION__, name="TIP_SCAN", &
2643 : description="Parameters needed to set up a Tip Scan. "// &
2644 : "Needs external definition of tip induced field.", &
2645 9514 : n_keywords=1, n_subsections=1, repeats=.FALSE.)
2646 :
2647 9514 : NULLIFY (keyword)
2648 :
2649 : CALL keyword_create(keyword, __LOCATION__, &
2650 : name="_SECTION_PARAMETERS_", &
2651 : description="Controls the activation of the Tip Scan procedure", &
2652 : default_l_val=.FALSE., &
2653 9514 : lone_keyword_l_val=.TRUE.)
2654 9514 : CALL section_add_keyword(section, keyword)
2655 9514 : CALL keyword_release(keyword)
2656 :
2657 : CALL keyword_create(keyword, __LOCATION__, name="SCAN_DIRECTION", &
2658 : description="Defines scan direction and scan type(line, plane).", &
2659 : usage="SCAN_DIRECTION XY", &
2660 : enum_c_vals=s2a("X", "Y", "Z", "XY", "XZ", "YZ", "XYZ"), &
2661 : enum_i_vals=[scan_x, scan_y, scan_z, scan_xy, scan_xz, scan_yz, scan_xyz], &
2662 9514 : default_i_val=scan_xy)
2663 9514 : CALL section_add_keyword(section, keyword)
2664 9514 : CALL keyword_release(keyword)
2665 :
2666 : CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
2667 : description="The reference point to define the absolute position of the scan. ", &
2668 : usage="REFERENCE_POINT 0.0 0.0 1.0", &
2669 : n_var=3, default_r_vals=[0.0_dp, 0.0_dp, 0.0_dp], type_of_var=real_t, &
2670 9514 : unit_str="angstrom")
2671 9514 : CALL section_add_keyword(section, keyword)
2672 9514 : CALL keyword_release(keyword)
2673 :
2674 : CALL keyword_create(keyword, __LOCATION__, name="SCAN_POINTS", &
2675 : description="Number of points calculated for each scan direction.", &
2676 : usage="SCAN_POINTS 20 20", &
2677 9514 : n_var=-1, type_of_var=integer_t)
2678 9514 : CALL section_add_keyword(section, keyword)
2679 9514 : CALL keyword_release(keyword)
2680 :
2681 : CALL keyword_create(keyword, __LOCATION__, name="SCAN_STEP", &
2682 : description="Step size for each scan direction.", &
2683 : usage="SCAN_STEP 0.01 0.01", &
2684 9514 : n_var=-1, type_of_var=real_t, unit_str="angstrom")
2685 9514 : CALL section_add_keyword(section, keyword)
2686 9514 : CALL keyword_release(keyword)
2687 :
2688 : CALL keyword_create(keyword, __LOCATION__, name="TIP_FILENAME", &
2689 : description="Filename of tip potential defined in cube file format.", &
2690 : usage="TIP_FILENAME <filename>", &
2691 9514 : type_of_var=lchar_t)
2692 9514 : CALL section_add_keyword(section, keyword)
2693 9514 : CALL keyword_release(keyword)
2694 :
2695 9514 : END SUBROUTINE create_tipscan_section
2696 :
2697 : END MODULE input_cp2k_properties_dft
|