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 XAS section of the input
10 : !> \par History
11 : !> 10.2005 moved out of input_cp2k [fawzi]
12 : !> 07.2024 moved out of input_cp2k_dft [JGH]
13 : !> \author fawzi
14 : ! **************************************************************************************************
15 : MODULE input_cp2k_xas
16 : USE bibliography, ONLY: Iannuzzi2007,&
17 : Shigeta2001
18 : USE cp_output_handling, ONLY: add_last_numeric,&
19 : cp_print_key_section_create,&
20 : debug_print_level,&
21 : high_print_level,&
22 : low_print_level
23 : USE input_constants, ONLY: &
24 : do_potential_coulomb, do_potential_id, do_potential_short, do_potential_truncated, &
25 : gaussian, ot_mini_cg, ot_mini_diis, tddfpt_singlet, tddfpt_spin_cons, tddfpt_spin_flip, &
26 : tddfpt_triplet, xas_1s_type, xas_2p_type, xas_2s_type, xas_3d_type, xas_3p_type, &
27 : xas_3s_type, xas_4d_type, xas_4f_type, xas_4p_type, xas_4s_type, xas_dip_len, xas_dip_vel, &
28 : xas_dscf, xas_none, xas_not_excited, xas_tdp_by_index, xas_tdp_by_kind, xas_tp_fh, &
29 : xas_tp_flex, xas_tp_hh, xas_tp_xfh, xas_tp_xhh, xes_tp_val
30 : USE input_cp2k_loc, ONLY: create_localize_section,&
31 : print_wanniers
32 : USE input_cp2k_print_dft, ONLY: create_pdos_section
33 : USE input_cp2k_scf, ONLY: create_scf_section
34 : USE input_cp2k_xc, ONLY: create_xc_fun_section
35 : USE input_keyword_types, ONLY: keyword_create,&
36 : keyword_release,&
37 : keyword_type
38 : USE input_section_types, ONLY: section_add_keyword,&
39 : section_add_subsection,&
40 : section_create,&
41 : section_release,&
42 : section_type
43 : USE input_val_types, ONLY: char_t,&
44 : integer_t,&
45 : lchar_t,&
46 : real_t
47 : USE kinds, ONLY: dp
48 : USE string_utilities, ONLY: s2a
49 : #include "./base/base_uses.f90"
50 :
51 : IMPLICIT NONE
52 : PRIVATE
53 :
54 : CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_xas'
55 :
56 : PUBLIC :: create_xas_section, create_xas_tdp_section
57 :
58 : CONTAINS
59 :
60 : ! **************************************************************************************************
61 : !> \brief makes the input section for core-level spectroscopy simulations
62 : !> \param section ...
63 : !> \par History
64 : !> 03.2005 created [MI]
65 : ! **************************************************************************************************
66 9839 : SUBROUTINE create_xas_section(section)
67 : TYPE(section_type), POINTER :: section
68 :
69 : TYPE(keyword_type), POINTER :: keyword
70 : TYPE(section_type), POINTER :: print_key, subsection
71 :
72 9839 : CPASSERT(.NOT. ASSOCIATED(section))
73 : CALL section_create(section, __LOCATION__, name="xas", &
74 : description="Controls transition-potential and delta-SCF calculations of core-level excitation spectra. "// &
75 : "The occupied states from which the excitations are calculated should be specified. "// &
76 : "Localization of the orbitals may be useful.", &
77 : n_keywords=10, n_subsections=1, repeats=.FALSE., &
78 19678 : citations=[Iannuzzi2007])
79 :
80 9839 : NULLIFY (keyword, subsection, print_key)
81 :
82 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
83 : description="controls the activation of core-level spectroscopy simulations", &
84 : usage="&XAS T", &
85 : default_l_val=.FALSE., &
86 9839 : lone_keyword_l_val=.TRUE.)
87 9839 : CALL section_add_keyword(section, keyword)
88 9839 : CALL keyword_release(keyword)
89 :
90 : CALL keyword_create(keyword, __LOCATION__, name="METHOD", &
91 : variants=["XAS_METHOD"], &
92 : description="Method to be used to calculate core-level excitation spectra", &
93 : usage="METHOD TP_HH", &
94 : default_i_val=xas_none, &
95 : enum_c_vals=s2a("NONE", "TP_HH", "TP_FH", "TP_VAL", "TP_XHH", "TP_XFH", "DSCF", "TP_FLEX"), &
96 : enum_desc=s2a( &
97 : "No core electron spectroscopy", "Transition potential half-hole", &
98 : "Transition potential full-hole", "Hole in homo for X-ray emission only ", &
99 : "Transition potential excited half-hole", &
100 : "Transition potential excited full-hole ", &
101 : "DSCF calculations to compute the first (core)excited state", &
102 : "Transition potential with generalized core occupation and total number of electrons"), &
103 : enum_i_vals=[xas_none, xas_tp_hh, xas_tp_fh, xes_tp_val, xas_tp_xhh, &
104 19678 : xas_tp_xfh, xas_dscf, xas_tp_flex])
105 9839 : CALL section_add_keyword(section, keyword)
106 9839 : CALL keyword_release(keyword)
107 :
108 : CALL keyword_create(keyword, __LOCATION__, name="XAS_CORE", &
109 : description="Occupation of the core state in XAS calculation by TP_FLEX.", &
110 : usage="XAS_CORE 0.5", &
111 9839 : default_r_val=0.5_dp)
112 9839 : CALL section_add_keyword(section, keyword)
113 9839 : CALL keyword_release(keyword)
114 :
115 : CALL keyword_create(keyword, __LOCATION__, name="XAS_TOT_EL", &
116 : description="Total number of electrons for spin channel alpha, in XAS calculation by TP_FLEX. "// &
117 : "If it is a negative value, the number of electrons is set to GS number of electrons "// &
118 : "minus the amount subtracted from the core state", &
119 : usage="XAS_TOT_EL 10", &
120 9839 : default_r_val=-1._dp)
121 9839 : CALL section_add_keyword(section, keyword)
122 9839 : CALL keyword_release(keyword)
123 :
124 : CALL keyword_create(keyword, __LOCATION__, name="XES_CORE", &
125 : description="Occupation of the core state in XES calculation by TP_VAL. "// &
126 : "The HOMO is emptied by the same amount.", &
127 : usage="XES_CORE 0.5", &
128 9839 : default_r_val=1._dp)
129 9839 : CALL section_add_keyword(section, keyword)
130 9839 : CALL keyword_release(keyword)
131 :
132 : CALL keyword_create(keyword, __LOCATION__, name="XES_EMPTY_HOMO", &
133 : description="Set the occupation of the HOMO in XES calculation by TP_VAL. "// &
134 : "The HOMO can be emptied or not, if the core is still full.", &
135 : usage="XES_EMPTY_HOMO", &
136 : default_l_val=.FALSE., &
137 9839 : lone_keyword_l_val=.TRUE.)
138 9839 : CALL section_add_keyword(section, keyword)
139 9839 : CALL keyword_release(keyword)
140 :
141 : CALL keyword_create(keyword, __LOCATION__, name="DIPOLE_FORM", &
142 : variants=["DIP_FORM"], &
143 : description="Type of integral to get the oscillator strengths "// &
144 : "in the diipole approximation", &
145 : usage="DIPOLE_FORM string", &
146 : default_i_val=xas_dip_vel, &
147 : enum_c_vals=s2a("LENGTH", "VELOCITY"), &
148 : enum_desc=s2a("Length form ⟨ i | e r | j ⟩", &
149 : "Velocity form ⟨ i | d/dr | j ⟩"), &
150 19678 : enum_i_vals=[xas_dip_len, xas_dip_vel])
151 9839 : CALL section_add_keyword(section, keyword)
152 9839 : CALL keyword_release(keyword)
153 :
154 : ! replace the specialized keyword with standard scf section
155 : ! scf_env is added to xas_env
156 :
157 9839 : NULLIFY (subsection)
158 9839 : CALL create_scf_section(subsection)
159 9839 : CALL section_add_subsection(section, subsection)
160 9839 : CALL section_release(subsection)
161 :
162 : CALL keyword_create(keyword, __LOCATION__, name="STATE_TYPE", &
163 : variants=["TYPE"], &
164 : description="Type of the orbitals that are excited for the xas spectra calculation", &
165 : usage="STATE_TYPE 1S", &
166 : default_i_val=xas_1s_type, &
167 : enum_c_vals=s2a("1S", "2S", "2P", "3S", "3P", "3D", "4S", "4P", "4D", "4F"), &
168 : enum_desc=s2a("1s orbitals", "2s orbitals", "2p orbitals", "3s orbitals", "3p orbitals", &
169 : "3d orbitals", "4s orbitals", "4p orbitals", "4d orbitals", "4f orbitals"), &
170 : enum_i_vals=[xas_1s_type, xas_2s_type, xas_2p_type, xas_3s_type, xas_3p_type, xas_3d_type, &
171 19678 : xas_4s_type, xas_4p_type, xas_4d_type, xas_4f_type])
172 9839 : CALL section_add_keyword(section, keyword)
173 9839 : CALL keyword_release(keyword)
174 :
175 : CALL keyword_create(keyword, __LOCATION__, name="STATE_SEARCH", &
176 : description="# of states where to look for the one to be excited", &
177 : usage="STATE_SEARCH 1", &
178 9839 : default_i_val=-1)
179 9839 : CALL section_add_keyword(section, keyword)
180 9839 : CALL keyword_release(keyword)
181 :
182 : CALL keyword_create(keyword, __LOCATION__, name="SPIN_CHANNEL", &
183 : description="# Spin channel of the excited orbital", &
184 : usage="SPIN_CHANNEL 1", &
185 9839 : default_i_val=1)
186 9839 : CALL section_add_keyword(section, keyword)
187 9839 : CALL keyword_release(keyword)
188 :
189 : CALL keyword_create(keyword, __LOCATION__, name="ATOMS_LIST", &
190 : variants=["AT_LIST"], &
191 : description="Indexes of the atoms to be excited. "// &
192 : "This keyword can be repeated several times "// &
193 : "(useful if you have to specify many indexes).", &
194 : usage="ATOMS_LIST {integer} {integer} .. {integer} ", &
195 19678 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
196 9839 : CALL section_add_keyword(section, keyword)
197 9839 : CALL keyword_release(keyword)
198 :
199 : CALL keyword_create(keyword, __LOCATION__, name="OVERLAP_THRESHOLD", &
200 : description="Threshold for including more than one initial core excited state "// &
201 : "per atom. The threshold is taken relative to the maximum overlap.", &
202 9839 : usage="OVERLAP_THRESHOLD 8.e-1", default_r_val=1.0_dp)
203 9839 : CALL section_add_keyword(section, keyword)
204 9839 : CALL keyword_release(keyword)
205 :
206 : CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_LIST", &
207 : variants=["ORBITAL_LIST"], &
208 : description="Indices of the localized orbitals to be excited. "// &
209 : "This keyword can be repeated several times "// &
210 : "(useful if you have to specify many indexes).", &
211 : usage="ORBITAL_LIST {integer} {integer} .. {integer} ", &
212 19678 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
213 9839 : CALL section_add_keyword(section, keyword)
214 9839 : CALL keyword_release(keyword)
215 :
216 : CALL keyword_create(keyword, __LOCATION__, name="ADDED_MOS", &
217 : description="Number of additional MOS added spin up only", &
218 9839 : usage="ADDED_MOS {integer}", default_i_val=-1)
219 9839 : CALL section_add_keyword(section, keyword)
220 9839 : CALL keyword_release(keyword)
221 :
222 : CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER_ADDED", &
223 : description="maximum number of iteration in calculation of added orbitals", &
224 9839 : usage="MAX_ITER_ADDED 100", default_i_val=2999)
225 9839 : CALL section_add_keyword(section, keyword)
226 9839 : CALL keyword_release(keyword)
227 :
228 : CALL keyword_create(keyword, __LOCATION__, name="EPS_ADDED", &
229 : description="target accuracy incalculation of the added orbitals", &
230 9839 : usage="EPS_ADDED 1.e-6", default_r_val=1.0e-5_dp)
231 9839 : CALL section_add_keyword(section, keyword)
232 9839 : CALL keyword_release(keyword)
233 :
234 : CALL keyword_create(keyword, __LOCATION__, name="NGAUSS", &
235 : description="Number of gto's for the expansion of the STO "// &
236 : "of the type given by STATE_TYPE", &
237 9839 : usage="NGAUSS {integer}", default_i_val=3)
238 9839 : CALL section_add_keyword(section, keyword)
239 9839 : CALL keyword_release(keyword)
240 :
241 : CALL keyword_create(keyword, __LOCATION__, name="RESTART", &
242 : description="Restart the excited state if the restart file exists", &
243 : usage="RESTART", &
244 9839 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
245 9839 : CALL section_add_keyword(section, keyword)
246 9839 : CALL keyword_release(keyword)
247 :
248 : CALL keyword_create(keyword, __LOCATION__, name="WFN_RESTART_FILE_NAME", &
249 : variants=["RESTART_FILE_NAME"], &
250 : description="Root of the file names where to read the MOS from "// &
251 : "which to restart the calculation of the core level excited states", &
252 : usage="WFN_RESTART_FILE_NAME <FILENAME>", &
253 19678 : type_of_var=lchar_t)
254 9839 : CALL section_add_keyword(section, keyword)
255 9839 : CALL keyword_release(keyword)
256 :
257 9839 : CALL create_localize_section(subsection)
258 9839 : CALL section_add_subsection(section, subsection)
259 9839 : CALL section_release(subsection)
260 :
261 : CALL section_create(subsection, __LOCATION__, name="PRINT", &
262 : description="printing of information during the core-level spectroscopy simulation", &
263 9839 : repeats=.FALSE.)
264 :
265 : ! Add printing of wannier infos
266 9839 : CALL print_wanniers(subsection)
267 :
268 : CALL cp_print_key_section_create(print_key, __LOCATION__, "iteration_info", &
269 : description="Controls the printing of basic iteration information during the XAS SCF.", &
270 9839 : print_level=low_print_level, filename="__STD_OUT__")
271 : CALL keyword_create(keyword, __LOCATION__, name="time_cumul", &
272 : description="If the printkey is activated switches the printing of timings"// &
273 : " to cumulative (over the SCF).", &
274 9839 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
275 9839 : CALL section_add_keyword(print_key, keyword)
276 9839 : CALL keyword_release(keyword)
277 9839 : CALL section_add_subsection(subsection, print_key)
278 9839 : CALL section_release(print_key)
279 :
280 : CALL cp_print_key_section_create(print_key, __LOCATION__, "program_run_info", &
281 : description="Controls the printing of basic iteration information in CLS", &
282 9839 : print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
283 9839 : CALL section_add_subsection(subsection, print_key)
284 9839 : CALL section_release(print_key)
285 :
286 : CALL cp_print_key_section_create(print_key, __LOCATION__, "XES_SPECTRUM", &
287 : description="Controls the dumping of the CLS output files containing the emission spectra", &
288 9839 : print_level=low_print_level, common_iter_levels=3, filename="")
289 9839 : CALL section_add_subsection(subsection, print_key)
290 9839 : CALL section_release(print_key)
291 :
292 : CALL cp_print_key_section_create( &
293 : print_key, __LOCATION__, "XAS_SPECTRUM", &
294 : description="Controls the dumping of the CLS output files containing the absorption spectra", &
295 9839 : print_level=low_print_level, common_iter_levels=3, filename="")
296 9839 : CALL section_add_subsection(subsection, print_key)
297 9839 : CALL section_release(print_key)
298 :
299 9839 : CALL create_pdos_section(print_key)
300 9839 : CALL section_add_subsection(subsection, print_key)
301 9839 : CALL section_release(print_key)
302 :
303 : CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
304 : description="Controls the dumping of MO restart file during the SCF. "// &
305 : "of a Core-Level-Spectroscopy calculation. For each new excited atom, "// &
306 : "one different restart file is dumped. These restart files should be "// &
307 : "employed only to restart the same type of CLS calculation, "// &
308 : "i.e. with the same core potential.", &
309 : print_level=low_print_level, common_iter_levels=3, each_iter_names=s2a("XAS_SCF"), &
310 9839 : add_last=add_last_numeric, each_iter_values=[3], filename="")
311 9839 : CALL section_add_subsection(subsection, print_key)
312 9839 : CALL section_release(print_key)
313 :
314 : CALL cp_print_key_section_create(print_key, __LOCATION__, "FULL_RESTART", &
315 : description="Controls the dumping of a standard MO restart file "// &
316 : "where coefficients and occupation numbers are those of the TP scheme, "// &
317 : "i.e. with emptied core state.", &
318 : print_level=high_print_level, common_iter_levels=3, each_iter_names=s2a("XAS_SCF"), &
319 9839 : add_last=add_last_numeric, each_iter_values=[3], filename="")
320 9839 : CALL section_add_subsection(subsection, print_key)
321 9839 : CALL section_release(print_key)
322 :
323 : CALL cp_print_key_section_create(print_key, __LOCATION__, "CLS_FUNCTION_CUBES", &
324 : description="Controls the printing of the relaxed orbitals ", &
325 9839 : print_level=high_print_level, common_iter_levels=3, add_last=add_last_numeric, filename="")
326 : CALL keyword_create(keyword, __LOCATION__, name="stride", &
327 : description="The stride (X,Y,Z) used to write the cube file "// &
328 : "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
329 : " 1 number valid for all components.", &
330 9839 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
331 9839 : CALL section_add_keyword(print_key, keyword)
332 9839 : CALL keyword_release(keyword)
333 :
334 : CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
335 : variants=["CUBES_LU"], &
336 : description="The lower and upper index of the states to be printed as cube", &
337 : usage="CUBES_LU_BOUNDS integer integer", &
338 19678 : n_var=2, default_i_vals=[0, -2], type_of_var=integer_t)
339 9839 : CALL section_add_keyword(print_key, keyword)
340 9839 : CALL keyword_release(keyword)
341 :
342 : CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
343 : description="Indexes of the states to be printed as cube files "// &
344 : "This keyword can be repeated several times "// &
345 : "(useful if you have to specify many indexes).", &
346 : usage="CUBES_LIST 1 2", &
347 9839 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
348 9839 : CALL section_add_keyword(print_key, keyword)
349 9839 : CALL keyword_release(keyword)
350 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
351 : description="append the cube files when they already exist", &
352 9839 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
353 9839 : CALL section_add_keyword(print_key, keyword)
354 9839 : CALL keyword_release(keyword)
355 :
356 9839 : CALL section_add_subsection(subsection, print_key)
357 9839 : CALL section_release(print_key)
358 :
359 9839 : CALL section_add_subsection(section, subsection)
360 9839 : CALL section_release(subsection)
361 :
362 9839 : END SUBROUTINE create_xas_section
363 :
364 : ! **************************************************************************************************
365 : !> \brief makes the input section for core-level spectroscopy simulations using
366 : !> linear response TDDFT
367 : !> \param section ...
368 : !> \par History
369 : !> 11.2017 created [AB]
370 : ! **************************************************************************************************
371 19662 : SUBROUTINE create_xas_tdp_section(section)
372 : TYPE(section_type), POINTER :: section
373 :
374 : TYPE(keyword_type), POINTER :: keyword
375 : TYPE(section_type), POINTER :: print_key, subsection, subsubsection, &
376 : subsubsubsection
377 :
378 19662 : NULLIFY (keyword, print_key, subsection, subsubsection, subsubsubsection)
379 :
380 19662 : CPASSERT(.NOT. ASSOCIATED(section))
381 : CALL section_create(section, __LOCATION__, name="XAS_TDP", &
382 : description="XAS simulations using linear-response TDDFT. Excitation from "// &
383 : "specified core orbitals is considered one at a time. In case of high "// &
384 : "symmetry structures, donor core orbitals should be localized.", &
385 19662 : n_keywords=19, n_subsections=4, repeats=.FALSE.)
386 :
387 19662 : NULLIFY (keyword, subsection, print_key)
388 :
389 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
390 : description="controls the activation of XAS simulations with linear "// &
391 : "response TDDFT.", &
392 : usage="&TDP_XAS {logical}", &
393 : default_l_val=.FALSE., &
394 19662 : lone_keyword_l_val=.TRUE.)
395 19662 : CALL section_add_keyword(section, keyword)
396 19662 : CALL keyword_release(keyword)
397 :
398 : CALL keyword_create(keyword, __LOCATION__, name="CHECK_ONLY", &
399 : description="This keyword defines whether the full calculation should "// &
400 : "be done or not. If set to .TRUE., only the determination "// &
401 : "of donor MOs is conducted. This run option allows for "// &
402 : "cheap verification of the input parameters", &
403 : usage="CHECK_ONLY {logical}", &
404 : default_l_val=.FALSE., &
405 : lone_keyword_l_val=.TRUE., &
406 19662 : repeats=.FALSE.)
407 19662 : CALL section_add_keyword(section, keyword)
408 19662 : CALL keyword_release(keyword)
409 :
410 : CALL keyword_create(keyword, __LOCATION__, name="RESTART_FROM_FILE", &
411 : variants=s2a("RESTART_FILENAME", "RST_FILENAME", "RESTART_FILE", "RST_FILE"), &
412 : description="By providing a RESTART file containing the linear-response "// &
413 : "orbitals and excitations energies from a previous calculation, "// &
414 : "all computations are skipped except for the corresponding "// &
415 : "PDOS and/or CUBE file printing as defined in the PRINT "// &
416 : "subsection. Basis sets and geometry need to be consistent.", &
417 : usage="RESTART_FROM_FILE <FILENAME>", &
418 19662 : type_of_var=char_t, n_var=-1)
419 19662 : CALL section_add_keyword(section, keyword)
420 19662 : CALL keyword_release(keyword)
421 :
422 : CALL keyword_create(keyword, __LOCATION__, name="EXCITATIONS", &
423 : variants=["EXCITATION"], &
424 : description="Specify the type of excitation to consider. In case of a "// &
425 : "restricted closed-shell ground state calculation, "// &
426 : "RCS_SINGLET or/and RCS_TRIPLET can be chosen. In case of a "// &
427 : "open-shell ground state calculation (either UKS or ROKS), "// &
428 : "standard spin conserving excitation (OS_SPIN_CONS) or/and "// &
429 : "spin-flip excitation (OS_SPIN_FLIP) can be chosen.", &
430 : usage="EXCITATIONS {string}", &
431 : repeats=.TRUE., &
432 : default_i_val=tddfpt_singlet, &
433 : enum_c_vals=s2a("RCS_SINGLET", "RCS_TRIPLET", "OS_SPIN_CONS", "OS_SPIN_FLIP"), &
434 : enum_desc=s2a("Singlet excitation on top of restricted closed-shell ground state", &
435 : "Triplet excitation on top of restricted closed-shell ground state", &
436 : "Spin-conserving excitations on top of open-shell ground state", &
437 : "Spin-flip excitation on top of open-shell ground state"), &
438 39324 : enum_i_vals=[tddfpt_singlet, tddfpt_triplet, tddfpt_spin_cons, tddfpt_spin_flip])
439 19662 : CALL section_add_keyword(section, keyword)
440 19662 : CALL keyword_release(keyword)
441 :
442 : CALL keyword_create(keyword, __LOCATION__, name="EPS_PGF_XAS", &
443 : variants=s2a("EPS_PGF", "EPS_PGF_XAS_TDP"), &
444 : description="The threshold used to determine the spatial extent of all "// &
445 : "primitive Gaussian functions used for the construction "// &
446 : "of neighbor lists in the XAS_TDP method. "// &
447 : "By default, takes the value of QS%EPS_PGF_ORB. Useful if "// &
448 : "the former value is tiny due to possible ground state HFX "// &
449 : "contributions.", &
450 : usage="EPS_PGF_XAS {real}", &
451 19662 : type_of_var=real_t)
452 19662 : CALL section_add_keyword(section, keyword)
453 19662 : CALL keyword_release(keyword)
454 :
455 : CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
456 : variants=s2a("EPS_FILTER_MATRIX"), &
457 : description="The threshold used for sparse matrix operations", &
458 : usage="EPS_FILTER {real}", &
459 : type_of_var=real_t, &
460 19662 : default_r_val=1.0E-10_dp)
461 19662 : CALL section_add_keyword(section, keyword)
462 19662 : CALL keyword_release(keyword)
463 :
464 : CALL keyword_create(keyword, __LOCATION__, name="DIPOLE_FORM", &
465 : variants=["DIP_FORM"], &
466 : description="Type of integral to get the oscillator strengths "// &
467 : "in the dipole approximation", &
468 : usage="DIPOLE_FORM {string}", &
469 : default_i_val=xas_dip_vel, &
470 : enum_c_vals=s2a("LENGTH", "VELOCITY"), &
471 : enum_desc=s2a("Length form ⟨ 0 | e r | n ⟩", &
472 : "Velocity form ⟨ 0 | d/dr | n ⟩"), &
473 39324 : enum_i_vals=[xas_dip_len, xas_dip_vel])
474 19662 : CALL section_add_keyword(section, keyword)
475 19662 : CALL keyword_release(keyword)
476 :
477 : CALL keyword_create(keyword, __LOCATION__, name="QUADRUPOLE", &
478 : variants=s2a("DO_QUADRUPOLE", "DO_QUAD", "QUAD"), &
479 : description="Compute the electric quadrupole contribution to the "// &
480 : "oscillator strenghts (in the length representation with "// &
481 : "the origin set on the relevant excited atom)", &
482 : usage="QUADRUPOLE {logical}", &
483 : default_l_val=.FALSE., &
484 19662 : lone_keyword_l_val=.TRUE.)
485 19662 : CALL section_add_keyword(section, keyword)
486 19662 : CALL keyword_release(keyword)
487 :
488 : CALL keyword_create(keyword, __LOCATION__, name="XYZ_DIPOLE", &
489 : variants=s2a("DIPOLE_XYZ"), &
490 : description="Whether the detailed contributions of the dipole oscillator "// &
491 : "strengths along the X,Y,Z directions should be printed.", &
492 : usage="XYZ_DIPOLE {logical}", &
493 : default_l_val=.FALSE., &
494 19662 : lone_keyword_l_val=.TRUE.)
495 19662 : CALL section_add_keyword(section, keyword)
496 19662 : CALL keyword_release(keyword)
497 :
498 : CALL keyword_create(keyword, __LOCATION__, name="SPIN_DIPOLE", &
499 : variants=s2a("DIPOLE_SPIN"), &
500 : description="Whether the detailed contributions of the dipole oscillator "// &
501 : "strengths for alpha and beta spins should be printed.", &
502 : usage="SPIN_DIPOLE {logical}", &
503 : default_l_val=.FALSE., &
504 19662 : lone_keyword_l_val=.TRUE.)
505 19662 : CALL section_add_keyword(section, keyword)
506 19662 : CALL keyword_release(keyword)
507 :
508 : ! the GW2X correction subsection
509 : CALL section_create(subsection, __LOCATION__, name="GW2X", &
510 : description="Specifications for the GW2X calculation of core "// &
511 : "ionization potentials. Note that donor states need to be actively "// &
512 : "localized using the LOCALIZE keyword in DONOR_STATES. N_SEARCH "// &
513 : "should be kept to the minimum, such that only core states are localized.", &
514 : citations=[Shigeta2001], &
515 : n_keywords=8, &
516 : n_subsections=0, &
517 39324 : repeats=.FALSE.)
518 :
519 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
520 : description="Enables the GW2X correction of the core ionization potentials", &
521 : usage="&GW2X {logical}", &
522 : default_l_val=.FALSE., &
523 19662 : lone_keyword_l_val=.TRUE.)
524 19662 : CALL section_add_keyword(subsection, keyword)
525 19662 : CALL keyword_release(keyword)
526 :
527 : CALL keyword_create(keyword, __LOCATION__, name="XPS_ONLY", &
528 : description="If set to .TRUE., only run GW2X calculations for XPS "// &
529 : "spectroscopy and ignore all XAS calculations. It is still "// &
530 : "required to define the DONOR_STATES and KERNEL%EXACT_EXCHANGE "// &
531 : "subsections.", &
532 : default_l_val=.FALSE., &
533 19662 : lone_keyword_l_val=.TRUE.)
534 19662 : CALL section_add_keyword(subsection, keyword)
535 19662 : CALL keyword_release(keyword)
536 :
537 : CALL keyword_create(keyword, __LOCATION__, name="BATCH_SIZE", &
538 : description="MOs batch size for batched tensor contraction. Larger "// &
539 : "size is faster, but uses more memory. Default should be safe "// &
540 : "in most cases.", &
541 19662 : default_i_val=64)
542 19662 : CALL section_add_keyword(subsection, keyword)
543 19662 : CALL keyword_release(keyword)
544 :
545 : CALL keyword_create(keyword, __LOCATION__, name="EPS_GW2X", &
546 : description="Convergence threshold for GW2X iterations (in eV)", &
547 19662 : default_r_val=1.E-2_dp)
548 19662 : CALL section_add_keyword(subsection, keyword)
549 19662 : CALL keyword_release(keyword)
550 :
551 : CALL keyword_create(keyword, __LOCATION__, name="C_OS", &
552 : description="Opposite-spin scling factor. SCS => 6/5, SOS => 1.3", &
553 19662 : default_r_val=1.0_dp)
554 19662 : CALL section_add_keyword(subsection, keyword)
555 19662 : CALL keyword_release(keyword)
556 :
557 : CALL keyword_create(keyword, __LOCATION__, name="C_SS", &
558 : description="Same-spin scling factor. SCS => 1/3, SOS => 0.0", &
559 19662 : default_r_val=1.0_dp)
560 19662 : CALL section_add_keyword(subsection, keyword)
561 19662 : CALL keyword_release(keyword)
562 :
563 : CALL keyword_create(keyword, __LOCATION__, name="MAX_GW2X_ITER", &
564 : description="Maximum number of iterations for GW2X", &
565 19662 : default_i_val=10)
566 19662 : CALL section_add_keyword(subsection, keyword)
567 19662 : CALL keyword_release(keyword)
568 :
569 : CALL keyword_create(keyword, __LOCATION__, name="PSEUDO_CANONICAL", &
570 : variants=["PSEUDO_CANO"], &
571 : description="Whether the pseudo-canonical version of GW2X should be used "// &
572 : "(versus only using the diagonal of the generalized Fock matrix)", &
573 39324 : default_l_val=.TRUE.)
574 19662 : CALL section_add_keyword(subsection, keyword)
575 19662 : CALL keyword_release(keyword)
576 :
577 19662 : CALL section_add_subsection(section, subsection)
578 19662 : CALL section_release(subsection)
579 :
580 : ! The donor state subsection
581 :
582 : CALL section_create(subsection, __LOCATION__, name="DONOR_STATES", &
583 : description="Specifications for the donor states from which core "// &
584 : "electrons are excited", &
585 : n_keywords=6, &
586 : n_subsections=0, &
587 19662 : repeats=.FALSE.)
588 :
589 : CALL keyword_create(keyword, __LOCATION__, name="DEFINE_EXCITED", &
590 : description="Whether the atoms to be excited should be defined by "// &
591 : "a list of atom indices or by a list of atom kinds.", &
592 : usage="DEFINE_EXCITED {string}", &
593 : default_i_val=xas_tdp_by_index, &
594 : enum_c_vals=s2a("BY_INDEX", "BY_KIND"), &
595 : enum_i_vals=[xas_tdp_by_index, xas_tdp_by_kind], &
596 : enum_desc=s2a("Excited atoms are defined by a list of indices", &
597 19662 : "Excited atoms are defined by a list of atomic kinds"))
598 19662 : CALL section_add_keyword(subsection, keyword)
599 19662 : CALL keyword_release(keyword)
600 :
601 : CALL keyword_create(keyword, __LOCATION__, name="ATOM_LIST", &
602 : variants=["AT_LIST"], &
603 : description="Indices of the atoms to be excited. "// &
604 : "Keyword only taken into account if DEFINE_EXCITED = BY_INDEX", &
605 : usage="ATOM_LIST {integer} {integer} .. {integer} ", &
606 39324 : n_var=-1, type_of_var=integer_t, repeats=.FALSE.)
607 19662 : CALL section_add_keyword(subsection, keyword)
608 19662 : CALL keyword_release(keyword)
609 :
610 : CALL keyword_create(keyword, __LOCATION__, name="KIND_LIST", &
611 : description="Kind of atoms to be excited. "// &
612 : "All atoms of the specified kinds are considered. "// &
613 : "Keyword only taken into account if DEFINE_EXCITED = BY_KIND", &
614 : usage="KIND_LIST {string} {string} .. {string} ", &
615 19662 : n_var=-1, type_of_var=char_t, repeats=.FALSE.)
616 19662 : CALL section_add_keyword(subsection, keyword)
617 19662 : CALL keyword_release(keyword)
618 :
619 : CALL keyword_create(keyword, __LOCATION__, name="STATE_TYPES", &
620 : variants=["TYPES"], &
621 : description="Types of orbitals that are excited, for each atom/kind, "// &
622 : "in order to do LR-TDDFT driven xas spectra calculation. "// &
623 : "This keyword MUST have the same number of entries as the relevant "// &
624 : "KIND_LIST or ATOM_LIST. The order of the specified state types must "// &
625 : "correspond to the order of the relevant kinds/indices. "// &
626 : "This keyword can be repeated, useful when multiple orbital types "// &
627 : "should be excited for specific kinds/atoms.", &
628 : n_var=-1, default_i_val=xas_not_excited, repeats=.TRUE., &
629 : usage="STATE_TYPES {string} {string} .. {string}", &
630 : enum_c_vals=s2a("1S", "2S", "2P", "NE"), &
631 : enum_desc=s2a("1s orbital", "2s orbital", "2p orbitals", "not excited"), &
632 39324 : enum_i_vals=[xas_1s_type, xas_2s_type, xas_2p_type, xas_not_excited])
633 19662 : CALL section_add_keyword(subsection, keyword)
634 19662 : CALL keyword_release(keyword)
635 :
636 : CALL keyword_create(keyword, __LOCATION__, name="N_SEARCH", &
637 : description="Number of MOs (per spin) to search to find specified donor core "// &
638 : "orbitals, starting from the lowest in energy and upward. By default, "// &
639 : "all HOMOs are searched. If the LOCALIZE keyword is used, "// &
640 : "then all searched states are first localized.", &
641 : usage="N_SEARCH {integer}", &
642 19662 : default_i_val=-1)
643 19662 : CALL section_add_keyword(subsection, keyword)
644 19662 : CALL keyword_release(keyword)
645 :
646 : CALL keyword_create(keyword, __LOCATION__, name="LOCALIZE", &
647 : variants=s2a("LOC", "DO_LOC"), &
648 : description="Whether the N_SEARCH potential donor states should be "// &
649 : "actively localized. Necessary in case of excited atoms "// &
650 : "equivalent under symmetry or GW2X correction.", &
651 : usage="LOCALIZE {logical}", &
652 : default_l_val=.FALSE., &
653 19662 : lone_keyword_l_val=.TRUE.)
654 19662 : CALL section_add_keyword(subsection, keyword)
655 19662 : CALL keyword_release(keyword)
656 :
657 19662 : CALL section_add_subsection(section, subsection)
658 19662 : CALL section_release(subsection)
659 : ! End of the donor states subsection
660 :
661 : ! The OT solver subsection
662 : CALL section_create(subsection, __LOCATION__, name="OT_SOLVER", &
663 : description="Specifications for the iterative OT solver. Note: only "// &
664 : "available within the Tamm-Dancoff approximation. Recommanded if excitations "// &
665 : "from multiple donor states take place.", &
666 : n_keywords=4, &
667 : n_subsections=0, &
668 19662 : repeats=.FALSE.)
669 :
670 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
671 : description="Enables the usage of the OT iterator solver", &
672 : usage="&OT_SOLVER {logical}", &
673 : default_l_val=.FALSE., &
674 19662 : lone_keyword_l_val=.TRUE.)
675 19662 : CALL section_add_keyword(subsection, keyword)
676 19662 : CALL keyword_release(keyword)
677 :
678 : CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
679 : description="Maximum number of iterations allowed for the OT solver", &
680 : usage="MAX_ITER {integer}", &
681 19662 : default_i_val=50)
682 19662 : CALL section_add_keyword(subsection, keyword)
683 19662 : CALL keyword_release(keyword)
684 :
685 : CALL keyword_create(keyword, __LOCATION__, name="EPS_ITER", &
686 : description="Convergence threshold for the OT solver", &
687 : usage="EPS_ITER {double}", &
688 19662 : default_r_val=1.0E-4_dp)
689 19662 : CALL section_add_keyword(subsection, keyword)
690 19662 : CALL keyword_release(keyword)
691 :
692 : CALL keyword_create(keyword, __LOCATION__, name="MINIMIZER", &
693 : description="Minimizer to be used with the OT solver", &
694 : usage="MINIMIZER DIIS", &
695 : default_i_val=ot_mini_diis, &
696 : enum_c_vals=s2a("CG", "DIIS"), &
697 : enum_desc=s2a("Conjugated gradient: safer", &
698 : "Direct inversion of the iterative subspace: faster"), &
699 19662 : enum_i_vals=[ot_mini_cg, ot_mini_diis])
700 19662 : CALL section_add_keyword(subsection, keyword)
701 19662 : CALL keyword_release(keyword)
702 :
703 19662 : CALL section_add_subsection(section, subsection)
704 19662 : CALL section_release(subsection)
705 : ! End of the OT solver subsection
706 :
707 : CALL keyword_create(keyword, __LOCATION__, name="SPIN_ORBIT_COUPLING", &
708 : variants=["SOC"], &
709 : description="Whether spin-orbit coupling should be added. "// &
710 : "Note: only applies for spin-restricted calculations with "// &
711 : "singlet and triplet excitations OR spin-unrestricted "// &
712 : "calculations with both spin-conserving and spin-flip.", &
713 : usage="SOC {logical}", &
714 : default_l_val=.FALSE., &
715 39324 : lone_keyword_l_val=.TRUE.)
716 19662 : CALL section_add_keyword(section, keyword)
717 19662 : CALL keyword_release(keyword)
718 :
719 : CALL keyword_create(keyword, __LOCATION__, name="TAMM_DANCOFF", &
720 : variants=["TDA"], &
721 : description="Whether the Tamm-Dancoff approximation should be used.", &
722 : usage="TAMM_DANCOFF {logical}", &
723 : default_l_val=.TRUE., &
724 39324 : lone_keyword_l_val=.TRUE.)
725 19662 : CALL section_add_keyword(section, keyword)
726 19662 : CALL keyword_release(keyword)
727 :
728 : CALL keyword_create(keyword, __LOCATION__, name="GRID", &
729 : variants=["ATOMIC_GRID"], &
730 : description="Specification of the atomic angular and radial grids for "// &
731 : "a given atomic kind. This keyword can/should be repeated "// &
732 : "for each excited kind. The default grid dimensions are "// &
733 : "those set for the GAPW ground state calculation. These "// &
734 : "grids are used for the xc-kernel integration. "// &
735 : "Usage: GRID < KIND > < LEBEDEV_GRID > < RADIAL_GRID >", &
736 : usage="GRID {string} {integer} {integer}", &
737 39324 : n_var=3, type_of_var=char_t, repeats=.TRUE.)
738 19662 : CALL section_add_keyword(section, keyword)
739 19662 : CALL keyword_release(keyword)
740 :
741 : CALL keyword_create(keyword, __LOCATION__, name="N_EXCITED", &
742 : variants=["N_ROOTS"], &
743 : description="The number of excited states to compute per donor "// &
744 : "molecular orbital. (e.g. if 2p excitations, "// &
745 : "3*N_EXCITED excited states are considered). "// &
746 : "If N_EXCITED is set to -1, all excitations are considered", &
747 : usage="N_EXCITED {integer}", &
748 39324 : default_i_val=-1)
749 19662 : CALL section_add_keyword(section, keyword)
750 19662 : CALL keyword_release(keyword)
751 :
752 : CALL keyword_create(keyword, __LOCATION__, name="ENERGY_RANGE", &
753 : variants=s2a("E_RANGE"), &
754 : description="The energy range in eV for which excitations are considered. "// &
755 : "Only excitated states within the range of: first excitation "// &
756 : "energy + ENERGY_RANGE are kept. If ENERGY_RANGE "// &
757 : "and N_EXCITED are specified, the former has priority. "// &
758 : "Negative values are ignored and N_EXCITED takes over.", &
759 : usage="ENERGY_RANGE {real}", &
760 19662 : default_r_val=-1.0_dp)
761 19662 : CALL section_add_keyword(section, keyword)
762 19662 : CALL keyword_release(keyword)
763 :
764 : ! The KERNEL subsection
765 : CALL section_create(subsection, __LOCATION__, name="KERNEL", &
766 : description="Defines how the kernel is built in terms of functionals.", &
767 : n_keywords=1, &
768 : n_subsections=1, &
769 19662 : repeats=.FALSE.)
770 :
771 : CALL keyword_create(keyword, __LOCATION__, name="RI_REGION", &
772 : variants=["RI_RADIUS"], &
773 : description="The region defined by a sphere of the given radius around "// &
774 : "the excited atom defining which RI_XAS basis elements are "// &
775 : "considered for the RI projection of the density. Each basis "// &
776 : "element which center is in this region is taken. The density "// &
777 : "for a given excited atom is expressed as : "// &
778 : "sum_ijkl P_ij (ijk) S_kl^-1 xi_l, where P_ij is the density "// &
779 : "matrix, i,j span the orbital basis and k,l the RI_XAS basis "// &
780 : "in the region. The larger the radius, the more basis "// &
781 : "functions to expand the density. However, it is assumed "// &
782 : "that it is a small number and the code does not scale well "// &
783 : "as the number of RI basis elements gets too large. "// &
784 : "Expressed in Angstrom. If the radius is set to 0.0, only "// &
785 : "the RI basis elements centered on the excited atom are used.", &
786 : usage="RI_REGION {real}", &
787 39324 : default_r_val=0.0_dp)
788 19662 : CALL section_add_keyword(subsection, keyword)
789 19662 : CALL keyword_release(keyword)
790 :
791 : ! The XC_FUNCTIONAL subsubsection
792 19662 : CALL create_xc_fun_section(subsubsection)
793 19662 : CALL section_add_subsection(subsection, subsubsection)
794 19662 : CALL section_release(subsubsection)
795 :
796 : ! The EXACT_EXCHANGE subsubsection
797 : CALL section_create(subsubsection, __LOCATION__, name="EXACT_EXCHANGE", &
798 : description="Whether exact-exchange should be added to the kernel and "// &
799 : "if so, with which fraction and operator.", &
800 : n_keywords=7, &
801 : n_subsections=1, &
802 19662 : repeats=.FALSE.)
803 :
804 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
805 : description="Enables the addition of exact exchange to the kernel.", &
806 : usage="&EXACT_EXCHANGE {logical}", &
807 : default_l_val=.FALSE., &
808 19662 : lone_keyword_l_val=.TRUE.)
809 19662 : CALL section_add_keyword(subsubsection, keyword)
810 19662 : CALL keyword_release(keyword)
811 :
812 : CALL keyword_create(keyword, __LOCATION__, name="POTENTIAL_TYPE", &
813 : variants=s2a("OP", "OPERATOR", "POTENTIAL"), &
814 : description="The type of operator used for exact exchange. The standard "// &
815 : "Coulomb operator cannot be used in periodic systems.", &
816 : usage="OPERATOR {string}", &
817 : repeats=.FALSE., &
818 : default_i_val=do_potential_coulomb, &
819 : enum_c_vals=s2a("COULOMB", "TRUNCATED", "SHORTRANGE"), &
820 : enum_desc=s2a("Standard Coulomb operator: 1/r", &
821 : "Truncated Coulomb operator: 1/r if r < R_c, 0 otherwise ", &
822 : "Short range: erfc(omega*r)/r"), &
823 : enum_i_vals=[do_potential_coulomb, do_potential_truncated, &
824 19662 : do_potential_short])
825 19662 : CALL section_add_keyword(subsubsection, keyword)
826 19662 : CALL keyword_release(keyword)
827 :
828 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
829 : variants=s2a("R_C", "RC", "RANGE"), &
830 : description="The cutoff radius (in Angstrom) for the truncated Coulomb operator.", &
831 : usage="CUTOFF_RADIUS {double}", &
832 : default_r_val=0.0_dp, &
833 19662 : repeats=.FALSE.)
834 19662 : CALL section_add_keyword(subsubsection, keyword)
835 19662 : CALL keyword_release(keyword)
836 :
837 : CALL keyword_create(keyword, __LOCATION__, name="T_C_G_DATA", &
838 : description="Location of the file t_c_g.dat that contains the data for the "// &
839 : "evaluation of the truncated gamma function ", &
840 : usage="T_C_G_DATA {string}", &
841 19662 : default_c_val="t_c_g.dat")
842 19662 : CALL section_add_keyword(subsubsection, keyword)
843 19662 : CALL keyword_release(keyword)
844 :
845 : CALL keyword_create(keyword, __LOCATION__, name="OMEGA", &
846 : description="The range parameter for the short range operator (in 1/a0).", &
847 : usage="OMEGA {double}", &
848 : default_r_val=0.0_dp, &
849 19662 : repeats=.FALSE.)
850 19662 : CALL section_add_keyword(subsubsection, keyword)
851 19662 : CALL keyword_release(keyword)
852 :
853 : CALL keyword_create(keyword, __LOCATION__, name="EPS_RANGE", &
854 : description="The threshold to determine the effective range of the short range "// &
855 : "operator: erfc(omega*eff_range)/eff_range = EPS_RANGE", &
856 : usage="EPS_RANGE = {double}", &
857 : default_r_val=1.0E-6_dp, &
858 19662 : repeats=.FALSE.)
859 19662 : CALL section_add_keyword(subsubsection, keyword)
860 19662 : CALL keyword_release(keyword)
861 :
862 : CALL keyword_create(keyword, __LOCATION__, name="EPS_SCREENING", &
863 : variants=s2a("EPS_SCREEN"), &
864 : description="A threshold to determine which primitive 3-center integrals "// &
865 : "are kept for contraction, as the latter operation can be "// &
866 : "expensive (especially for large basis sets ). "// &
867 : "If |(ab|c)| < EPS_SCREENING, it is discarded.", &
868 : default_r_val=1.0E-8_dp, &
869 19662 : repeats=.FALSE.)
870 19662 : CALL section_add_keyword(subsubsection, keyword)
871 19662 : CALL keyword_release(keyword)
872 :
873 : CALL keyword_create(keyword, __LOCATION__, name="SCALE", &
874 : variants=s2a("FRACTION"), &
875 : description="Scaling of the exact exchange contribution.", &
876 19662 : default_r_val=1.0_dp)
877 19662 : CALL section_add_keyword(subsubsection, keyword)
878 19662 : CALL keyword_release(keyword)
879 :
880 : !The RI metric subsection
881 : CALL section_create(subsubsubsection, __LOCATION__, name="RI_METRIC", &
882 : description="This subsection allows for the definition of an exchange "// &
883 : "RI metric that is different from the main exchange potential. "// &
884 : "By default (i.e. if this subsection is ignored), the "// &
885 : "exchange kernel is computed in the V approximation: "// &
886 : "(ab|ij) = (ab|P) V^-1 (Q|ij), where V = (P|Q). With a RI "// &
887 : "metric, we have a 2 step RI involving the metric potential "// &
888 : "for the 3-center integrals: "// &
889 : "(ab|ij) = (ab!P) (P!Q)^-1 (Q|R) (R!S)^-1 (S!ij), where | "// &
890 : "stands for the exchange potential and ! for the metric "// &
891 : "potential. This allows for drastic screening of the "// &
892 : "3-center integrals by selecting shorter range metric.", &
893 : n_keywords=5, &
894 : n_subsections=0, &
895 19662 : repeats=.FALSE.)
896 :
897 : CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", &
898 : description="Enables the use of a RI metric.", &
899 : usage="&EXACT_EXCHANGE {logical}", &
900 : default_l_val=.FALSE., &
901 19662 : lone_keyword_l_val=.TRUE.)
902 19662 : CALL section_add_keyword(subsubsubsection, keyword)
903 19662 : CALL keyword_release(keyword)
904 :
905 : CALL keyword_create(keyword, __LOCATION__, name="POTENTIAL_TYPE", &
906 : variants=s2a("OP", "OPERATOR", "POTENTIAL"), &
907 : description="The type of operator used for the metric.", &
908 : usage="OPERATOR {string}", &
909 : repeats=.FALSE., &
910 : default_i_val=do_potential_id, &
911 : enum_c_vals=s2a("OVERLAP", "TRUNCATED", "SHORTRANGE"), &
912 : enum_desc=s2a("Overlap operator (=identity)", &
913 : "Truncated Coulomb operator: 1/r if r < R_c, 0 otherwise ", &
914 : "Short range: erfc(omega*r)/r"), &
915 : enum_i_vals=[do_potential_id, do_potential_truncated, &
916 19662 : do_potential_short])
917 19662 : CALL section_add_keyword(subsubsubsection, keyword)
918 19662 : CALL keyword_release(keyword)
919 :
920 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
921 : variants=s2a("R_C", "RC", "RANGE"), &
922 : description="The cutoff radius (in Angstrom) for the truncated Coulomb operator.", &
923 : usage="CUTOFF_RADIUS {double}", &
924 : default_r_val=0.0_dp, &
925 19662 : repeats=.FALSE.)
926 19662 : CALL section_add_keyword(subsubsubsection, keyword)
927 19662 : CALL keyword_release(keyword)
928 :
929 : CALL keyword_create(keyword, __LOCATION__, name="T_C_G_DATA", &
930 : description="Location of the file t_c_g.dat that contains the data for the "// &
931 : "evaluation of the truncated gamma function ", &
932 : usage="T_C_G_DATA {string}", &
933 19662 : default_c_val="t_c_g.dat")
934 19662 : CALL section_add_keyword(subsubsubsection, keyword)
935 19662 : CALL keyword_release(keyword)
936 :
937 : CALL keyword_create(keyword, __LOCATION__, name="OMEGA", &
938 : description="The range parameter for the short range operator (in 1/a0).", &
939 : usage="OMEGA {double}", &
940 : default_r_val=0.0_dp, &
941 19662 : repeats=.FALSE.)
942 19662 : CALL section_add_keyword(subsubsubsection, keyword)
943 19662 : CALL keyword_release(keyword)
944 :
945 19662 : CALL section_add_subsection(subsubsection, subsubsubsection)
946 19662 : CALL section_release(subsubsubsection)
947 :
948 19662 : CALL section_add_subsection(subsection, subsubsection)
949 19662 : CALL section_release(subsubsection)
950 :
951 19662 : CALL section_add_subsection(section, subsection)
952 19662 : CALL section_release(subsection)
953 : ! End of Kernel subsection
954 :
955 : CALL section_create(subsection, __LOCATION__, "PRINT", "Controls the printing of information during "// &
956 19662 : "XAS TDP calculations", repeats=.FALSE.)
957 :
958 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="SPECTRUM", &
959 : description="Controls the dumping of the XAS TDP spectrum in output files", &
960 19662 : print_level=low_print_level, filename="", common_iter_levels=3)
961 19662 : CALL section_add_subsection(subsection, print_key)
962 19662 : CALL section_release(print_key)
963 :
964 : CALL cp_print_key_section_create(print_key, __LOCATION__, name="RESTART_WFN", &
965 : description="Controles the dumping of a MO restart file for a given "// &
966 : "excited state index. Only for K-edge RKS calculations. "// &
967 : "Can be repeated to get multiple *.wfn files at once.", &
968 19662 : print_level=debug_print_level, filename="", common_iter_levels=1)
969 : CALL keyword_create(keyword, __LOCATION__, name="EXCITED_STATE_INDEX", variants=["INDEX"], &
970 : description="The index of the excited state that should be dumped", &
971 39324 : usage="INDEX {int}", default_i_val=1, repeats=.TRUE.)
972 19662 : CALL section_add_keyword(print_key, keyword)
973 19662 : CALL keyword_release(keyword)
974 :
975 19662 : CALL section_add_subsection(subsection, print_key)
976 19662 : CALL section_release(print_key)
977 :
978 19662 : CALL create_pdos_section(print_key)
979 19662 : CALL section_add_subsection(subsection, print_key)
980 19662 : CALL section_release(print_key)
981 :
982 : CALL cp_print_key_section_create(print_key, __LOCATION__, "CUBES", &
983 : description="Controls the printing of the linear-response orbitals "// &
984 : "as *.cube files.", &
985 : print_level=high_print_level, common_iter_levels=1, &
986 19662 : add_last=add_last_numeric, filename="")
987 :
988 : CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
989 : description="The stride (X,Y,Z) used to write the cube file "// &
990 : "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
991 : " 1 number valid for all components.", &
992 19662 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
993 19662 : CALL section_add_keyword(print_key, keyword)
994 19662 : CALL keyword_release(keyword)
995 :
996 : CALL keyword_create(keyword, __LOCATION__, name="CUBES_LU_BOUNDS", &
997 : variants=["CUBES_LU"], &
998 : description="The lower and upper index of the excited states to be printed as cube", &
999 : usage="CUBES_LU_BOUNDS integer integer", &
1000 39324 : n_var=2, default_i_vals=[1, 0], type_of_var=integer_t)
1001 19662 : CALL section_add_keyword(print_key, keyword)
1002 19662 : CALL keyword_release(keyword)
1003 :
1004 : CALL keyword_create(keyword, __LOCATION__, name="CUBES_LIST", &
1005 : description="Indexes of the excited states to be printed as cube files "// &
1006 : "This keyword can be repeated several times "// &
1007 : "(useful if you have to specify many indexes).", &
1008 : usage="CUBES_LIST 1 2", &
1009 19662 : n_var=-1, type_of_var=integer_t, repeats=.TRUE.)
1010 19662 : CALL section_add_keyword(print_key, keyword)
1011 19662 : CALL keyword_release(keyword)
1012 :
1013 : CALL keyword_create(keyword, __LOCATION__, name="APPEND", &
1014 : description="append the cube files when they already exist", &
1015 19662 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
1016 19662 : CALL section_add_keyword(print_key, keyword)
1017 19662 : CALL keyword_release(keyword)
1018 :
1019 19662 : CALL section_add_subsection(subsection, print_key)
1020 19662 : CALL section_release(print_key)
1021 :
1022 : CALL cp_print_key_section_create(print_key, __LOCATION__, "RESTART", &
1023 : description="Controls the dumping of LR-orbitals coefficients "// &
1024 : "and corresponding excitation energies such that "// &
1025 : "the program can be restarted for PDOS or CUBE "// &
1026 : "printing without the heavy computing.", &
1027 19662 : print_level=high_print_level, filename="", common_iter_levels=3)
1028 19662 : CALL section_add_subsection(subsection, print_key)
1029 19662 : CALL section_release(print_key)
1030 :
1031 19662 : CALL section_add_subsection(section, subsection)
1032 19662 : CALL section_release(subsection)
1033 :
1034 19662 : END SUBROUTINE create_xas_tdp_section
1035 :
1036 : END MODULE input_cp2k_xas
|