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 1481 : 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 1481 : 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 1481 : n_keywords=3, n_subsections=4, repeats=.FALSE.)
133 :
134 1481 : 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 1481 : default_lc_val="BASIS_SET", n_var=1)
141 1481 : CALL section_add_keyword(section, keyword)
142 1481 : 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 1481 : default_lc_val="POTENTIAL", n_var=1)
152 1481 : CALL section_add_keyword(section, keyword)
153 1481 : 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 2962 : type_of_var=lchar_t)
161 1481 : CALL section_add_keyword(section, keyword)
162 1481 : 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 1481 : lone_keyword_l_val=.TRUE.)
174 1481 : CALL section_add_keyword(section, keyword)
175 1481 : 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 2962 : lone_keyword_l_val=.TRUE.)
183 1481 : CALL section_add_keyword(section, keyword)
184 1481 : 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 2962 : default_i_val=0) ! this default value is just a flag to get the above
195 1481 : CALL section_add_keyword(section, keyword)
196 1481 : 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 1481 : default_i_val=0)
201 1481 : CALL section_add_keyword(section, keyword)
202 1481 : 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 1481 : usage="PLUS_U_METHOD Lowdin")
221 1481 : CALL section_add_keyword(section, keyword)
222 1481 : 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 1481 : usage="EPS_U_J_LOOP [eV] 0.01")
233 1481 : CALL section_add_keyword(section, keyword)
234 1481 : 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 1481 : usage="MTLR_REFERENCE_SCF ON")
247 1481 : CALL section_add_keyword(section, keyword)
248 1481 : 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 1481 : usage="MAX_MTLR_LOOP 10")
256 1481 : CALL section_add_keyword(section, keyword)
257 1481 : 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 2962 : default_r_val=0.0_dp)
283 1481 : CALL section_add_keyword(section, keyword)
284 1481 : 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 1481 : n_var=1, default_r_val=2.0_dp)
290 1481 : CALL section_add_keyword(section, keyword)
291 1481 : 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 4443 : type_of_var=char_t, repeats=.TRUE., n_var=-1, default_c_vals=["X", "X"])
304 1481 : CALL section_add_keyword(section, keyword)
305 1481 : 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 2962 : citations=[Bengtsson1999])
319 1481 : CALL section_add_keyword(section, keyword)
320 1481 : 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 1481 : usage="SURF_DIP_DIR Z")
331 1481 : CALL section_add_keyword(section, keyword)
332 1481 : 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 1481 : default_r_val=-1.0_dp)
342 1481 : CALL section_add_keyword(section, keyword)
343 1481 : 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 1481 : lone_keyword_l_val=.TRUE.)
355 1481 : CALL section_add_keyword(section, keyword)
356 1481 : 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 1481 : lone_keyword_l_val=.TRUE.)
367 1481 : CALL section_add_keyword(section, keyword)
368 1481 : 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 1481 : usage="SORT_BASIS EXP")
379 1481 : CALL section_add_keyword(section, keyword)
380 1481 : CALL keyword_release(keyword)
381 :
382 1481 : NULLIFY (subsection)
383 1481 : CALL create_scf_section(subsection)
384 1481 : CALL section_add_subsection(section, subsection)
385 1481 : CALL section_release(subsection)
386 :
387 1481 : CALL create_ls_scf_section(subsection)
388 1481 : CALL section_add_subsection(section, subsection)
389 1481 : CALL section_release(subsection)
390 :
391 1481 : CALL create_almo_scf_section(subsection)
392 1481 : CALL section_add_subsection(section, subsection)
393 1481 : CALL section_release(subsection)
394 :
395 1481 : CALL create_kg_section(subsection)
396 1481 : CALL section_add_subsection(section, subsection)
397 1481 : CALL section_release(subsection)
398 :
399 1481 : CALL create_fde_section(subsection)
400 1481 : CALL section_add_subsection(section, subsection)
401 1481 : CALL section_release(subsection)
402 :
403 1481 : CALL create_harris_section(subsection)
404 1481 : CALL section_add_subsection(section, subsection)
405 1481 : CALL section_release(subsection)
406 :
407 1481 : CALL create_ec_section(subsection)
408 1481 : CALL section_add_subsection(section, subsection)
409 1481 : CALL section_release(subsection)
410 :
411 1481 : CALL create_exstate_section(subsection)
412 1481 : CALL section_add_subsection(section, subsection)
413 1481 : CALL section_release(subsection)
414 :
415 1481 : CALL create_admm_section(subsection)
416 1481 : CALL section_add_subsection(section, subsection)
417 1481 : CALL section_release(subsection)
418 :
419 1481 : CALL create_qs_section(subsection)
420 1481 : CALL section_add_subsection(section, subsection)
421 1481 : CALL section_release(subsection)
422 :
423 1481 : CALL create_mgrid_section(subsection, create_subsections=.TRUE.)
424 1481 : CALL section_add_subsection(section, subsection)
425 1481 : CALL section_release(subsection)
426 :
427 1481 : CALL create_xc_section(subsection)
428 1481 : CALL section_add_subsection(section, subsection)
429 1481 : CALL section_release(subsection)
430 :
431 1481 : CALL create_relativistic_section(subsection)
432 1481 : CALL section_add_subsection(section, subsection)
433 1481 : CALL section_release(subsection)
434 :
435 1481 : CALL create_sic_section(subsection)
436 1481 : CALL section_add_subsection(section, subsection)
437 1481 : CALL section_release(subsection)
438 :
439 1481 : CALL create_low_spin_roks_section(subsection)
440 1481 : CALL section_add_subsection(section, subsection)
441 1481 : CALL section_release(subsection)
442 :
443 1481 : CALL create_efield_section(subsection)
444 1481 : CALL section_add_subsection(section, subsection)
445 1481 : CALL section_release(subsection)
446 :
447 1481 : CALL create_per_efield_section(subsection)
448 1481 : CALL section_add_subsection(section, subsection)
449 1481 : CALL section_release(subsection)
450 :
451 1481 : CALL create_ext_pot_section(subsection)
452 1481 : CALL section_add_subsection(section, subsection)
453 1481 : CALL section_release(subsection)
454 :
455 1481 : CALL create_transport_section(subsection)
456 1481 : CALL section_add_subsection(section, subsection)
457 1481 : CALL section_release(subsection)
458 :
459 : ! ZMP sections to include the external density or v_xc potential
460 1481 : CALL create_ext_den_section(subsection)
461 1481 : CALL section_add_subsection(section, subsection)
462 1481 : CALL section_release(subsection)
463 :
464 1481 : CALL create_ext_vxc_section(subsection)
465 1481 : CALL section_add_subsection(section, subsection)
466 1481 : CALL section_release(subsection)
467 :
468 1481 : CALL create_poisson_section(subsection)
469 1481 : CALL section_add_subsection(section, subsection)
470 1481 : CALL section_release(subsection)
471 :
472 1481 : CALL create_kpoints_section(subsection)
473 1481 : CALL section_add_subsection(section, subsection)
474 1481 : CALL section_release(subsection)
475 :
476 1481 : CALL create_kpoint_set_section(subsection)
477 1481 : CALL section_add_subsection(section, subsection)
478 1481 : CALL section_release(subsection)
479 :
480 1481 : CALL create_implicit_solv_section(subsection)
481 1481 : CALL section_add_subsection(section, subsection)
482 1481 : CALL section_release(subsection)
483 :
484 1481 : CALL create_density_fitting_section(subsection)
485 1481 : CALL section_add_subsection(section, subsection)
486 1481 : CALL section_release(subsection)
487 :
488 1481 : CALL create_xas_section(subsection)
489 1481 : CALL section_add_subsection(section, subsection)
490 1481 : CALL section_release(subsection)
491 :
492 1481 : CALL create_xas_tdp_section(subsection)
493 1481 : CALL section_add_subsection(section, subsection)
494 1481 : CALL section_release(subsection)
495 :
496 1481 : CALL create_localize_section(subsection)
497 1481 : CALL section_add_subsection(section, subsection)
498 1481 : CALL section_release(subsection)
499 :
500 1481 : CALL create_rtp_section(subsection)
501 1481 : CALL section_add_subsection(section, subsection)
502 1481 : CALL section_release(subsection)
503 :
504 1481 : CALL create_print_dft_section(subsection)
505 1481 : CALL section_add_subsection(section, subsection)
506 1481 : CALL section_release(subsection)
507 :
508 1481 : CALL create_sccs_section(subsection)
509 1481 : CALL section_add_subsection(section, subsection)
510 1481 : CALL section_release(subsection)
511 :
512 1481 : CALL create_active_space_section(subsection)
513 1481 : CALL section_add_subsection(section, subsection)
514 1481 : CALL section_release(subsection)
515 :
516 1481 : CALL create_dft_smeagol_section(subsection)
517 1481 : CALL section_add_subsection(section, subsection)
518 1481 : CALL section_release(subsection)
519 :
520 1481 : CALL create_hairy_probes_section(subsection)
521 1481 : CALL section_add_subsection(section, subsection)
522 1481 : CALL section_release(subsection)
523 :
524 1481 : CALL create_pcc_section(subsection)
525 1481 : CALL section_add_subsection(section, subsection)
526 1481 : CALL section_release(subsection)
527 :
528 1481 : CALL create_paep_section(subsection)
529 1481 : CALL section_add_subsection(section, subsection)
530 1481 : CALL section_release(subsection)
531 :
532 1481 : END SUBROUTINE create_dft_section
533 :
534 : ! **************************************************************************************************
535 : !> \brief Hairy Probe DFT Model
536 : !> \param section ...
537 : !> \author Margherita Buraschi
538 : ! **************************************************************************************************
539 :
540 1481 : SUBROUTINE create_hairy_probes_section(section)
541 : TYPE(section_type), POINTER :: section
542 :
543 : TYPE(keyword_type), POINTER :: keyword
544 :
545 1481 : NULLIFY (keyword)
546 1481 : CPASSERT(.NOT. ASSOCIATED(section))
547 : CALL section_create(section, __LOCATION__, &
548 : name="HAIRY_PROBES", &
549 : description="Sets up a Hairy Probe calculation. ", &
550 1481 : 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 1481 : lone_keyword_l_val=.TRUE.)
558 1481 : CALL section_add_keyword(section, keyword)
559 1481 : 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 1481 : type_of_var=integer_t, n_var=-1)
565 1481 : CALL section_add_keyword(section, keyword)
566 1481 : 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 1481 : unit_str="K")
573 1481 : CALL section_add_keyword(section, keyword)
574 1481 : 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 1481 : unit_str="eV")
581 1481 : CALL section_add_keyword(section, keyword)
582 1481 : CALL keyword_release(keyword)
583 :
584 : CALL keyword_create(keyword, __LOCATION__, name="ALPHA", &
585 : description="Parameter for solution probes ", &
586 : usage="ALPHA <REAL>", &
587 1481 : default_r_val=1.0_dp)
588 1481 : CALL section_add_keyword(section, keyword)
589 1481 : 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 1481 : default_r_val=1.0E-5_dp)
596 1481 : CALL section_add_keyword(section, keyword)
597 1481 : CALL keyword_release(keyword)
598 1481 : END SUBROUTINE create_hairy_probes_section
599 : !####################################################################################
600 :
601 : ! **************************************************************************************************
602 : !> \brief Implicit Solvation Model
603 : !> \param section ...
604 : !> \author tlaino
605 : ! **************************************************************************************************
606 1481 : 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 1481 : NULLIFY (keyword, subsection, print_key)
613 1481 : 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 1481 : 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 1481 : default_r_val=1.0_dp)
623 1481 : CALL section_add_keyword(section, keyword)
624 1481 : 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 1481 : default_i_val=3)
630 1481 : CALL section_add_keyword(section, keyword)
631 1481 : CALL keyword_release(keyword)
632 :
633 1481 : CALL create_sphere_section(subsection)
634 1481 : CALL section_add_subsection(section, subsection)
635 1481 : 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 1481 : print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
640 1481 : CALL section_add_subsection(section, print_key)
641 1481 : CALL section_release(print_key)
642 :
643 1481 : END SUBROUTINE create_implicit_solv_section
644 :
645 : ! **************************************************************************************************
646 : !> \brief Create Sphere cavity
647 : !> \param section ...
648 : !> \author tlaino
649 : ! **************************************************************************************************
650 1481 : 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 1481 : NULLIFY (keyword, subsection)
657 1481 : CPASSERT(.NOT. ASSOCIATED(section))
658 : CALL section_create(section, __LOCATION__, name="SPHERE", &
659 : description="Treats the implicit solvent environment like a sphere", &
660 1481 : 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 1481 : type_of_var=real_t)
667 1481 : CALL section_add_keyword(section, keyword)
668 1481 : CALL keyword_release(keyword)
669 :
670 1481 : CALL create_center_section(subsection)
671 1481 : CALL section_add_subsection(section, subsection)
672 1481 : CALL section_release(subsection)
673 :
674 1481 : END SUBROUTINE create_sphere_section
675 :
676 : ! **************************************************************************************************
677 : !> \brief ...
678 : !> \param section ...
679 : !> \author tlaino
680 : ! **************************************************************************************************
681 1481 : SUBROUTINE create_center_section(section)
682 : TYPE(section_type), POINTER :: section
683 :
684 : TYPE(keyword_type), POINTER :: keyword
685 :
686 1481 : NULLIFY (keyword)
687 1481 : CPASSERT(.NOT. ASSOCIATED(section))
688 : CALL section_create(section, __LOCATION__, name="CENTER", &
689 : description="Defines the center of the sphere.", &
690 1481 : 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 1481 : type_of_var=real_t, n_var=3)
696 1481 : CALL section_add_keyword(section, keyword)
697 1481 : 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 1481 : type_of_var=integer_t, n_var=-1)
703 1481 : CALL section_add_keyword(section, keyword)
704 1481 : 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 4443 : default_i_val=weight_type_unit)
713 1481 : CALL section_add_keyword(section, keyword)
714 1481 : 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 1481 : default_l_val=.TRUE.)
721 1481 : CALL section_add_keyword(section, keyword)
722 1481 : CALL keyword_release(keyword)
723 :
724 1481 : END SUBROUTINE create_center_section
725 :
726 : ! **************************************************************************************************
727 : !> \brief ...
728 : !> \param section ...
729 : ! **************************************************************************************************
730 1481 : SUBROUTINE create_admm_section(section)
731 : TYPE(section_type), POINTER :: section
732 :
733 : TYPE(keyword_type), POINTER :: keyword
734 :
735 1481 : NULLIFY (keyword)
736 1481 : 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 2962 : 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 4443 : citations=[Guidon2010, Merlot2014])
758 1481 : CALL section_add_keyword(section, keyword)
759 1481 : 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 1481 : default_i_val=do_admm_purify_mo_diag)
777 1481 : CALL section_add_keyword(section, keyword)
778 1481 : 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 1481 : default_i_val=do_admm_basis_projection)
794 1481 : CALL section_add_keyword(section, keyword)
795 1481 : 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 1481 : default_i_val=do_admm_exch_scaling_none)
806 1481 : CALL section_add_keyword(section, keyword)
807 1481 : 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 1481 : default_i_val=do_admm_aux_exch_func_default)
832 1481 : CALL section_add_keyword(section, keyword)
833 1481 : CALL keyword_release(keyword)
834 :
835 : CALL keyword_create(keyword, __LOCATION__, name="optx_a1", &
836 : description="OPTX a1 coefficient", &
837 1481 : default_r_val=1.05151_dp)
838 1481 : CALL section_add_keyword(section, keyword)
839 1481 : CALL keyword_release(keyword)
840 : CALL keyword_create(keyword, __LOCATION__, name="optx_a2", &
841 : description="OPTX a2 coefficient", &
842 1481 : default_r_val=1.43169_dp)
843 1481 : CALL section_add_keyword(section, keyword)
844 1481 : CALL keyword_release(keyword)
845 : CALL keyword_create(keyword, __LOCATION__, name="optx_gamma", &
846 : description="OPTX gamma coefficient", &
847 1481 : default_r_val=0.006_dp)
848 1481 : CALL section_add_keyword(section, keyword)
849 1481 : 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 1481 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
855 1481 : CALL section_add_keyword(section, keyword)
856 1481 : CALL keyword_release(keyword)
857 :
858 : CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
859 : description="Define accuracy of DBCSR operations", &
860 1481 : usage="EPS_FILTER", default_r_val=0.0_dp)
861 1481 : CALL section_add_keyword(section, keyword)
862 1481 : CALL keyword_release(keyword)
863 :
864 1481 : END SUBROUTINE create_admm_section
865 :
866 : ! **************************************************************************************************
867 : !> \brief ...
868 : !> \param section ...
869 : ! **************************************************************************************************
870 1481 : 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 1481 : NULLIFY (keyword, print_key)
877 1481 : 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 2962 : 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 1481 : n_var=1, type_of_var=integer_t, default_i_val=3)
888 1481 : CALL section_add_keyword(section, keyword)
889 1481 : 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 1481 : n_var=1, type_of_var=real_t, default_r_val=1.5_dp)
895 1481 : CALL section_add_keyword(section, keyword)
896 1481 : 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 1481 : unit_str="angstrom", n_var=1, type_of_var=real_t, default_r_val=0.5_dp)
903 1481 : CALL section_add_keyword(section, keyword)
904 1481 : 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 1481 : unit_str="angstrom", n_var=-1, type_of_var=real_t)
911 1481 : CALL section_add_keyword(section, keyword)
912 1481 : 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 1481 : n_var=1, type_of_var=real_t, default_r_val=SQRT(6.0_dp))
918 1481 : CALL section_add_keyword(section, keyword)
919 1481 : 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 1481 : 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 1481 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
929 1481 : CALL section_add_keyword(print_key, keyword)
930 1481 : CALL keyword_release(keyword)
931 :
932 1481 : CALL section_add_subsection(section, print_key)
933 1481 : CALL section_release(print_key)
934 :
935 1481 : 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 1481 : SUBROUTINE create_relativistic_section(section)
943 : TYPE(section_type), POINTER :: section
944 :
945 : TYPE(keyword_type), POINTER :: keyword
946 :
947 1481 : CPASSERT(.NOT. ASSOCIATED(section))
948 : CALL section_create(section, __LOCATION__, name="relativistic", &
949 : description="parameters needed and setup for relativistic calculations", &
950 1481 : n_keywords=5, n_subsections=0, repeats=.FALSE.)
951 :
952 1481 : 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 1481 : "Use ZORA method"))
962 1481 : CALL section_add_keyword(section, keyword)
963 1481 : CALL keyword_release(keyword)
964 :
965 : CALL keyword_create(keyword, __LOCATION__, name="DKH_order", &
966 : description="The order of the DKH transformation ", &
967 1481 : usage="DKH_order 2", default_i_val=2)
968 1481 : CALL section_add_keyword(section, keyword)
969 1481 : 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 1481 : enum_i_vals=[rel_zora_full, rel_zora_mp, rel_sczora_mp])
979 1481 : CALL section_add_keyword(section, keyword)
980 1481 : 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 1481 : "Use atomic blocks"))
990 1481 : CALL section_add_keyword(section, keyword)
991 1481 : 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 1481 : usage="z_cutoff 50", default_i_val=1)
996 1481 : CALL section_add_keyword(section, keyword)
997 1481 : 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 1481 : enum_i_vals=[rel_pot_full, rel_pot_erfc])
1004 1481 : CALL section_add_keyword(section, keyword)
1005 1481 : CALL keyword_release(keyword)
1006 :
1007 1481 : END SUBROUTINE create_relativistic_section
1008 :
1009 : ! **************************************************************************************************
1010 : !> \brief creates the KG section
1011 : !> \param section ...
1012 : !> \author Martin Haeufel [2012.07]
1013 : ! **************************************************************************************************
1014 1481 : 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 1481 : 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 5924 : citations=[Iannuzzi2006, Brelaz1979, Andermatt2016])
1026 :
1027 1481 : NULLIFY (keyword, subsection, print_key)
1028 :
1029 : ! add a XC section
1030 1481 : CALL create_xc_section(subsection)
1031 1481 : CALL section_add_subsection(section, subsection)
1032 1481 : CALL section_release(subsection)
1033 :
1034 : ! add LRI section
1035 1481 : CALL create_lrigpw_section(subsection)
1036 1481 : CALL section_add_subsection(section, subsection)
1037 1481 : 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 1481 : enum_i_vals=[kg_color_dsatur, kg_color_greedy])
1047 1481 : CALL section_add_keyword(section, keyword)
1048 1481 : 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 1481 : enum_i_vals=[kg_tnadd_embed, kg_tnadd_embed_ri, kg_tnadd_atomic, kg_tnadd_none])
1060 1481 : CALL section_add_keyword(section, keyword)
1061 1481 : 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 1481 : default_c_val="MEDIUM")
1067 1481 : CALL section_add_keyword(section, keyword)
1068 1481 : CALL keyword_release(keyword)
1069 :
1070 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
1071 : description="Print section", &
1072 1481 : 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 1481 : 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 1481 : lone_keyword_l_val=.TRUE.)
1084 1481 : CALL section_add_keyword(print_key, keyword)
1085 1481 : 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 1481 : lone_keyword_l_val=.TRUE.)
1093 1481 : CALL section_add_keyword(print_key, keyword)
1094 1481 : 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 1481 : lone_keyword_l_val=.TRUE.)
1102 1481 : CALL section_add_keyword(print_key, keyword)
1103 1481 : CALL keyword_release(keyword)
1104 :
1105 1481 : CALL section_add_subsection(subsection, print_key)
1106 1481 : CALL section_release(print_key)
1107 :
1108 1481 : CALL section_add_subsection(section, subsection)
1109 1481 : CALL section_release(subsection)
1110 :
1111 1481 : 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 1462 : 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 1462 : 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 1462 : n_keywords=3, n_subsections=1, repeats=.FALSE.)
1130 :
1131 1462 : 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 1462 : 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 1462 : repeats=.TRUE., n_var=-1, type_of_var=integer_t)
1141 1462 : CALL section_add_keyword(subsection, keyword)
1142 1462 : CALL keyword_release(keyword)
1143 :
1144 1462 : CALL section_add_subsection(section, subsection)
1145 1462 : 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 1462 : 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 1462 : n_var=-1, type_of_var=integer_t)
1159 1462 : CALL section_add_keyword(subsection, keyword)
1160 1462 : 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 1462 : n_var=-1, type_of_var=integer_t)
1167 1462 : CALL section_add_keyword(subsection, keyword)
1168 1462 : 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 2924 : default_i_val=0) ! this default value is just a flag to get the above
1178 1462 : CALL section_add_keyword(subsection, keyword)
1179 1462 : 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 1462 : default_i_val=0)
1185 1462 : CALL section_add_keyword(subsection, keyword)
1186 1462 : CALL keyword_release(keyword)
1187 1462 : CALL section_add_subsection(section, subsection)
1188 1462 : 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 1462 : 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 1462 : usage="{REAL}", type_of_var=real_t)
1197 1462 : CALL section_add_keyword(subsection, keyword)
1198 1462 : CALL keyword_release(keyword)
1199 1462 : CALL section_add_subsection(section, subsection)
1200 1462 : CALL section_release(subsection)
1201 :
1202 1462 : CALL create_print_bsse_section(subsection)
1203 1462 : CALL section_add_subsection(section, subsection)
1204 1462 : CALL section_release(subsection)
1205 :
1206 1462 : 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 1462 : SUBROUTINE create_print_bsse_section(section)
1214 : TYPE(section_type), POINTER :: section
1215 :
1216 : TYPE(section_type), POINTER :: print_key
1217 :
1218 1462 : CPASSERT(.NOT. ASSOCIATED(section))
1219 : CALL section_create(section, __LOCATION__, name="print", &
1220 : description="Section of possible print options in BSSE code.", &
1221 1462 : n_keywords=0, n_subsections=1, repeats=.FALSE.)
1222 :
1223 1462 : 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 1462 : print_level=low_print_level, filename="__STD_OUT__")
1227 1462 : CALL section_add_subsection(section, print_key)
1228 1462 : 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 1462 : add_last=add_last_numeric, filename="")
1236 1462 : CALL section_add_subsection(section, print_key)
1237 1462 : CALL section_release(print_key)
1238 :
1239 1462 : 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 4405 : 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 4405 : 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 4405 : n_keywords=5, n_subsections=1, repeats=.FALSE.)
1300 4405 : 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 4405 : usage="ngrids 1", default_i_val=4)
1305 4405 : CALL section_add_keyword(section, keyword)
1306 4405 : 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 4405 : n_var=1, unit_str="Ry")
1317 4405 : CALL section_add_keyword(section, keyword)
1318 4405 : 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 4405 : usage="progression_factor <integer>", default_r_val=3._dp)
1324 4405 : CALL section_add_keyword(section, keyword)
1325 4405 : 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 4405 : lone_keyword_l_val=.TRUE.)
1332 4405 : CALL section_add_keyword(section, keyword)
1333 4405 : 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 4405 : lone_keyword_l_val=.TRUE.)
1339 4405 : CALL section_add_keyword(section, keyword)
1340 4405 : 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 8810 : unit_str="Ry")
1350 4405 : CALL section_add_keyword(section, keyword)
1351 4405 : CALL keyword_release(keyword)
1352 :
1353 : CALL keyword_create(keyword, __LOCATION__, name="MULTIGRID_SET", &
1354 : description="Activate a manual setting of the multigrids", &
1355 4405 : usage="MULTIGRID_SET", default_l_val=.FALSE.)
1356 4405 : CALL section_add_keyword(section, keyword)
1357 4405 : 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 4405 : 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 4405 : CALL section_add_keyword(section, keyword)
1373 4405 : 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 8810 : unit_str="Ry")
1382 4405 : CALL section_add_keyword(section, keyword)
1383 4405 : CALL keyword_release(keyword)
1384 :
1385 4405 : IF (create_subsections) THEN
1386 1481 : NULLIFY (subsection)
1387 1481 : CALL create_rsgrid_section(subsection)
1388 1481 : CALL section_add_subsection(section, subsection)
1389 1481 : CALL section_release(subsection)
1390 :
1391 1481 : NULLIFY (subsection)
1392 1481 : CALL create_interp_section(subsection)
1393 1481 : CALL section_add_subsection(section, subsection)
1394 1481 : CALL section_release(subsection)
1395 : END IF
1396 4405 : END SUBROUTINE create_mgrid_section
1397 :
1398 : ! **************************************************************************************************
1399 : !> \brief creates the interpolation section
1400 : !> \param section ...
1401 : !> \author tlaino
1402 : ! **************************************************************************************************
1403 11715 : 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 11715 : CPASSERT(.NOT. ASSOCIATED(section))
1410 : CALL section_create(section, __LOCATION__, name="interpolator", &
1411 : description="kind of interpolation used between the multigrids", &
1412 11715 : n_keywords=5, n_subsections=0, repeats=.FALSE.)
1413 :
1414 11715 : 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 11715 : enum_i_vals=[pw_interp, spline3_pbc_interp])
1422 11715 : CALL section_add_keyword(section, keyword)
1423 11715 : 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 11715 : lone_keyword_l_val=.TRUE.)
1430 11715 : CALL section_add_keyword(section, keyword)
1431 11715 : 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 11715 : precond_spl3_1, precond_spl3_2, precond_spl3_3])
1442 11715 : CALL section_add_keyword(section, keyword)
1443 11715 : 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 11715 : precond_spl3_1, precond_spl3_2, precond_spl3_3])
1454 11715 : CALL section_add_keyword(section, keyword)
1455 11715 : 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 11715 : usage="eps_x 1.e-15", default_r_val=1.e-10_dp)
1460 11715 : CALL section_add_keyword(section, keyword)
1461 11715 : 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 11715 : usage="eps_r 1.e-15", default_r_val=1.e-10_dp)
1466 11715 : CALL section_add_keyword(section, keyword)
1467 11715 : 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 23430 : usage="max_iter 200", default_i_val=100)
1473 11715 : CALL section_add_keyword(section, keyword)
1474 11715 : CALL keyword_release(keyword)
1475 :
1476 11715 : 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 11715 : add_last=add_last_numeric)
1483 11715 : CALL section_add_subsection(section, print_key)
1484 11715 : CALL section_release(print_key)
1485 :
1486 11715 : END SUBROUTINE create_interp_section
1487 :
1488 : ! **************************************************************************************************
1489 : !> \brief creates the sic (self interaction correction) section
1490 : !> \param section ...
1491 : !> \author fawzi
1492 : ! **************************************************************************************************
1493 1481 : SUBROUTINE create_sic_section(section)
1494 : TYPE(section_type), POINTER :: section
1495 :
1496 : TYPE(keyword_type), POINTER :: keyword
1497 :
1498 1481 : 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 5924 : citations=[VandeVondele2005b, Perdew1981, Avezac2005])
1503 :
1504 1481 : 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 2962 : default_r_val=1.0_dp)
1511 1481 : CALL section_add_keyword(section, keyword)
1512 1481 : 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 2962 : default_r_val=1.0_dp)
1519 1481 : CALL section_add_keyword(section, keyword)
1520 1481 : 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 5924 : citations=[VandeVondele2005b, Perdew1981, Avezac2005])
1536 1481 : CALL section_add_keyword(section, keyword)
1537 1481 : 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 1481 : enum_i_vals=[sic_list_unpaired, sic_list_all])
1547 1481 : CALL section_add_keyword(section, keyword)
1548 1481 : CALL keyword_release(keyword)
1549 :
1550 1481 : END SUBROUTINE create_sic_section
1551 :
1552 : ! **************************************************************************************************
1553 : !> \brief creates the low spin roks section
1554 : !> \param section ...
1555 : !> \author Joost VandeVondele
1556 : ! **************************************************************************************************
1557 1481 : SUBROUTINE create_low_spin_roks_section(section)
1558 : TYPE(section_type), POINTER :: section
1559 :
1560 : TYPE(keyword_type), POINTER :: keyword
1561 :
1562 1481 : 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 : "full-AO 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 1481 : n_keywords=6, n_subsections=0, repeats=.FALSE.)
1572 :
1573 1481 : 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 1481 : n_var=-1, type_of_var=real_t, repeats=.FALSE.)
1579 1481 : CALL section_add_keyword(section, keyword)
1580 1481 : 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 1481 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
1587 1481 : CALL section_add_keyword(section, keyword)
1588 1481 : CALL keyword_release(keyword)
1589 :
1590 1481 : END SUBROUTINE create_low_spin_roks_section
1591 :
1592 : ! **************************************************************************************************
1593 : !> \brief ...
1594 : !> \param section ...
1595 : ! **************************************************************************************************
1596 1481 : 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 1481 : NULLIFY (keyword)
1603 1481 : 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 5924 : 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 1481 : default_i_val=10)
1614 1481 : CALL section_add_keyword(section, keyword)
1615 1481 : 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 1481 : default_r_val=1.0E-7_dp)
1621 1481 : CALL section_add_keyword(section, keyword)
1622 1481 : 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 1481 : default_i_val=3)
1629 1481 : CALL section_add_keyword(section, keyword)
1630 1481 : 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 1481 : "matrix exponential exactly. Only implemented for GWBSE."))
1648 1481 : CALL section_add_keyword(section, keyword)
1649 1481 : 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 1481 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1657 1481 : CALL section_add_keyword(section, keyword)
1658 1481 : 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 1481 : default_i_val=0)
1665 1481 : CALL section_add_keyword(section, keyword)
1666 1481 : 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 1481 : default_r_val=1.0E-9_dp)
1674 1481 : CALL section_add_keyword(section, keyword)
1675 1481 : 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 1481 : "Exponential midpoint propagator"))
1685 1481 : CALL section_add_keyword(section, keyword)
1686 1481 : 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 1481 : "use the wavefunction of a real time propagation/ehrenfest run"))
1701 1481 : CALL section_add_keyword(section, keyword)
1702 1481 : 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 1481 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1713 1481 : CALL section_add_keyword(section, keyword)
1714 1481 : CALL keyword_release(keyword)
1715 :
1716 : CALL keyword_create(keyword, __LOCATION__, name="APPLY_DELTA_PULSE", &
1717 : description="Applies a delta kick to the initial wfn (only RTP for now - the EMD"// &
1718 : " case is not yet implemented). Only work for INITIAL_WFN=SCF_WFN", &
1719 : usage="APPLY_DELTA_PULSE", &
1720 1481 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1721 1481 : CALL section_add_keyword(section, keyword)
1722 1481 : CALL keyword_release(keyword)
1723 :
1724 : CALL keyword_create(keyword, __LOCATION__, name="APPLY_DELTA_PULSE_MAG", &
1725 : description="Applies a magnetic delta kick to the initial wfn (only RTP for now - the EMD"// &
1726 : " case is not yet implemented). Only work for INITIAL_WFN=SCF_WFN", &
1727 : usage="APPLY_DELTA_PULSE_MAG", &
1728 1481 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1729 1481 : CALL section_add_keyword(section, keyword)
1730 1481 : CALL keyword_release(keyword)
1731 :
1732 : CALL keyword_create(keyword, __LOCATION__, name="VELOCITY_GAUGE", &
1733 : description="Perform propagation in the velocity gauge using the explicit vector potential"// &
1734 : " only a constant vector potential as of now (corresonding to a delta-pulse)."// &
1735 : " uses DELTA_PULSE_SCALE and DELTA_PULSE_DIRECTION to define the vector potential", &
1736 : usage="VELOCITY_GAUGE T", &
1737 1481 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1738 1481 : CALL section_add_keyword(section, keyword)
1739 1481 : CALL keyword_release(keyword)
1740 :
1741 : CALL keyword_create(keyword, __LOCATION__, name="GAUGE_ORIG", &
1742 : description="Define gauge origin for magnetic perturbation", &
1743 : usage="GAUGE_ORIG COM", &
1744 : enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
1745 : enum_desc=s2a("Use Center of Mass", &
1746 : "Use Center of Atomic Charges", &
1747 : "Use User Defined Point (Keyword:REF_POINT)", &
1748 : "Use Origin of Coordinate System"), &
1749 : enum_i_vals=[use_mom_ref_com, &
1750 : use_mom_ref_coac, &
1751 : use_mom_ref_user, &
1752 : use_mom_ref_zero], &
1753 1481 : default_i_val=use_mom_ref_com)
1754 1481 : CALL section_add_keyword(section, keyword)
1755 1481 : CALL keyword_release(keyword)
1756 :
1757 : CALL keyword_create(keyword, __LOCATION__, name="GAUGE_ORIG_MANUAL", &
1758 : description="Manually defined gauge origin for magnetic perturbation [in Bohr!]", &
1759 : usage="GAUGE_ORIG_MANUAL x y z", &
1760 : repeats=.FALSE., &
1761 : n_var=3, default_r_vals=[0._dp, 0._dp, 0._dp], &
1762 : type_of_var=real_t, &
1763 1481 : unit_str='bohr')
1764 1481 : CALL section_add_keyword(section, keyword)
1765 1481 : CALL keyword_release(keyword)
1766 :
1767 : CALL keyword_create(keyword, __LOCATION__, name="VG_COM_NL", &
1768 : description="apply gauge transformed non-local potential term"// &
1769 : " only affects VELOCITY_GAUGE=.TRUE.", &
1770 : usage="VG_COM_NL T", &
1771 1481 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1772 1481 : CALL section_add_keyword(section, keyword)
1773 1481 : CALL keyword_release(keyword)
1774 :
1775 : CALL keyword_create(keyword, __LOCATION__, name="COM_NL", &
1776 : description="Include non-local commutator for periodic delta pulse."// &
1777 : " only affects PERIODIC=.TRUE.", &
1778 : usage="COM_NL", &
1779 1481 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1780 1481 : CALL section_add_keyword(section, keyword)
1781 1481 : CALL keyword_release(keyword)
1782 :
1783 : CALL keyword_create(keyword, __LOCATION__, name="LEN_REP", &
1784 : description="Use length representation delta pulse (in conjunction with PERIODIC T)."// &
1785 : " This corresponds to a 1st order perturbation in the length gauge."// &
1786 : " Note that this is NOT compatible with a periodic calculation!"// &
1787 : " Uses the reference point defined in DFT%PRINT%MOMENTS ", &
1788 : usage="LEN_REP T", &
1789 1481 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1790 1481 : CALL section_add_keyword(section, keyword)
1791 1481 : CALL keyword_release(keyword)
1792 :
1793 : CALL keyword_create(keyword, __LOCATION__, name="PERIODIC", &
1794 : description="Apply a delta-kick that is compatible with periodic boundary conditions"// &
1795 : " for any value of DELTA_PULSE_SCALE. Uses perturbation theory for the preparation of"// &
1796 : " the initial wfn with the velocity operator as perturbation."// &
1797 : " If LEN_REP is .FALSE. this corresponds to a first order velocity gauge."// &
1798 : " Note that the pulse is only applied when INITIAL_WFN is set to SCF_WFN,"// &
1799 : " and not for restarts (RT_RESTART).", &
1800 : usage="PERIODIC", &
1801 1481 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
1802 1481 : CALL section_add_keyword(section, keyword)
1803 1481 : CALL keyword_release(keyword)
1804 :
1805 : CALL keyword_create(keyword, __LOCATION__, name="LOCALIZE", &
1806 : description="Localise the Molecular orbitals each n steps "// &
1807 : "real-time propagated TDDFT, 0 means never localise", &
1808 1481 : usage="LOCALIZE", default_i_val=0)
1809 1481 : CALL section_add_keyword(section, keyword)
1810 1481 : CALL keyword_release(keyword)
1811 :
1812 : CALL keyword_create(keyword, __LOCATION__, name="DELTA_PULSE_DIRECTION", &
1813 : description="Direction of the applied electric field. The k vector is given as"// &
1814 : " 2*Pi*[i,j,k]*inv(h_mat), which for PERIODIC .FALSE. yields exp(ikr) periodic with"// &
1815 : " the unit cell, only if DELTA_PULSE_SCALE is set to unity. For an orthorhombic cell"// &
1816 : " [1,0,0] yields [2*Pi/L_x,0,0]. For small cells, this results in a very large kick.", &
1817 : usage="DELTA_PULSE_DIRECTION 1 1 1", n_var=3, default_i_vals=[1, 0, 0], &
1818 1481 : type_of_var=integer_t)
1819 1481 : CALL section_add_keyword(section, keyword)
1820 1481 : CALL keyword_release(keyword)
1821 :
1822 : CALL keyword_create(keyword, __LOCATION__, name="DELTA_PULSE_SCALE", &
1823 : description="Scale the k vector, which for PERIODIC .FALSE. results in exp(ikr) no"// &
1824 : " longer being periodic with the unit cell. The norm of k is the strength of the"// &
1825 : " applied electric field in atomic units.", &
1826 1481 : usage="DELTA_PULSE_SCALE 0.01 ", n_var=1, default_r_val=0.001_dp)
1827 1481 : CALL section_add_keyword(section, keyword)
1828 1481 : CALL keyword_release(keyword)
1829 :
1830 : CALL keyword_create(keyword, __LOCATION__, name="HFX_BALANCE_IN_CORE", &
1831 : description="If HFX is used, this keyword forces a redistribution/recalculation"// &
1832 : " of the integrals, balanced with respect to the in core steps.", &
1833 : usage="HFX_BALANCE_IN_CORE", &
1834 1481 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1835 1481 : CALL section_add_keyword(section, keyword)
1836 1481 : CALL keyword_release(keyword)
1837 :
1838 : CALL keyword_create(keyword, __LOCATION__, name="MCWEENY_MAX_ITER", &
1839 : description="Determines the maximum amount of McWeeny steps used after each converged"// &
1840 : " step in density propagation", &
1841 1481 : usage="MCWEENY_MAX_ITER 2", default_i_val=1)
1842 1481 : CALL section_add_keyword(section, keyword)
1843 1481 : CALL keyword_release(keyword)
1844 :
1845 : CALL keyword_create( &
1846 : keyword, __LOCATION__, name="ACCURACY_REFINEMENT", &
1847 : description="If using density propagation some parts should be calculated with a higher accuracy than the rest"// &
1848 : " to reduce numerical noise. This factor determines by how much the filtering threshold is"// &
1849 : " reduced for these calculations.", &
1850 1481 : usage="ACCURACY_REFINEMENT", default_i_val=100)
1851 1481 : CALL section_add_keyword(section, keyword)
1852 1481 : CALL keyword_release(keyword)
1853 :
1854 : CALL keyword_create(keyword, __LOCATION__, name="MCWEENY_EPS", &
1855 : description="Threshold after which McWeeny is terminated", &
1856 : usage="MCWEENY_EPS 0.00001", &
1857 1481 : default_r_val=0.0_dp)
1858 1481 : CALL section_add_keyword(section, keyword)
1859 1481 : CALL keyword_release(keyword)
1860 :
1861 1481 : NULLIFY (print_section)
1862 : CALL section_create(print_section, __LOCATION__, name="PRINT", &
1863 : description="Section of possible print options for an RTP runs", &
1864 1481 : repeats=.FALSE.)
1865 :
1866 1481 : NULLIFY (print_key)
1867 : CALL cp_print_key_section_create(print_key, __LOCATION__, "PROGRAM_RUN_INFO", &
1868 : description="Controls the printing within real time propagation and Eherenfest dynamics", &
1869 1481 : print_level=low_print_level, filename="__STD_OUT__")
1870 1481 : CALL section_add_subsection(print_section, print_key)
1871 1481 : CALL section_release(print_key)
1872 :
1873 : CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
1874 : description="Controls the dumping of the latest wavefunction restart "// &
1875 : "file during rtp. In density propagation this controls the printing "// &
1876 : "of density matrix. See also RESTART_HISTORY.", &
1877 : print_level=low_print_level, common_iter_levels=3, &
1878 : each_iter_names=s2a("MD"), each_iter_values=[20], &
1879 1481 : add_last=add_last_numeric, filename="RESTART", do_backup=.TRUE.)
1880 1481 : CALL section_add_subsection(print_section, print_key)
1881 1481 : CALL section_release(print_key)
1882 :
1883 : CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART_HISTORY", &
1884 : description="Dumps unique wavefunction restart files during the run, "// &
1885 : "keeping all of them. In density propagation it dumps the density "// &
1886 : "matrix instead. For the latest wavefunction restart file, see RESTART.", &
1887 : print_level=low_print_level, common_iter_levels=0, &
1888 : each_iter_names=s2a("MD"), &
1889 : each_iter_values=[500], &
1890 1481 : filename="RESTART", do_backup=.TRUE.)
1891 1481 : CALL section_add_subsection(print_section, print_key)
1892 1481 : CALL section_release(print_key)
1893 :
1894 : CALL cp_print_key_section_create(print_key, __LOCATION__, "FIELD", &
1895 : description="Print the time-dependent field applied during an EMD simulation in "// &
1896 : "atomic unit.", &
1897 : print_level=high_print_level, common_iter_levels=1, &
1898 : each_iter_names=s2a("MD"), &
1899 : each_iter_values=[1], &
1900 1481 : filename="FIELD")
1901 1481 : CALL section_add_subsection(print_section, print_key)
1902 1481 : CALL section_release(print_key)
1903 :
1904 1481 : CALL create_projection_rtp_section(print_key)
1905 1481 : CALL section_add_subsection(print_section, print_key)
1906 1481 : CALL section_release(print_key)
1907 :
1908 : CALL cp_print_key_section_create(print_key, __LOCATION__, "CURRENT_INT", &
1909 : description="Print the integral of the current density (only if the"// &
1910 : " imaginary part of the density is NOT zero).", &
1911 : print_level=high_print_level, common_iter_levels=1, &
1912 : each_iter_names=s2a("MD"), &
1913 : each_iter_values=[1], &
1914 1481 : filename="rtp_j_int")
1915 1481 : CALL section_add_subsection(print_section, print_key)
1916 1481 : CALL section_release(print_key)
1917 :
1918 : CALL cp_print_key_section_create(print_key, __LOCATION__, "CURRENT", &
1919 : description="Print the current during an EMD simulation to cube files.", &
1920 : print_level=high_print_level, common_iter_levels=0, &
1921 : each_iter_names=s2a("MD"), &
1922 : each_iter_values=[20], &
1923 1481 : filename="current", do_backup=.TRUE.)
1924 : CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
1925 : description="The stride (X,Y,Z) used to write the cube file "// &
1926 : "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
1927 : " 1 number valid for all components.", &
1928 1481 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
1929 1481 : CALL section_add_keyword(print_key, keyword)
1930 1481 : CALL keyword_release(keyword)
1931 :
1932 1481 : CALL section_add_subsection(print_section, print_key)
1933 1481 : CALL section_release(print_key)
1934 :
1935 : ! Marek : Add print option for ASCII density files - DEVELPMENT ONLY?
1936 : CALL cp_print_key_section_create(print_key, __LOCATION__, "DENSITY_MATRIX", &
1937 : description="Prints the density matrix at iterations in clear text to a file", &
1938 : print_level=high_print_level, common_iter_levels=0, &
1939 : each_iter_names=s2a("MD"), &
1940 : each_iter_values=[1], &
1941 1481 : filename="rho")
1942 1481 : CALL section_add_subsection(print_section, print_key)
1943 1481 : CALL section_release(print_key)
1944 : ! Marek : Moments ASCII print
1945 : CALL cp_print_key_section_create(print_key, __LOCATION__, "MOMENTS", &
1946 : description="Prints the time-dependent electronic moments at "// &
1947 : "iterations in clear text to a file.", &
1948 : print_level=high_print_level, common_iter_levels=1, &
1949 : each_iter_names=s2a("MD"), &
1950 : each_iter_values=[1], &
1951 1481 : filename="__STD_OUT__")
1952 : CALL keyword_create(keyword, __LOCATION__, name="REFERENCE", &
1953 : variants=s2a("REF"), &
1954 : description="Define the reference point for the calculation of the electrostatic moment.", &
1955 : usage="REFERENCE COM", &
1956 : enum_c_vals=s2a("COM", "COAC", "USER_DEFINED", "ZERO"), &
1957 : enum_desc=s2a("Use Center of Mass", &
1958 : "Use Center of Atomic Charges", &
1959 : "Use User Defined Point (Keyword:REFERENCE_POINT)", &
1960 : "Use Origin of Coordinate System"), &
1961 : enum_i_vals=[use_mom_ref_com, &
1962 : use_mom_ref_coac, &
1963 : use_mom_ref_user, &
1964 : use_mom_ref_zero], &
1965 1481 : default_i_val=use_mom_ref_coac)
1966 1481 : CALL section_add_keyword(print_key, keyword)
1967 1481 : CALL keyword_release(keyword)
1968 :
1969 : CALL keyword_create(keyword, __LOCATION__, name="REFERENCE_POINT", &
1970 : variants=s2a("REF_POINT"), &
1971 : description="Fixed reference point for the calculations of the electrostatic moment.", &
1972 : usage="REFERENCE_POINT x y z", &
1973 : repeats=.FALSE., &
1974 : n_var=3, default_r_vals=[0._dp, 0._dp, 0._dp], &
1975 : type_of_var=real_t, &
1976 1481 : unit_str='angstrom')
1977 1481 : CALL section_add_keyword(print_key, keyword)
1978 1481 : CALL keyword_release(keyword)
1979 1481 : CALL section_add_subsection(print_section, print_key)
1980 1481 : CALL section_release(print_key)
1981 : ! Marek : Fourier transform of MOMENTS ASCII print
1982 : CALL cp_print_key_section_create(print_key, __LOCATION__, "MOMENTS_FT", &
1983 : description="Prints the calculated Fourier transform of "// &
1984 : "time-dependent moments. For calculations with real time pulse (not delta kick) "// &
1985 : "can be supplied with starting time.", &
1986 : print_level=medium_print_level, common_iter_levels=0, &
1987 : each_iter_names=s2a("MD"), &
1988 : each_iter_values=[1], &
1989 1481 : filename="MOMENTS_FT")
1990 1481 : CALL section_add_subsection(print_section, print_key)
1991 1481 : CALL section_release(print_key)
1992 : ! Marek : Chosen element of (Fourier transformed) polarizability tensor (energy dependent) - text format
1993 : CALL cp_print_key_section_create(print_key, __LOCATION__, "POLARIZABILITY", &
1994 : description="Prints the chosen element of the energy dependent polarizability tensor "// &
1995 : "to a specified file. The tensor is calculated as ratio of "// &
1996 : "Fourier transform of the dipole "// &
1997 : "moment trace and Fourier transform of the applied field "// &
1998 : "(for delta kick, constant real field is applied.", &
1999 : print_level=medium_print_level, common_iter_levels=0, &
2000 : each_iter_names=s2a("MD"), &
2001 : each_iter_values=[1], &
2002 1481 : filename="POLARIZABILITY")
2003 : CALL keyword_create(keyword, __LOCATION__, "ELEMENT", &
2004 : description="Specifies the element of polarizability which is to be printed out "// &
2005 : "(indexing starts at 1). If not explicitly provided, RTBSE code tries to guess "// &
2006 : "the optimal values - for applied electric field (both delta pulse and RT field) "// &
2007 : "with only a single non-zero cartesian component, prints the 3 trivially available elements.", &
2008 1481 : type_of_var=integer_t, default_i_vals=[1, 1], n_var=2, usage="ELEMENT 1 1", repeats=.TRUE.)
2009 1481 : CALL section_add_keyword(print_key, keyword)
2010 1481 : CALL keyword_release(keyword)
2011 1481 : CALL section_add_subsection(print_section, print_key)
2012 1481 : CALL section_release(print_key)
2013 : ! Liouvillian eigenvalue diagnostic (linearized RT-BSE, TDA only)
2014 : CALL cp_print_key_section_create(print_key, __LOCATION__, "LIOUVILLIAN_EIG", &
2015 : description="Prints the eigenvalues of the linearized RT-BSE "// &
2016 : "Liouvillian on the OV subspace, computed once at job init from a "// &
2017 : "matrix-free probe of the kernel (no time propagation). In TDA this "// &
2018 : "equals the Casida-A eigenvalue problem and gives a broadening-free, "// &
2019 : "finite-time-free correctness check against bse_full.F. "// &
2020 : "Activated by RTBSE%DIAGNOSE_LIOUVILLIAN_EIG. Output lists "// &
2021 : "eigenvalues in atomic units and eV.", &
2022 : print_level=medium_print_level, common_iter_levels=0, &
2023 : each_iter_names=s2a("MD"), &
2024 : each_iter_values=[1], &
2025 1481 : filename="LIOUVILLIAN_EIG")
2026 1481 : CALL section_add_subsection(print_section, print_key)
2027 1481 : CALL section_release(print_key)
2028 :
2029 : CALL cp_print_key_section_create(print_key, __LOCATION__, "E_CONSTITUENTS", &
2030 : description="Print the energy constituents (relevant to RTP) which make up "// &
2031 : "the Total Energy", &
2032 : print_level=high_print_level, common_iter_levels=1, &
2033 : each_iter_names=s2a("MD"), &
2034 : each_iter_values=[1], &
2035 1481 : filename="rtp")
2036 1481 : CALL section_add_subsection(print_section, print_key)
2037 1481 : CALL section_release(print_key)
2038 :
2039 1481 : CALL section_add_subsection(section, print_section)
2040 1481 : CALL section_release(print_section)
2041 :
2042 : ! RTBSE subsection
2043 1481 : NULLIFY (subsection)
2044 1481 : CALL create_rtbse_section(subsection)
2045 1481 : CALL section_add_subsection(section, subsection)
2046 1481 : CALL section_release(subsection)
2047 : ! FT subsection
2048 1481 : CALL create_ft_section(subsection)
2049 1481 : CALL section_add_subsection(section, subsection)
2050 1481 : CALL section_release(subsection)
2051 :
2052 1481 : END SUBROUTINE create_rtp_section
2053 : ! **************************************************************************************************
2054 : !> \brief Creates the subsection for specialized options of RTBSE code
2055 : !> \param section The created RTBSE section
2056 : !> \author Stepan Marek
2057 : ! **************************************************************************************************
2058 1481 : SUBROUTINE create_rtbse_section(section)
2059 : TYPE(section_type), POINTER :: section
2060 :
2061 : TYPE(keyword_type), POINTER :: keyword
2062 :
2063 1481 : NULLIFY (keyword)
2064 1481 : CPASSERT(.NOT. ASSOCIATED(section))
2065 :
2066 : CALL section_create(section, __LOCATION__, name="RTBSE", &
2067 : description="Controls options for the real-time Bethe-Salpeter (RTBSE) propagation. "// &
2068 : "Note that running RTBSE requires previous low-scaling "// &
2069 : "[GW](#CP2K_INPUT.FORCE_EVAL.PROPERTIES.BANDSTRUCTURE.GW) calculation. Also note that "// &
2070 : "designating this section as RTBSE run but choosing run type ENERGY leads to potential "// &
2071 : "deallocation errors. More details (including description of output files) is available in "// &
2072 : "the [methods](../../../../methods/properties/optical/rtbse) section of the documentation.", &
2073 2962 : repeats=.FALSE., citations=[Marek2025])
2074 :
2075 : ! Marek : Controlling flow to RTBSE
2076 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
2077 : description="Which method is used for the time propagation of electronic structure. "// &
2078 : "By default, use the TDDFT method. Can also choose RT-BSE method, which propagates the lesser "// &
2079 : "Green's function instead of density matrix/molecular orbitals.", &
2080 : usage="&RTBSE TDDFT", &
2081 : default_i_val=rtp_method_tddft, &
2082 : lone_keyword_i_val=rtp_method_bse, &
2083 : enum_c_vals=s2a("TDDFT", "RTBSE"), &
2084 : enum_i_vals=[rtp_method_tddft, rtp_method_bse], &
2085 : enum_desc=s2a("Use TDDFT for density matrix/MO propagation.", &
2086 1481 : "Use RT-BSE for Green's function propagation"))
2087 1481 : CALL section_add_keyword(section, keyword)
2088 1481 : CALL keyword_release(keyword)
2089 :
2090 : ! Marek : Development option - run GWBSE starting from the KS Hamiltonian
2091 : CALL keyword_create(keyword, __LOCATION__, name="RTBSE_HAMILTONIAN", &
2092 : description="Which Hamiltonian to use as the single-particle Hamiltonian"// &
2093 : " in the Green's propagator.", &
2094 : usage="RTBSE_HAMILTONIAN GW", &
2095 : default_i_val=rtp_bse_ham_gw, &
2096 : enum_c_vals=s2a("KS", "GW"), &
2097 : enum_i_vals=[rtp_bse_ham_ks, rtp_bse_ham_gw], &
2098 : enum_desc=s2a("Use Kohn-Sham Hamiltonian for Green's function propagation.", &
2099 : "Use GW Hamiltonian for Green's function propagation. The GW "// &
2100 1481 : "eigenvalues from the highest-level GW flavor will be picked."))
2101 1481 : CALL section_add_keyword(section, keyword)
2102 1481 : CALL keyword_release(keyword)
2103 :
2104 : ! Switch for linearized rtbse propagation
2105 : CALL keyword_create(keyword, __LOCATION__, name="LINEARIZED_BSE_PROPAGATION", &
2106 : variants=s2a("LRRTBSE"), &
2107 : description="Linearizes the BSE propagation", &
2108 : usage="LINEARIZED_BSE_PROPAGATION .T.", &
2109 : default_l_val=.FALSE., &
2110 1481 : lone_keyword_l_val=.TRUE.)
2111 1481 : CALL section_add_keyword(section, keyword)
2112 1481 : CALL keyword_release(keyword)
2113 :
2114 : ! Energy cutoff (occupied) for active MO window in linearized RT-BSE
2115 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_CUTOFF_OCC", &
2116 : description="Energy cutoff (relative to HOMO) defining the lowest "// &
2117 : "occupied molecular orbital included in the active MO window of the "// &
2118 : "linearized RT-BSE propagation. Only used when "// &
2119 : "LINEARIZED_BSE_PROPAGATION=.TRUE.. A non-positive value disables the "// &
2120 : "occupied truncation.", &
2121 : usage="ENERGY_CUTOFF_OCC 5.0", &
2122 : unit_str="eV", &
2123 1481 : default_r_val=-1.0_dp/evolt)
2124 1481 : CALL section_add_keyword(section, keyword)
2125 1481 : CALL keyword_release(keyword)
2126 :
2127 : ! Energy cutoff (empty) for active MO window in linearized RT-BSE
2128 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_CUTOFF_EMPTY", &
2129 : description="Energy cutoff (relative to LUMO) defining the highest "// &
2130 : "virtual molecular orbital included in the active MO window of the "// &
2131 : "linearized RT-BSE propagation. Only used when "// &
2132 : "LINEARIZED_BSE_PROPAGATION=.TRUE.. A non-positive value disables the "// &
2133 : "virtual truncation.", &
2134 : usage="ENERGY_CUTOFF_EMPTY 5.0", &
2135 : unit_str="eV", &
2136 1481 : default_r_val=-1.0_dp/evolt)
2137 1481 : CALL section_add_keyword(section, keyword)
2138 1481 : CALL keyword_release(keyword)
2139 :
2140 : CALL keyword_create(keyword, __LOCATION__, name="ENFORCE_MAX_DT", &
2141 : description="For linearized RT-BSE, recompute TIMESTEP and STEPS so the same total "// &
2142 : "propagation time is covered with the largest timestep that does not exceed the "// &
2143 : "estimated RK4 stability limit.", &
2144 : usage="ENFORCE_MAX_DT", &
2145 : default_l_val=.FALSE., &
2146 1481 : lone_keyword_l_val=.TRUE.)
2147 1481 : CALL section_add_keyword(section, keyword)
2148 1481 : CALL keyword_release(keyword)
2149 :
2150 : ! Tamm-Dancoff approximation for the linearized RT-BSE kernel
2151 : CALL keyword_create(keyword, __LOCATION__, name="TDA", &
2152 : description="Apply the Tamm-Dancoff approximation to the linearized RT-BSE kernel: "// &
2153 : "the Hartree and screened-exchange contributions are restricted so that the OV and VO "// &
2154 : "blocks of the density response remain decoupled (i.e. only A-block coupling is kept, "// &
2155 : "B-block coupling is dropped). Only effective when "// &
2156 : "LINEARIZED_BSE_PROPAGATION=.TRUE..", &
2157 : usage="TDA", &
2158 : default_l_val=.FALSE., &
2159 1481 : lone_keyword_l_val=.TRUE.)
2160 1481 : CALL section_add_keyword(section, keyword)
2161 1481 : CALL keyword_release(keyword)
2162 :
2163 : ! First-peak shift for the TDA path
2164 : CALL keyword_create(keyword, __LOCATION__, name="TDA_SHIFT_TO_FIRST_PEAK", &
2165 : description="For the linearized RT-BSE TDA path, shift the active-MO single-particle "// &
2166 : "diagonals by +Omega_0/2 (occupied) and -Omega_0/2 (virtual) with "// &
2167 : "Omega_0 = eps_min_ai, so the lowest active OV mode oscillates at zero frequency "// &
2168 : "in the rotating frame (RK4-exact for peak 1). omega_max becomes the full active "// &
2169 : "OV width Delta = eps_max_ai - eps_min_ai. The rotation is undone at I/O so "// &
2170 : "observables remain in the lab frame. Only effective when TDA=.TRUE.. "// &
2171 : "Use with caution, additional convergence checks w.r.t. dt needed.", &
2172 : usage="TDA_SHIFT_TO_FIRST_PEAK", &
2173 : default_l_val=.FALSE., &
2174 1481 : lone_keyword_l_val=.TRUE.)
2175 1481 : CALL section_add_keyword(section, keyword)
2176 1481 : CALL keyword_release(keyword)
2177 :
2178 : CALL keyword_create(keyword, __LOCATION__, name="DEBUG_DISABLE_HARTREE", &
2179 : description="Debug option for linearized RT-BSE: disables the Hartree kernel in both "// &
2180 : "the static reference initialization and the propagation. The Coulomb RI setup is "// &
2181 : "still built so the run stays internally consistent.", &
2182 : usage="DEBUG_DISABLE_HARTREE", &
2183 : default_l_val=.FALSE., &
2184 1481 : lone_keyword_l_val=.TRUE.)
2185 1481 : CALL section_add_keyword(section, keyword)
2186 1481 : CALL keyword_release(keyword)
2187 :
2188 : CALL keyword_create(keyword, __LOCATION__, name="KERNEL_RI", &
2189 : description="Select the RI framework used to evaluate the linearized RT-BSE "// &
2190 : "Hartree and screened-exchange kernels (propagation and reference). "// &
2191 : "DEFAULT infers from the GW flavor: RI-RS if the GW_RI_RS section was active, "// &
2192 : "AO-RI otherwise. RS/AO force that framework regardless of how GW was run. The "// &
2193 : "RI-RS grid (mat_phi_mu_l, mat_Z_lP) and the V_grid/W0_grid kernels are built on "// &
2194 : "demand. RI-RS is implemented for linearized RT-BSE only; for full RT-BSE an "// &
2195 : "explicit RS is overridden to AO with a warning.", &
2196 : usage="KERNEL_RI RS", &
2197 : enum_c_vals=s2a("DEFAULT", "RS", "AO"), &
2198 : enum_i_vals=[rtp_bse_kernel_ri_default, rtp_bse_kernel_ri_rs, rtp_bse_kernel_ri_ao], &
2199 : enum_desc=s2a("Infer from the GW flavor (GW_RI_RS active -> RS, else AO).", &
2200 : "Real-space RI grid kernels (linearized RT-BSE only).", &
2201 : "AO-RI kernels."), &
2202 1481 : default_i_val=rtp_bse_kernel_ri_default, n_var=1)
2203 1481 : CALL section_add_keyword(section, keyword)
2204 1481 : CALL keyword_release(keyword)
2205 :
2206 : CALL keyword_create(keyword, __LOCATION__, name="DEBUG_DISABLE_SEX", &
2207 : description="Debug option for linearized RT-BSE: disables the screened-exchange kernel "// &
2208 : "in both the static reference initialization and the propagation.", &
2209 : usage="DEBUG_DISABLE_SEX", &
2210 : default_l_val=.FALSE., &
2211 1481 : lone_keyword_l_val=.TRUE.)
2212 1481 : CALL section_add_keyword(section, keyword)
2213 1481 : CALL keyword_release(keyword)
2214 :
2215 : ! Liouvillian eigenvalue diagnostic (matrix-free probe at init; TDA + ABBA)
2216 : CALL keyword_create(keyword, __LOCATION__, name="DIAGNOSE_LIOUVILLIAN_EIG", &
2217 : description="Diagnostic for linearized RT-BSE: at job initialization, build the "// &
2218 : "Liouvillian on the OV subspace by probing the kernel routine with canonical OV basis "// &
2219 : "vectors, then diagonalize. In TDA this equals the Casida-A eigenvalue problem, giving a "// &
2220 : "broadening-free, finite-time-free correctness check against bse_full.F. "// &
2221 : "In ABBA it builds and diagonalizes the full coupled (A, B) Liouvillian via the "// &
2222 : "Furche reduction. "// &
2223 : "Output is controlled by the LIOUVILLIAN_EIG print key in the parent "// &
2224 : "&REAL_TIME_PROPAGATION%&PRINT section.", &
2225 : usage="DIAGNOSE_LIOUVILLIAN_EIG", &
2226 : default_l_val=.FALSE., &
2227 1481 : lone_keyword_l_val=.TRUE.)
2228 1481 : CALL section_add_keyword(section, keyword)
2229 1481 : CALL keyword_release(keyword)
2230 :
2231 : CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER_RHO", &
2232 : description="RI-RS linearized RT-BSE: block-filter threshold on the propagated "// &
2233 : "response density Delta-rho (AO). Applied upstream of the projection the "// &
2234 : "Hartree shares, so it cuts the SEX kernel and the Hartree response alike. "// &
2235 : "Absolute, so its strength is the ratio to the Delta-rho scale.", &
2236 : usage="EPS_FILTER_RHO 1.0E-6", &
2237 1481 : default_r_val=-1.0_dp)
2238 1481 : CALL section_add_keyword(section, keyword)
2239 1481 : CALL keyword_release(keyword)
2240 :
2241 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS_W0", &
2242 : description="RI-RS linearized RT-BSE: real-space truncation radius for the "// &
2243 : "grid-basis screened interaction W0. Grid block pairs whose centroids lie "// &
2244 : "further apart are dropped at build, and the per-step SEX grid transient is "// &
2245 : "built into the same pattern. Affects the BSE kernel only, not the GW "// &
2246 : "quasiparticle energies and not the Hartree response. Requires a "// &
2247 : "non-periodic cell. Zero or negative disables the truncation.", &
2248 : usage="CUTOFF_RADIUS_W0 30.0", &
2249 : default_r_val=cp_unit_to_cp2k(value=-1.0_dp, unit_str="angstrom"), &
2250 1481 : type_of_var=real_t, unit_str="angstrom")
2251 1481 : CALL section_add_keyword(section, keyword)
2252 1481 : CALL keyword_release(keyword)
2253 :
2254 1481 : END SUBROUTINE create_rtbse_section
2255 : ! **************************************************************************************************
2256 : !> \brief Creates the subsection for Fourier transform options applicable to RTP output
2257 : !> \param ft_section The created FT section
2258 : !> \date 11.2025
2259 : !> \author Stepan Marek
2260 : ! **************************************************************************************************
2261 1481 : SUBROUTINE create_ft_section(ft_section)
2262 : TYPE(section_type), POINTER :: ft_section
2263 :
2264 : TYPE(keyword_type), POINTER :: keyword
2265 : TYPE(section_type), POINTER :: subsection
2266 :
2267 1481 : CPASSERT(.NOT. ASSOCIATED(ft_section))
2268 :
2269 : ! Create the section itself
2270 : CALL section_create(ft_section, __LOCATION__, &
2271 : name="FT", &
2272 : description="Define parameters for Fourier transforms used in RTP outputs.", &
2273 1481 : repeats=.FALSE.)
2274 :
2275 : ! Start time keyword
2276 1481 : NULLIFY (keyword)
2277 : CALL keyword_create(keyword, __LOCATION__, "START_TIME", &
2278 : description="The starting time from which damping is applied and from which on the trace is "// &
2279 : "considered for the Fourier transform (Fourier transform is used for the calculation of "// &
2280 : "MOMENTS_FT and POLARIZABILITY). Useful for real-time pulse - "// &
2281 : "one can specify the center of the pulse as the starting point.", &
2282 : type_of_var=real_t, &
2283 : unit_str="fs", &
2284 1481 : default_r_val=0.0_dp)
2285 1481 : CALL section_add_keyword(ft_section, keyword)
2286 1481 : CALL keyword_release(keyword)
2287 :
2288 : ! Damping keyword
2289 : CALL keyword_create(keyword, __LOCATION__, "DAMPING", &
2290 : description="Numerical Fourier transform (required for calculation of "// &
2291 : "MOMENTS_FT and POLARIZABILITY) can oscillate "// &
2292 : "when the final time trace values are far away from zero. "// &
2293 : "This keyword controls the exponential damping added to the Fourier transform "// &
2294 : "(Fourier transform is used for calculation of MOMENTS_FT and POLARIZABILITY). "// &
2295 : "For negative values (the default), calculates the damping at the run time so that the last point "// &
2296 : "in the time trace is reduced by factor e^(-4). When set manually, determines the time in which "// &
2297 : "the moments trace is reduced by factor of e^(-1), except when set to zero, in which case "// &
2298 : "the damping is not applied.", &
2299 : type_of_var=real_t, &
2300 : unit_str="fs", &
2301 1481 : default_r_val=-1.0_dp/femtoseconds)
2302 1481 : CALL section_add_keyword(ft_section, keyword)
2303 1481 : CALL keyword_release(keyword)
2304 :
2305 : ! Create the Padé subsection
2306 1481 : NULLIFY (subsection)
2307 : CALL section_create(subsection, __LOCATION__, name="PADE", &
2308 : description="Defines the parameters for the Padé interpolation of the "// &
2309 : "Fourier transforms used in the output of RTP. Only available with the GreenX library linked to CP2K.", &
2310 1481 : repeats=.FALSE.)
2311 :
2312 : ! Explicit presence of the section turns on the Padé interpolation
2313 : CALL keyword_create(keyword, __LOCATION__, "_SECTION_PARAMETERS_", &
2314 : description="Turns on the Padé interpolation", &
2315 : type_of_var=logical_t, &
2316 : default_l_val=.FALSE., &
2317 1481 : lone_keyword_l_val=.TRUE.)
2318 1481 : CALL section_add_keyword(subsection, keyword)
2319 1481 : CALL keyword_release(keyword)
2320 :
2321 : ! Minimum interpolated energy
2322 : CALL keyword_create(keyword, __LOCATION__, "E_MIN", &
2323 : description="The minimum energy of the Padé interpolation output.", &
2324 : type_of_var=real_t, &
2325 : unit_str="eV", &
2326 1481 : default_r_val=0.0_dp)
2327 1481 : CALL section_add_keyword(subsection, keyword)
2328 1481 : CALL keyword_release(keyword)
2329 :
2330 : ! Maximum interpolated energy
2331 : CALL keyword_create(keyword, __LOCATION__, "E_MAX", &
2332 : description="The maximum energy of the Padé interpolation output.", &
2333 : type_of_var=real_t, &
2334 : unit_str="eV", &
2335 1481 : default_r_val=100.0_dp)
2336 1481 : CALL section_add_keyword(subsection, keyword)
2337 1481 : CALL keyword_release(keyword)
2338 :
2339 : ! Energy resolution
2340 : CALL keyword_create(keyword, __LOCATION__, "E_STEP", &
2341 : description="The energy resolution of the Padé interpolation output.", &
2342 : type_of_var=real_t, &
2343 : unit_str="eV", &
2344 1481 : default_r_val=0.02_dp/evolt)
2345 1481 : CALL section_add_keyword(subsection, keyword)
2346 1481 : CALL keyword_release(keyword)
2347 :
2348 : ! Minimum fitting energy
2349 : CALL keyword_create(keyword, __LOCATION__, "FIT_E_MIN", &
2350 : description="The lower boundary in energy for the points "// &
2351 : "used in the fitting of Padé parameters. If negative, uses "// &
2352 : "value of E_MIN (default).", &
2353 : type_of_var=real_t, &
2354 : unit_str="eV", &
2355 1481 : default_r_val=-1.0_dp)
2356 1481 : CALL section_add_keyword(subsection, keyword)
2357 1481 : CALL keyword_release(keyword)
2358 :
2359 : ! Maximum fitting energy
2360 : CALL keyword_create(keyword, __LOCATION__, "FIT_E_MAX", &
2361 : description="The upper boundary in energy for the points "// &
2362 : "used in the fitting of Padé parameters. If negative, uses "// &
2363 : "the value of E_MAX (default).", &
2364 : type_of_var=real_t, &
2365 : unit_str="eV", &
2366 1481 : default_r_val=-1.0_dp)
2367 1481 : CALL section_add_keyword(subsection, keyword)
2368 1481 : CALL keyword_release(keyword)
2369 :
2370 : ! Add the Padé subsection
2371 1481 : CALL section_add_subsection(ft_section, subsection)
2372 1481 : CALL section_release(subsection)
2373 1481 : END SUBROUTINE create_ft_section
2374 :
2375 : ! **************************************************************************************************
2376 : !> \brief Create CP2K input section for the SCCS model
2377 : !> \param section ...
2378 : !> \par History:
2379 : !> - Creation (10.10.2013,MK)
2380 : !> \author Matthias Krack (MK)
2381 : !> \version 1.0
2382 : ! **************************************************************************************************
2383 1481 : SUBROUTINE create_sccs_section(section)
2384 :
2385 : TYPE(section_type), POINTER :: section
2386 :
2387 : TYPE(keyword_type), POINTER :: keyword
2388 : TYPE(section_type), POINTER :: subsection
2389 :
2390 1481 : CPASSERT(.NOT. ASSOCIATED(section))
2391 :
2392 : CALL section_create(section, __LOCATION__, &
2393 : name="SCCS", &
2394 : description="Define the parameters for self-consistent continuum solvation (SCCS) model", &
2395 : citations=[Fattebert2002, Andreussi2012, Yin2017], &
2396 : n_keywords=10, &
2397 : n_subsections=4, &
2398 5924 : repeats=.FALSE.)
2399 :
2400 1481 : NULLIFY (keyword)
2401 :
2402 : CALL keyword_create(keyword, __LOCATION__, &
2403 : name="_SECTION_PARAMETERS_", &
2404 : description="Controls the activation of the SCCS section", &
2405 : usage="&SCCS ON", &
2406 : default_l_val=.FALSE., &
2407 1481 : lone_keyword_l_val=.TRUE.)
2408 1481 : CALL section_add_keyword(section, keyword)
2409 1481 : CALL keyword_release(keyword)
2410 :
2411 : CALL keyword_create(keyword, __LOCATION__, &
2412 : name="ALPHA", &
2413 : description="Solvent specific tunable parameter for the calculation of "// &
2414 : "the repulsion term $G^\text{rep} = \alpha S$ "// &
2415 : "where $S$ is the (quantum) surface of the cavity", &
2416 : repeats=.FALSE., &
2417 : n_var=1, &
2418 : type_of_var=real_t, &
2419 : default_r_val=0.0_dp, &
2420 1481 : unit_str="mN/m")
2421 1481 : CALL section_add_keyword(section, keyword)
2422 1481 : CALL keyword_release(keyword)
2423 :
2424 : CALL keyword_create(keyword, __LOCATION__, &
2425 : name="BETA", &
2426 : description="Solvent specific tunable parameter for the calculation of "// &
2427 : "the dispersion term $G^\text{dis} = \beta V$ "// &
2428 : "where $V$ is the (quantum) volume of the cavity", &
2429 : repeats=.FALSE., &
2430 : n_var=1, &
2431 : type_of_var=real_t, &
2432 : default_r_val=0.0_dp, &
2433 1481 : unit_str="GPa")
2434 1481 : CALL section_add_keyword(section, keyword)
2435 1481 : CALL keyword_release(keyword)
2436 :
2437 : CALL keyword_create(keyword, __LOCATION__, &
2438 : name="DELTA_RHO", &
2439 : description="Numerical increment for the calculation of the (quantum) "// &
2440 : "surface of the solute cavity", &
2441 : repeats=.FALSE., &
2442 : n_var=1, &
2443 : type_of_var=real_t, &
2444 1481 : default_r_val=2.0E-5_dp)
2445 1481 : CALL section_add_keyword(section, keyword)
2446 1481 : CALL keyword_release(keyword)
2447 :
2448 : CALL keyword_create(keyword, __LOCATION__, &
2449 : name="DERIVATIVE_METHOD", &
2450 : description="Method for the calculation of the numerical derivatives on the real-space grids", &
2451 : usage="DERIVATIVE_METHOD cd5", &
2452 : repeats=.FALSE., &
2453 : n_var=1, &
2454 : default_i_val=sccs_derivative_fft, &
2455 : enum_c_vals=s2a("FFT", "CD3", "CD5", "CD7"), &
2456 : enum_i_vals=[sccs_derivative_fft, &
2457 : sccs_derivative_cd3, &
2458 : sccs_derivative_cd5, &
2459 : sccs_derivative_cd7], &
2460 : enum_desc=s2a("Fast Fourier transformation", &
2461 : "3-point stencil central differences", &
2462 : "5-point stencil central differences", &
2463 1481 : "7-point stencil central differences"))
2464 1481 : CALL section_add_keyword(section, keyword)
2465 1481 : CALL keyword_release(keyword)
2466 :
2467 : CALL keyword_create(keyword, __LOCATION__, &
2468 : name="RELATIVE_PERMITTIVITY", &
2469 : variants=s2a("DIELECTRIC_CONSTANT", "EPSILON_RELATIVE", "EPSILON_SOLVENT"), &
2470 : description="Relative permittivity (dielectric constant) of the solvent (medium)", &
2471 : repeats=.FALSE., &
2472 : n_var=1, &
2473 : type_of_var=real_t, &
2474 : default_r_val=80.0_dp, &
2475 1481 : usage="RELATIVE_PERMITTIVITY 78.36")
2476 1481 : CALL section_add_keyword(section, keyword)
2477 1481 : CALL keyword_release(keyword)
2478 :
2479 : CALL keyword_create(keyword, __LOCATION__, &
2480 : name="EPS_SCCS", &
2481 : variants=s2a("EPS_ITER", "TAU_POL"), &
2482 : description="Tolerance for the convergence of the polarisation density, "// &
2483 : "i.e. requested accuracy for the SCCS iteration cycle", &
2484 : repeats=.FALSE., &
2485 : n_var=1, &
2486 : type_of_var=real_t, &
2487 : default_r_val=1.0E-6_dp, &
2488 1481 : usage="EPS_ITER 1.0E-7")
2489 1481 : CALL section_add_keyword(section, keyword)
2490 1481 : CALL keyword_release(keyword)
2491 :
2492 : CALL keyword_create(keyword, __LOCATION__, &
2493 : name="EPS_SCF", &
2494 : description="The SCCS iteration cycle is activated only if the SCF iteration cycle "// &
2495 : "is converged to this threshold value", &
2496 : repeats=.FALSE., &
2497 : n_var=1, &
2498 : type_of_var=real_t, &
2499 : default_r_val=0.5_dp, &
2500 1481 : usage="EPS_SCF 1.0E-2")
2501 1481 : CALL section_add_keyword(section, keyword)
2502 1481 : CALL keyword_release(keyword)
2503 :
2504 : CALL keyword_create(keyword, __LOCATION__, &
2505 : name="GAMMA", &
2506 : variants=s2a("SURFACE_TENSION"), &
2507 : description="Surface tension of the solvent used for the calculation of "// &
2508 : "the cavitation term $G^\text{cav} = \gamma S$ "// &
2509 : "where $S$ is the (quantum) surface of the cavity", &
2510 : repeats=.FALSE., &
2511 : n_var=1, &
2512 : type_of_var=real_t, &
2513 : default_r_val=0.0_dp, &
2514 1481 : unit_str="mN/m")
2515 1481 : CALL section_add_keyword(section, keyword)
2516 1481 : CALL keyword_release(keyword)
2517 :
2518 : CALL keyword_create(keyword, __LOCATION__, &
2519 : name="MAX_ITER", &
2520 : description="Maximum number of SCCS iteration steps performed to converge "// &
2521 : "within the given tolerance", &
2522 : repeats=.FALSE., &
2523 : n_var=1, &
2524 : type_of_var=integer_t, &
2525 : default_i_val=100, &
2526 1481 : usage="MAX_ITER 50")
2527 1481 : CALL section_add_keyword(section, keyword)
2528 1481 : CALL keyword_release(keyword)
2529 :
2530 : CALL keyword_create(keyword, __LOCATION__, &
2531 : name="METHOD", &
2532 : description="Method used for the smoothing of the dielectric function", &
2533 : usage="METHOD Fattebert-Gygi", &
2534 : default_i_val=sccs_andreussi, &
2535 : enum_c_vals=s2a("ANDREUSSI", "FATTEBERT-GYGI", "SAA_ANDREUSSI"), &
2536 : enum_i_vals=[sccs_andreussi, sccs_fattebert_gygi, sccs_saa_andreussi], &
2537 : enum_desc=s2a("Smoothing function proposed by Andreussi et al.", &
2538 : "Smoothing function proposed by Fattebert and Gygi", &
2539 1481 : "Smoothing function of the solvent aware algorithm"))
2540 1481 : CALL section_add_keyword(section, keyword)
2541 1481 : CALL keyword_release(keyword)
2542 :
2543 : CALL keyword_create(keyword, __LOCATION__, &
2544 : name="MIXING", &
2545 : variants=["ETA"], &
2546 : description="Mixing parameter (Hartree damping) employed during the iteration procedure", &
2547 : repeats=.FALSE., &
2548 : n_var=1, &
2549 : type_of_var=real_t, &
2550 : default_r_val=0.6_dp, &
2551 2962 : usage="MIXING 0.2")
2552 1481 : CALL section_add_keyword(section, keyword)
2553 1481 : CALL keyword_release(keyword)
2554 :
2555 : CALL keyword_create(keyword, __LOCATION__, &
2556 : name="CORE_FILL", &
2557 : description="Add a normalised Gaussian fill density $Z_{val}/(\sqrt{\pi}\sigma)^3 "// &
2558 : "\exp(-r^2/\sigma^2)$ on each atom to the electronic density used for the "// &
2559 : "definition of the dielectric function. This fills the low valence density "// &
2560 : "region at the nuclei of pseudopotential atoms, which otherwise may be treated "// &
2561 : "as solvent if a grid point is close to a nucleus (similar to the solvent_mode "// &
2562 : "'full' of the Environ library). Kinds without removed core electrons (Z_val = Z, "// &
2563 : "e.g. H, He-q2, Li-q3, Be-q4) are not filled by default. "// &
2564 : "The resulting ionic forces are included.", &
2565 : usage="CORE_FILL", &
2566 : default_l_val=.FALSE., &
2567 1481 : lone_keyword_l_val=.TRUE.)
2568 1481 : CALL section_add_keyword(section, keyword)
2569 1481 : CALL keyword_release(keyword)
2570 :
2571 : CALL keyword_create(keyword, __LOCATION__, &
2572 : name="CORE_FILL_SPREAD", &
2573 : description="Default spread $\sigma$ of the Gaussian fill density used with CORE_FILL "// &
2574 : "(Environ default 0.5 bohr). Can be overwritten per kind in the CORE_FILL_KIND section.", &
2575 : repeats=.FALSE., &
2576 : n_var=1, &
2577 : type_of_var=real_t, &
2578 : unit_str="bohr", &
2579 : default_r_val=0.5_dp, &
2580 1481 : usage="CORE_FILL_SPREAD [bohr] 0.5")
2581 1481 : CALL section_add_keyword(section, keyword)
2582 1481 : CALL keyword_release(keyword)
2583 :
2584 1481 : NULLIFY (subsection)
2585 :
2586 : CALL section_create(subsection, __LOCATION__, &
2587 : name="CORE_FILL_KIND", &
2588 : description="Per-kind spread of the CORE_FILL Gaussian fill density. "// &
2589 : "Each line contains a kind label (as defined in &KIND) and the spread in bohr. "// &
2590 : "A spread <= 0 disables the fill for that kind. Kinds not listed use "// &
2591 : "CORE_FILL_SPREAD, except kinds without removed core electrons (Z_val = Z) which are "// &
2592 : "not filled.", &
2593 : n_keywords=1, &
2594 : n_subsections=0, &
2595 1481 : repeats=.FALSE.)
2596 : CALL keyword_create(keyword, __LOCATION__, name="_DEFAULT_KEYWORD_", &
2597 : description="Kind label and spread in bohr", &
2598 : repeats=.TRUE., &
2599 : usage="{kind label} {spread in bohr}", &
2600 1481 : type_of_var=lchar_t)
2601 1481 : CALL section_add_keyword(subsection, keyword)
2602 1481 : CALL keyword_release(keyword)
2603 1481 : CALL section_add_subsection(section, subsection)
2604 1481 : CALL section_release(subsection)
2605 :
2606 : CALL section_create(subsection, __LOCATION__, &
2607 : name="ANDREUSSI", &
2608 : description="Define the parameters of the dielectric smoothing function proposed by "// &
2609 : "Andreussi et al.", &
2610 : citations=[Andreussi2012], &
2611 : n_keywords=2, &
2612 : n_subsections=0, &
2613 2962 : repeats=.FALSE.)
2614 :
2615 : CALL keyword_create(keyword, __LOCATION__, &
2616 : name="RHO_MAX", &
2617 : description="Maximum density value used for the smoothing of the dielectric function", &
2618 : repeats=.FALSE., &
2619 : n_var=1, &
2620 : type_of_var=real_t, &
2621 : default_r_val=0.0035_dp, &
2622 1481 : usage="RHO_MAX 0.01")
2623 1481 : CALL section_add_keyword(subsection, keyword)
2624 1481 : CALL keyword_release(keyword)
2625 :
2626 : CALL keyword_create(keyword, __LOCATION__, &
2627 : name="RHO_MIN", &
2628 : description="Minimum density value used for the smoothing of the dielectric function", &
2629 : repeats=.FALSE., &
2630 : n_var=1, &
2631 : type_of_var=real_t, &
2632 : default_r_val=0.0001_dp, &
2633 1481 : usage="RHO_MIN 0.0003")
2634 1481 : CALL section_add_keyword(subsection, keyword)
2635 1481 : CALL keyword_release(keyword)
2636 :
2637 1481 : CALL section_add_subsection(section, subsection)
2638 1481 : CALL section_release(subsection)
2639 :
2640 : CALL section_create(subsection, __LOCATION__, &
2641 : name="FATTEBERT-GYGI", &
2642 : description="Define the parameters of the dielectric smoothing function proposed by "// &
2643 : "Fattebert and Gygi", &
2644 : citations=[Fattebert2002], &
2645 : n_keywords=2, &
2646 : n_subsections=0, &
2647 2962 : repeats=.FALSE.)
2648 :
2649 : CALL keyword_create(keyword, __LOCATION__, &
2650 : name="BETA", &
2651 : description="Parameter β changes the width of the interface solute-solvent", &
2652 : repeats=.FALSE., &
2653 : n_var=1, &
2654 : type_of_var=real_t, &
2655 : default_r_val=1.7_dp, &
2656 1481 : usage="BETA 1.3")
2657 1481 : CALL section_add_keyword(subsection, keyword)
2658 1481 : CALL keyword_release(keyword)
2659 :
2660 : CALL keyword_create(keyword, __LOCATION__, &
2661 : name="RHO_ZERO", &
2662 : variants=["RHO0"], &
2663 : description="Parameter $\rho_0$ defines the critical density in the middle "// &
2664 : "of the interface solute-solvent", &
2665 : repeats=.FALSE., &
2666 : n_var=1, &
2667 : type_of_var=real_t, &
2668 : default_r_val=0.0006_dp, &
2669 2962 : usage="RHO_ZERO 0.0004")
2670 1481 : CALL section_add_keyword(subsection, keyword)
2671 1481 : CALL keyword_release(keyword)
2672 :
2673 1481 : CALL section_add_subsection(section, subsection)
2674 1481 : CALL section_release(subsection)
2675 :
2676 : CALL section_create(subsection, __LOCATION__, &
2677 : name="SAA_ANDREUSSI", &
2678 : description="Define the parameters of the dielectric smoothing function of "// &
2679 : "the solvent aware algorithm proposed by Andreussi et al.", &
2680 : citations=[Andreussi2019, Chai2025a], &
2681 : n_keywords=7, &
2682 : n_subsections=0, &
2683 4443 : repeats=.FALSE.)
2684 :
2685 : CALL keyword_create(keyword, __LOCATION__, &
2686 : name="RHO_MAX", &
2687 : description="Maximum density value used for the smoothing of the dielectric function", &
2688 : repeats=.FALSE., &
2689 : n_var=1, &
2690 : type_of_var=real_t, &
2691 : default_r_val=0.0035_dp, &
2692 1481 : usage="RHO_MAX 0.01")
2693 1481 : CALL section_add_keyword(subsection, keyword)
2694 1481 : CALL keyword_release(keyword)
2695 :
2696 : CALL keyword_create(keyword, __LOCATION__, &
2697 : name="RHO_MIN", &
2698 : description="Minimum density value used for the smoothing of the dielectric function", &
2699 : repeats=.FALSE., &
2700 : n_var=1, &
2701 : type_of_var=real_t, &
2702 : default_r_val=0.0001_dp, &
2703 1481 : usage="RHO_MIN 0.0003")
2704 1481 : CALL section_add_keyword(subsection, keyword)
2705 1481 : CALL keyword_release(keyword)
2706 :
2707 : CALL keyword_create(keyword, __LOCATION__, &
2708 : name="F0", &
2709 : description="The threshold of the filled fraction that controls whether a point in space "// &
2710 : "needs to be removed from the continuum", &
2711 : repeats=.FALSE., &
2712 : n_var=1, &
2713 : type_of_var=real_t, &
2714 : default_r_val=0.65_dp, &
2715 1481 : usage="F0 0.65")
2716 1481 : CALL section_add_keyword(subsection, keyword)
2717 1481 : CALL keyword_release(keyword)
2718 :
2719 : CALL keyword_create(keyword, __LOCATION__, &
2720 : name="DELTA_ETA", &
2721 : description="Controls the softness of function t(r)", &
2722 : repeats=.FALSE., &
2723 : n_var=1, &
2724 : type_of_var=real_t, &
2725 : default_r_val=0.02_dp, &
2726 1481 : usage="DELTA_ETA 0.02")
2727 1481 : CALL section_add_keyword(subsection, keyword)
2728 1481 : CALL keyword_release(keyword)
2729 :
2730 : CALL keyword_create(keyword, __LOCATION__, &
2731 : name="DELTA_ZETA", &
2732 : description="Controls the softness of function u(r)", &
2733 : repeats=.FALSE., &
2734 : n_var=1, &
2735 : type_of_var=real_t, &
2736 : unit_str='bohr', &
2737 : default_r_val=0.5_dp, &
2738 1481 : usage="DELTA_ZETA 0.5")
2739 1481 : CALL section_add_keyword(subsection, keyword)
2740 1481 : CALL keyword_release(keyword)
2741 :
2742 : CALL keyword_create(keyword, __LOCATION__, &
2743 : name="ALPHA_ZETA", &
2744 : description="The scaling factor for R_SOLV", &
2745 : repeats=.FALSE., &
2746 : n_var=1, &
2747 : type_of_var=real_t, &
2748 : default_r_val=2.0_dp, &
2749 1481 : usage="ALPHA_ZETA 2.0")
2750 1481 : CALL section_add_keyword(subsection, keyword)
2751 1481 : CALL keyword_release(keyword)
2752 :
2753 : CALL keyword_create(keyword, __LOCATION__, &
2754 : name="R_SOLV", &
2755 : description="The solvent radius", &
2756 : repeats=.FALSE., &
2757 : n_var=1, &
2758 : type_of_var=real_t, &
2759 : unit_str='bohr', &
2760 : default_r_val=2.6_dp, &
2761 1481 : usage="R_SOLV 2.6")
2762 1481 : CALL section_add_keyword(subsection, keyword)
2763 1481 : CALL keyword_release(keyword)
2764 :
2765 1481 : CALL section_add_subsection(section, subsection)
2766 1481 : CALL section_release(subsection)
2767 :
2768 1481 : END SUBROUTINE create_sccs_section
2769 :
2770 : ! **************************************************************************************************
2771 : !> \brief Create CP2K input section for the planar counter charge density
2772 : !> \param section ...
2773 : !> \author Ziwei Chai
2774 : !> \version 1.0
2775 : ! **************************************************************************************************
2776 1481 : SUBROUTINE create_pcc_section(section)
2777 :
2778 : TYPE(section_type), POINTER :: section
2779 :
2780 : TYPE(keyword_type), POINTER :: keyword
2781 :
2782 1481 : CPASSERT(.NOT. ASSOCIATED(section))
2783 :
2784 : CALL section_create(section, __LOCATION__, &
2785 : name="PLANAR_COUNTER_CHARGE", &
2786 : description="Define the parameters for the planar counter charge density", &
2787 : citations=[Chai2024a], &
2788 : n_keywords=4, &
2789 : n_subsections=0, &
2790 2962 : repeats=.FALSE.)
2791 :
2792 1481 : NULLIFY (keyword)
2793 :
2794 : CALL keyword_create(keyword, __LOCATION__, &
2795 : name="_SECTION_PARAMETERS_", &
2796 : description="Controls the activation of the planar counter charge section", &
2797 : usage="&PLANAR_COUNTER_CHARGE ON", &
2798 : default_l_val=.FALSE., &
2799 1481 : lone_keyword_l_val=.TRUE.)
2800 1481 : CALL section_add_keyword(section, keyword)
2801 1481 : CALL keyword_release(keyword)
2802 :
2803 : CALL keyword_create(keyword, __LOCATION__, name="PARALLEL_PLANE", &
2804 : enum_c_vals=s2a('XY', 'YZ', 'XZ'), &
2805 : enum_i_vals=[3, 1, 2], &
2806 : description="The coordinate plane that the surface is parallel to.", &
2807 : enum_desc=s2a("Parallel to XY", "Parallel to YZ", "Parallel to XZ"), &
2808 : n_var=1, &
2809 : default_i_val=3, &
2810 1481 : usage="PARALLEL_PLANE XY")
2811 1481 : CALL section_add_keyword(section, keyword)
2812 1481 : CALL keyword_release(keyword)
2813 :
2814 : CALL keyword_create(keyword, __LOCATION__, &
2815 : name="DIST_EDGE", &
2816 : description="Controls the distance between the center of the Gaussian "// &
2817 : "and the cell boundary", &
2818 : usage="DIST_EDGE 1.0", &
2819 : unit_str="angstrom", &
2820 1481 : type_of_var=real_t)
2821 1481 : CALL section_add_keyword(section, keyword)
2822 1481 : CALL keyword_release(keyword)
2823 :
2824 : CALL keyword_create(keyword, __LOCATION__, &
2825 : name="GAU_C", &
2826 : description="Controls the spread of the Gaussian distribution", &
2827 : usage="GAU_C 0.1", &
2828 : unit_str="angstrom", &
2829 1481 : type_of_var=real_t)
2830 1481 : CALL section_add_keyword(section, keyword)
2831 1481 : CALL keyword_release(keyword)
2832 :
2833 1481 : END SUBROUTINE create_pcc_section
2834 :
2835 : ! **************************************************************************************************
2836 : !> \brief Create CP2K input section for calculating and printing the planar averaged
2837 : !> electrostatic potential (Hartree potential) for symmetric slab systems
2838 : !> \param section ...
2839 : !> \author Ziwei Chai
2840 : !> \version 1.0
2841 : ! **************************************************************************************************
2842 1481 : SUBROUTINE create_paep_section(section)
2843 :
2844 : TYPE(section_type), POINTER :: section
2845 :
2846 : TYPE(keyword_type), POINTER :: keyword
2847 :
2848 1481 : CPASSERT(.NOT. ASSOCIATED(section))
2849 :
2850 : CALL section_create(section, __LOCATION__, &
2851 : name="PLANAR_AVERAGED_V_HARTREE", &
2852 : description="Define the parameters for calculating and printing the planar "// &
2853 : "averaged electrostatic potential (Hartree potential) "// &
2854 : "for symmetric slab systems", &
2855 : n_keywords=2, &
2856 : n_subsections=0, &
2857 1481 : repeats=.FALSE.)
2858 :
2859 1481 : NULLIFY (keyword)
2860 :
2861 : CALL keyword_create(keyword, __LOCATION__, &
2862 : name="_SECTION_PARAMETERS_", &
2863 : description="Controls the activation of the planar averaged electrostatic "// &
2864 : "potential (Hartree potential) section", &
2865 : usage="&PLANAR_AVERAGED_V_HARTREE ON", &
2866 : default_l_val=.FALSE., &
2867 1481 : lone_keyword_l_val=.TRUE.)
2868 1481 : CALL section_add_keyword(section, keyword)
2869 1481 : CALL keyword_release(keyword)
2870 :
2871 : CALL keyword_create(keyword, __LOCATION__, name="PARALLEL_PLANE", &
2872 : enum_c_vals=s2a('XY', 'YZ', 'XZ'), &
2873 : enum_i_vals=[3, 1, 2], &
2874 : description="The coordinate plane that the surface is parallel to.", &
2875 : enum_desc=s2a("Parallel to XY", "Parallel to YZ", "Parallel to XZ"), &
2876 : n_var=1, &
2877 : default_i_val=3, &
2878 1481 : usage="PARALLEL_PLANE XY")
2879 1481 : CALL section_add_keyword(section, keyword)
2880 1481 : CALL keyword_release(keyword)
2881 :
2882 1481 : END SUBROUTINE create_paep_section
2883 :
2884 : END MODULE input_cp2k_dft
|