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 active space 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_as
16 : USE cp_output_handling, ONLY: cp_print_key_section_create,&
17 : debug_print_level,&
18 : high_print_level,&
19 : low_print_level,&
20 : medium_print_level,&
21 : silent_print_level
22 : USE input_constants, ONLY: &
23 : casci_canonical, eri_method_full_gpw, eri_method_gpw_ht, eri_operator_coulomb, &
24 : eri_operator_erf, eri_operator_erfc, eri_operator_gaussian, eri_operator_lr_trunc, &
25 : eri_operator_trunc, eri_operator_yukawa, fci_solver, gaussian, gto_cartesian, &
26 : gto_spherical, manual_selection, mao_projection, no_solver, qiskit_solver, &
27 : wannier_projection
28 : USE input_cp2k_loc, ONLY: create_localize_section
29 : USE input_cp2k_xc, ONLY: create_xc_section
30 : USE input_keyword_types, ONLY: keyword_create,&
31 : keyword_release,&
32 : keyword_type
33 : USE input_section_types, ONLY: section_add_keyword,&
34 : section_add_subsection,&
35 : section_create,&
36 : section_release,&
37 : section_type
38 : USE input_val_types, ONLY: char_t,&
39 : integer_t,&
40 : lchar_t,&
41 : logical_t,&
42 : real_t
43 : USE kinds, ONLY: dp
44 : USE qs_density_mixing_types, ONLY: create_mixing_section
45 : USE string_utilities, ONLY: s2a
46 : #include "./base/base_uses.f90"
47 :
48 : IMPLICIT NONE
49 : PRIVATE
50 :
51 : CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_as'
52 :
53 : PUBLIC :: create_active_space_section
54 :
55 : CONTAINS
56 :
57 : ! **************************************************************************************************
58 : !> \brief Create CP2K input section for the calculation of an active space Hamiltonian
59 : !> \param section ...
60 : !> \par History:
61 : !> - Creation 06.04.2016
62 : !> \author JHU
63 : ! **************************************************************************************************
64 1474 : SUBROUTINE create_active_space_section(section)
65 :
66 : TYPE(section_type), POINTER :: section
67 :
68 : TYPE(keyword_type), POINTER :: keyword
69 : TYPE(section_type), POINTER :: print_key, subsection
70 :
71 1474 : CPASSERT(.NOT. ASSOCIATED(section))
72 :
73 : CALL section_create(section, __LOCATION__, name="ACTIVE_SPACE", &
74 : description="Define parameters and method to calculate an electronic active space", &
75 1474 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
76 :
77 1474 : NULLIFY (keyword, subsection, print_key)
78 :
79 : CALL keyword_create(keyword, __LOCATION__, &
80 : name="_SECTION_PARAMETERS_", &
81 : description="Controls the activation of the ACTIVE_SPACE section", &
82 : usage="&ACTIVE_SPACE ON", &
83 : default_l_val=.FALSE., &
84 1474 : lone_keyword_l_val=.TRUE.)
85 1474 : CALL section_add_keyword(section, keyword)
86 1474 : CALL keyword_release(keyword)
87 :
88 : CALL keyword_create(keyword, __LOCATION__, name="ACTIVE_ELECTRONS", &
89 : description="The number of active electrons in the CAS space", &
90 1474 : usage="ACTIVE_ELECTRONS 4", n_var=1, default_i_val=-1, type_of_var=integer_t)
91 1474 : CALL section_add_keyword(section, keyword)
92 1474 : CALL keyword_release(keyword)
93 :
94 : CALL keyword_create(keyword, __LOCATION__, name="ACTIVE_ORBITALS", &
95 : description="The number of active orbitals defining the CAS space.", &
96 1474 : usage="ACTIVE_ORBITALS 2", n_var=1, default_i_val=-1, type_of_var=integer_t)
97 1474 : CALL section_add_keyword(section, keyword)
98 1474 : CALL keyword_release(keyword)
99 :
100 : CALL keyword_create(keyword, __LOCATION__, name="ACTIVE_ORBITAL_INDICES", &
101 : description="The indices of the active orbitals. Requires ORBITAL_SELECTION MANUAL! "// &
102 : "Need to be as many indices as active orbitals times the number of spin "// &
103 : "channels (2 if ROKS or UKS/LSD else 1). The indices refer to the canonical "// &
104 : "SCF orbitals ordered by energy: if the SCF orbitals are not canonical (e.g. OT), "// &
105 : "they are first rotated into canonical orbitals, so the indices do not refer to "// &
106 : "the original OT orbitals. With OT%ON_THE_FLY_LOC the indices refer to the "// &
107 : "localized orbitals.", &
108 : usage="ACTIVE_ORBITAL_INDICES 2 3 {...}", n_var=-1, default_i_vals=[-1], &
109 1474 : type_of_var=integer_t)
110 1474 : CALL section_add_keyword(section, keyword)
111 1474 : CALL keyword_release(keyword)
112 :
113 : CALL cp_print_key_section_create(print_key, __LOCATION__, "FCIDUMP", &
114 : description="Controls the writing of a file in FCIDUMP format.", &
115 1474 : print_level=high_print_level, filename="")
116 1474 : CALL section_add_subsection(section, print_key)
117 1474 : CALL section_release(print_key)
118 :
119 : CALL cp_print_key_section_create(print_key, __LOCATION__, "MOLDEN", &
120 : description="Writes the orbitals of the active space Hamiltonian in "// &
121 : "Molden format: the inactive orbitals first, then the active orbitals "// &
122 : "in the orbital order of the FCIDUMP file. These are exactly the "// &
123 : "orbitals used for the integrals, also for ORBITAL_SELECTION MANUAL.", &
124 1474 : print_level=high_print_level, filename="ACTIVE_SPACE")
125 : CALL keyword_create(keyword, __LOCATION__, name="UNIT", &
126 : description="Unit for coordinates and cell in the MOLDEN file.", &
127 : usage="UNIT ANGSTROM", &
128 : enum_c_vals=s2a("BOHR", "ANGSTROM"), &
129 : enum_desc=s2a("Write in Bohr (AU)", "Write in Angstrom"), &
130 : enum_i_vals=[1, 2], &
131 1474 : default_i_val=1)
132 1474 : CALL section_add_keyword(print_key, keyword)
133 1474 : CALL keyword_release(keyword)
134 : CALL keyword_create(keyword, __LOCATION__, name="WRITE_CELL", &
135 : description="Controls whether the [Cell] block is written to the MOLDEN file.", &
136 : usage="WRITE_CELL T", &
137 1474 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
138 1474 : CALL section_add_keyword(print_key, keyword)
139 1474 : CALL keyword_release(keyword)
140 : CALL keyword_create(keyword, __LOCATION__, name="WRITE_PSEUDO", &
141 : description="Controls whether the [Pseudo] block is written to the MOLDEN file.", &
142 : usage="WRITE_PSEUDO T", &
143 1474 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
144 1474 : CALL section_add_keyword(print_key, keyword)
145 1474 : CALL keyword_release(keyword)
146 : CALL keyword_create(keyword, __LOCATION__, name="MARK_GHOST", &
147 : description="Controls whether ghost atoms are marked in the [Atoms] block by "// &
148 : "setting their atomic number to zero.", &
149 : usage="MARK_GHOST T", &
150 1474 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
151 1474 : CALL section_add_keyword(print_key, keyword)
152 1474 : CALL keyword_release(keyword)
153 : CALL keyword_create(keyword, __LOCATION__, name="NDIGITS", &
154 : description="Specifies the number of significant digits retained. "// &
155 : "The default keeps full precision for use in other programs.", &
156 : usage="NDIGITS {int}", &
157 1474 : default_i_val=15)
158 1474 : CALL section_add_keyword(print_key, keyword)
159 1474 : CALL keyword_release(keyword)
160 : CALL keyword_create(keyword, __LOCATION__, name="GTO_KIND", &
161 : description="Representation of Gaussian-type orbitals", &
162 : default_i_val=gto_spherical, &
163 : enum_c_vals=s2a("CARTESIAN", "SPHERICAL"), &
164 : enum_desc=s2a( &
165 : "Cartesian Gaussian orbitals. Use with caution", &
166 : "Spherical Gaussian orbitals. Incompatible with VMD"), &
167 1474 : enum_i_vals=[gto_cartesian, gto_spherical])
168 1474 : CALL section_add_keyword(print_key, keyword)
169 1474 : CALL keyword_release(keyword)
170 1474 : CALL section_add_subsection(section, print_key)
171 1474 : CALL section_release(print_key)
172 :
173 : CALL keyword_create(keyword, __LOCATION__, name="ORBITAL_SELECTION", &
174 : description="Method used to select active space orbitals. CANONICAL and MANUAL "// &
175 : "use the canonical SCF orbitals unchanged; non-canonical SCF orbitals (e.g. "// &
176 : "from OT) are first rotated once into canonical orbitals, separately within the "// &
177 : "occupied and the unoccupied orbitals. Not done for ROKS and for OT%ON_THE_FLY_LOC, "// &
178 : "where CANONICAL is not possible.", &
179 : usage="ORBITAL_SELECTION CANONICAL", &
180 : default_i_val=casci_canonical, &
181 : enum_c_vals=s2a("CANONICAL", "WANNIER_PROJECTION", "MAO", "MANUAL"), &
182 : enum_i_vals=[casci_canonical, wannier_projection, mao_projection, manual_selection], &
183 : enum_desc=s2a("Select orbitals using energy ordering of canonical orbitals", &
184 : "Select orbitals from projected Wannier functions", &
185 : "Select orbitals from modified atomic orbitals", &
186 1474 : "Select canonical orbitals by their indices given in ACTIVE_ORBITAL_INDICES"))
187 :
188 1474 : CALL section_add_keyword(section, keyword)
189 1474 : CALL keyword_release(keyword)
190 :
191 : CALL keyword_create(keyword, __LOCATION__, name="SUBSPACE_ATOM", &
192 : description="Number of atom that defines the subspace to be projected on.", &
193 : usage="SUBSPACE_ATOM x", default_i_val=-1, &
194 1474 : type_of_var=integer_t)
195 1474 : CALL section_add_keyword(section, keyword)
196 1474 : CALL keyword_release(keyword)
197 :
198 : CALL keyword_create(keyword, __LOCATION__, name="SUBSPACE_SHELL", &
199 : description="Shell definition for subsapce.", &
200 : usage="SUBSPACE_SHELL 3d4s", default_c_val="X", &
201 1474 : type_of_var=char_t)
202 1474 : CALL section_add_keyword(section, keyword)
203 1474 : CALL keyword_release(keyword)
204 :
205 : CALL keyword_create(keyword, __LOCATION__, name="SCF_EMBEDDING", &
206 : description="Whether to turn on the self-consistent embedding scheme", &
207 1474 : default_l_val=.FALSE., lone_keyword_l_val=.FALSE.)
208 1474 : CALL section_add_keyword(section, keyword)
209 1474 : CALL keyword_release(keyword)
210 :
211 : CALL keyword_create(keyword, __LOCATION__, name="QCSCHEMA", &
212 : description="Name of the QCSchema file, may include a path", &
213 : usage="QCSCHEMA <FILENAME>", &
214 : type_of_var=lchar_t, repeats=.FALSE., &
215 1474 : default_lc_val="")
216 1474 : CALL section_add_keyword(section, keyword)
217 1474 : CALL keyword_release(keyword)
218 :
219 : CALL keyword_create(keyword, __LOCATION__, name="AS_SOLVER", &
220 : description="The active space solver for the embedding approach", &
221 : usage="AS_SOLVER FCI", &
222 : default_i_val=no_solver, &
223 : enum_c_vals=s2a("NONE", "QISKIT", "FCI"), &
224 : enum_i_vals=[no_solver, qiskit_solver, fci_solver], &
225 : enum_desc=s2a("NO solver, used to produce FCIDUMP/QCSchema files", &
226 : "QISKIT active space solver", &
227 1474 : "LibFCI full-CI active space solver"))
228 1474 : CALL section_add_keyword(section, keyword)
229 1474 : CALL keyword_release(keyword)
230 :
231 : CALL keyword_create(keyword, __LOCATION__, name="EPS_ITER", &
232 : description="Energy convergence threshold of the DFT embedding scheme.", &
233 : usage="EPS_ITER 1.0E-6 ", type_of_var=real_t, &
234 1474 : default_r_val=1.0E-6_dp)
235 1474 : CALL section_add_keyword(section, keyword)
236 1474 : CALL keyword_release(keyword)
237 :
238 : CALL keyword_create(keyword, __LOCATION__, name="ALPHA", &
239 : description="Fraction of new density to be mixed with previous one in SCF embedding. "// &
240 : "Kept for backwards compatibility; prefer ACTIVE_SPACE%MIXING%ALPHA.", &
241 : usage="ALPHA 0.25", type_of_var=real_t, &
242 1474 : default_r_val=0.8_dp)
243 1474 : CALL section_add_keyword(section, keyword)
244 1474 : CALL keyword_release(keyword)
245 :
246 : CALL keyword_create(keyword, __LOCATION__, name="MAX_ITER", &
247 : description="Max number of iterations for the DFT embedding scheme.", &
248 : usage="MAX_ITER 50", type_of_var=integer_t, &
249 1474 : default_i_val=50)
250 1474 : CALL section_add_keyword(section, keyword)
251 1474 : CALL keyword_release(keyword)
252 :
253 1474 : CALL create_print_orb_section(subsection)
254 1474 : CALL section_add_subsection(section, subsection)
255 1474 : CALL section_release(subsection)
256 :
257 1474 : CALL create_eri_section(subsection)
258 1474 : CALL section_add_subsection(section, subsection)
259 1474 : CALL section_release(subsection)
260 :
261 1474 : CALL create_eri_gpw(subsection)
262 1474 : CALL section_add_subsection(section, subsection)
263 1474 : CALL section_release(subsection)
264 :
265 1474 : CALL create_localize_section(subsection)
266 1474 : CALL section_add_subsection(section, subsection)
267 1474 : CALL section_release(subsection)
268 :
269 1474 : CALL create_mixing_section(subsection, active_space=.TRUE.)
270 1474 : CALL section_add_subsection(section, subsection)
271 1474 : CALL section_release(subsection)
272 :
273 1474 : CALL create_socket_section(subsection)
274 1474 : CALL section_add_subsection(section, subsection)
275 1474 : CALL section_release(subsection)
276 :
277 1474 : CALL create_xc_section(subsection)
278 1474 : CALL section_add_subsection(section, subsection)
279 1474 : CALL section_release(subsection)
280 :
281 1474 : END SUBROUTINE create_active_space_section
282 :
283 : ! **************************************************************************************************
284 : !> \brief ...
285 : !> \param section ...
286 : ! **************************************************************************************************
287 1474 : SUBROUTINE create_socket_section(section)
288 : TYPE(section_type), POINTER :: section
289 :
290 : TYPE(keyword_type), POINTER :: keyword
291 :
292 1474 : CPASSERT(.NOT. ASSOCIATED(section))
293 : CALL section_create(section, __LOCATION__, name="SOCKET", &
294 : description="Parameters to set up the socket communicating to the external active space solver.", &
295 1474 : n_keywords=3, n_subsections=0, repeats=.FALSE.)
296 :
297 1474 : NULLIFY (keyword)
298 : CALL keyword_create(keyword, __LOCATION__, name="INET", &
299 : description="Use an INET socket rather than a UNIX socket.", &
300 : usage="INET <LOGICAL>", &
301 1474 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
302 1474 : CALL section_add_keyword(section, keyword)
303 1474 : CALL keyword_release(keyword)
304 :
305 : CALL keyword_create(keyword, __LOCATION__, name="PORT", &
306 : description="Port number for the socket client.", &
307 : usage="port <INTEGER>", &
308 1474 : default_i_val=12345)
309 1474 : CALL section_add_keyword(section, keyword)
310 1474 : CALL keyword_release(keyword)
311 :
312 : CALL keyword_create(keyword, __LOCATION__, name="HOST", &
313 : description="Host name for the socket client.", &
314 : usage="host <HOSTNAME>", &
315 1474 : default_c_val="embedding_socket")
316 1474 : CALL section_add_keyword(section, keyword)
317 1474 : CALL keyword_release(keyword)
318 :
319 1474 : END SUBROUTINE create_socket_section
320 :
321 : ! **************************************************************************************************
322 : !> \brief ...
323 : !> \param section ...
324 : ! **************************************************************************************************
325 1474 : SUBROUTINE create_print_orb_section(section)
326 : TYPE(section_type), POINTER :: section
327 :
328 : TYPE(keyword_type), POINTER :: keyword
329 :
330 1474 : CPASSERT(.NOT. ASSOCIATED(section))
331 : CALL section_create(section, __LOCATION__, name="PRINT_ORBITAL_CUBES", &
332 : description="Controls printing of active orbital cube files.", &
333 1474 : n_keywords=5, n_subsections=0, repeats=.FALSE.)
334 :
335 1474 : NULLIFY (keyword)
336 : CALL keyword_create(keyword, __LOCATION__, name="FILENAME", &
337 : description="Body of Filename for the cube files.", &
338 : usage="FILENAME {name}", default_c_val="ActiveOrbital", &
339 1474 : type_of_var=char_t)
340 1474 : CALL section_add_keyword(section, keyword)
341 1474 : CALL keyword_release(keyword)
342 :
343 : CALL keyword_create(keyword, __LOCATION__, name="ALIST", &
344 : description="List of alpha orbitals to be printed. -1 defaults to all values", &
345 : usage="ALIST {1 2 3 ...}", n_var=-1, default_i_vals=[-1], &
346 1474 : lone_keyword_i_val=-1, type_of_var=integer_t)
347 1474 : CALL section_add_keyword(section, keyword)
348 1474 : CALL keyword_release(keyword)
349 :
350 : CALL keyword_create(keyword, __LOCATION__, name="BLIST", &
351 : description="List of beta orbitals to be printed. -1 defaults to all values", &
352 : usage="BLIST {1 2 3 ...}", n_var=-1, default_i_vals=[-1], &
353 1474 : lone_keyword_i_val=-1, type_of_var=integer_t)
354 1474 : CALL section_add_keyword(section, keyword)
355 1474 : CALL keyword_release(keyword)
356 :
357 : CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
358 : description="The stride (X,Y,Z) used to write the cube file"// &
359 : " (larger values result in smaller cube files)."// &
360 : " You can provide 3 numbers (for X,Y,Z) or 1 number valid for all components", &
361 : usage="STRIDE {2 2 2}", n_var=-1, default_i_vals=[2, 2, 2], &
362 1474 : type_of_var=integer_t)
363 1474 : CALL section_add_keyword(section, keyword)
364 1474 : CALL keyword_release(keyword)
365 :
366 : CALL keyword_create(keyword, __LOCATION__, name="STOP_AFTER_CUBES", &
367 : description="Whether to stop the computation after printing the cubes.", &
368 1474 : default_l_val=.FALSE., lone_keyword_l_val=.FALSE.)
369 1474 : CALL section_add_keyword(section, keyword)
370 1474 : CALL keyword_release(keyword)
371 :
372 1474 : END SUBROUTINE create_print_orb_section
373 :
374 : ! **************************************************************************************************
375 : !> \brief ...
376 : !> \param section ...
377 : ! **************************************************************************************************
378 1474 : SUBROUTINE create_eri_section(section)
379 : TYPE(section_type), POINTER :: section
380 :
381 : TYPE(keyword_type), POINTER :: keyword
382 :
383 1474 : CPASSERT(.NOT. ASSOCIATED(section))
384 : CALL section_create(section, __LOCATION__, name="ERI", &
385 : description="Parameters for the electron repulsion integrals.", &
386 1474 : n_keywords=5, n_subsections=0, repeats=.FALSE.)
387 :
388 1474 : NULLIFY (keyword)
389 : CALL keyword_create(keyword, __LOCATION__, name="METHOD", &
390 : description="Method used in ERI calculation.", &
391 : usage="METHOD FULL_GPW", &
392 : enum_c_vals=s2a("FULL_GPW", "GPW_HALF_TRANSFORM"), &
393 : enum_i_vals=[eri_method_full_gpw, eri_method_gpw_ht], &
394 : enum_desc=s2a("Use the GPW approach with MOs", &
395 : "Use the GPW approach for half-transformed MO ERIs"), &
396 1474 : default_i_val=eri_method_full_gpw)
397 1474 : CALL section_add_keyword(section, keyword)
398 1474 : CALL keyword_release(keyword)
399 :
400 : CALL keyword_create(keyword, __LOCATION__, name="OPERATOR", &
401 : description="Operator used in ERI calculation.", &
402 : usage="OPERATOR LONGRANGE", &
403 : enum_c_vals=s2a("COULOMB", "YUKAWA", "LONGRANGE", &
404 : "SHORTRANGE", "GAUSSIAN", "TRUNCATED", "LR_TRUNC"), &
405 : enum_i_vals=[eri_operator_coulomb, eri_operator_yukawa, &
406 : eri_operator_erf, eri_operator_erfc, eri_operator_gaussian, &
407 : eri_operator_trunc, eri_operator_lr_trunc], &
408 : enum_desc=s2a("Coulomb operator: 1/r", &
409 : "Yukawa operator: exp(-omega*R)/R", &
410 : "Longrange operator: erf(omega*R)/R", &
411 : "Shortrange operator: erfc(omega*R)/R", &
412 : "Gaussian operator: exp(-omega*R2)/R", &
413 : "Truncated Coulomb operator: if (R < R_c) 1/R else 0)", &
414 : "Truncated longrange operator: if (R < R_c) erf(omega*R)/R else 0"), &
415 1474 : default_i_val=eri_operator_coulomb)
416 1474 : CALL section_add_keyword(section, keyword)
417 1474 : CALL keyword_release(keyword)
418 :
419 : CALL keyword_create(keyword, __LOCATION__, name="PERIODICITY", &
420 : description="Periodicity used for operators in ERI calclulation.", &
421 : usage="PERIODICITY 1 1 1", n_var=-1, default_i_vals=[0, 0, 0], &
422 1474 : type_of_var=integer_t)
423 1474 : CALL section_add_keyword(section, keyword)
424 1474 : CALL keyword_release(keyword)
425 :
426 : CALL keyword_create(keyword, __LOCATION__, name="OMEGA", &
427 : description="Range-separation parameter for ERI operator.", &
428 : usage="OMEGA 0.25", type_of_var=real_t, &
429 1474 : default_r_val=0.4_dp)
430 1474 : CALL section_add_keyword(section, keyword)
431 1474 : CALL keyword_release(keyword)
432 :
433 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF_RADIUS", &
434 : description="Cutoff radius (in Angstroms) for the truncated 1/r and "// &
435 : "longrange potentials. "// &
436 : "Only valid when doing truncated calculations.", &
437 : usage="CUTOFF_RADIUS 10.0", type_of_var=real_t, &
438 1474 : unit_str="angstrom", default_r_val=0.0_dp)
439 1474 : CALL section_add_keyword(section, keyword)
440 1474 : CALL keyword_release(keyword)
441 :
442 : CALL keyword_create( &
443 : keyword, __LOCATION__, name="EPS_INTEGRAL", &
444 : description="Accuracy of ERIs that will be stored.", &
445 : usage="EPS_INTEGRAL 1.0E-10 ", type_of_var=real_t, &
446 1474 : default_r_val=1.0E-12_dp)
447 1474 : CALL section_add_keyword(section, keyword)
448 1474 : CALL keyword_release(keyword)
449 :
450 1474 : END SUBROUTINE create_eri_section
451 :
452 : ! **************************************************************************************************
453 : !> \brief ...
454 : !> \param section ...
455 : ! **************************************************************************************************
456 1474 : SUBROUTINE create_eri_gpw(section)
457 : TYPE(section_type), POINTER :: section
458 :
459 : TYPE(keyword_type), POINTER :: keyword
460 :
461 1474 : CPASSERT(.NOT. ASSOCIATED(section))
462 : CALL section_create(section, __LOCATION__, name="ERI_GPW", &
463 : description="Parameters for the GPW approach to electron repulsion integrals.", &
464 1474 : n_keywords=5, n_subsections=0, repeats=.FALSE.)
465 :
466 1474 : NULLIFY (keyword)
467 : CALL keyword_create(keyword, __LOCATION__, name="EPS_GRID", &
468 : description="Determines a threshold for the GPW based integration", &
469 : usage="EPS_GRID 1.0E-9 ", type_of_var=real_t, &
470 1474 : default_r_val=1.0E-8_dp)
471 1474 : CALL section_add_keyword(section, keyword)
472 1474 : CALL keyword_release(keyword)
473 :
474 : CALL keyword_create(keyword, __LOCATION__, name="EPS_FILTER", &
475 : description="Determines a threshold for the sparse matrix multiplications if METHOD "// &
476 : "GPW_HALF_TRANSFORM is used", &
477 : usage="EPS_FILTER 1.0E-9 ", type_of_var=real_t, &
478 1474 : default_r_val=1.0E-9_dp)
479 1474 : CALL section_add_keyword(section, keyword)
480 1474 : CALL keyword_release(keyword)
481 :
482 : CALL keyword_create(keyword, __LOCATION__, name="CUTOFF", &
483 : description="The cutoff of the finest grid level in the GPW integration.", &
484 : usage="CUTOFF 300", type_of_var=real_t, &
485 1474 : default_r_val=300.0_dp)
486 1474 : CALL section_add_keyword(section, keyword)
487 1474 : CALL keyword_release(keyword)
488 :
489 : CALL keyword_create(keyword, __LOCATION__, name="REL_CUTOFF", &
490 : variants=["RELATIVE_CUTOFF"], &
491 : description="Determines the grid at which a Gaussian is mapped.", &
492 : usage="REL_CUTOFF 50", type_of_var=real_t, &
493 2948 : default_r_val=50.0_dp)
494 1474 : CALL section_add_keyword(section, keyword)
495 1474 : CALL keyword_release(keyword)
496 :
497 : CALL keyword_create(keyword, __LOCATION__, name="STORE_WFN", &
498 : variants=["STORE_WAVEFUNCTION"], &
499 : description="Store wavefunction in real space representation for integration.", &
500 : usage="STORE_WFN T", type_of_var=logical_t, &
501 2948 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
502 1474 : CALL section_add_keyword(section, keyword)
503 1474 : CALL keyword_release(keyword)
504 :
505 : CALL keyword_create(keyword, __LOCATION__, name="GROUP_SIZE", &
506 : description="Sets the size of a subgroup for ERI calculation, "// &
507 : "each of which with a full set of work grids, arrays or orbitals "// &
508 : "depending on the method of grids (work grids, arrays, orbitals). "// &
509 : "Small numbers reduce communication but increase the memory demands. "// &
510 : "A negative number indicates all processes (default).", &
511 : usage="GROUP_SIZE 2", type_of_var=integer_t, &
512 1474 : default_i_val=-1)
513 1474 : CALL section_add_keyword(section, keyword)
514 1474 : CALL keyword_release(keyword)
515 :
516 : CALL keyword_create(keyword, __LOCATION__, name="PRINT_LEVEL", &
517 : variants=["IOLEVEL"], &
518 : description="How much output is written by the individual groups.", &
519 : usage="PRINT_LEVEL HIGH", &
520 : default_i_val=silent_print_level, enum_c_vals= &
521 : s2a("SILENT", "LOW", "MEDIUM", "HIGH", "DEBUG"), &
522 : enum_desc=s2a("Almost no output", &
523 : "Little output", "Quite some output", "Lots of output", &
524 : "Everything is written out, useful for debugging purposes only"), &
525 : enum_i_vals=[silent_print_level, low_print_level, medium_print_level, &
526 2948 : high_print_level, debug_print_level])
527 1474 : CALL section_add_keyword(section, keyword)
528 1474 : CALL keyword_release(keyword)
529 :
530 1474 : END SUBROUTINE create_eri_gpw
531 :
532 : END MODULE input_cp2k_as
|