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 : !> 10.2005 moved out of input_cp2k [fawzi]
12 : !> \author fawzi
13 : ! **************************************************************************************************
14 : MODULE input_cp2k_dft
15 : USE basis_set_types, ONLY: basis_sort_default,&
16 : basis_sort_zet
17 : USE bibliography, ONLY: &
18 : Andermatt2016, Andreussi2012, Andreussi2019, Avezac2005, Bengtsson1999, Blochl1995, &
19 : Brelaz1979, Chai2024a, Chai2025a, Fattebert2002, Guidon2010, Iannuzzi2006, Kunert2003, &
20 : Marek2025, Mattiat2022, Merlot2014, Perdew1981, VandeVondele2005b, Yin2017
21 : USE cp_output_handling, ONLY: add_last_numeric,&
22 : cp_print_key_section_create,&
23 : high_print_level,&
24 : low_print_level,&
25 : medium_print_level,&
26 : silent_print_level
27 : USE cp_spline_utils, ONLY: pw_interp,&
28 : spline3_pbc_interp
29 : USE cp_units, ONLY: cp_unit_to_cp2k
30 : USE input_constants, ONLY: &
31 : admm1_type, admm2_type, admmp_type, admmq_type, admms_type, do_admm_aux_exch_func_bee, &
32 : do_admm_aux_exch_func_bee_libxc, do_admm_aux_exch_func_default, &
33 : do_admm_aux_exch_func_default_libxc, do_admm_aux_exch_func_none, &
34 : do_admm_aux_exch_func_opt, do_admm_aux_exch_func_opt_libxc, do_admm_aux_exch_func_pbex, &
35 : do_admm_aux_exch_func_pbex_libxc, do_admm_aux_exch_func_sx_libxc, &
36 : do_admm_basis_projection, do_admm_blocked_projection, do_admm_blocking_purify_full, &
37 : do_admm_charge_constrained_projection, do_admm_exch_scaling_merlot, &
38 : do_admm_exch_scaling_none, do_admm_purify_cauchy, do_admm_purify_cauchy_subspace, &
39 : do_admm_purify_mcweeny, do_admm_purify_mo_diag, do_admm_purify_mo_no_diag, &
40 : do_admm_purify_none, do_admm_purify_none_dm, do_arnoldi, do_bch, do_cn, do_em, do_etrs, &
41 : do_exact, do_pade, do_taylor, ehrenfest, gaussian, kg_color_dsatur, kg_color_greedy, &
42 : kg_tnadd_atomic, kg_tnadd_embed, kg_tnadd_embed_ri, kg_tnadd_none, no_admm_type, &
43 : numerical, plus_u_lowdin, plus_u_mulliken, plus_u_mulliken_charges, plus_u_tensorial, &
44 : real_time_propagation, rel_dkh, rel_none, rel_pot_erfc, rel_pot_full, rel_sczora_mp, &
45 : rel_trans_atom, rel_trans_full, rel_trans_molecule, rel_zora, rel_zora_full, rel_zora_mp, &
46 : rtp_bse_ham_gw, rtp_bse_ham_ks, rtp_bse_kernel_ri_ao, rtp_bse_kernel_ri_default, &
47 : rtp_bse_kernel_ri_rs, rtp_method_bse, rtp_method_tddft, sccs_andreussi, &
48 : sccs_derivative_cd3, sccs_derivative_cd5, sccs_derivative_cd7, sccs_derivative_fft, &
49 : sccs_fattebert_gygi, sccs_saa_andreussi, sic_ad, sic_eo, sic_list_all, sic_list_unpaired, &
50 : sic_mauri_spz, sic_mauri_us, sic_none, slater, use_mom_ref_coac, use_mom_ref_com, &
51 : use_mom_ref_user, use_mom_ref_zero, use_restart_wfn, use_rt_restart, use_scf_wfn, &
52 : weight_type_mass, weight_type_unit
53 : USE input_cp2k_almo, ONLY: create_almo_scf_section
54 : USE input_cp2k_as, ONLY: create_active_space_section
55 : USE input_cp2k_ec, ONLY: create_ec_section
56 : USE input_cp2k_exstate, ONLY: create_exstate_section
57 : USE input_cp2k_external, ONLY: create_ext_den_section,&
58 : create_ext_pot_section,&
59 : create_ext_vxc_section
60 : USE input_cp2k_fde, ONLY: create_fde_section
61 : USE input_cp2k_field, ONLY: create_efield_section,&
62 : create_per_efield_section
63 : USE input_cp2k_harris, ONLY: create_harris_section
64 : USE input_cp2k_kpoints, ONLY: create_kpoint_set_section,&
65 : create_kpoints_section
66 : USE input_cp2k_loc, ONLY: create_localize_section
67 : USE input_cp2k_ls, ONLY: create_ls_scf_section
68 : USE input_cp2k_poisson, ONLY: create_poisson_section
69 : USE input_cp2k_print_dft, ONLY: create_print_dft_section
70 : USE input_cp2k_projection_rtp, ONLY: create_projection_rtp_section
71 : USE input_cp2k_qs, ONLY: create_lrigpw_section,&
72 : create_qs_section
73 : USE input_cp2k_rsgrid, ONLY: create_rsgrid_section
74 : USE input_cp2k_scf, ONLY: create_scf_section
75 : USE input_cp2k_smeagol, ONLY: create_dft_smeagol_section
76 : USE input_cp2k_transport, ONLY: create_transport_section
77 : USE input_cp2k_xas, ONLY: create_xas_section,&
78 : create_xas_tdp_section
79 : USE input_cp2k_xc, ONLY: create_xc_section
80 : USE input_keyword_types, ONLY: keyword_create,&
81 : keyword_release,&
82 : keyword_type
83 : USE input_section_types, ONLY: section_add_keyword,&
84 : section_add_subsection,&
85 : section_create,&
86 : section_release,&
87 : section_type
88 : USE input_val_types, ONLY: char_t,&
89 : integer_t,&
90 : lchar_t,&
91 : logical_t,&
92 : real_t
93 : USE kinds, ONLY: dp
94 : USE physcon, ONLY: evolt,&
95 : femtoseconds
96 : USE pw_spline_utils, ONLY: no_precond,&
97 : precond_spl3_1,&
98 : precond_spl3_2,&
99 : precond_spl3_3,&
100 : precond_spl3_aint,&
101 : precond_spl3_aint2
102 : USE string_utilities, ONLY: s2a
103 : #include "./base/base_uses.f90"
104 :
105 : IMPLICIT NONE
106 : PRIVATE
107 :
108 : CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_dft'
109 :
110 : PUBLIC :: create_dft_section
111 : PUBLIC :: create_bsse_section
112 : PUBLIC :: create_interp_section
113 : PUBLIC :: create_mgrid_section
114 :
115 : CONTAINS
116 :
117 : ! **************************************************************************************************
118 : !> \brief creates the dft section
119 : !> \param section the section to be created
120 : !> \author fawzi
121 : ! **************************************************************************************************
122 1499 : SUBROUTINE create_dft_section(section)
123 : TYPE(section_type), POINTER :: section
124 :
125 : TYPE(keyword_type), POINTER :: keyword
126 : TYPE(section_type), POINTER :: subsection
127 :
128 1499 : CPASSERT(.NOT. ASSOCIATED(section))
129 : CALL section_create(section, __LOCATION__, name="DFT", &
130 : description="Controls electronic-structure settings for Quickstep and related "// &
131 : "Gaussian-basis DFT methods.", &
132 1499 : n_keywords=3, n_subsections=4, repeats=.FALSE.)
133 :
134 1499 : NULLIFY (keyword)
135 : CALL keyword_create(keyword, __LOCATION__, name="BASIS_SET_FILE_NAME", &
136 : description="Name of a basis-set library file, optionally including a path. "// &
137 : "This keyword can be repeated to search several basis-set files.", &
138 : usage="BASIS_SET_FILE_NAME <FILENAME>", &
139 : type_of_var=lchar_t, repeats=.TRUE., &
140 1499 : default_lc_val="BASIS_SET", n_var=1)
141 1499 : CALL section_add_keyword(section, keyword)
142 1499 : CALL keyword_release(keyword)
143 :
144 : CALL keyword_create(keyword, __LOCATION__, name="POTENTIAL_FILE_NAME", &
145 : description="Name of the pseudopotential library file, optionally including a path. "// &
146 : "This keyword can be repeated to search several pseudopotential files. "// &
147 : "Files are searched in input order and the first matching potential is used. "// &
148 : "The potential selected for each kind is set with KIND%POTENTIAL.", &
149 : usage="POTENTIAL_FILE_NAME <FILENAME>", &
150 : type_of_var=lchar_t, repeats=.TRUE., &
151 1499 : default_lc_val="POTENTIAL", n_var=1)
152 1499 : CALL section_add_keyword(section, keyword)
153 1499 : CALL keyword_release(keyword)
154 :
155 : CALL keyword_create(keyword, __LOCATION__, name="WFN_RESTART_FILE_NAME", &
156 : variants=["RESTART_FILE_NAME"], &
157 : description="Name of the wavefunction restart file, may include a path."// &
158 : " If no file is specified, the default is to open the file as generated by the wfn restart print key.", &
159 : usage="WFN_RESTART_FILE_NAME <FILENAME>", &
160 2998 : type_of_var=lchar_t)
161 1499 : CALL section_add_keyword(section, keyword)
162 1499 : CALL keyword_release(keyword)
163 :
164 : CALL keyword_create(keyword, __LOCATION__, &
165 : name="UKS", &
166 : variants=s2a("UNRESTRICTED_KOHN_SHAM", &
167 : "LSD", &
168 : "SPIN_POLARIZED"), &
169 : description="Requests a spin-polarized calculation using alpha "// &
170 : "and beta orbitals, i.e. no spin restriction is applied", &
171 : usage="LSD", &
172 : default_l_val=.FALSE., &
173 1499 : lone_keyword_l_val=.TRUE.)
174 1499 : CALL section_add_keyword(section, keyword)
175 1499 : CALL keyword_release(keyword)
176 : CALL keyword_create(keyword, __LOCATION__, &
177 : name="ROKS", &
178 : variants=["RESTRICTED_OPEN_KOHN_SHAM"], &
179 : description="Requests a restricted open Kohn-Sham calculation", &
180 : usage="ROKS", &
181 : default_l_val=.FALSE., &
182 2998 : lone_keyword_l_val=.TRUE.)
183 1499 : CALL section_add_keyword(section, keyword)
184 1499 : CALL keyword_release(keyword)
185 : CALL keyword_create(keyword, __LOCATION__, &
186 : name="MULTIPLICITY", &
187 : variants=["MULTIP"], &
188 : description="Two times the total spin plus one. "// &
189 : "Specify 3 for a triplet, 4 for a quartet, "// &
190 : "and so on. Default is 1 (singlet) for an "// &
191 : "even number and 2 (doublet) for an odd number "// &
192 : "of electrons.", &
193 : usage="MULTIPLICITY 3", &
194 2998 : default_i_val=0) ! this default value is just a flag to get the above
195 1499 : CALL section_add_keyword(section, keyword)
196 1499 : CALL keyword_release(keyword)
197 : CALL keyword_create(keyword, __LOCATION__, name="CHARGE", &
198 : description="The total charge of the system", &
199 : usage="CHARGE -1", &
200 1499 : default_i_val=0)
201 1499 : CALL section_add_keyword(section, keyword)
202 1499 : CALL keyword_release(keyword)
203 :
204 : CALL keyword_create(keyword, __LOCATION__, &
205 : name="PLUS_U_METHOD", &
206 : description="Method employed for the calculation of the DFT+U contribution", &
207 : repeats=.FALSE., &
208 : enum_c_vals=s2a("LOWDIN", "MULLIKEN", "MULLIKEN_CHARGES", "TENSORIAL"), &
209 : enum_i_vals=[plus_u_lowdin, plus_u_mulliken, plus_u_mulliken_charges, &
210 : plus_u_tensorial], &
211 : enum_desc=s2a("Method based on Lowdin population analysis "// &
212 : "(computationally expensive, since the diagonalization of the "// &
213 : "overlap matrix is required, but possibly more robust than Mulliken)", &
214 : "Method based on Mulliken population analysis using the net AO and "// &
215 : "overlap populations (computationally cheap method)", &
216 : "Method based on Mulliken gross orbital populations (GOP)", &
217 : "Method based on Tensorial population analysis approach"), &
218 : n_var=1, &
219 : default_i_val=plus_u_mulliken, &
220 1499 : usage="PLUS_U_METHOD Lowdin")
221 1499 : CALL section_add_keyword(section, keyword)
222 1499 : CALL keyword_release(keyword)
223 :
224 : CALL keyword_create(keyword, __LOCATION__, &
225 : name="EPS_U_J_LOOP", &
226 : description="Convergence threshold for the self-consistent update of U and J parameters "// &
227 : "in the minimum tracking linear response calculation.", &
228 : repeats=.FALSE., &
229 : n_var=1, &
230 : unit_str="hartree", &
231 : default_r_val=1.0E-2_dp, &
232 1499 : usage="EPS_U_J_LOOP [eV] 0.01")
233 1499 : CALL section_add_keyword(section, keyword)
234 1499 : CALL keyword_release(keyword)
235 :
236 : CALL keyword_create(keyword, __LOCATION__, &
237 : name="MTLR_REFERENCE_SCF", &
238 : description="Controls the unperturbed reference SCF for minimum tracking linear "// &
239 : "response. With SCF_GUESS ATOMIC, the default is OFF. If enabled, an unperturbed "// &
240 : "reference SCF is first converged and its orbitals initialize every perturbation. "// &
241 : "With SCF_GUESS RESTART, a reference SCF is required and uses the standard "// &
242 : "restart initial guess.", &
243 : repeats=.FALSE., &
244 : type_of_var=logical_t, &
245 : lone_keyword_l_val=.TRUE., &
246 1499 : usage="MTLR_REFERENCE_SCF ON")
247 1499 : CALL section_add_keyword(section, keyword)
248 1499 : CALL keyword_release(keyword)
249 :
250 : CALL keyword_create(keyword, __LOCATION__, &
251 : name="MAX_MTLR_LOOP", &
252 : description="Max number of iterations for calculated self-consistent linear response U and J.", &
253 : repeats=.FALSE., &
254 : default_i_val=10, &
255 1499 : usage="MAX_MTLR_LOOP 10")
256 1499 : CALL section_add_keyword(section, keyword)
257 1499 : CALL keyword_release(keyword)
258 :
259 : CALL keyword_create(keyword, __LOCATION__, &
260 : name="RELAX_MULTIPLICITY", &
261 : variants=["RELAX_MULTIP"], &
262 : description="Tolerance in Hartrees. Do not enforce the occupation "// &
263 : "of alpha and beta MOs due to the initially "// &
264 : "defined multiplicity, but rather follow the Aufbau principle. "// &
265 : "A value greater than zero activates this option. "// &
266 : "If alpha/beta MOs differ in energy less than this tolerance, "// &
267 : "then alpha-MO occupation is preferred even if it is higher "// &
268 : "in energy (within the tolerance). "// &
269 : "Such spin-symmetry broken (spin-polarized) occupation is used "// &
270 : "as SCF input, which (is assumed to) bias the SCF "// &
271 : "towards a spin-polarized solution. "// &
272 : "Thus, larger tolerance increases chances of ending up "// &
273 : "with spin-polarization. "// &
274 : "This option is only valid for unrestricted (i.e. spin polarised) "// &
275 : "Kohn-Sham (UKS) calculations. It also needs non-zero "// &
276 : "[ADDED_MOS](#CP2K_INPUT.FORCE_EVAL.DFT.SCF.ADDED_MOS) to actually affect the calculations, "// &
277 : "which is why it is not expected to work with [OT](#CP2K_INPUT.FORCE_EVAL.DFT.SCF.OT) "// &
278 : "and may raise errors when used with OT. "// &
279 : "For more details see [this discussion](https://github.com/cp2k/cp2k/issues/4389).", &
280 : usage="RELAX_MULTIPLICITY 0.00001", &
281 : repeats=.FALSE., &
282 2998 : default_r_val=0.0_dp)
283 1499 : CALL section_add_keyword(section, keyword)
284 1499 : CALL keyword_release(keyword)
285 :
286 : CALL keyword_create(keyword, __LOCATION__, name="SUBCELLS", &
287 : description="Read the grid size for subcell generation in the construction of "// &
288 : "neighbor lists.", usage="SUBCELLS 1.5", &
289 1499 : n_var=1, default_r_val=2.0_dp)
290 1499 : CALL section_add_keyword(section, keyword)
291 1499 : CALL keyword_release(keyword)
292 :
293 : CALL keyword_create(keyword, __LOCATION__, name="AUTO_BASIS", &
294 : description="Specify type and size of automatically generated auxiliary "// &
295 : "(RI) basis sets. Exactly two arguments are required for this option. "// &
296 : "The first argument of basis type should be one of the following: "// &
297 : "`RI_AUX`, `AUX_FIT`, `LRI_AUX`, `P_LRI_AUX`, `RI_HXC`, `RI_XAS`, or "// &
298 : "`RI_HFX`. The second argument of basis size should be one of the "// &
299 : "following: `SMALL`, `MEDIUM`, `LARGE`, or `HUGE`. The default is not "// &
300 : "using any of these basis sets, requested by `AUTO_BASIS X X` (exactly "// &
301 : "as written here).", &
302 : usage="AUTO_BASIS {basis_type} {basis_size}", &
303 4497 : type_of_var=char_t, repeats=.TRUE., n_var=-1, default_c_vals=["X", "X"])
304 1499 : CALL section_add_keyword(section, keyword)
305 1499 : CALL keyword_release(keyword)
306 :
307 : CALL keyword_create(keyword, __LOCATION__, &
308 : name="SURFACE_DIPOLE_CORRECTION", &
309 : variants=s2a("SURFACE_DIPOLE", &
310 : "SURF_DIP"), &
311 : description="For slab calculations with asymmetric geometries, activate the correction of "// &
312 : "the electrostatic potential with "// &
313 : "by compensating for the surface dipole. Implemented only for slabs with normal "// &
314 : "parallel to one Cartesian axis. The normal direction is given by the keyword SURF_DIP_DIR", &
315 : usage="SURF_DIP", &
316 : default_l_val=.FALSE., &
317 : lone_keyword_l_val=.TRUE., &
318 2998 : citations=[Bengtsson1999])
319 1499 : CALL section_add_keyword(section, keyword)
320 1499 : CALL keyword_release(keyword)
321 :
322 : CALL keyword_create(keyword, __LOCATION__, &
323 : name="SURF_DIP_DIR", &
324 : description="Cartesian axis parallel to surface normal.", &
325 : enum_c_vals=s2a("X", "Y", "Z"), &
326 : enum_i_vals=[1, 2, 3], &
327 : enum_desc=s2a("Along x", "Along y", "Along z"), &
328 : n_var=1, &
329 : default_i_val=3, &
330 1499 : usage="SURF_DIP_DIR Z")
331 1499 : CALL section_add_keyword(section, keyword)
332 1499 : CALL keyword_release(keyword)
333 :
334 : CALL keyword_create(keyword, __LOCATION__, &
335 : name="SURF_DIP_POS", &
336 : description="This keyword assigns an user defined position in Angstroms "// &
337 : "in the direction normal to the surface (given by SURF_DIP_DIR). "// &
338 : "The default value is -1.0_dp which appplies the correction at a position "// &
339 : "that has minimum electron density on the grid.", &
340 : usage="SURF_DIP_POS -1.0_dp", &
341 1499 : default_r_val=-1.0_dp)
342 1499 : CALL section_add_keyword(section, keyword)
343 1499 : CALL keyword_release(keyword)
344 :
345 : CALL keyword_create(keyword, __LOCATION__, &
346 : name="SURF_DIP_SWITCH", &
347 : description="WARNING: Experimental feature under development that will help the "// &
348 : "user to switch parameters to facilitate SCF convergence. In its current form the "// &
349 : "surface dipole correction is switched off if the calculation does not converge in "// &
350 : "(0.5*MAX_SCF + 1) outer_scf steps. "// &
351 : "The default value is .FALSE.", &
352 : usage="SURF_DIP_SWITCH .TRUE.", &
353 : default_l_val=.FALSE., &
354 1499 : lone_keyword_l_val=.TRUE.)
355 1499 : CALL section_add_keyword(section, keyword)
356 1499 : CALL keyword_release(keyword)
357 :
358 : CALL keyword_create(keyword, __LOCATION__, &
359 : name="CORE_CORR_DIP", &
360 : description="If the total CORE_CORRECTION is non-zero and surface dipole "// &
361 : "correction is switched on, presence of this keyword will adjust electron "// &
362 : "density via MO occupation to reflect the total CORE_CORRECTION. "// &
363 : "The default value is .FALSE.", &
364 : usage="CORE_CORR_DIP .TRUE.", &
365 : default_l_val=.FALSE., &
366 1499 : lone_keyword_l_val=.TRUE.)
367 1499 : CALL section_add_keyword(section, keyword)
368 1499 : CALL keyword_release(keyword)
369 :
370 : CALL keyword_create(keyword, __LOCATION__, &
371 : name="SORT_BASIS", &
372 : description="Sorts basis functions according to a selected criterion. "// &
373 : "Sorting by exponent can improve data locality for selected exact-exchange and RI workflows.", &
374 : enum_c_vals=s2a("DEFAULT", "EXP"), &
375 : enum_i_vals=[basis_sort_default, basis_sort_zet], &
376 : enum_desc=s2a("don't sort", "sort w.r.t. exponent"), &
377 : default_i_val=basis_sort_default, &
378 1499 : usage="SORT_BASIS EXP")
379 1499 : CALL section_add_keyword(section, keyword)
380 1499 : CALL keyword_release(keyword)
381 :
382 1499 : NULLIFY (subsection)
383 1499 : CALL create_scf_section(subsection)
384 1499 : CALL section_add_subsection(section, subsection)
385 1499 : CALL section_release(subsection)
386 :
387 1499 : CALL create_ls_scf_section(subsection)
388 1499 : CALL section_add_subsection(section, subsection)
389 1499 : CALL section_release(subsection)
390 :
391 1499 : CALL create_almo_scf_section(subsection)
392 1499 : CALL section_add_subsection(section, subsection)
393 1499 : CALL section_release(subsection)
394 :
395 1499 : CALL create_kg_section(subsection)
396 1499 : CALL section_add_subsection(section, subsection)
397 1499 : CALL section_release(subsection)
398 :
399 1499 : CALL create_fde_section(subsection)
400 1499 : CALL section_add_subsection(section, subsection)
401 1499 : CALL section_release(subsection)
402 :
403 1499 : CALL create_harris_section(subsection)
404 1499 : CALL section_add_subsection(section, subsection)
405 1499 : CALL section_release(subsection)
406 :
407 1499 : CALL create_ec_section(subsection)
408 1499 : CALL section_add_subsection(section, subsection)
409 1499 : CALL section_release(subsection)
410 :
411 1499 : CALL create_exstate_section(subsection)
412 1499 : CALL section_add_subsection(section, subsection)
413 1499 : CALL section_release(subsection)
414 :
415 1499 : CALL create_admm_section(subsection)
416 1499 : CALL section_add_subsection(section, subsection)
417 1499 : CALL section_release(subsection)
418 :
419 1499 : CALL create_qs_section(subsection)
420 1499 : CALL section_add_subsection(section, subsection)
421 1499 : CALL section_release(subsection)
422 :
423 1499 : CALL create_mgrid_section(subsection, create_subsections=.TRUE.)
424 1499 : CALL section_add_subsection(section, subsection)
425 1499 : CALL section_release(subsection)
426 :
427 1499 : CALL create_xc_section(subsection)
428 1499 : CALL section_add_subsection(section, subsection)
429 1499 : CALL section_release(subsection)
430 :
431 1499 : CALL create_relativistic_section(subsection)
432 1499 : CALL section_add_subsection(section, subsection)
433 1499 : CALL section_release(subsection)
434 :
435 1499 : CALL create_sic_section(subsection)
436 1499 : CALL section_add_subsection(section, subsection)
437 1499 : CALL section_release(subsection)
438 :
439 1499 : CALL create_low_spin_roks_section(subsection)
440 1499 : CALL section_add_subsection(section, subsection)
441 1499 : CALL section_release(subsection)
442 :
443 1499 : CALL create_efield_section(subsection)
444 1499 : CALL section_add_subsection(section, subsection)
445 1499 : CALL section_release(subsection)
446 :
447 1499 : CALL create_per_efield_section(subsection)
448 1499 : CALL section_add_subsection(section, subsection)
449 1499 : CALL section_release(subsection)
450 :
451 1499 : CALL create_ext_pot_section(subsection)
452 1499 : CALL section_add_subsection(section, subsection)
453 1499 : CALL section_release(subsection)
454 :
455 1499 : CALL create_transport_section(subsection)
456 1499 : CALL section_add_subsection(section, subsection)
457 1499 : CALL section_release(subsection)
458 :
459 : ! ZMP sections to include the external density or v_xc potential
460 1499 : CALL create_ext_den_section(subsection)
461 1499 : CALL section_add_subsection(section, subsection)
462 1499 : CALL section_release(subsection)
463 :
464 1499 : CALL create_ext_vxc_section(subsection)
465 1499 : CALL section_add_subsection(section, subsection)
466 1499 : CALL section_release(subsection)
467 :
468 1499 : CALL create_poisson_section(subsection)
469 1499 : CALL section_add_subsection(section, subsection)
470 1499 : CALL section_release(subsection)
471 :
472 1499 : CALL create_kpoints_section(subsection)
473 1499 : CALL section_add_subsection(section, subsection)
474 1499 : CALL section_release(subsection)
475 :
476 1499 : CALL create_kpoint_set_section(subsection)
477 1499 : CALL section_add_subsection(section, subsection)
478 1499 : CALL section_release(subsection)
479 :
480 1499 : CALL create_implicit_solv_section(subsection)
481 1499 : CALL section_add_subsection(section, subsection)
482 1499 : CALL section_release(subsection)
483 :
484 1499 : CALL create_density_fitting_section(subsection)
485 1499 : CALL section_add_subsection(section, subsection)
486 1499 : CALL section_release(subsection)
487 :
488 1499 : CALL create_xas_section(subsection)
489 1499 : CALL section_add_subsection(section, subsection)
490 1499 : CALL section_release(subsection)
491 :
492 1499 : CALL create_xas_tdp_section(subsection)
493 1499 : CALL section_add_subsection(section, subsection)
494 1499 : CALL section_release(subsection)
495 :
496 1499 : CALL create_localize_section(subsection)
497 1499 : CALL section_add_subsection(section, subsection)
498 1499 : CALL section_release(subsection)
499 :
500 1499 : CALL create_rtp_section(subsection)
501 1499 : CALL section_add_subsection(section, subsection)
502 1499 : CALL section_release(subsection)
503 :
504 1499 : CALL create_print_dft_section(subsection)
505 1499 : CALL section_add_subsection(section, subsection)
506 1499 : CALL section_release(subsection)
507 :
508 1499 : CALL create_sccs_section(subsection)
509 1499 : CALL section_add_subsection(section, subsection)
510 1499 : CALL section_release(subsection)
511 :
512 1499 : CALL create_active_space_section(subsection)
513 1499 : CALL section_add_subsection(section, subsection)
514 1499 : CALL section_release(subsection)
515 :
516 1499 : CALL create_dft_smeagol_section(subsection)
517 1499 : CALL section_add_subsection(section, subsection)
518 1499 : CALL section_release(subsection)
519 :
520 1499 : CALL create_hairy_probes_section(subsection)
521 1499 : CALL section_add_subsection(section, subsection)
522 1499 : CALL section_release(subsection)
523 :
524 1499 : CALL create_pcc_section(subsection)
525 1499 : CALL section_add_subsection(section, subsection)
526 1499 : CALL section_release(subsection)
527 :
528 1499 : CALL create_paep_section(subsection)
529 1499 : CALL section_add_subsection(section, subsection)
530 1499 : CALL section_release(subsection)
531 :
532 1499 : END SUBROUTINE create_dft_section
533 :
534 : ! **************************************************************************************************
535 : !> \brief Hairy Probe DFT Model
536 : !> \param section ...
537 : !> \author Margherita Buraschi
538 : ! **************************************************************************************************
539 :
540 1499 : SUBROUTINE create_hairy_probes_section(section)
541 : TYPE(section_type), POINTER :: section
542 :
543 : TYPE(keyword_type), POINTER :: keyword
544 :
545 1499 : NULLIFY (keyword)
546 1499 : CPASSERT(.NOT. ASSOCIATED(section))
547 : CALL section_create(section, __LOCATION__, &
548 : name="HAIRY_PROBES", &
549 : description="Sets up a Hairy Probe calculation. ", &
550 1499 : n_keywords=0, n_subsections=0, repeats=.TRUE.)
551 :
552 : CALL keyword_create(keyword, __LOCATION__, &
553 : name="_SECTION_PARAMETERS_", &
554 : description="Controls the activation of hairy probe", &
555 : usage="&HAIRY_PROBES ON", &
556 : default_l_val=.FALSE., &
557 1499 : lone_keyword_l_val=.TRUE.)
558 1499 : CALL section_add_keyword(section, keyword)
559 1499 : CALL keyword_release(keyword)
560 :
561 : CALL keyword_create(keyword, __LOCATION__, name="ATOM_IDS", &
562 : description="Indexes of the atoms to which the probes are attached.", &
563 : usage="ATOM_IDS <INTEGER> .. <INTEGER>", &
564 1499 : type_of_var=integer_t, n_var=-1)
565 1499 : CALL section_add_keyword(section, keyword)
566 1499 : CALL keyword_release(keyword)
567 :
568 : CALL keyword_create(keyword, __LOCATION__, name="T", &
569 : description="Electronic temperature [K]", &
570 : usage="T <REAL>", &
571 : default_r_val=cp_unit_to_cp2k(value=300.0_dp, unit_str="K"), &
572 1499 : unit_str="K")
573 1499 : CALL section_add_keyword(section, keyword)
574 1499 : CALL keyword_release(keyword)
575 :
576 : CALL keyword_create(keyword, __LOCATION__, name="MU", &
577 : description="Chemical potential of the electrons in the probes [eV] ", &
578 : usage="MU <REAL>", &
579 : default_r_val=cp_unit_to_cp2k(value=0.0_dp, unit_str="eV"), &
580 1499 : unit_str="eV")
581 1499 : CALL section_add_keyword(section, keyword)
582 1499 : CALL keyword_release(keyword)
583 :
584 : CALL keyword_create(keyword, __LOCATION__, name="ALPHA", &
585 : description="Parameter for solution probes ", &
586 : usage="ALPHA <REAL>", &
587 1499 : default_r_val=1.0_dp)
588 1499 : CALL section_add_keyword(section, keyword)
589 1499 : CALL keyword_release(keyword)
590 :
591 : CALL keyword_create(keyword, __LOCATION__, name="EPS_HP", &
592 : description=" Tolerance for accuracy checks on occupation numbers "// &
593 : "calculated using hair-probes. ", &
594 : usage="EPS_HP <REAL>", &
595 1499 : default_r_val=1.0E-5_dp)
596 1499 : CALL section_add_keyword(section, keyword)
597 1499 : CALL keyword_release(keyword)
598 1499 : END SUBROUTINE create_hairy_probes_section
599 : !####################################################################################
600 :
601 : ! **************************************************************************************************
602 : !> \brief Implicit Solvation Model
603 : !> \param section ...
604 : !> \author tlaino
605 : ! **************************************************************************************************
606 1499 : SUBROUTINE create_implicit_solv_section(section)
607 : TYPE(section_type), POINTER :: section
608 :
609 : TYPE(keyword_type), POINTER :: keyword
610 : TYPE(section_type), POINTER :: print_key, subsection
611 :
612 1499 : NULLIFY (keyword, subsection, print_key)
613 1499 : CPASSERT(.NOT. ASSOCIATED(section))
614 : CALL section_create(section, __LOCATION__, name="SCRF", &
615 : description="Adds an implicit solvation model to the DFT calculation."// &
616 : " Know also as Self Consistent Reaction Field.", &
617 1499 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
618 :
619 : CALL keyword_create(keyword, __LOCATION__, name="EPS_OUT", &
620 : description="Value of the dielectric constant outside the sphere", &
621 : usage="EPS_OUT <REAL>", &
622 1499 : default_r_val=1.0_dp)
623 1499 : CALL section_add_keyword(section, keyword)
624 1499 : CALL keyword_release(keyword)
625 :
626 : CALL keyword_create(keyword, __LOCATION__, name="LMAX", &
627 : description="Maximum value of L used in the multipole expansion", &
628 : usage="LMAX <INTEGER>", &
629 1499 : default_i_val=3)
630 1499 : CALL section_add_keyword(section, keyword)
631 1499 : CALL keyword_release(keyword)
632 :
633 1499 : CALL create_sphere_section(subsection)
634 1499 : CALL section_add_subsection(section, subsection)
635 1499 : CALL section_release(subsection)
636 :
637 : CALL cp_print_key_section_create(print_key, __LOCATION__, "program_run_info", &
638 : description="Controls the printing basic info about the method", &
639 1499 : print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
640 1499 : CALL section_add_subsection(section, print_key)
641 1499 : CALL section_release(print_key)
642 :
643 1499 : END SUBROUTINE create_implicit_solv_section
644 :
645 : ! **************************************************************************************************
646 : !> \brief Create Sphere cavity
647 : !> \param section ...
648 : !> \author tlaino
649 : ! **************************************************************************************************
650 1499 : SUBROUTINE create_sphere_section(section)
651 : TYPE(section_type), POINTER :: section
652 :
653 : TYPE(keyword_type), POINTER :: keyword
654 : TYPE(section_type), POINTER :: subsection
655 :
656 1499 : NULLIFY (keyword, subsection)
657 1499 : CPASSERT(.NOT. ASSOCIATED(section))
658 : CALL section_create(section, __LOCATION__, name="SPHERE", &
659 : description="Treats the implicit solvent environment like a sphere", &
660 1499 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
661 :
662 : CALL keyword_create(keyword, __LOCATION__, name="RADIUS", &
663 : description="Value of the spherical cavity in the dielectric medium", &
664 : usage="RADIUS <REAL>", &
665 : unit_str="angstrom", &
666 1499 : type_of_var=real_t)
667 1499 : CALL section_add_keyword(section, keyword)
668 1499 : CALL keyword_release(keyword)
669 :
670 1499 : CALL create_center_section(subsection)
671 1499 : CALL section_add_subsection(section, subsection)
672 1499 : CALL section_release(subsection)
673 :
674 1499 : END SUBROUTINE create_sphere_section
675 :
676 : ! **************************************************************************************************
677 : !> \brief ...
678 : !> \param section ...
679 : !> \author tlaino
680 : ! **************************************************************************************************
681 1499 : SUBROUTINE create_center_section(section)
682 : TYPE(section_type), POINTER :: section
683 :
684 : TYPE(keyword_type), POINTER :: keyword
685 :
686 1499 : NULLIFY (keyword)
687 1499 : CPASSERT(.NOT. ASSOCIATED(section))
688 : CALL section_create(section, __LOCATION__, name="CENTER", &
689 : description="Defines the center of the sphere.", &
690 1499 : n_keywords=0, n_subsections=0, repeats=.FALSE.)
691 : CALL keyword_create(keyword, __LOCATION__, name="XYZ", &
692 : description="Coordinates of the center of the sphere", &
693 : usage="XYZ <REAL> <REAL> <REAL>", &
694 : unit_str="angstrom", &
695 1499 : type_of_var=real_t, n_var=3)
696 1499 : CALL section_add_keyword(section, keyword)
697 1499 : CALL keyword_release(keyword)
698 :
699 : CALL keyword_create(keyword, __LOCATION__, name="ATOM_LIST", &
700 : description="Defines a list of atoms to define the center of the sphere", &
701 : usage="ATOM_LIST <INTEGER> .. <INTEGER>", &
702 1499 : type_of_var=integer_t, n_var=-1)
703 1499 : CALL section_add_keyword(section, keyword)
704 1499 : CALL keyword_release(keyword)
705 :
706 : CALL keyword_create(keyword, __LOCATION__, name="WEIGHT_TYPE", &
707 : description="Defines the weight used to define the center of the sphere"// &
708 : " (if ATOM_LIST is provided)", &
709 : usage="WEIGHT_TYPE (UNIT|MASS)", &
710 : enum_c_vals=["UNIT", "MASS"], &
711 : enum_i_vals=[weight_type_unit, weight_type_mass], &
712 4497 : default_i_val=weight_type_unit)
713 1499 : CALL section_add_keyword(section, keyword)
714 1499 : CALL keyword_release(keyword)
715 :
716 : CALL keyword_create(keyword, __LOCATION__, name="FIXED", &
717 : description="Specify if the center of the sphere should be fixed or"// &
718 : " allowed to move", &
719 : usage="FIXED <LOGICAL>", &
720 1499 : default_l_val=.TRUE.)
721 1499 : CALL section_add_keyword(section, keyword)
722 1499 : CALL keyword_release(keyword)
723 :
724 1499 : END SUBROUTINE create_center_section
725 :
726 : ! **************************************************************************************************
727 : !> \brief ...
728 : !> \param section ...
729 : ! **************************************************************************************************
730 1499 : SUBROUTINE create_admm_section(section)
731 : TYPE(section_type), POINTER :: section
732 :
733 : TYPE(keyword_type), POINTER :: keyword
734 :
735 1499 : NULLIFY (keyword)
736 1499 : CPASSERT(.NOT. ASSOCIATED(section))
737 : CALL section_create(section, __LOCATION__, name="AUXILIARY_DENSITY_MATRIX_METHOD", &
738 : description="Controls the auxiliary density matrix method (ADMM), which evaluates "// &
739 : "Hartree-Fock exchange on a smaller auxiliary basis and adds an exchange correction.", &
740 : n_keywords=1, n_subsections=1, repeats=.FALSE., &
741 2998 : citations=[Guidon2010])
742 :
743 : CALL keyword_create( &
744 : keyword, __LOCATION__, &
745 : name="ADMM_TYPE", &
746 : description="Named ADMM variant from the literature. This shortcut sets METHOD, "// &
747 : "ADMM_PURIFICATION_METHOD, and EXCH_SCALING_MODEL consistently for the selected variant.", &
748 : enum_c_vals=s2a("NONE", "ADMM1", "ADMM2", "ADMMS", "ADMMP", "ADMMQ"), &
749 : enum_desc=s2a("No short name is used, use specific definitions (default)", &
750 : "ADMM1 method from Guidon2010", &
751 : "ADMM2 method from Guidon2010", &
752 : "ADMMS method from Merlot2014", &
753 : "ADMMP method from Merlot2014", &
754 : "ADMMQ method from Merlot2014"), &
755 : enum_i_vals=[no_admm_type, admm1_type, admm2_type, admms_type, admmp_type, admmq_type], &
756 : default_i_val=no_admm_type, &
757 4497 : citations=[Guidon2010, Merlot2014])
758 1499 : CALL section_add_keyword(section, keyword)
759 1499 : CALL keyword_release(keyword)
760 :
761 : CALL keyword_create( &
762 : keyword, __LOCATION__, &
763 : name="ADMM_PURIFICATION_METHOD", &
764 : description="Method that shall be used for wavefunction fitting. Use MO_DIAG for MD.", &
765 : enum_c_vals=s2a("NONE", "CAUCHY", "CAUCHY_SUBSPACE", "MO_DIAG", "MO_NO_DIAG", "MCWEENY", "NONE_DM"), &
766 : enum_i_vals=[do_admm_purify_none, do_admm_purify_cauchy, do_admm_purify_cauchy_subspace, &
767 : do_admm_purify_mo_diag, do_admm_purify_mo_no_diag, &
768 : do_admm_purify_mcweeny, do_admm_purify_none_dm], &
769 : enum_desc=s2a("Do not apply any purification", &
770 : "Perform purification via general Cauchy representation", &
771 : "Perform purification via Cauchy representation in occupied subspace", &
772 : "Calculate MO derivatives via Cauchy representation by diagonalization", &
773 : "Calculate MO derivatives via Cauchy representation by inversion", &
774 : "Perform original McWeeny purification via matrix multiplications", &
775 : "Do not apply any purification, works directly with density matrix"), &
776 1499 : default_i_val=do_admm_purify_mo_diag)
777 1499 : CALL section_add_keyword(section, keyword)
778 1499 : CALL keyword_release(keyword)
779 :
780 : CALL keyword_create( &
781 : keyword, __LOCATION__, &
782 : name="METHOD", &
783 : description="Method that shall be used for wavefunction fitting. Use BASIS_PROJECTION for MD.", &
784 : enum_c_vals=s2a("BASIS_PROJECTION", "BLOCKED_PROJECTION_PURIFY_FULL", "BLOCKED_PROJECTION", &
785 : "CHARGE_CONSTRAINED_PROJECTION"), &
786 : enum_i_vals=[do_admm_basis_projection, do_admm_blocking_purify_full, do_admm_blocked_projection, &
787 : do_admm_charge_constrained_projection], &
788 : enum_desc=s2a("Construct auxiliary density matrix from auxiliary basis.", &
789 : "Construct auxiliary density from a blocked Fock matrix,"// &
790 : " but use the original matrix for purification.", &
791 : "Construct auxiliary density from a blocked Fock matrix.", &
792 : "Construct auxiliary density from auxiliary basis enforcing charge constrain."), &
793 1499 : default_i_val=do_admm_basis_projection)
794 1499 : CALL section_add_keyword(section, keyword)
795 1499 : CALL keyword_release(keyword)
796 :
797 : CALL keyword_create( &
798 : keyword, __LOCATION__, &
799 : name="EXCH_SCALING_MODEL", &
800 : description="Scaling of the exchange correction calculated by the auxiliary density matrix.", &
801 : enum_c_vals=s2a("NONE", "MERLOT"), &
802 : enum_i_vals=[do_admm_exch_scaling_none, do_admm_exch_scaling_merlot], &
803 : enum_desc=s2a("No scaling is enabled, refers to methods ADMM1, ADMM2 or ADMMQ.", &
804 : "Exchange scaling according to Merlot (2014)"), &
805 1499 : default_i_val=do_admm_exch_scaling_none)
806 1499 : CALL section_add_keyword(section, keyword)
807 1499 : CALL keyword_release(keyword)
808 :
809 : CALL keyword_create( &
810 : keyword, __LOCATION__, &
811 : name="EXCH_CORRECTION_FUNC", &
812 : description="Exchange functional used for the ADMM correction. It should be chosen consistently "// &
813 : "with the exchange functional in the main XC setup. LibXC implementations require linking with LibXC.", &
814 : enum_c_vals=s2a("DEFAULT", "PBEX", "NONE", "OPTX", "BECKE88X", &
815 : "PBEX_LIBXC", "BECKE88X_LIBXC", "OPTX_LIBXC", "DEFAULT_LIBXC", "LDA_X_LIBXC"), &
816 : enum_i_vals=[do_admm_aux_exch_func_default, do_admm_aux_exch_func_pbex, &
817 : do_admm_aux_exch_func_none, do_admm_aux_exch_func_opt, do_admm_aux_exch_func_bee, &
818 : do_admm_aux_exch_func_pbex_libxc, do_admm_aux_exch_func_bee_libxc, &
819 : do_admm_aux_exch_func_opt_libxc, do_admm_aux_exch_func_default_libxc, &
820 : do_admm_aux_exch_func_sx_libxc], &
821 : enum_desc=s2a("Use PBE-based corrections according to the chosen interaction operator.", &
822 : "Use PBEX functional for exchange correction.", &
823 : "No correction: X(D)-x(d)-> 0.", &
824 : "Use OPTX functional for exchange correction.", &
825 : "Use Becke88X functional for exchange correction.", &
826 : "Use PBEX functional (LibXC implementation) for exchange correction.", &
827 : "Use Becke88X functional (LibXC implementation) for exchange correction.", &
828 : "Use OPTX functional (LibXC implementation) for exchange correction.", &
829 : "Use PBE-based corrections (LibXC where possible) to the chosen interaction operator.", &
830 : "Use Slater X functional (LibXC where possible) for exchange correction."), &
831 1499 : default_i_val=do_admm_aux_exch_func_default)
832 1499 : CALL section_add_keyword(section, keyword)
833 1499 : CALL keyword_release(keyword)
834 :
835 : CALL keyword_create(keyword, __LOCATION__, name="optx_a1", &
836 : description="OPTX a1 coefficient", &
837 1499 : default_r_val=1.05151_dp)
838 1499 : CALL section_add_keyword(section, keyword)
839 1499 : CALL keyword_release(keyword)
840 : CALL keyword_create(keyword, __LOCATION__, name="optx_a2", &
841 : description="OPTX a2 coefficient", &
842 1499 : default_r_val=1.43169_dp)
843 1499 : CALL section_add_keyword(section, keyword)
844 1499 : CALL keyword_release(keyword)
845 : CALL keyword_create(keyword, __LOCATION__, name="optx_gamma", &
846 : description="OPTX gamma coefficient", &
847 1499 : default_r_val=0.006_dp)
848 1499 : CALL section_add_keyword(section, keyword)
849 1499 : CALL keyword_release(keyword)
850 :
851 : CALL keyword_create(keyword, __LOCATION__, name="BLOCK_LIST", &
852 : description="Specifies a list of atoms.", &
853 : usage="BLOCK_LIST {integer} {integer} .. {integer}", &
854 1499 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
855 1499 : CALL section_add_keyword(section, keyword)
856 1499 : CALL keyword_release(keyword)
857 :
858 : CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
859 : description="Define accuracy of DBCSR operations", &
860 1499 : usage="EPS_FILTER", default_r_val=0.0_dp)
861 1499 : CALL section_add_keyword(section, keyword)
862 1499 : CALL keyword_release(keyword)
863 :
864 1499 : END SUBROUTINE create_admm_section
865 :
866 : ! **************************************************************************************************
867 : !> \brief ...
868 : !> \param section ...
869 : ! **************************************************************************************************
870 1499 : SUBROUTINE create_density_fitting_section(section)
871 : TYPE(section_type), POINTER :: section
872 :
873 : TYPE(keyword_type), POINTER :: keyword
874 : TYPE(section_type), POINTER :: print_key
875 :
876 1499 : NULLIFY (keyword, print_key)
877 1499 : CPASSERT(.NOT. ASSOCIATED(section))
878 : CALL section_create(section, __LOCATION__, name="DENSITY_FITTING", &
879 : description="Setup parameters for density fitting (Bloechl charges or density derived "// &
880 : "atomic point charges (DDAPC) charges)", &
881 : n_keywords=7, n_subsections=0, repeats=.FALSE., &
882 2998 : citations=[Blochl1995])
883 :
884 : CALL keyword_create(keyword, __LOCATION__, name="NUM_GAUSS", &
885 : description="Specifies the numbers of gaussian used to fit the QM density for each atomic site.", &
886 : usage="NUM_GAUSS {integer}", &
887 1499 : n_var=1, type_of_var=integer_t, default_i_val=3)
888 1499 : CALL section_add_keyword(section, keyword)
889 1499 : CALL keyword_release(keyword)
890 :
891 : CALL keyword_create(keyword, __LOCATION__, name="PFACTOR", &
892 : description="Specifies the progression factor for the gaussian exponent for each atomic site.", &
893 : usage="PFACTOR {real}", &
894 1499 : n_var=1, type_of_var=real_t, default_r_val=1.5_dp)
895 1499 : CALL section_add_keyword(section, keyword)
896 1499 : CALL keyword_release(keyword)
897 :
898 : CALL keyword_create(keyword, __LOCATION__, name="MIN_RADIUS", &
899 : description="Specifies the smallest radius of the gaussian used in the fit. All other radius are"// &
900 : " obtained with the progression factor.", &
901 : usage="MIN_RADIUS {real}", &
902 1499 : unit_str="angstrom", n_var=1, type_of_var=real_t, default_r_val=0.5_dp)
903 1499 : CALL section_add_keyword(section, keyword)
904 1499 : CALL keyword_release(keyword)
905 :
906 : CALL keyword_create(keyword, __LOCATION__, name="RADII", &
907 : description="Specifies all the radius of the gaussian used in the fit for each atomic site. The use"// &
908 : " of this keyword disables all other keywords of this section.", &
909 : usage="RADII {real} {real} .. {real}", &
910 1499 : unit_str="angstrom", n_var=-1, type_of_var=real_t)
911 1499 : CALL section_add_keyword(section, keyword)
912 1499 : CALL keyword_release(keyword)
913 :
914 : CALL keyword_create(keyword, __LOCATION__, name="GCUT", &
915 : description="Cutoff for charge fit in G-space.", &
916 : usage="GCUT {real}", &
917 1499 : n_var=1, type_of_var=real_t, default_r_val=SQRT(6.0_dp))
918 1499 : CALL section_add_keyword(section, keyword)
919 1499 : CALL keyword_release(keyword)
920 :
921 : CALL cp_print_key_section_create(print_key, __LOCATION__, "program_run_info", &
922 : description="Controls the printing of basic information during the run", &
923 1499 : print_level=high_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
924 :
925 : CALL keyword_create(keyword, __LOCATION__, name="CONDITION_NUMBER", &
926 : description="Prints information regarding the condition numbers of the A matrix (to be inverted)", &
927 : usage="CONDITION_NUMBER <LOGICAL>", &
928 1499 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
929 1499 : CALL section_add_keyword(print_key, keyword)
930 1499 : CALL keyword_release(keyword)
931 :
932 1499 : CALL section_add_subsection(section, print_key)
933 1499 : CALL section_release(print_key)
934 :
935 1499 : END SUBROUTINE create_density_fitting_section
936 :
937 : ! **************************************************************************************************
938 : !> \brief creates the input section for the relativistic part
939 : !> \param section the section to create
940 : !> \author jens
941 : ! **************************************************************************************************
942 1499 : SUBROUTINE create_relativistic_section(section)
943 : TYPE(section_type), POINTER :: section
944 :
945 : TYPE(keyword_type), POINTER :: keyword
946 :
947 1499 : CPASSERT(.NOT. ASSOCIATED(section))
948 : CALL section_create(section, __LOCATION__, name="relativistic", &
949 : description="parameters needed and setup for relativistic calculations", &
950 1499 : n_keywords=5, n_subsections=0, repeats=.FALSE.)
951 :
952 1499 : NULLIFY (keyword)
953 :
954 : CALL keyword_create(keyword, __LOCATION__, name="method", &
955 : description="type of relativistic correction used", &
956 : usage="method (NONE|DKH|ZORA)", default_i_val=rel_none, &
957 : enum_c_vals=s2a("NONE", "DKH", "ZORA"), &
958 : enum_i_vals=[rel_none, rel_dkh, rel_zora], &
959 : enum_desc=s2a("Use no relativistic correction", &
960 : "Use Douglas-Kroll-Hess method", &
961 1499 : "Use ZORA method"))
962 1499 : CALL section_add_keyword(section, keyword)
963 1499 : CALL keyword_release(keyword)
964 :
965 : CALL keyword_create(keyword, __LOCATION__, name="DKH_order", &
966 : description="The order of the DKH transformation ", &
967 1499 : usage="DKH_order 2", default_i_val=2)
968 1499 : CALL section_add_keyword(section, keyword)
969 1499 : CALL keyword_release(keyword)
970 :
971 : CALL keyword_create(keyword, __LOCATION__, name="ZORA_type", &
972 : description="Type of ZORA method to be used", &
973 : usage="ZORA_type scMP", default_i_val=rel_zora_full, &
974 : enum_c_vals=s2a("FULL", "MP", "scMP"), &
975 : enum_desc=s2a("Full ZORA method (not implemented)", &
976 : "ZORA with atomic model potential", &
977 : "Scaled ZORA with atomic model potential"), &
978 1499 : enum_i_vals=[rel_zora_full, rel_zora_mp, rel_sczora_mp])
979 1499 : CALL section_add_keyword(section, keyword)
980 1499 : CALL keyword_release(keyword)
981 :
982 : CALL keyword_create(keyword, __LOCATION__, name="transformation", &
983 : description="Type of DKH transformation", &
984 : usage="transformation (FULL|MOLECULE|ATOM)", default_i_val=rel_trans_atom, &
985 : enum_c_vals=s2a("FULL", "MOLECULE", "ATOM"), &
986 : enum_i_vals=[rel_trans_full, rel_trans_molecule, rel_trans_atom], &
987 : enum_desc=s2a("Use full matrix transformation", &
988 : "Use transformation blocked by molecule", &
989 1499 : "Use atomic blocks"))
990 1499 : CALL section_add_keyword(section, keyword)
991 1499 : CALL keyword_release(keyword)
992 :
993 : CALL keyword_create(keyword, __LOCATION__, name="z_cutoff", &
994 : description="The minimal atomic number considered for atom transformation", &
995 1499 : usage="z_cutoff 50", default_i_val=1)
996 1499 : CALL section_add_keyword(section, keyword)
997 1499 : CALL keyword_release(keyword)
998 :
999 : CALL keyword_create(keyword, __LOCATION__, name="potential", &
1000 : description="External potential used in DKH transformation, full 1/r or erfc(r)/r", &
1001 : usage="POTENTIAL {FULL,ERFC}", default_i_val=rel_pot_erfc, &
1002 : enum_c_vals=s2a("FULL", "ERFC"), &
1003 1499 : enum_i_vals=[rel_pot_full, rel_pot_erfc])
1004 1499 : CALL section_add_keyword(section, keyword)
1005 1499 : CALL keyword_release(keyword)
1006 :
1007 1499 : END SUBROUTINE create_relativistic_section
1008 :
1009 : ! **************************************************************************************************
1010 : !> \brief creates the KG section
1011 : !> \param section ...
1012 : !> \author Martin Haeufel [2012.07]
1013 : ! **************************************************************************************************
1014 1499 : SUBROUTINE create_kg_section(section)
1015 : TYPE(section_type), POINTER :: section
1016 :
1017 : TYPE(keyword_type), POINTER :: keyword
1018 : TYPE(section_type), POINTER :: print_key, subsection
1019 :
1020 1499 : CPASSERT(.NOT. ASSOCIATED(section))
1021 : CALL section_create(section, __LOCATION__, name="KG_METHOD", &
1022 : description="Specifies the parameters for a Kim-Gordon-like partitioning"// &
1023 : " into molecular subunits", &
1024 : n_keywords=0, n_subsections=1, repeats=.FALSE., &
1025 5996 : citations=[Iannuzzi2006, Brelaz1979, Andermatt2016])
1026 :
1027 1499 : NULLIFY (keyword, subsection, print_key)
1028 :
1029 : ! add a XC section
1030 1499 : CALL create_xc_section(subsection)
1031 1499 : CALL section_add_subsection(section, subsection)
1032 1499 : CALL section_release(subsection)
1033 :
1034 : ! add LRI section
1035 1499 : CALL create_lrigpw_section(subsection)
1036 1499 : CALL section_add_subsection(section, subsection)
1037 1499 : CALL section_release(subsection)
1038 :
1039 : CALL keyword_create(keyword, __LOCATION__, name="COLORING_METHOD", &
1040 : description="Which algorithm to use for coloring.", &
1041 : usage="COLORING_METHOD GREEDY", &
1042 : default_i_val=kg_color_dsatur, &
1043 : enum_c_vals=s2a("DSATUR", "GREEDY"), &
1044 : enum_desc=s2a("Maximum degree of saturation, relatively accurate", &
1045 : "Greedy, fast coloring, less accurate"), &
1046 1499 : enum_i_vals=[kg_color_dsatur, kg_color_greedy])
1047 1499 : CALL section_add_keyword(section, keyword)
1048 1499 : CALL keyword_release(keyword)
1049 :
1050 : CALL keyword_create(keyword, __LOCATION__, name="TNADD_METHOD", &
1051 : description="Algorithm to use for the calculation of the nonadditive kinetic energy.", &
1052 : usage="TNADD_METHOD ATOMIC", &
1053 : default_i_val=kg_tnadd_embed, &
1054 : enum_c_vals=s2a("EMBEDDING", "RI_EMBEDDING", "ATOMIC", "NONE"), &
1055 : enum_desc=s2a("Use full embedding potential (see Iannuzzi et al)", &
1056 : "Use full embedding potential with RI density fitting", &
1057 : "Use sum of atomic model potentials", &
1058 : "Do not use kinetic energy embedding"), &
1059 1499 : enum_i_vals=[kg_tnadd_embed, kg_tnadd_embed_ri, kg_tnadd_atomic, kg_tnadd_none])
1060 1499 : CALL section_add_keyword(section, keyword)
1061 1499 : CALL keyword_release(keyword)
1062 :
1063 : CALL keyword_create(keyword, __LOCATION__, name="INTEGRATION_GRID", &
1064 : description="Grid [small,medium,large,huge]to be used for the TNADD integration.", &
1065 : usage="INTEGRATION_GRID MEDIUM", &
1066 1499 : default_c_val="MEDIUM")
1067 1499 : CALL section_add_keyword(section, keyword)
1068 1499 : CALL keyword_release(keyword)
1069 :
1070 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
1071 : description="Print section", &
1072 1499 : n_keywords=0, n_subsections=1, repeats=.FALSE.)
1073 :
1074 : CALL cp_print_key_section_create(print_key, __LOCATION__, "NEIGHBOR_LISTS", &
1075 : description="Controls the printing of the neighbor lists.", &
1076 1499 : print_level=low_print_level, filename="__STD_OUT__", unit_str="angstrom")
1077 :
1078 : CALL keyword_create(keyword, __LOCATION__, &
1079 : name="SAB_ORB_FULL", &
1080 : description="Activates the printing of the full orbital "// &
1081 : "orbital neighbor lists.", &
1082 : default_l_val=.FALSE., &
1083 1499 : lone_keyword_l_val=.TRUE.)
1084 1499 : CALL section_add_keyword(print_key, keyword)
1085 1499 : CALL keyword_release(keyword)
1086 :
1087 : CALL keyword_create(keyword, __LOCATION__, &
1088 : name="SAB_ORB_MOLECULAR", &
1089 : description="Activates the printing of the orbital "// &
1090 : "orbital neighbor lists for molecular subsets.", &
1091 : default_l_val=.FALSE., &
1092 1499 : lone_keyword_l_val=.TRUE.)
1093 1499 : CALL section_add_keyword(print_key, keyword)
1094 1499 : CALL keyword_release(keyword)
1095 :
1096 : CALL keyword_create(keyword, __LOCATION__, &
1097 : name="SAC_KIN", &
1098 : description="Activates the printing of the orbital "// &
1099 : "atomic potential neighbor list.", &
1100 : default_l_val=.FALSE., &
1101 1499 : lone_keyword_l_val=.TRUE.)
1102 1499 : CALL section_add_keyword(print_key, keyword)
1103 1499 : CALL keyword_release(keyword)
1104 :
1105 1499 : CALL section_add_subsection(subsection, print_key)
1106 1499 : CALL section_release(print_key)
1107 :
1108 1499 : CALL section_add_subsection(section, subsection)
1109 1499 : CALL section_release(subsection)
1110 :
1111 1499 : END SUBROUTINE create_kg_section
1112 :
1113 : ! **************************************************************************************************
1114 : !> \brief Create the BSSE section for counterpoise correction
1115 : !> \param section the section to create
1116 : !> \author teo
1117 : ! **************************************************************************************************
1118 1480 : SUBROUTINE create_bsse_section(section)
1119 : TYPE(section_type), POINTER :: section
1120 :
1121 : TYPE(keyword_type), POINTER :: keyword
1122 : TYPE(section_type), POINTER :: subsection
1123 :
1124 1480 : CPASSERT(.NOT. ASSOCIATED(section))
1125 : CALL section_create(section, __LOCATION__, name="BSSE", &
1126 : description="This section is used to set up the BSSE calculation. "// &
1127 : "It also requires that for each atomic kind X a kind X_ghost is present, "// &
1128 : "with the GHOST keyword specified, in addition to the other required fields.", &
1129 1480 : n_keywords=3, n_subsections=1, repeats=.FALSE.)
1130 :
1131 1480 : NULLIFY (keyword, subsection)
1132 : ! FRAGMENT SECTION
1133 : CALL section_create(subsection, __LOCATION__, name="FRAGMENT", &
1134 : description="Specify the atom number belonging to this fragment.", &
1135 1480 : n_keywords=2, n_subsections=0, repeats=.TRUE.)
1136 :
1137 : CALL keyword_create(keyword, __LOCATION__, name="LIST", &
1138 : description="Specifies a list of atoms.", &
1139 : usage="LIST {integer} {integer} .. {integer}", &
1140 1480 : repeats=.TRUE., n_var=-1, type_of_var=integer_t)
1141 1480 : CALL section_add_keyword(subsection, keyword)
1142 1480 : CALL keyword_release(keyword)
1143 :
1144 1480 : CALL section_add_subsection(section, subsection)
1145 1480 : CALL section_release(subsection)
1146 :
1147 : ! CONFIGURATION SECTION
1148 : CALL section_create(subsection, __LOCATION__, name="CONFIGURATION", &
1149 : description="Specify additional parameters for the combinatorial configurations. "// &
1150 : "Use this section to manually specify charge and multiplicity of the fragments "// &
1151 : "and their combinations.", &
1152 1480 : n_keywords=2, n_subsections=0, repeats=.TRUE.)
1153 :
1154 : CALL keyword_create(keyword, __LOCATION__, name="GLB_CONF", &
1155 : description="Specifies the global configuration using 1 or 0 for each fragment. "// &
1156 : "1 specifies the respective fragment as used, 0 as unused.", &
1157 : usage="GLB_CONF {integer} {integer} .. {integer}", &
1158 1480 : n_var=-1, type_of_var=integer_t)
1159 1480 : CALL section_add_keyword(subsection, keyword)
1160 1480 : CALL keyword_release(keyword)
1161 :
1162 : CALL keyword_create(keyword, __LOCATION__, name="SUB_CONF", &
1163 : description="Specifies the subconfiguration using 1 or 0 belonging to the global configuration. "// &
1164 : "1 specifies the respective fragment as real, 0 as ghost.", &
1165 : usage="SUB_CONF {integer} {integer} .. {integer}", &
1166 1480 : n_var=-1, type_of_var=integer_t)
1167 1480 : CALL section_add_keyword(subsection, keyword)
1168 1480 : CALL keyword_release(keyword)
1169 :
1170 : CALL keyword_create(keyword, __LOCATION__, &
1171 : name="MULTIPLICITY", &
1172 : variants=["MULTIP"], &
1173 : description="Specify for each fragment the multiplicity. Two times the total spin plus one. "// &
1174 : "Specify 3 for a triplet, 4 for a quartet,and so on. Default is 1 (singlet) for an "// &
1175 : "even number and 2 (doublet) for an odd number of electrons.", &
1176 : usage="MULTIPLICITY 3", &
1177 2960 : default_i_val=0) ! this default value is just a flag to get the above
1178 1480 : CALL section_add_keyword(subsection, keyword)
1179 1480 : CALL keyword_release(keyword)
1180 :
1181 : CALL keyword_create(keyword, __LOCATION__, name="CHARGE", &
1182 : description="The total charge for each fragment.", &
1183 : usage="CHARGE -1", &
1184 1480 : default_i_val=0)
1185 1480 : CALL section_add_keyword(subsection, keyword)
1186 1480 : CALL keyword_release(keyword)
1187 1480 : CALL section_add_subsection(section, subsection)
1188 1480 : CALL section_release(subsection)
1189 :
1190 : CALL section_create(subsection, __LOCATION__, name="FRAGMENT_ENERGIES", &
1191 : description="This section contains the energies of the fragments already"// &
1192 : " computed. It is useful as a summary and specifically for restarting BSSE runs.", &
1193 1480 : n_keywords=2, n_subsections=0, repeats=.TRUE.)
1194 : CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
1195 : description="The energy computed for each fragment", repeats=.TRUE., &
1196 1480 : usage="{REAL}", type_of_var=real_t)
1197 1480 : CALL section_add_keyword(subsection, keyword)
1198 1480 : CALL keyword_release(keyword)
1199 1480 : CALL section_add_subsection(section, subsection)
1200 1480 : CALL section_release(subsection)
1201 :
1202 1480 : CALL create_print_bsse_section(subsection)
1203 1480 : CALL section_add_subsection(section, subsection)
1204 1480 : CALL section_release(subsection)
1205 :
1206 1480 : END SUBROUTINE create_bsse_section
1207 :
1208 : ! **************************************************************************************************
1209 : !> \brief Create the print bsse section
1210 : !> \param section the section to create
1211 : !> \author teo
1212 : ! **************************************************************************************************
1213 1480 : SUBROUTINE create_print_bsse_section(section)
1214 : TYPE(section_type), POINTER :: section
1215 :
1216 : TYPE(section_type), POINTER :: print_key
1217 :
1218 1480 : CPASSERT(.NOT. ASSOCIATED(section))
1219 : CALL section_create(section, __LOCATION__, name="print", &
1220 : description="Section of possible print options in BSSE code.", &
1221 1480 : n_keywords=0, n_subsections=1, repeats=.FALSE.)
1222 :
1223 1480 : NULLIFY (print_key)
1224 : CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
1225 : description="Controls the printing of information regarding the run.", &
1226 1480 : print_level=low_print_level, filename="__STD_OUT__")
1227 1480 : CALL section_add_subsection(section, print_key)
1228 1480 : CALL section_release(print_key)
1229 :
1230 : CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
1231 : description="Controls the dumping of the restart file during BSSE runs. "// &
1232 : "By default the restart is updated after each configuration calculation is "// &
1233 : "completed.", &
1234 : print_level=silent_print_level, common_iter_levels=0, &
1235 1480 : add_last=add_last_numeric, filename="")
1236 1480 : CALL section_add_subsection(section, print_key)
1237 1480 : CALL section_release(print_key)
1238 :
1239 1480 : END SUBROUTINE create_print_bsse_section
1240 :
1241 : ! **************************************************************************************************
1242 : !> \brief input section for optional parameters for RIGPW
1243 : !> \param section the section to create
1244 : !> \author JGH [06.2017]
1245 : ! **************************************************************************************************
1246 0 : SUBROUTINE create_rigpw_section(section)
1247 : TYPE(section_type), POINTER :: section
1248 :
1249 0 : CPASSERT(.NOT. ASSOCIATED(section))
1250 : CALL section_create(section, __LOCATION__, name="RIGPW", &
1251 : description="This section specifies optional parameters for RIGPW.", &
1252 0 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
1253 :
1254 : ! CALL keyword_create(keyword, __LOCATION__, name="RI_OVERLAP_MATRIX", &
1255 : ! description="Specifies whether to calculate the inverse or the "// &
1256 : ! "pseudoinverse of the overlap matrix of the auxiliary "// &
1257 : ! "basis set. Calculating the pseudoinverse is necessary "// &
1258 : ! "for very large auxiliary basis sets, but more expensive. "// &
1259 : ! "Using the pseudoinverse, consistent forces are not "// &
1260 : ! "guaranteed yet.", &
1261 : ! usage="RI_OVERLAP_MATRIX INVERSE", &
1262 : ! enum_c_vals=s2a("INVERSE", "PSEUDO_INVERSE_SVD", "PSEUDO_INVERSE_DIAG", &
1263 : ! "AUTOSELECT"), &
1264 : ! enum_desc=s2a("Calculate inverse of the overlap matrix.", &
1265 : ! "Calculate the pseuodinverse of the overlap matrix "// &
1266 : ! "using singular value decomposition.", &
1267 : ! "Calculate the pseudoinverse of the overlap matrix "// &
1268 : ! "by prior diagonalization.", &
1269 : ! "Choose automatically for each pair whether to "// &
1270 : ! "calculate the inverse or pseudoinverse based on the "// &
1271 : ! "condition number of the overlap matrix for each pair. "// &
1272 : ! "Calculating the pseudoinverse is much more expensive."), &
1273 : ! enum_i_vals=(/do_lri_inv, do_lri_pseudoinv_svd, &
1274 : ! do_lri_pseudoinv_diag, do_lri_inv_auto/), &
1275 : ! default_i_val=do_lri_inv)
1276 : ! CALL section_add_keyword(section, keyword)
1277 : ! CALL keyword_release(keyword)
1278 :
1279 0 : END SUBROUTINE create_rigpw_section
1280 :
1281 : ! **************************************************************************************************
1282 : !> \brief creates the multigrid
1283 : !> \param section input section to create
1284 : !> \param create_subsections indicates whether or not subsections INTERPOLATOR and RS_GRID
1285 : !> should be created
1286 : !> \author fawzi
1287 : ! **************************************************************************************************
1288 4459 : SUBROUTINE create_mgrid_section(section, create_subsections)
1289 : TYPE(section_type), POINTER :: section
1290 : LOGICAL, INTENT(in) :: create_subsections
1291 :
1292 : TYPE(keyword_type), POINTER :: keyword
1293 : TYPE(section_type), POINTER :: subsection
1294 :
1295 4459 : CPASSERT(.NOT. ASSOCIATED(section))
1296 : CALL section_create(section, __LOCATION__, name="mgrid", &
1297 : description="Controls the multigrid used by GPW/GAPW to represent densities, "// &
1298 : "potentials, and Gaussian products on real-space grids.", &
1299 4459 : n_keywords=5, n_subsections=1, repeats=.FALSE.)
1300 4459 : NULLIFY (keyword)
1301 : CALL keyword_create(keyword, __LOCATION__, name="NGRIDS", &
1302 : description="Number of multigrid levels. Smooth Gaussian products can be mapped to "// &
1303 : "coarser levels, while sharper products require finer levels.", &
1304 4459 : usage="ngrids 1", default_i_val=4)
1305 4459 : CALL section_add_keyword(section, keyword)
1306 4459 : CALL keyword_release(keyword)
1307 :
1308 : CALL keyword_create(keyword, __LOCATION__, name="cutoff", &
1309 : description= &
1310 : "Plane-wave cutoff of the finest real-space grid level. "// &
1311 : "Increasing this value improves the grid representation, but it is "// &
1312 : "not a substitute for converging the Gaussian basis set. "// &
1313 : "Default value for SE or DFTB calculation is 1.0 [Ry].", &
1314 : usage="cutoff 300", &
1315 : default_r_val=cp_unit_to_cp2k(value=280.0_dp, unit_str="Ry"), &
1316 4459 : n_var=1, unit_str="Ry")
1317 4459 : CALL section_add_keyword(section, keyword)
1318 4459 : CALL keyword_release(keyword)
1319 :
1320 : CALL keyword_create(keyword, __LOCATION__, name="progression_factor", &
1321 : description="Factor used to derive the cutoff of coarser multigrid levels when "// &
1322 : "they are not given explicitly.", &
1323 4459 : usage="progression_factor <integer>", default_r_val=3._dp)
1324 4459 : CALL section_add_keyword(section, keyword)
1325 4459 : CALL keyword_release(keyword)
1326 :
1327 : CALL keyword_create(keyword, __LOCATION__, name="commensurate", &
1328 : description="If the grids should be commensurate. If true overrides "// &
1329 : "the progression factor and the cutoffs of the sub grids", &
1330 : usage="commensurate", default_l_val=.FALSE., &
1331 4459 : lone_keyword_l_val=.TRUE.)
1332 4459 : CALL section_add_keyword(section, keyword)
1333 4459 : CALL keyword_release(keyword)
1334 :
1335 : CALL keyword_create(keyword, __LOCATION__, name="realspace", &
1336 : description="If both rho and rho_gspace are needed ", &
1337 : usage="realspace", default_l_val=.FALSE., &
1338 4459 : lone_keyword_l_val=.TRUE.)
1339 4459 : CALL section_add_keyword(section, keyword)
1340 4459 : CALL keyword_release(keyword)
1341 :
1342 : CALL keyword_create(keyword, __LOCATION__, name="REL_CUTOFF", &
1343 : variants=["RELATIVE_CUTOFF"], &
1344 : description="Controls to which multigrid level a Gaussian product is mapped. "// &
1345 : "It is the reference cutoff for a Gaussian with exponent alpha=1. Larger values "// &
1346 : "keep more Gaussian products on finer grids and can be important for accurate "// &
1347 : "energies, forces, stress tensors, and variable-cell simulations.", &
1348 : usage="RELATIVE_CUTOFF real", default_r_val=20.0_dp, &
1349 8918 : unit_str="Ry")
1350 4459 : CALL section_add_keyword(section, keyword)
1351 4459 : CALL keyword_release(keyword)
1352 :
1353 : CALL keyword_create(keyword, __LOCATION__, name="MULTIGRID_SET", &
1354 : description="Activate a manual setting of the multigrids", &
1355 4459 : usage="MULTIGRID_SET", default_l_val=.FALSE.)
1356 4459 : CALL section_add_keyword(section, keyword)
1357 4459 : CALL keyword_release(keyword)
1358 :
1359 : CALL keyword_create(keyword, __LOCATION__, &
1360 : name="SKIP_LOAD_BALANCE_DISTRIBUTED", &
1361 : description="Skips load balancing on distributed multigrids. "// &
1362 : "Memory usage is O(p) so may be used "// &
1363 : "for all but the very largest runs.", &
1364 : usage="SKIP_LOAD_BALANCE_DISTRIBUTED", &
1365 : default_l_val=.FALSE., &
1366 4459 : lone_keyword_l_val=.TRUE.)
1367 : ! CALL keyword_create(keyword, __LOCATION__, name="SKIP_LOAD_BALANCE_DISTRIBUTED",&
1368 : ! description="Skip load balancing on distributed multigrids, which might be memory intensive."//&
1369 : ! "If not explicitly specified, runs using more than 1024 MPI tasks will default to .TRUE.",&
1370 : ! usage="SKIP_LOAD_BALANCE_DISTRIBUTED", default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1371 :
1372 4459 : CALL section_add_keyword(section, keyword)
1373 4459 : CALL keyword_release(keyword)
1374 :
1375 : CALL keyword_create(keyword, __LOCATION__, name="MULTIGRID_CUTOFF", &
1376 : variants=["CUTOFF_LIST"], &
1377 : description="List of cutoff values to set up multigrids manually", &
1378 : usage="MULTIGRID_CUTOFF 200.0 100.0 ", &
1379 : n_var=-1, &
1380 : type_of_var=real_t, &
1381 8918 : unit_str="Ry")
1382 4459 : CALL section_add_keyword(section, keyword)
1383 4459 : CALL keyword_release(keyword)
1384 :
1385 4459 : IF (create_subsections) THEN
1386 1499 : NULLIFY (subsection)
1387 1499 : CALL create_rsgrid_section(subsection)
1388 1499 : CALL section_add_subsection(section, subsection)
1389 1499 : CALL section_release(subsection)
1390 :
1391 1499 : NULLIFY (subsection)
1392 1499 : CALL create_interp_section(subsection)
1393 1499 : CALL section_add_subsection(section, subsection)
1394 1499 : CALL section_release(subsection)
1395 : END IF
1396 4459 : END SUBROUTINE create_mgrid_section
1397 :
1398 : ! **************************************************************************************************
1399 : !> \brief creates the interpolation section
1400 : !> \param section ...
1401 : !> \author tlaino
1402 : ! **************************************************************************************************
1403 11859 : SUBROUTINE create_interp_section(section)
1404 : TYPE(section_type), POINTER :: section
1405 :
1406 : TYPE(keyword_type), POINTER :: keyword
1407 : TYPE(section_type), POINTER :: print_key
1408 :
1409 11859 : CPASSERT(.NOT. ASSOCIATED(section))
1410 : CALL section_create(section, __LOCATION__, name="interpolator", &
1411 : description="kind of interpolation used between the multigrids", &
1412 11859 : n_keywords=5, n_subsections=0, repeats=.FALSE.)
1413 :
1414 11859 : NULLIFY (keyword, print_key)
1415 :
1416 : CALL keyword_create(keyword, __LOCATION__, name="kind", &
1417 : description="The interpolator to use. SPLINE3 automatically enables commensurate grids.", &
1418 : usage="kind spline3", &
1419 : default_i_val=pw_interp, &
1420 : enum_c_vals=s2a("pw", "spline3"), &
1421 11859 : enum_i_vals=[pw_interp, spline3_pbc_interp])
1422 11859 : CALL section_add_keyword(section, keyword)
1423 11859 : CALL keyword_release(keyword)
1424 :
1425 : CALL keyword_create(keyword, __LOCATION__, name="safe_computation", &
1426 : description="if a non unrolled calculation is to be performed in parallel", &
1427 : usage="safe_computation OFF", &
1428 : default_l_val=.FALSE., &
1429 11859 : lone_keyword_l_val=.TRUE.)
1430 11859 : CALL section_add_keyword(section, keyword)
1431 11859 : CALL keyword_release(keyword)
1432 :
1433 : CALL keyword_create(keyword, __LOCATION__, name="aint_precond", &
1434 : description="the approximate inverse to use to get the starting point"// &
1435 : " for the linear solver of the spline3 methods", &
1436 : usage="aint_precond copy", &
1437 : default_i_val=precond_spl3_aint, &
1438 : enum_c_vals=s2a("copy", "spl3_nopbc_aint1", "spl3_nopbc_aint2", &
1439 : "spl3_nopbc_precond1", "spl3_nopbc_precond2", "spl3_nopbc_precond3"), &
1440 : enum_i_vals=[no_precond, precond_spl3_aint, precond_spl3_aint2, &
1441 11859 : precond_spl3_1, precond_spl3_2, precond_spl3_3])
1442 11859 : CALL section_add_keyword(section, keyword)
1443 11859 : CALL keyword_release(keyword)
1444 :
1445 : CALL keyword_create(keyword, __LOCATION__, name="precond", &
1446 : description="The preconditioner used"// &
1447 : " for the linear solver of the spline3 methods", &
1448 : usage="PRECOND copy", &
1449 : default_i_val=precond_spl3_3, &
1450 : enum_c_vals=s2a("copy", "spl3_nopbc_aint1", "spl3_nopbc_aint2", &
1451 : "spl3_nopbc_precond1", "spl3_nopbc_precond2", "spl3_nopbc_precond3"), &
1452 : enum_i_vals=[no_precond, precond_spl3_aint, precond_spl3_aint2, &
1453 11859 : precond_spl3_1, precond_spl3_2, precond_spl3_3])
1454 11859 : CALL section_add_keyword(section, keyword)
1455 11859 : CALL keyword_release(keyword)
1456 :
1457 : CALL keyword_create(keyword, __LOCATION__, name="eps_x", &
1458 : description="accuracy on the solution for spline3 the interpolators", &
1459 11859 : usage="eps_x 1.e-15", default_r_val=1.e-10_dp)
1460 11859 : CALL section_add_keyword(section, keyword)
1461 11859 : CALL keyword_release(keyword)
1462 :
1463 : CALL keyword_create(keyword, __LOCATION__, name="eps_r", &
1464 : description="accuracy on the residual for spline3 the interpolators", &
1465 11859 : usage="eps_r 1.e-15", default_r_val=1.e-10_dp)
1466 11859 : CALL section_add_keyword(section, keyword)
1467 11859 : CALL keyword_release(keyword)
1468 :
1469 : CALL keyword_create(keyword, __LOCATION__, name="max_iter", &
1470 : variants=['maxiter'], &
1471 : description="the maximum number of iterations", &
1472 23718 : usage="max_iter 200", default_i_val=100)
1473 11859 : CALL section_add_keyword(section, keyword)
1474 11859 : CALL keyword_release(keyword)
1475 :
1476 11859 : NULLIFY (print_key)
1477 : CALL cp_print_key_section_create(print_key, __LOCATION__, "conv_info", &
1478 : description="if convergence information about the linear solver"// &
1479 : " of the spline methods should be printed", &
1480 : print_level=medium_print_level, each_iter_names=s2a("SPLINE_FIND_COEFFS"), &
1481 : each_iter_values=[10], filename="__STD_OUT__", &
1482 11859 : add_last=add_last_numeric)
1483 11859 : CALL section_add_subsection(section, print_key)
1484 11859 : CALL section_release(print_key)
1485 :
1486 11859 : END SUBROUTINE create_interp_section
1487 :
1488 : ! **************************************************************************************************
1489 : !> \brief creates the sic (self interaction correction) section
1490 : !> \param section ...
1491 : !> \author fawzi
1492 : ! **************************************************************************************************
1493 1499 : SUBROUTINE create_sic_section(section)
1494 : TYPE(section_type), POINTER :: section
1495 :
1496 : TYPE(keyword_type), POINTER :: keyword
1497 :
1498 1499 : CPASSERT(.NOT. ASSOCIATED(section))
1499 : CALL section_create(section, __LOCATION__, name="sic", &
1500 : description="parameters for the self interaction correction", &
1501 : n_keywords=6, n_subsections=0, repeats=.FALSE., &
1502 5996 : citations=[VandeVondele2005b, Perdew1981, Avezac2005])
1503 :
1504 1499 : NULLIFY (keyword)
1505 :
1506 : CALL keyword_create(keyword, __LOCATION__, name="SIC_SCALING_A", &
1507 : description="Scaling of the coulomb term in sic [experimental]", &
1508 : usage="SIC_SCALING_A 0.5", &
1509 : citations=[VandeVondele2005b], &
1510 2998 : default_r_val=1.0_dp)
1511 1499 : CALL section_add_keyword(section, keyword)
1512 1499 : CALL keyword_release(keyword)
1513 :
1514 : CALL keyword_create(keyword, __LOCATION__, name="SIC_SCALING_B", &
1515 : description="Scaling of the xc term in sic [experimental]", &
1516 : usage="SIC_SCALING_B 0.5", &
1517 : citations=[VandeVondele2005b], &
1518 2998 : default_r_val=1.0_dp)
1519 1499 : CALL section_add_keyword(section, keyword)
1520 1499 : CALL keyword_release(keyword)
1521 :
1522 : CALL keyword_create(keyword, __LOCATION__, name="SIC_METHOD", &
1523 : description="Method used to remove the self interaction", &
1524 : usage="SIC_METHOD MAURI_US", &
1525 : default_i_val=sic_none, &
1526 : enum_c_vals=s2a("NONE", "MAURI_US", "MAURI_SPZ", "AD", "EXPLICIT_ORBITALS"), &
1527 : enum_i_vals=[sic_none, sic_mauri_us, sic_mauri_spz, sic_ad, sic_eo], &
1528 : enum_desc=s2a("Do not apply a sic correction", &
1529 : "Employ a (scaled) correction proposed by Mauri and co-workers"// &
1530 : " on the spin density / doublet unpaired orbital", &
1531 : "Employ a (scaled) Perdew-Zunger expression"// &
1532 : " on the spin density / doublet unpaired orbital", &
1533 : "The average density correction", &
1534 : "(scaled) Perdew-Zunger correction explicitly on a set of orbitals."), &
1535 5996 : citations=[VandeVondele2005b, Perdew1981, Avezac2005])
1536 1499 : CALL section_add_keyword(section, keyword)
1537 1499 : CALL keyword_release(keyword)
1538 :
1539 : CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_SET", &
1540 : description="Type of orbitals treated with the SIC", &
1541 : usage="ORBITAL_SET ALL", &
1542 : default_i_val=sic_list_unpaired, &
1543 : enum_c_vals=s2a("UNPAIRED", "ALL"), &
1544 : enum_desc=s2a("correction for the unpaired orbitals only, requires a restricted open shell calculation", &
1545 : "correction for all orbitals, requires a LSD or ROKS calculation"), &
1546 1499 : enum_i_vals=[sic_list_unpaired, sic_list_all])
1547 1499 : CALL section_add_keyword(section, keyword)
1548 1499 : CALL keyword_release(keyword)
1549 :
1550 1499 : END SUBROUTINE create_sic_section
1551 :
1552 : ! **************************************************************************************************
1553 : !> \brief creates the low spin roks section
1554 : !> \param section ...
1555 : !> \author Joost VandeVondele
1556 : ! **************************************************************************************************
1557 1499 : SUBROUTINE create_low_spin_roks_section(section)
1558 : TYPE(section_type), POINTER :: section
1559 :
1560 : TYPE(keyword_type), POINTER :: keyword
1561 :
1562 1499 : CPASSERT(.NOT. ASSOCIATED(section))
1563 : CALL section_create(section, __LOCATION__, name="LOW_SPIN_ROKS", &
1564 : description="Specify the details of the low spin ROKS method. "// &
1565 : "In particular, one can specify various terms added to the energy of the high spin roks configuration"// &
1566 : " with an energy scaling factor, and a prescription of the spin state. "// &
1567 : "With METHOD GAPW, energies and orbital derivatives are supported for LDA/GGA, "// &
1568 : "hybrids (without ADMM), tau-dependent meta-GGAs, and molecular GauXC/Skala. "// &
1569 : "Nuclear forces, analytical stress, and native-grid Skala are not supported with GAPW. "// &
1570 : "The GauXC path requires isolated all-electron calculations with HOST execution.", &
1571 1499 : n_keywords=6, n_subsections=0, repeats=.FALSE.)
1572 :
1573 1499 : NULLIFY (keyword)
1574 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_SCALING", &
1575 : description="The scaling factors for each term added to the total energy. "// &
1576 : "This list should contain one number for each term added to the total energy.", &
1577 : usage="ENERGY_SCALING 1.0 -1.0 ", &
1578 1499 : n_var=-1, type_of_var=real_t, repeats=.FALSE.)
1579 1499 : CALL section_add_keyword(section, keyword)
1580 1499 : CALL keyword_release(keyword)
1581 : CALL keyword_create( &
1582 : keyword, __LOCATION__, name="SPIN_CONFIGURATION", &
1583 : description="For each singly occupied orbital, specify if this should be an alpha (=1) or a beta (=2) orbital. "// &
1584 : "This keyword should be repeated, each repetition corresponding to an additional term.", &
1585 : usage="SPIN_CONFIGURATION 1 2", &
1586 1499 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
1587 1499 : CALL section_add_keyword(section, keyword)
1588 1499 : CALL keyword_release(keyword)
1589 :
1590 1499 : END SUBROUTINE create_low_spin_roks_section
1591 :
1592 : ! **************************************************************************************************
1593 : !> \brief ...
1594 : !> \param section ...
1595 : ! **************************************************************************************************
1596 1499 : SUBROUTINE create_rtp_section(section)
1597 : TYPE(section_type), POINTER :: section
1598 :
1599 : TYPE(keyword_type), POINTER :: keyword
1600 : TYPE(section_type), POINTER :: print_key, print_section, subsection
1601 :
1602 1499 : NULLIFY (keyword)
1603 1499 : CPASSERT(.NOT. ASSOCIATED(section))
1604 : CALL section_create(section, __LOCATION__, name="REAL_TIME_PROPAGATION", &
1605 : description="Parameters needed to set up the real time propagation"// &
1606 : " for the electron dynamics. This currently works only in the NVE ensemble.", &
1607 : n_keywords=4, n_subsections=4, repeats=.FALSE., &
1608 5996 : citations=[Kunert2003, Andermatt2016, Mattiat2022])
1609 :
1610 : CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
1611 : description="Maximal number of iterations for the self consistent propagator loop.", &
1612 : usage="MAX_ITER 10", &
1613 1499 : default_i_val=10)
1614 1499 : CALL section_add_keyword(section, keyword)
1615 1499 : CALL keyword_release(keyword)
1616 :
1617 : CALL keyword_create(keyword, __LOCATION__, name="EPS_ITER", &
1618 : description="Convergence criterion for the self consistent propagator loop.", &
1619 : usage="EPS_ITER 1.0E-5", &
1620 1499 : default_r_val=1.0E-7_dp)
1621 1499 : CALL section_add_keyword(section, keyword)
1622 1499 : CALL keyword_release(keyword)
1623 :
1624 : CALL keyword_create(keyword, __LOCATION__, name="ASPC_ORDER", &
1625 : description="Speciefies how many steps will be used for extrapolation. "// &
1626 : "One will be always used which is means X(t+dt)=X(t)", &
1627 : usage="ASPC_ORDER 3", &
1628 1499 : default_i_val=3)
1629 1499 : CALL section_add_keyword(section, keyword)
1630 1499 : CALL keyword_release(keyword)
1631 :
1632 : CALL keyword_create(keyword, __LOCATION__, name="MAT_EXP", &
1633 : description="Which method should be used to calculate the exponential"// &
1634 : " in the propagator. It is recommended to use BCH when employing density_propagation "// &
1635 : "and ARNOLDI otherwise.", &
1636 : usage="MAT_EXP TAYLOR", default_i_val=do_arnoldi, &
1637 : enum_c_vals=s2a("TAYLOR", "PADE", "ARNOLDI", "BCH", "EXACT"), &
1638 : enum_i_vals=[do_taylor, do_pade, do_arnoldi, do_bch, do_exact], &
1639 : enum_desc=s2a("exponential is evaluated using scaling and squaring in combination"// &
1640 : " with a taylor expansion of the exponential.", &
1641 : "uses scaling and squaring together with the pade approximation", &
1642 : "uses arnoldi subspace algorithm to compute exp(H)*MO directly, can't be used in "// &
1643 : "combination with Crank Nicholson or density propagation", &
1644 : "Uses a Baker-Campbell-Hausdorff expansion to propagate the density matrix,"// &
1645 : " only works for density propagation", &
1646 : "Uses diagonalisation of the exponent matrices to determine the "// &
1647 1499 : "matrix exponential exactly. Only implemented for GWBSE."))
1648 1499 : CALL section_add_keyword(section, keyword)
1649 1499 : CALL keyword_release(keyword)
1650 :
1651 : CALL keyword_create(keyword, __LOCATION__, name="DENSITY_PROPAGATION", &
1652 : description="The density matrix is propagated instead of the molecular orbitals. "// &
1653 : "This can allow a linear scaling simulation. The density matrix is filtered with "// &
1654 : "the threshold based on the EPS_FILTER keyword from the LS_SCF section", &
1655 : usage="DENSITY_PROPAGATION .TRUE.", &
1656 1499 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1657 1499 : CALL section_add_keyword(section, keyword)
1658 1499 : CALL keyword_release(keyword)
1659 :
1660 : CALL keyword_create(keyword, __LOCATION__, name="SC_CHECK_START", &
1661 : description="Speciefies how many iteration steps will be done without "// &
1662 : "a check for self consistency. Can save some time in big calculations.", &
1663 : usage="SC_CHECK_START 3", &
1664 1499 : default_i_val=0)
1665 1499 : CALL section_add_keyword(section, keyword)
1666 1499 : CALL keyword_release(keyword)
1667 :
1668 : CALL keyword_create(keyword, __LOCATION__, name="EXP_ACCURACY", &
1669 : description="Accuracy for the taylor and pade approximation. "// &
1670 : "This is only an upper bound bound since the norm used for the guess "// &
1671 : "is an upper bound for the needed one.", &
1672 : usage="EXP_ACCURACY 1.0E-6", &
1673 1499 : default_r_val=1.0E-9_dp)
1674 1499 : CALL section_add_keyword(section, keyword)
1675 1499 : CALL keyword_release(keyword)
1676 :
1677 : CALL keyword_create(keyword, __LOCATION__, name="PROPAGATOR", &
1678 : description="Which propagator should be used for the orbitals", &
1679 : usage="PROPAGATOR ETRS", default_i_val=do_etrs, &
1680 : enum_c_vals=s2a("ETRS", "CN", "EM"), &
1681 : enum_i_vals=[do_etrs, do_cn, do_em], &
1682 : enum_desc=s2a("enforced time reversible symmetry", &
1683 : "Crank Nicholson propagator", &
1684 1499 : "Exponential midpoint propagator"))
1685 1499 : CALL section_add_keyword(section, keyword)
1686 1499 : CALL keyword_release(keyword)
1687 :
1688 : CALL keyword_create(keyword, __LOCATION__, name="INITIAL_WFN", &
1689 : description="Controls the initial WFN used for propagation. "// &
1690 : "Note that some energy contributions may not be "// &
1691 : "initialized in the restart cases, for instance "// &
1692 : "electronic entropy energy in the case of smearing.", &
1693 : usage="INITIAL_WFN SCF_WFN", default_i_val=use_scf_wfn, &
1694 : enum_c_vals=s2a("SCF_WFN", "RESTART_WFN", "RT_RESTART"), &
1695 : enum_i_vals=[use_scf_wfn, use_restart_wfn, use_rt_restart], &
1696 : enum_desc=s2a("An SCF run is performed to get the initial state.", &
1697 : "A wavefunction from a previous SCF is propagated. Especially useful,"// &
1698 : " if electronic constraints or restraints are used in the previous calculation, "// &
1699 : "since these do not work in the rtp scheme.", &
1700 1499 : "use the wavefunction of a real time propagation/ehrenfest run"))
1701 1499 : CALL section_add_keyword(section, keyword)
1702 1499 : CALL keyword_release(keyword)
1703 :
1704 : CALL keyword_create(keyword, __LOCATION__, name="APPLY_WFN_MIX_INIT_RESTART", &
1705 : description="If set to True and in the case of INITIAL_WFN=RESTART_WFN, call the "// &
1706 : "DFT%PRINT%WFN_MIX section to mix the read initial wfn. The starting wave-function of the "// &
1707 : "RTP will be the mixed one. Setting this to True without a defined WFN_MIX section will "// &
1708 : "not do anything as defining a WFN_MIX section without this keyword for RTP run with "// &
1709 : "INITIAL_WFN=RESTART_WFN. Note that if INITIAL_WFN=SCF_WFN, this keyword is not needed to "// &
1710 : "apply the mixing defined in the WFN_MIX section. Default is False.", &
1711 : usage="APPLY_WFN_MIX_INIT_RESTART", &
1712 1499 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1713 1499 : CALL section_add_keyword(section, keyword)
1714 1499 : CALL keyword_release(keyword)
1715 :
1716 : CALL keyword_create(keyword, __LOCATION__, name="LOCALIZE_INITIAL_WFN", &
1717 : description="Replace the occupied orbitals of the initial wavefunction by "// &
1718 : "localized orbitals, computed as requested in the DFT%LOCALIZE section, "// &
1719 : "before the propagation starts. Applies to INITIAL_WFN SCF_WFN and RESTART_WFN; "// &
1720 : "with RESTART_WFN the localization is done before APPLY_WFN_MIX_INIT_RESTART, so that "// &
1721 : "WFN_MIX acts on the localized orbitals. The rotation is unitary within orbitals "// &
1722 : "of equal occupation: the density matrix and all observables are unchanged, "// &
1723 : "only the orbital representation of the propagated wavefunction differs. "// &
1724 : "Ignored with INITIAL_WFN RT_RESTART and in the linear scaling propagation.", &
1725 : usage="LOCALIZE_INITIAL_WFN", &
1726 1499 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1727 1499 : CALL section_add_keyword(section, keyword)
1728 1499 : CALL keyword_release(keyword)
1729 :
1730 : CALL keyword_create(keyword, __LOCATION__, name="APPLY_DELTA_PULSE", &
1731 : description="Applies a delta kick to the initial wfn (only RTP for now - the EMD"// &
1732 : " case is not yet implemented). Only work for INITIAL_WFN=SCF_WFN", &
1733 : usage="APPLY_DELTA_PULSE", &
1734 1499 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1735 1499 : CALL section_add_keyword(section, keyword)
1736 1499 : CALL keyword_release(keyword)
1737 :
1738 : CALL keyword_create(keyword, __LOCATION__, name="APPLY_DELTA_PULSE_MAG", &
1739 : description="Applies a magnetic delta kick to the initial wfn (only RTP for now - the EMD"// &
1740 : " case is not yet implemented). Only work for INITIAL_WFN=SCF_WFN", &
1741 : usage="APPLY_DELTA_PULSE_MAG", &
1742 1499 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1743 1499 : CALL section_add_keyword(section, keyword)
1744 1499 : CALL keyword_release(keyword)
1745 :
1746 : CALL keyword_create(keyword, __LOCATION__, name="VELOCITY_GAUGE", &
1747 : description="Perform propagation in the velocity gauge using the explicit vector potential"// &
1748 : " only a constant vector potential as of now (corresonding to a delta-pulse)."// &
1749 : " uses DELTA_PULSE_SCALE and DELTA_PULSE_DIRECTION to define the vector potential", &
1750 : usage="VELOCITY_GAUGE T", &
1751 1499 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1752 1499 : CALL section_add_keyword(section, keyword)
1753 1499 : CALL keyword_release(keyword)
1754 :
1755 : CALL keyword_create(keyword, __LOCATION__, name="GAUGE_ORIG", &
1756 : description="Define gauge origin for magnetic perturbation", &
1757 : usage="GAUGE_ORIG COM", &
1758 : enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
1759 : enum_desc=s2a("Use Center of Mass", &
1760 : "Use Center of Atomic Charges", &
1761 : "Use User Defined Point (Keyword:REF_POINT)", &
1762 : "Use Origin of Coordinate System"), &
1763 : enum_i_vals=[use_mom_ref_com, &
1764 : use_mom_ref_coac, &
1765 : use_mom_ref_user, &
1766 : use_mom_ref_zero], &
1767 1499 : default_i_val=use_mom_ref_com)
1768 1499 : CALL section_add_keyword(section, keyword)
1769 1499 : CALL keyword_release(keyword)
1770 :
1771 : CALL keyword_create(keyword, __LOCATION__, name="GAUGE_ORIG_MANUAL", &
1772 : description="Manually defined gauge origin for magnetic perturbation [in Bohr!]", &
1773 : usage="GAUGE_ORIG_MANUAL x y z", &
1774 : repeats=.FALSE., &
1775 : n_var=3, default_r_vals=[0._dp, 0._dp, 0._dp], &
1776 : type_of_var=real_t, &
1777 1499 : unit_str='bohr')
1778 1499 : CALL section_add_keyword(section, keyword)
1779 1499 : CALL keyword_release(keyword)
1780 :
1781 : CALL keyword_create(keyword, __LOCATION__, name="VG_COM_NL", &
1782 : description="apply gauge transformed non-local potential term"// &
1783 : " only affects VELOCITY_GAUGE=.TRUE.", &
1784 : usage="VG_COM_NL T", &
1785 1499 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1786 1499 : CALL section_add_keyword(section, keyword)
1787 1499 : CALL keyword_release(keyword)
1788 :
1789 : CALL keyword_create(keyword, __LOCATION__, name="COM_NL", &
1790 : description="Include non-local commutator for periodic delta pulse."// &
1791 : " only affects PERIODIC=.TRUE.", &
1792 : usage="COM_NL", &
1793 1499 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1794 1499 : CALL section_add_keyword(section, keyword)
1795 1499 : CALL keyword_release(keyword)
1796 :
1797 : CALL keyword_create(keyword, __LOCATION__, name="LEN_REP", &
1798 : description="Use length representation delta pulse (in conjunction with PERIODIC T)."// &
1799 : " This corresponds to a 1st order perturbation in the length gauge."// &
1800 : " Note that this is NOT compatible with a periodic calculation!"// &
1801 : " Uses the reference point defined in DFT%PRINT%MOMENTS ", &
1802 : usage="LEN_REP T", &
1803 1499 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1804 1499 : CALL section_add_keyword(section, keyword)
1805 1499 : CALL keyword_release(keyword)
1806 :
1807 : CALL keyword_create(keyword, __LOCATION__, name="PERIODIC", &
1808 : description="Apply a delta-kick that is compatible with periodic boundary conditions"// &
1809 : " for any value of DELTA_PULSE_SCALE. Uses perturbation theory for the preparation of"// &
1810 : " the initial wfn with the velocity operator as perturbation."// &
1811 : " If LEN_REP is .FALSE. this corresponds to a first order velocity gauge."// &
1812 : " Note that the pulse is only applied when INITIAL_WFN is set to SCF_WFN,"// &
1813 : " and not for restarts (RT_RESTART).", &
1814 : usage="PERIODIC", &
1815 1499 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1816 1499 : CALL section_add_keyword(section, keyword)
1817 1499 : CALL keyword_release(keyword)
1818 :
1819 : CALL keyword_create(keyword, __LOCATION__, name="LOCALIZE", &
1820 : description="Localise the Molecular orbitals each n steps "// &
1821 : "real-time propagated TDDFT, 0 means never localise", &
1822 1499 : usage="LOCALIZE", default_i_val=0)
1823 1499 : CALL section_add_keyword(section, keyword)
1824 1499 : CALL keyword_release(keyword)
1825 :
1826 : CALL keyword_create(keyword, __LOCATION__, name="DELTA_PULSE_DIRECTION", &
1827 : description="Direction of the applied electric field. The k vector is given as"// &
1828 : " 2*Pi*[i,j,k]*inv(h_mat), which for PERIODIC .FALSE. yields exp(ikr) periodic with"// &
1829 : " the unit cell, only if DELTA_PULSE_SCALE is set to unity. For an orthorhombic cell"// &
1830 : " [1,0,0] yields [2*Pi/L_x,0,0]. For small cells, this results in a very large kick.", &
1831 : usage="DELTA_PULSE_DIRECTION 1 1 1", n_var=3, default_i_vals=[1, 0, 0], &
1832 1499 : type_of_var=integer_t)
1833 1499 : CALL section_add_keyword(section, keyword)
1834 1499 : CALL keyword_release(keyword)
1835 :
1836 : CALL keyword_create(keyword, __LOCATION__, name="DELTA_PULSE_SCALE", &
1837 : description="Scale the k vector, which for PERIODIC .FALSE. results in exp(ikr) no"// &
1838 : " longer being periodic with the unit cell. The norm of k is the strength of the"// &
1839 : " applied electric field in atomic units.", &
1840 1499 : usage="DELTA_PULSE_SCALE 0.01 ", n_var=1, default_r_val=0.001_dp)
1841 1499 : CALL section_add_keyword(section, keyword)
1842 1499 : CALL keyword_release(keyword)
1843 :
1844 : CALL keyword_create(keyword, __LOCATION__, name="HFX_BALANCE_IN_CORE", &
1845 : description="If HFX is used, this keyword forces a redistribution/recalculation"// &
1846 : " of the integrals, balanced with respect to the in core steps.", &
1847 : usage="HFX_BALANCE_IN_CORE", &
1848 1499 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1849 1499 : CALL section_add_keyword(section, keyword)
1850 1499 : CALL keyword_release(keyword)
1851 :
1852 : CALL keyword_create(keyword, __LOCATION__, name="MCWEENY_MAX_ITER", &
1853 : description="Determines the maximum amount of McWeeny steps used after each converged"// &
1854 : " step in density propagation", &
1855 1499 : usage="MCWEENY_MAX_ITER 2", default_i_val=1)
1856 1499 : CALL section_add_keyword(section, keyword)
1857 1499 : CALL keyword_release(keyword)
1858 :
1859 : CALL keyword_create( &
1860 : keyword, __LOCATION__, name="ACCURACY_REFINEMENT", &
1861 : description="If using density propagation some parts should be calculated with a higher accuracy than the rest"// &
1862 : " to reduce numerical noise. This factor determines by how much the filtering threshold is"// &
1863 : " reduced for these calculations.", &
1864 1499 : usage="ACCURACY_REFINEMENT", default_i_val=100)
1865 1499 : CALL section_add_keyword(section, keyword)
1866 1499 : CALL keyword_release(keyword)
1867 :
1868 : CALL keyword_create(keyword, __LOCATION__, name="MCWEENY_EPS", &
1869 : description="Threshold after which McWeeny is terminated", &
1870 : usage="MCWEENY_EPS 0.00001", &
1871 1499 : default_r_val=0.0_dp)
1872 1499 : CALL section_add_keyword(section, keyword)
1873 1499 : CALL keyword_release(keyword)
1874 :
1875 1499 : NULLIFY (print_section)
1876 : CALL section_create(print_section, __LOCATION__, name="PRINT", &
1877 : description="Section of possible print options for an RTP runs", &
1878 1499 : repeats=.FALSE.)
1879 :
1880 1499 : NULLIFY (print_key)
1881 : CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
1882 : description="Controls the printing within real time propagation and Eherenfest dynamics", &
1883 1499 : print_level=low_print_level, filename="__STD_OUT__")
1884 1499 : CALL section_add_subsection(print_section, print_key)
1885 1499 : CALL section_release(print_key)
1886 :
1887 : CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
1888 : description="Controls the dumping of the latest wavefunction restart "// &
1889 : "file during rtp. In density propagation this controls the printing "// &
1890 : "of density matrix. See also RESTART_HISTORY.", &
1891 : print_level=low_print_level, common_iter_levels=3, &
1892 : each_iter_names=s2a("MD"), each_iter_values=[20], &
1893 1499 : add_last=add_last_numeric, filename="RESTART", do_backup=.TRUE.)
1894 1499 : CALL section_add_subsection(print_section, print_key)
1895 1499 : CALL section_release(print_key)
1896 :
1897 : CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART_HISTORY", &
1898 : description="Dumps unique wavefunction restart files during the run, "// &
1899 : "keeping all of them. In density propagation it dumps the density "// &
1900 : "matrix instead. For the latest wavefunction restart file, see RESTART.", &
1901 : print_level=low_print_level, common_iter_levels=0, &
1902 : each_iter_names=s2a("MD"), &
1903 : each_iter_values=[500], &
1904 1499 : filename="RESTART", do_backup=.TRUE.)
1905 1499 : CALL section_add_subsection(print_section, print_key)
1906 1499 : CALL section_release(print_key)
1907 :
1908 : CALL cp_print_key_section_create(print_key, __LOCATION__, "FIELD", &
1909 : description="Print the time-dependent field applied during an EMD simulation in "// &
1910 : "atomic unit.", &
1911 : print_level=high_print_level, common_iter_levels=1, &
1912 : each_iter_names=s2a("MD"), &
1913 : each_iter_values=[1], &
1914 1499 : filename="FIELD")
1915 1499 : CALL section_add_subsection(print_section, print_key)
1916 1499 : CALL section_release(print_key)
1917 :
1918 1499 : CALL create_projection_rtp_section(print_key)
1919 1499 : CALL section_add_subsection(print_section, print_key)
1920 1499 : CALL section_release(print_key)
1921 :
1922 : CALL cp_print_key_section_create(print_key, __LOCATION__, "CURRENT_INT", &
1923 : description="Print the integral of the current density (only if the"// &
1924 : " imaginary part of the density is NOT zero).", &
1925 : print_level=high_print_level, common_iter_levels=1, &
1926 : each_iter_names=s2a("MD"), &
1927 : each_iter_values=[1], &
1928 1499 : filename="rtp_j_int")
1929 1499 : CALL section_add_subsection(print_section, print_key)
1930 1499 : CALL section_release(print_key)
1931 :
1932 : CALL cp_print_key_section_create(print_key, __LOCATION__, "CURRENT", &
1933 : description="Print the current during an EMD simulation to cube files.", &
1934 : print_level=high_print_level, common_iter_levels=0, &
1935 : each_iter_names=s2a("MD"), &
1936 : each_iter_values=[20], &
1937 1499 : filename="current", do_backup=.TRUE.)
1938 : CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
1939 : description="The stride (X,Y,Z) used to write the cube file "// &
1940 : "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1941 : " 1 number valid for all components.", &
1942 1499 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
1943 1499 : CALL section_add_keyword(print_key, keyword)
1944 1499 : CALL keyword_release(keyword)
1945 :
1946 1499 : CALL section_add_subsection(print_section, print_key)
1947 1499 : CALL section_release(print_key)
1948 :
1949 : ! Marek : Add print option for ASCII density files - DEVELPMENT ONLY?
1950 : CALL cp_print_key_section_create(print_key, __LOCATION__, "DENSITY_MATRIX", &
1951 : description="Prints the density matrix at iterations in clear text to a file", &
1952 : print_level=high_print_level, common_iter_levels=0, &
1953 : each_iter_names=s2a("MD"), &
1954 : each_iter_values=[1], &
1955 1499 : filename="rho")
1956 1499 : CALL section_add_subsection(print_section, print_key)
1957 1499 : CALL section_release(print_key)
1958 : ! Marek : Moments ASCII print
1959 : CALL cp_print_key_section_create(print_key, __LOCATION__, "MOMENTS", &
1960 : description="Prints the time-dependent electronic moments at "// &
1961 : "iterations in clear text to a file.", &
1962 : print_level=high_print_level, common_iter_levels=1, &
1963 : each_iter_names=s2a("MD"), &
1964 : each_iter_values=[1], &
1965 1499 : filename="__STD_OUT__")
1966 : CALL keyword_create(keyword, __LOCATION__, name="REFERENCE", &
1967 : variants=s2a("REF"), &
1968 : description="Define the reference point for the calculation of the electrostatic moment.", &
1969 : usage="REFERENCE COM", &
1970 : enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
1971 : enum_desc=s2a("Use Center of Mass", &
1972 : "Use Center of Atomic Charges", &
1973 : "Use User Defined Point (Keyword:REFERENCE_POINT)", &
1974 : "Use Origin of Coordinate System"), &
1975 : enum_i_vals=[use_mom_ref_com, &
1976 : use_mom_ref_coac, &
1977 : use_mom_ref_user, &
1978 : use_mom_ref_zero], &
1979 1499 : default_i_val=use_mom_ref_coac)
1980 1499 : CALL section_add_keyword(print_key, keyword)
1981 1499 : CALL keyword_release(keyword)
1982 :
1983 : CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
1984 : variants=s2a("REF_POINT"), &
1985 : description="Fixed reference point for the calculations of the electrostatic moment.", &
1986 : usage="REFERENCE_POINT x y z", &
1987 : repeats=.FALSE., &
1988 : n_var=3, default_r_vals=[0._dp, 0._dp, 0._dp], &
1989 : type_of_var=real_t, &
1990 1499 : unit_str='angstrom')
1991 1499 : CALL section_add_keyword(print_key, keyword)
1992 1499 : CALL keyword_release(keyword)
1993 1499 : CALL section_add_subsection(print_section, print_key)
1994 1499 : CALL section_release(print_key)
1995 : ! Marek : Fourier transform of MOMENTS ASCII print
1996 : CALL cp_print_key_section_create(print_key, __LOCATION__, "MOMENTS_FT", &
1997 : description="Prints the calculated Fourier transform of "// &
1998 : "time-dependent moments. For calculations with real time pulse (not delta kick) "// &
1999 : "can be supplied with starting time.", &
2000 : print_level=medium_print_level, common_iter_levels=0, &
2001 : each_iter_names=s2a("MD"), &
2002 : each_iter_values=[1], &
2003 1499 : filename="MOMENTS_FT")
2004 1499 : CALL section_add_subsection(print_section, print_key)
2005 1499 : CALL section_release(print_key)
2006 : ! Marek : Chosen element of (Fourier transformed) polarizability tensor (energy dependent) - text format
2007 : CALL cp_print_key_section_create(print_key, __LOCATION__, "POLARIZABILITY", &
2008 : description="Prints the chosen element of the energy dependent polarizability tensor "// &
2009 : "to a specified file. The tensor is calculated as ratio of "// &
2010 : "Fourier transform of the dipole "// &
2011 : "moment trace and Fourier transform of the applied field "// &
2012 : "(for delta kick, constant real field is applied.", &
2013 : print_level=medium_print_level, common_iter_levels=0, &
2014 : each_iter_names=s2a("MD"), &
2015 : each_iter_values=[1], &
2016 1499 : filename="POLARIZABILITY")
2017 : CALL keyword_create(keyword, __LOCATION__, "ELEMENT", &
2018 : description="Specifies the element of polarizability which is to be printed out "// &
2019 : "(indexing starts at 1). If not explicitly provided, RTBSE code tries to guess "// &
2020 : "the optimal values - for applied electric field (both delta pulse and RT field) "// &
2021 : "with only a single non-zero cartesian component, prints the 3 trivially available elements.", &
2022 1499 : type_of_var=integer_t, default_i_vals=[1, 1], n_var=2, usage="ELEMENT 1 1", repeats=.TRUE.)
2023 1499 : CALL section_add_keyword(print_key, keyword)
2024 1499 : CALL keyword_release(keyword)
2025 1499 : CALL section_add_subsection(print_section, print_key)
2026 1499 : CALL section_release(print_key)
2027 : ! Liouvillian eigenvalue diagnostic (linearized RT-BSE, TDA only)
2028 : CALL cp_print_key_section_create(print_key, __LOCATION__, "LIOUVILLIAN_EIG", &
2029 : description="Prints the eigenvalues of the linearized RT-BSE "// &
2030 : "Liouvillian on the OV subspace, computed once at job init from a "// &
2031 : "matrix-free probe of the kernel (no time propagation). In TDA this "// &
2032 : "equals the Casida-A eigenvalue problem and gives a broadening-free, "// &
2033 : "finite-time-free correctness check against bse_full.F. "// &
2034 : "Activated by RTBSE%DIAGNOSE_LIOUVILLIAN_EIG. Output lists "// &
2035 : "eigenvalues in atomic units and eV.", &
2036 : print_level=medium_print_level, common_iter_levels=0, &
2037 : each_iter_names=s2a("MD"), &
2038 : each_iter_values=[1], &
2039 1499 : filename="LIOUVILLIAN_EIG")
2040 1499 : CALL section_add_subsection(print_section, print_key)
2041 1499 : CALL section_release(print_key)
2042 :
2043 : CALL cp_print_key_section_create(print_key, __LOCATION__, "E_CONSTITUENTS", &
2044 : description="Print the energy constituents (relevant to RTP) which make up "// &
2045 : "the Total Energy", &
2046 : print_level=high_print_level, common_iter_levels=1, &
2047 : each_iter_names=s2a("MD"), &
2048 : each_iter_values=[1], &
2049 1499 : filename="rtp")
2050 1499 : CALL section_add_subsection(print_section, print_key)
2051 1499 : CALL section_release(print_key)
2052 :
2053 1499 : CALL section_add_subsection(section, print_section)
2054 1499 : CALL section_release(print_section)
2055 :
2056 : ! RTBSE subsection
2057 1499 : NULLIFY (subsection)
2058 1499 : CALL create_rtbse_section(subsection)
2059 1499 : CALL section_add_subsection(section, subsection)
2060 1499 : CALL section_release(subsection)
2061 : ! FT subsection
2062 1499 : CALL create_ft_section(subsection)
2063 1499 : CALL section_add_subsection(section, subsection)
2064 1499 : CALL section_release(subsection)
2065 :
2066 1499 : END SUBROUTINE create_rtp_section
2067 : ! **************************************************************************************************
2068 : !> \brief Creates the subsection for specialized options of RTBSE code
2069 : !> \param section The created RTBSE section
2070 : !> \author Stepan Marek
2071 : ! **************************************************************************************************
2072 1499 : SUBROUTINE create_rtbse_section(section)
2073 : TYPE(section_type), POINTER :: section
2074 :
2075 : TYPE(keyword_type), POINTER :: keyword
2076 :
2077 1499 : NULLIFY (keyword)
2078 1499 : CPASSERT(.NOT. ASSOCIATED(section))
2079 :
2080 : CALL section_create(section, __LOCATION__, name="RTBSE", &
2081 : description="Controls options for the real-time Bethe-Salpeter (RTBSE) propagation. "// &
2082 : "Note that running RTBSE requires previous low-scaling "// &
2083 : "[GW](#CP2K_INPUT.FORCE_EVAL.PROPERTIES.BANDSTRUCTURE.GW) calculation. Also note that "// &
2084 : "designating this section as RTBSE run but choosing run type ENERGY leads to potential "// &
2085 : "deallocation errors. More details (including description of output files) is available in "// &
2086 : "the [methods](../../../../methods/properties/optical/rtbse) section of the documentation.", &
2087 2998 : repeats=.FALSE., citations=[Marek2025])
2088 :
2089 : ! Marek : Controlling flow to RTBSE
2090 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
2091 : description="Which method is used for the time propagation of electronic structure. "// &
2092 : "By default, use the TDDFT method. Can also choose RT-BSE method, which propagates the lesser "// &
2093 : "Green's function instead of density matrix/molecular orbitals.", &
2094 : usage="&RTBSE TDDFT", &
2095 : default_i_val=rtp_method_tddft, &
2096 : lone_keyword_i_val=rtp_method_bse, &
2097 : enum_c_vals=s2a("TDDFT", "RTBSE"), &
2098 : enum_i_vals=[rtp_method_tddft, rtp_method_bse], &
2099 : enum_desc=s2a("Use TDDFT for density matrix/MO propagation.", &
2100 1499 : "Use RT-BSE for Green's function propagation"))
2101 1499 : CALL section_add_keyword(section, keyword)
2102 1499 : CALL keyword_release(keyword)
2103 :
2104 : ! Marek : Development option - run GWBSE starting from the KS Hamiltonian
2105 : CALL keyword_create(keyword, __LOCATION__, name="RTBSE_HAMILTONIAN", &
2106 : description="Which Hamiltonian to use as the single-particle Hamiltonian"// &
2107 : " in the Green's propagator.", &
2108 : usage="RTBSE_HAMILTONIAN GW", &
2109 : default_i_val=rtp_bse_ham_gw, &
2110 : enum_c_vals=s2a("KS", "GW"), &
2111 : enum_i_vals=[rtp_bse_ham_ks, rtp_bse_ham_gw], &
2112 : enum_desc=s2a("Use Kohn-Sham Hamiltonian for Green's function propagation.", &
2113 : "Use GW Hamiltonian for Green's function propagation. The GW "// &
2114 1499 : "eigenvalues from the highest-level GW flavor will be picked."))
2115 1499 : CALL section_add_keyword(section, keyword)
2116 1499 : CALL keyword_release(keyword)
2117 :
2118 : ! Switch for linearized rtbse propagation
2119 : CALL keyword_create(keyword, __LOCATION__, name="LINEARIZED_BSE_PROPAGATION", &
2120 : variants=s2a("LRRTBSE"), &
2121 : description="Linearizes the BSE propagation", &
2122 : usage="LINEARIZED_BSE_PROPAGATION .T.", &
2123 : default_l_val=.FALSE., &
2124 1499 : lone_keyword_l_val=.TRUE.)
2125 1499 : CALL section_add_keyword(section, keyword)
2126 1499 : CALL keyword_release(keyword)
2127 :
2128 : ! Energy cutoff (occupied) for active MO window in linearized RT-BSE
2129 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_CUTOFF_OCC", &
2130 : description="Energy cutoff (relative to HOMO) defining the lowest "// &
2131 : "occupied molecular orbital included in the active MO window of the "// &
2132 : "linearized RT-BSE propagation. Only used when "// &
2133 : "LINEARIZED_BSE_PROPAGATION=.TRUE.. A non-positive value disables the "// &
2134 : "occupied truncation.", &
2135 : usage="ENERGY_CUTOFF_OCC 5.0", &
2136 : unit_str="eV", &
2137 1499 : default_r_val=-1.0_dp/evolt)
2138 1499 : CALL section_add_keyword(section, keyword)
2139 1499 : CALL keyword_release(keyword)
2140 :
2141 : ! Energy cutoff (empty) for active MO window in linearized RT-BSE
2142 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_CUTOFF_EMPTY", &
2143 : description="Energy cutoff (relative to LUMO) defining the highest "// &
2144 : "virtual molecular orbital included in the active MO window of the "// &
2145 : "linearized RT-BSE propagation. Only used when "// &
2146 : "LINEARIZED_BSE_PROPAGATION=.TRUE.. A non-positive value disables the "// &
2147 : "virtual truncation.", &
2148 : usage="ENERGY_CUTOFF_EMPTY 5.0", &
2149 : unit_str="eV", &
2150 1499 : default_r_val=-1.0_dp/evolt)
2151 1499 : CALL section_add_keyword(section, keyword)
2152 1499 : CALL keyword_release(keyword)
2153 :
2154 : CALL keyword_create(keyword, __LOCATION__, name="ENFORCE_MAX_DT", &
2155 : description="For linearized RT-BSE, recompute TIMESTEP and STEPS so the same total "// &
2156 : "propagation time is covered with the largest timestep that does not exceed the "// &
2157 : "estimated RK4 stability limit.", &
2158 : usage="ENFORCE_MAX_DT", &
2159 : default_l_val=.FALSE., &
2160 1499 : lone_keyword_l_val=.TRUE.)
2161 1499 : CALL section_add_keyword(section, keyword)
2162 1499 : CALL keyword_release(keyword)
2163 :
2164 : ! Tamm-Dancoff approximation for the linearized RT-BSE kernel
2165 : CALL keyword_create(keyword, __LOCATION__, name="TDA", &
2166 : description="Apply the Tamm-Dancoff approximation to the linearized RT-BSE kernel: "// &
2167 : "the Hartree and screened-exchange contributions are restricted so that the OV and VO "// &
2168 : "blocks of the density response remain decoupled (i.e. only A-block coupling is kept, "// &
2169 : "B-block coupling is dropped). Only effective when "// &
2170 : "LINEARIZED_BSE_PROPAGATION=.TRUE..", &
2171 : usage="TDA", &
2172 : default_l_val=.FALSE., &
2173 1499 : lone_keyword_l_val=.TRUE.)
2174 1499 : CALL section_add_keyword(section, keyword)
2175 1499 : CALL keyword_release(keyword)
2176 :
2177 : ! First-peak shift for the TDA path
2178 : CALL keyword_create(keyword, __LOCATION__, name="TDA_SHIFT_TO_FIRST_PEAK", &
2179 : description="For the linearized RT-BSE TDA path, shift the active-MO single-particle "// &
2180 : "diagonals by +Omega_0/2 (occupied) and -Omega_0/2 (virtual) with "// &
2181 : "Omega_0 = eps_min_ai, so the lowest active OV mode oscillates at zero frequency "// &
2182 : "in the rotating frame (RK4-exact for peak 1). omega_max becomes the full active "// &
2183 : "OV width Delta = eps_max_ai - eps_min_ai. The rotation is undone at I/O so "// &
2184 : "observables remain in the lab frame. Only effective when TDA=.TRUE.. "// &
2185 : "Use with caution, additional convergence checks w.r.t. dt needed.", &
2186 : usage="TDA_SHIFT_TO_FIRST_PEAK", &
2187 : default_l_val=.FALSE., &
2188 1499 : lone_keyword_l_val=.TRUE.)
2189 1499 : CALL section_add_keyword(section, keyword)
2190 1499 : CALL keyword_release(keyword)
2191 :
2192 : CALL keyword_create(keyword, __LOCATION__, name="DEBUG_DISABLE_HARTREE", &
2193 : description="Debug option for linearized RT-BSE: disables the Hartree kernel in both "// &
2194 : "the static reference initialization and the propagation. The Coulomb RI setup is "// &
2195 : "still built so the run stays internally consistent.", &
2196 : usage="DEBUG_DISABLE_HARTREE", &
2197 : default_l_val=.FALSE., &
2198 1499 : lone_keyword_l_val=.TRUE.)
2199 1499 : CALL section_add_keyword(section, keyword)
2200 1499 : CALL keyword_release(keyword)
2201 :
2202 : CALL keyword_create(keyword, __LOCATION__, name="KERNEL_RI", &
2203 : description="Select the RI framework used to evaluate the linearized RT-BSE "// &
2204 : "Hartree and screened-exchange kernels (propagation and reference). "// &
2205 : "DEFAULT infers from the GW flavor: RI-RS if the GW_RI_RS section was active, "// &
2206 : "AO-RI otherwise. RS/AO force that framework regardless of how GW was run. The "// &
2207 : "RI-RS grid (mat_phi_mu_l, mat_Z_lP) and the V_grid/W0_grid kernels are built on "// &
2208 : "demand. RI-RS is implemented for linearized RT-BSE only; for full RT-BSE an "// &
2209 : "explicit RS is overridden to AO with a warning.", &
2210 : usage="KERNEL_RI RS", &
2211 : enum_c_vals=s2a("DEFAULT", "RS", "AO"), &
2212 : enum_i_vals=[rtp_bse_kernel_ri_default, rtp_bse_kernel_ri_rs, rtp_bse_kernel_ri_ao], &
2213 : enum_desc=s2a("Infer from the GW flavor (GW_RI_RS active -> RS, else AO).", &
2214 : "Real-space RI grid kernels (linearized RT-BSE only).", &
2215 : "AO-RI kernels."), &
2216 1499 : default_i_val=rtp_bse_kernel_ri_default, n_var=1)
2217 1499 : CALL section_add_keyword(section, keyword)
2218 1499 : CALL keyword_release(keyword)
2219 :
2220 : CALL keyword_create(keyword, __LOCATION__, name="DEBUG_DISABLE_SEX", &
2221 : description="Debug option for linearized RT-BSE: disables the screened-exchange kernel "// &
2222 : "in both the static reference initialization and the propagation.", &
2223 : usage="DEBUG_DISABLE_SEX", &
2224 : default_l_val=.FALSE., &
2225 1499 : lone_keyword_l_val=.TRUE.)
2226 1499 : CALL section_add_keyword(section, keyword)
2227 1499 : CALL keyword_release(keyword)
2228 :
2229 : ! Liouvillian eigenvalue diagnostic (matrix-free probe at init; TDA + ABBA)
2230 : CALL keyword_create(keyword, __LOCATION__, name="DIAGNOSE_LIOUVILLIAN_EIG", &
2231 : description="Diagnostic for linearized RT-BSE: at job initialization, build the "// &
2232 : "Liouvillian on the OV subspace by probing the kernel routine with canonical OV basis "// &
2233 : "vectors, then diagonalize. In TDA this equals the Casida-A eigenvalue problem, giving a "// &
2234 : "broadening-free, finite-time-free correctness check against bse_full.F. "// &
2235 : "In ABBA it builds and diagonalizes the full coupled (A, B) Liouvillian via the "// &
2236 : "Furche reduction. "// &
2237 : "Output is controlled by the LIOUVILLIAN_EIG print key in the parent "// &
2238 : "&REAL_TIME_PROPAGATION%&PRINT section.", &
2239 : usage="DIAGNOSE_LIOUVILLIAN_EIG", &
2240 : default_l_val=.FALSE., &
2241 1499 : lone_keyword_l_val=.TRUE.)
2242 1499 : CALL section_add_keyword(section, keyword)
2243 1499 : CALL keyword_release(keyword)
2244 :
2245 : CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER_RHO", &
2246 : description="RI-RS linearized RT-BSE: block-filter threshold on the propagated "// &
2247 : "response density Delta-rho (AO). Applied upstream of the projection the "// &
2248 : "Hartree shares, so it cuts the SEX kernel and the Hartree response alike. "// &
2249 : "Absolute, so its strength is the ratio to the Delta-rho scale.", &
2250 : usage="EPS_FILTER_RHO 1.0E-6", &
2251 1499 : default_r_val=-1.0_dp)
2252 1499 : CALL section_add_keyword(section, keyword)
2253 1499 : CALL keyword_release(keyword)
2254 :
2255 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS_W0", &
2256 : description="RI-RS linearized RT-BSE: real-space truncation radius for the "// &
2257 : "grid-basis screened interaction W0. Grid block pairs whose centroids lie "// &
2258 : "further apart are dropped at build, and the per-step SEX grid transient is "// &
2259 : "built into the same pattern. Affects the BSE kernel only, not the GW "// &
2260 : "quasiparticle energies and not the Hartree response. Requires a "// &
2261 : "non-periodic cell. Zero or negative disables the truncation.", &
2262 : usage="CUTOFF_RADIUS_W0 30.0", &
2263 : default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
2264 1499 : type_of_var=real_t, unit_str="angstrom")
2265 1499 : CALL section_add_keyword(section, keyword)
2266 1499 : CALL keyword_release(keyword)
2267 :
2268 1499 : END SUBROUTINE create_rtbse_section
2269 : ! **************************************************************************************************
2270 : !> \brief Creates the subsection for Fourier transform options applicable to RTP output
2271 : !> \param ft_section The created FT section
2272 : !> \date 11.2025
2273 : !> \author Stepan Marek
2274 : ! **************************************************************************************************
2275 1499 : SUBROUTINE create_ft_section(ft_section)
2276 : TYPE(section_type), POINTER :: ft_section
2277 :
2278 : TYPE(keyword_type), POINTER :: keyword
2279 : TYPE(section_type), POINTER :: subsection
2280 :
2281 1499 : CPASSERT(.NOT. ASSOCIATED(ft_section))
2282 :
2283 : ! Create the section itself
2284 : CALL section_create(ft_section, __LOCATION__, &
2285 : name="FT", &
2286 : description="Define parameters for Fourier transforms used in RTP outputs.", &
2287 1499 : repeats=.FALSE.)
2288 :
2289 : ! Start time keyword
2290 1499 : NULLIFY (keyword)
2291 : CALL keyword_create(keyword, __LOCATION__, "START_TIME", &
2292 : description="The starting time from which damping is applied and from which on the trace is "// &
2293 : "considered for the Fourier transform (Fourier transform is used for the calculation of "// &
2294 : "MOMENTS_FT and POLARIZABILITY). Useful for real-time pulse - "// &
2295 : "one can specify the center of the pulse as the starting point.", &
2296 : type_of_var=real_t, &
2297 : unit_str="fs", &
2298 1499 : default_r_val=0.0_dp)
2299 1499 : CALL section_add_keyword(ft_section, keyword)
2300 1499 : CALL keyword_release(keyword)
2301 :
2302 : ! Damping keyword
2303 : CALL keyword_create(keyword, __LOCATION__, "DAMPING", &
2304 : description="Numerical Fourier transform (required for calculation of "// &
2305 : "MOMENTS_FT and POLARIZABILITY) can oscillate "// &
2306 : "when the final time trace values are far away from zero. "// &
2307 : "This keyword controls the exponential damping added to the Fourier transform "// &
2308 : "(Fourier transform is used for calculation of MOMENTS_FT and POLARIZABILITY). "// &
2309 : "For negative values (the default), calculates the damping at the run time so that the last point "// &
2310 : "in the time trace is reduced by factor e^(-4). When set manually, determines the time in which "// &
2311 : "the moments trace is reduced by factor of e^(-1), except when set to zero, in which case "// &
2312 : "the damping is not applied.", &
2313 : type_of_var=real_t, &
2314 : unit_str="fs", &
2315 1499 : default_r_val=-1.0_dp/femtoseconds)
2316 1499 : CALL section_add_keyword(ft_section, keyword)
2317 1499 : CALL keyword_release(keyword)
2318 :
2319 : ! Create the Padé subsection
2320 1499 : NULLIFY (subsection)
2321 : CALL section_create(subsection, __LOCATION__, name="PADE", &
2322 : description="Defines the parameters for the Padé interpolation of the "// &
2323 : "Fourier transforms used in the output of RTP. Only available with the GreenX library linked to CP2K.", &
2324 1499 : repeats=.FALSE.)
2325 :
2326 : ! Explicit presence of the section turns on the Padé interpolation
2327 : CALL keyword_create(keyword, __LOCATION__, "_SECTION_PARAMETERS_", &
2328 : description="Turns on the Padé interpolation", &
2329 : type_of_var=logical_t, &
2330 : default_l_val=.FALSE., &
2331 1499 : lone_keyword_l_val=.TRUE.)
2332 1499 : CALL section_add_keyword(subsection, keyword)
2333 1499 : CALL keyword_release(keyword)
2334 :
2335 : ! Minimum interpolated energy
2336 : CALL keyword_create(keyword, __LOCATION__, "E_MIN", &
2337 : description="The minimum energy of the Padé interpolation output.", &
2338 : type_of_var=real_t, &
2339 : unit_str="eV", &
2340 1499 : default_r_val=0.0_dp)
2341 1499 : CALL section_add_keyword(subsection, keyword)
2342 1499 : CALL keyword_release(keyword)
2343 :
2344 : ! Maximum interpolated energy
2345 : CALL keyword_create(keyword, __LOCATION__, "E_MAX", &
2346 : description="The maximum energy of the Padé interpolation output.", &
2347 : type_of_var=real_t, &
2348 : unit_str="eV", &
2349 1499 : default_r_val=100.0_dp)
2350 1499 : CALL section_add_keyword(subsection, keyword)
2351 1499 : CALL keyword_release(keyword)
2352 :
2353 : ! Energy resolution
2354 : CALL keyword_create(keyword, __LOCATION__, "E_STEP", &
2355 : description="The energy resolution of the Padé interpolation output.", &
2356 : type_of_var=real_t, &
2357 : unit_str="eV", &
2358 1499 : default_r_val=0.02_dp/evolt)
2359 1499 : CALL section_add_keyword(subsection, keyword)
2360 1499 : CALL keyword_release(keyword)
2361 :
2362 : ! Minimum fitting energy
2363 : CALL keyword_create(keyword, __LOCATION__, "FIT_E_MIN", &
2364 : description="The lower boundary in energy for the points "// &
2365 : "used in the fitting of Padé parameters. If negative, uses "// &
2366 : "value of E_MIN (default).", &
2367 : type_of_var=real_t, &
2368 : unit_str="eV", &
2369 1499 : default_r_val=-1.0_dp)
2370 1499 : CALL section_add_keyword(subsection, keyword)
2371 1499 : CALL keyword_release(keyword)
2372 :
2373 : ! Maximum fitting energy
2374 : CALL keyword_create(keyword, __LOCATION__, "FIT_E_MAX", &
2375 : description="The upper boundary in energy for the points "// &
2376 : "used in the fitting of Padé parameters. If negative, uses "// &
2377 : "the value of E_MAX (default).", &
2378 : type_of_var=real_t, &
2379 : unit_str="eV", &
2380 1499 : default_r_val=-1.0_dp)
2381 1499 : CALL section_add_keyword(subsection, keyword)
2382 1499 : CALL keyword_release(keyword)
2383 :
2384 : ! Add the Padé subsection
2385 1499 : CALL section_add_subsection(ft_section, subsection)
2386 1499 : CALL section_release(subsection)
2387 1499 : END SUBROUTINE create_ft_section
2388 :
2389 : ! **************************************************************************************************
2390 : !> \brief Create CP2K input section for the SCCS model
2391 : !> \param section ...
2392 : !> \par History:
2393 : !> - Creation (10.10.2013,MK)
2394 : !> \author Matthias Krack (MK)
2395 : !> \version 1.0
2396 : ! **************************************************************************************************
2397 1499 : SUBROUTINE create_sccs_section(section)
2398 :
2399 : TYPE(section_type), POINTER :: section
2400 :
2401 : TYPE(keyword_type), POINTER :: keyword
2402 : TYPE(section_type), POINTER :: subsection
2403 :
2404 1499 : CPASSERT(.NOT. ASSOCIATED(section))
2405 :
2406 : CALL section_create(section, __LOCATION__, &
2407 : name="SCCS", &
2408 : description="Define the parameters for self-consistent continuum solvation (SCCS) model", &
2409 : citations=[Fattebert2002, Andreussi2012, Yin2017], &
2410 : n_keywords=10, &
2411 : n_subsections=4, &
2412 5996 : repeats=.FALSE.)
2413 :
2414 1499 : NULLIFY (keyword)
2415 :
2416 : CALL keyword_create(keyword, __LOCATION__, &
2417 : name="_SECTION_PARAMETERS_", &
2418 : description="Controls the activation of the SCCS section", &
2419 : usage="&SCCS ON", &
2420 : default_l_val=.FALSE., &
2421 1499 : lone_keyword_l_val=.TRUE.)
2422 1499 : CALL section_add_keyword(section, keyword)
2423 1499 : CALL keyword_release(keyword)
2424 :
2425 : CALL keyword_create(keyword, __LOCATION__, &
2426 : name="ALPHA", &
2427 : description="Solvent specific tunable parameter for the calculation of "// &
2428 : "the repulsion term $G^\text{rep} = \alpha S$ "// &
2429 : "where $S$ is the (quantum) surface of the cavity", &
2430 : repeats=.FALSE., &
2431 : n_var=1, &
2432 : type_of_var=real_t, &
2433 : default_r_val=0.0_dp, &
2434 1499 : unit_str="mN/m")
2435 1499 : CALL section_add_keyword(section, keyword)
2436 1499 : CALL keyword_release(keyword)
2437 :
2438 : CALL keyword_create(keyword, __LOCATION__, &
2439 : name="BETA", &
2440 : description="Solvent specific tunable parameter for the calculation of "// &
2441 : "the dispersion term $G^\text{dis} = \beta V$ "// &
2442 : "where $V$ is the (quantum) volume of the cavity", &
2443 : repeats=.FALSE., &
2444 : n_var=1, &
2445 : type_of_var=real_t, &
2446 : default_r_val=0.0_dp, &
2447 1499 : unit_str="GPa")
2448 1499 : CALL section_add_keyword(section, keyword)
2449 1499 : CALL keyword_release(keyword)
2450 :
2451 : CALL keyword_create(keyword, __LOCATION__, &
2452 : name="DELTA_RHO", &
2453 : description="Numerical increment for the calculation of the (quantum) "// &
2454 : "surface of the solute cavity", &
2455 : repeats=.FALSE., &
2456 : n_var=1, &
2457 : type_of_var=real_t, &
2458 1499 : default_r_val=2.0E-5_dp)
2459 1499 : CALL section_add_keyword(section, keyword)
2460 1499 : CALL keyword_release(keyword)
2461 :
2462 : CALL keyword_create(keyword, __LOCATION__, &
2463 : name="DERIVATIVE_METHOD", &
2464 : description="Method for the calculation of the numerical derivatives on the real-space grids", &
2465 : usage="DERIVATIVE_METHOD cd5", &
2466 : repeats=.FALSE., &
2467 : n_var=1, &
2468 : default_i_val=sccs_derivative_fft, &
2469 : enum_c_vals=s2a("FFT", "CD3", "CD5", "CD7"), &
2470 : enum_i_vals=[sccs_derivative_fft, &
2471 : sccs_derivative_cd3, &
2472 : sccs_derivative_cd5, &
2473 : sccs_derivative_cd7], &
2474 : enum_desc=s2a("Fast Fourier transformation", &
2475 : "3-point stencil central differences", &
2476 : "5-point stencil central differences", &
2477 1499 : "7-point stencil central differences"))
2478 1499 : CALL section_add_keyword(section, keyword)
2479 1499 : CALL keyword_release(keyword)
2480 :
2481 : CALL keyword_create(keyword, __LOCATION__, &
2482 : name="RELATIVE_PERMITTIVITY", &
2483 : variants=s2a("DIELECTRIC_CONSTANT", "EPSILON_RELATIVE", "EPSILON_SOLVENT"), &
2484 : description="Relative permittivity (dielectric constant) of the solvent (medium)", &
2485 : repeats=.FALSE., &
2486 : n_var=1, &
2487 : type_of_var=real_t, &
2488 : default_r_val=80.0_dp, &
2489 1499 : usage="RELATIVE_PERMITTIVITY 78.36")
2490 1499 : CALL section_add_keyword(section, keyword)
2491 1499 : CALL keyword_release(keyword)
2492 :
2493 : CALL keyword_create(keyword, __LOCATION__, &
2494 : name="EPS_SCCS", &
2495 : variants=s2a("EPS_ITER", "TAU_POL"), &
2496 : description="Tolerance for the convergence of the polarisation density, "// &
2497 : "i.e. requested accuracy for the SCCS iteration cycle", &
2498 : repeats=.FALSE., &
2499 : n_var=1, &
2500 : type_of_var=real_t, &
2501 : default_r_val=1.0E-6_dp, &
2502 1499 : usage="EPS_ITER 1.0E-7")
2503 1499 : CALL section_add_keyword(section, keyword)
2504 1499 : CALL keyword_release(keyword)
2505 :
2506 : CALL keyword_create(keyword, __LOCATION__, &
2507 : name="EPS_SCF", &
2508 : description="The SCCS iteration cycle is activated only if the SCF iteration cycle "// &
2509 : "is converged to this threshold value", &
2510 : repeats=.FALSE., &
2511 : n_var=1, &
2512 : type_of_var=real_t, &
2513 : default_r_val=0.5_dp, &
2514 1499 : usage="EPS_SCF 1.0E-2")
2515 1499 : CALL section_add_keyword(section, keyword)
2516 1499 : CALL keyword_release(keyword)
2517 :
2518 : CALL keyword_create(keyword, __LOCATION__, &
2519 : name="GAMMA", &
2520 : variants=s2a("SURFACE_TENSION"), &
2521 : description="Surface tension of the solvent used for the calculation of "// &
2522 : "the cavitation term $G^\text{cav} = \gamma S$ "// &
2523 : "where $S$ is the (quantum) surface of the cavity", &
2524 : repeats=.FALSE., &
2525 : n_var=1, &
2526 : type_of_var=real_t, &
2527 : default_r_val=0.0_dp, &
2528 1499 : unit_str="mN/m")
2529 1499 : CALL section_add_keyword(section, keyword)
2530 1499 : CALL keyword_release(keyword)
2531 :
2532 : CALL keyword_create(keyword, __LOCATION__, &
2533 : name="MAX_ITER", &
2534 : description="Maximum number of SCCS iteration steps performed to converge "// &
2535 : "within the given tolerance", &
2536 : repeats=.FALSE., &
2537 : n_var=1, &
2538 : type_of_var=integer_t, &
2539 : default_i_val=100, &
2540 1499 : usage="MAX_ITER 50")
2541 1499 : CALL section_add_keyword(section, keyword)
2542 1499 : CALL keyword_release(keyword)
2543 :
2544 : CALL keyword_create(keyword, __LOCATION__, &
2545 : name="METHOD", &
2546 : description="Method used for the smoothing of the dielectric function", &
2547 : usage="METHOD Fattebert-Gygi", &
2548 : default_i_val=sccs_andreussi, &
2549 : enum_c_vals=s2a("ANDREUSSI", "FATTEBERT-GYGI", "SAA_ANDREUSSI"), &
2550 : enum_i_vals=[sccs_andreussi, sccs_fattebert_gygi, sccs_saa_andreussi], &
2551 : enum_desc=s2a("Smoothing function proposed by Andreussi et al.", &
2552 : "Smoothing function proposed by Fattebert and Gygi", &
2553 1499 : "Smoothing function of the solvent aware algorithm"))
2554 1499 : CALL section_add_keyword(section, keyword)
2555 1499 : CALL keyword_release(keyword)
2556 :
2557 : CALL keyword_create(keyword, __LOCATION__, &
2558 : name="MIXING", &
2559 : variants=["ETA"], &
2560 : description="Mixing parameter (Hartree damping) employed during the iteration procedure", &
2561 : repeats=.FALSE., &
2562 : n_var=1, &
2563 : type_of_var=real_t, &
2564 : default_r_val=0.6_dp, &
2565 2998 : usage="MIXING 0.2")
2566 1499 : CALL section_add_keyword(section, keyword)
2567 1499 : CALL keyword_release(keyword)
2568 :
2569 : CALL keyword_create(keyword, __LOCATION__, &
2570 : name="CORE_FILL", &
2571 : description="Add a normalised Gaussian fill density $Z_{val}/(\sqrt{\pi}\sigma)^3 "// &
2572 : "\exp(-r^2/\sigma^2)$ on each atom to the electronic density used for the "// &
2573 : "definition of the dielectric function. This fills the low valence density "// &
2574 : "region at the nuclei of pseudopotential atoms, which otherwise may be treated "// &
2575 : "as solvent if a grid point is close to a nucleus (similar to the solvent_mode "// &
2576 : "'full' of the Environ library). Kinds without removed core electrons (Z_val = Z, "// &
2577 : "e.g. H, He-q2, Li-q3, Be-q4) are not filled by default. "// &
2578 : "The resulting ionic forces are included.", &
2579 : usage="CORE_FILL", &
2580 : default_l_val=.FALSE., &
2581 1499 : lone_keyword_l_val=.TRUE.)
2582 1499 : CALL section_add_keyword(section, keyword)
2583 1499 : CALL keyword_release(keyword)
2584 :
2585 : CALL keyword_create(keyword, __LOCATION__, &
2586 : name="CORE_FILL_SPREAD", &
2587 : description="Default spread $\sigma$ of the Gaussian fill density used with CORE_FILL "// &
2588 : "(Environ default 0.5 bohr). Can be overwritten per kind in the CORE_FILL_KIND section.", &
2589 : repeats=.FALSE., &
2590 : n_var=1, &
2591 : type_of_var=real_t, &
2592 : unit_str="bohr", &
2593 : default_r_val=0.5_dp, &
2594 1499 : usage="CORE_FILL_SPREAD [bohr] 0.5")
2595 1499 : CALL section_add_keyword(section, keyword)
2596 1499 : CALL keyword_release(keyword)
2597 :
2598 1499 : NULLIFY (subsection)
2599 :
2600 : CALL section_create(subsection, __LOCATION__, &
2601 : name="CORE_FILL_KIND", &
2602 : description="Per-kind spread of the CORE_FILL Gaussian fill density. "// &
2603 : "Each line contains a kind label (as defined in &KIND) and the spread in bohr. "// &
2604 : "A spread <= 0 disables the fill for that kind. Kinds not listed use "// &
2605 : "CORE_FILL_SPREAD, except kinds without removed core electrons (Z_val = Z) which are "// &
2606 : "not filled.", &
2607 : n_keywords=1, &
2608 : n_subsections=0, &
2609 1499 : repeats=.FALSE.)
2610 : CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
2611 : description="Kind label and spread in bohr", &
2612 : repeats=.TRUE., &
2613 : usage="{kind label} {spread in bohr}", &
2614 1499 : type_of_var=lchar_t)
2615 1499 : CALL section_add_keyword(subsection, keyword)
2616 1499 : CALL keyword_release(keyword)
2617 1499 : CALL section_add_subsection(section, subsection)
2618 1499 : CALL section_release(subsection)
2619 :
2620 : CALL section_create(subsection, __LOCATION__, &
2621 : name="ANDREUSSI", &
2622 : description="Define the parameters of the dielectric smoothing function proposed by "// &
2623 : "Andreussi et al.", &
2624 : citations=[Andreussi2012], &
2625 : n_keywords=2, &
2626 : n_subsections=0, &
2627 2998 : repeats=.FALSE.)
2628 :
2629 : CALL keyword_create(keyword, __LOCATION__, &
2630 : name="RHO_MAX", &
2631 : description="Maximum density value used for the smoothing of the dielectric function", &
2632 : repeats=.FALSE., &
2633 : n_var=1, &
2634 : type_of_var=real_t, &
2635 : default_r_val=0.0035_dp, &
2636 1499 : usage="RHO_MAX 0.01")
2637 1499 : CALL section_add_keyword(subsection, keyword)
2638 1499 : CALL keyword_release(keyword)
2639 :
2640 : CALL keyword_create(keyword, __LOCATION__, &
2641 : name="RHO_MIN", &
2642 : description="Minimum density value used for the smoothing of the dielectric function", &
2643 : repeats=.FALSE., &
2644 : n_var=1, &
2645 : type_of_var=real_t, &
2646 : default_r_val=0.0001_dp, &
2647 1499 : usage="RHO_MIN 0.0003")
2648 1499 : CALL section_add_keyword(subsection, keyword)
2649 1499 : CALL keyword_release(keyword)
2650 :
2651 1499 : CALL section_add_subsection(section, subsection)
2652 1499 : CALL section_release(subsection)
2653 :
2654 : CALL section_create(subsection, __LOCATION__, &
2655 : name="FATTEBERT-GYGI", &
2656 : description="Define the parameters of the dielectric smoothing function proposed by "// &
2657 : "Fattebert and Gygi", &
2658 : citations=[Fattebert2002], &
2659 : n_keywords=2, &
2660 : n_subsections=0, &
2661 2998 : repeats=.FALSE.)
2662 :
2663 : CALL keyword_create(keyword, __LOCATION__, &
2664 : name="BETA", &
2665 : description="Parameter β changes the width of the interface solute-solvent", &
2666 : repeats=.FALSE., &
2667 : n_var=1, &
2668 : type_of_var=real_t, &
2669 : default_r_val=1.7_dp, &
2670 1499 : usage="BETA 1.3")
2671 1499 : CALL section_add_keyword(subsection, keyword)
2672 1499 : CALL keyword_release(keyword)
2673 :
2674 : CALL keyword_create(keyword, __LOCATION__, &
2675 : name="RHO_ZERO", &
2676 : variants=["RHO0"], &
2677 : description="Parameter $\rho_0$ defines the critical density in the middle "// &
2678 : "of the interface solute-solvent", &
2679 : repeats=.FALSE., &
2680 : n_var=1, &
2681 : type_of_var=real_t, &
2682 : default_r_val=0.0006_dp, &
2683 2998 : usage="RHO_ZERO 0.0004")
2684 1499 : CALL section_add_keyword(subsection, keyword)
2685 1499 : CALL keyword_release(keyword)
2686 :
2687 1499 : CALL section_add_subsection(section, subsection)
2688 1499 : CALL section_release(subsection)
2689 :
2690 : CALL section_create(subsection, __LOCATION__, &
2691 : name="SAA_ANDREUSSI", &
2692 : description="Define the parameters of the dielectric smoothing function of "// &
2693 : "the solvent aware algorithm proposed by Andreussi et al.", &
2694 : citations=[Andreussi2019, Chai2025a], &
2695 : n_keywords=7, &
2696 : n_subsections=0, &
2697 4497 : repeats=.FALSE.)
2698 :
2699 : CALL keyword_create(keyword, __LOCATION__, &
2700 : name="RHO_MAX", &
2701 : description="Maximum density value used for the smoothing of the dielectric function", &
2702 : repeats=.FALSE., &
2703 : n_var=1, &
2704 : type_of_var=real_t, &
2705 : default_r_val=0.0035_dp, &
2706 1499 : usage="RHO_MAX 0.01")
2707 1499 : CALL section_add_keyword(subsection, keyword)
2708 1499 : CALL keyword_release(keyword)
2709 :
2710 : CALL keyword_create(keyword, __LOCATION__, &
2711 : name="RHO_MIN", &
2712 : description="Minimum density value used for the smoothing of the dielectric function", &
2713 : repeats=.FALSE., &
2714 : n_var=1, &
2715 : type_of_var=real_t, &
2716 : default_r_val=0.0001_dp, &
2717 1499 : usage="RHO_MIN 0.0003")
2718 1499 : CALL section_add_keyword(subsection, keyword)
2719 1499 : CALL keyword_release(keyword)
2720 :
2721 : CALL keyword_create(keyword, __LOCATION__, &
2722 : name="F0", &
2723 : description="The threshold of the filled fraction that controls whether a point in space "// &
2724 : "needs to be removed from the continuum", &
2725 : repeats=.FALSE., &
2726 : n_var=1, &
2727 : type_of_var=real_t, &
2728 : default_r_val=0.65_dp, &
2729 1499 : usage="F0 0.65")
2730 1499 : CALL section_add_keyword(subsection, keyword)
2731 1499 : CALL keyword_release(keyword)
2732 :
2733 : CALL keyword_create(keyword, __LOCATION__, &
2734 : name="DELTA_ETA", &
2735 : description="Controls the softness of function t(r)", &
2736 : repeats=.FALSE., &
2737 : n_var=1, &
2738 : type_of_var=real_t, &
2739 : default_r_val=0.02_dp, &
2740 1499 : usage="DELTA_ETA 0.02")
2741 1499 : CALL section_add_keyword(subsection, keyword)
2742 1499 : CALL keyword_release(keyword)
2743 :
2744 : CALL keyword_create(keyword, __LOCATION__, &
2745 : name="DELTA_ZETA", &
2746 : description="Controls the softness of function u(r)", &
2747 : repeats=.FALSE., &
2748 : n_var=1, &
2749 : type_of_var=real_t, &
2750 : unit_str='bohr', &
2751 : default_r_val=0.5_dp, &
2752 1499 : usage="DELTA_ZETA 0.5")
2753 1499 : CALL section_add_keyword(subsection, keyword)
2754 1499 : CALL keyword_release(keyword)
2755 :
2756 : CALL keyword_create(keyword, __LOCATION__, &
2757 : name="ALPHA_ZETA", &
2758 : description="The scaling factor for R_SOLV", &
2759 : repeats=.FALSE., &
2760 : n_var=1, &
2761 : type_of_var=real_t, &
2762 : default_r_val=2.0_dp, &
2763 1499 : usage="ALPHA_ZETA 2.0")
2764 1499 : CALL section_add_keyword(subsection, keyword)
2765 1499 : CALL keyword_release(keyword)
2766 :
2767 : CALL keyword_create(keyword, __LOCATION__, &
2768 : name="R_SOLV", &
2769 : description="The solvent radius", &
2770 : repeats=.FALSE., &
2771 : n_var=1, &
2772 : type_of_var=real_t, &
2773 : unit_str='bohr', &
2774 : default_r_val=2.6_dp, &
2775 1499 : usage="R_SOLV 2.6")
2776 1499 : CALL section_add_keyword(subsection, keyword)
2777 1499 : CALL keyword_release(keyword)
2778 :
2779 1499 : CALL section_add_subsection(section, subsection)
2780 1499 : CALL section_release(subsection)
2781 :
2782 1499 : END SUBROUTINE create_sccs_section
2783 :
2784 : ! **************************************************************************************************
2785 : !> \brief Create CP2K input section for the planar counter charge density
2786 : !> \param section ...
2787 : !> \author Ziwei Chai
2788 : !> \version 1.0
2789 : ! **************************************************************************************************
2790 1499 : SUBROUTINE create_pcc_section(section)
2791 :
2792 : TYPE(section_type), POINTER :: section
2793 :
2794 : TYPE(keyword_type), POINTER :: keyword
2795 :
2796 1499 : CPASSERT(.NOT. ASSOCIATED(section))
2797 :
2798 : CALL section_create(section, __LOCATION__, &
2799 : name="PLANAR_COUNTER_CHARGE", &
2800 : description="Define the parameters for the planar counter charge density", &
2801 : citations=[Chai2024a], &
2802 : n_keywords=4, &
2803 : n_subsections=0, &
2804 2998 : repeats=.FALSE.)
2805 :
2806 1499 : NULLIFY (keyword)
2807 :
2808 : CALL keyword_create(keyword, __LOCATION__, &
2809 : name="_SECTION_PARAMETERS_", &
2810 : description="Controls the activation of the planar counter charge section", &
2811 : usage="&PLANAR_COUNTER_CHARGE ON", &
2812 : default_l_val=.FALSE., &
2813 1499 : lone_keyword_l_val=.TRUE.)
2814 1499 : CALL section_add_keyword(section, keyword)
2815 1499 : CALL keyword_release(keyword)
2816 :
2817 : CALL keyword_create(keyword, __LOCATION__, name="PARALLEL_PLANE", &
2818 : enum_c_vals=s2a('XY', 'YZ', 'XZ'), &
2819 : enum_i_vals=[3, 1, 2], &
2820 : description="The coordinate plane that the surface is parallel to.", &
2821 : enum_desc=s2a("Parallel to XY", "Parallel to YZ", "Parallel to XZ"), &
2822 : n_var=1, &
2823 : default_i_val=3, &
2824 1499 : usage="PARALLEL_PLANE XY")
2825 1499 : CALL section_add_keyword(section, keyword)
2826 1499 : CALL keyword_release(keyword)
2827 :
2828 : CALL keyword_create(keyword, __LOCATION__, &
2829 : name="DIST_EDGE", &
2830 : description="Controls the distance between the center of the Gaussian "// &
2831 : "and the cell boundary", &
2832 : usage="DIST_EDGE 1.0", &
2833 : unit_str="angstrom", &
2834 1499 : type_of_var=real_t)
2835 1499 : CALL section_add_keyword(section, keyword)
2836 1499 : CALL keyword_release(keyword)
2837 :
2838 : CALL keyword_create(keyword, __LOCATION__, &
2839 : name="GAU_C", &
2840 : description="Controls the spread of the Gaussian distribution", &
2841 : usage="GAU_C 0.1", &
2842 : unit_str="angstrom", &
2843 1499 : type_of_var=real_t)
2844 1499 : CALL section_add_keyword(section, keyword)
2845 1499 : CALL keyword_release(keyword)
2846 :
2847 1499 : END SUBROUTINE create_pcc_section
2848 :
2849 : ! **************************************************************************************************
2850 : !> \brief Create CP2K input section for calculating and printing the planar averaged
2851 : !> electrostatic potential (Hartree potential) for symmetric slab systems
2852 : !> \param section ...
2853 : !> \author Ziwei Chai
2854 : !> \version 1.0
2855 : ! **************************************************************************************************
2856 1499 : SUBROUTINE create_paep_section(section)
2857 :
2858 : TYPE(section_type), POINTER :: section
2859 :
2860 : TYPE(keyword_type), POINTER :: keyword
2861 :
2862 1499 : CPASSERT(.NOT. ASSOCIATED(section))
2863 :
2864 : CALL section_create(section, __LOCATION__, &
2865 : name="PLANAR_AVERAGED_V_HARTREE", &
2866 : description="Define the parameters for calculating and printing the planar "// &
2867 : "averaged electrostatic potential (Hartree potential) "// &
2868 : "for symmetric slab systems", &
2869 : n_keywords=2, &
2870 : n_subsections=0, &
2871 1499 : repeats=.FALSE.)
2872 :
2873 1499 : NULLIFY (keyword)
2874 :
2875 : CALL keyword_create(keyword, __LOCATION__, &
2876 : name="_SECTION_PARAMETERS_", &
2877 : description="Controls the activation of the planar averaged electrostatic "// &
2878 : "potential (Hartree potential) section", &
2879 : usage="&PLANAR_AVERAGED_V_HARTREE ON", &
2880 : default_l_val=.FALSE., &
2881 1499 : lone_keyword_l_val=.TRUE.)
2882 1499 : CALL section_add_keyword(section, keyword)
2883 1499 : CALL keyword_release(keyword)
2884 :
2885 : CALL keyword_create(keyword, __LOCATION__, name="PARALLEL_PLANE", &
2886 : enum_c_vals=s2a('XY', 'YZ', 'XZ'), &
2887 : enum_i_vals=[3, 1, 2], &
2888 : description="The coordinate plane that the surface is parallel to.", &
2889 : enum_desc=s2a("Parallel to XY", "Parallel to YZ", "Parallel to XZ"), &
2890 : n_var=1, &
2891 : default_i_val=3, &
2892 1499 : usage="PARALLEL_PLANE XY")
2893 1499 : CALL section_add_keyword(section, keyword)
2894 1499 : CALL keyword_release(keyword)
2895 :
2896 1499 : END SUBROUTINE create_paep_section
2897 :
2898 : END MODULE input_cp2k_dft
|