(git:ed6f26b)
Loading...
Searching...
No Matches
input_cp2k_se.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2025 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 semi empirical section of the input
10!> \par History
11!> 10.2005 moved out of input_cp2k [fawzi]
12!> 07.2024 moved out of input_cp2k [JGH]
13!> \author fawzi
14! **************************************************************************************************
18 USE cp_units, ONLY: cp_unit_to_cp2k
19 USE input_constants, ONLY: &
31 USE input_val_types, ONLY: char_t,&
32 real_t
33 USE kinds, ONLY: dp
34 USE string_utilities, ONLY: s2a
35#include "./base/base_uses.f90"
36
37 IMPLICIT NONE
38 PRIVATE
39
40 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_se'
41
43
44CONTAINS
45
46! **************************************************************************************************
47!> \brief ...
48!> \param section ...
49! **************************************************************************************************
50 SUBROUTINE create_se_control_section(section)
51 TYPE(section_type), POINTER :: section
52
53 TYPE(keyword_type), POINTER :: keyword
54 TYPE(section_type), POINTER :: subsection
55
56 NULLIFY (keyword)
57 cpassert(.NOT. ASSOCIATED(section))
58 CALL section_create(section, __location__, name="SE", &
59 description="Parameters needed to set up the Semi-empirical methods", &
60 n_keywords=8, n_subsections=0, repeats=.false.)
61
62 CALL keyword_create(keyword, __location__, name="ORTHOGONAL_BASIS", &
63 description="Assume orthogonal basis set. This flag is overwritten by "// &
64 "methods with fixed orthogonal/non-orthogonal basis set.", &
65 usage="ORTHOGONAL_BASIS", default_l_val=.false., lone_keyword_l_val=.true.)
66 CALL section_add_keyword(section, keyword)
67 CALL keyword_release(keyword)
68
69 CALL keyword_create(keyword, __location__, name="STO_NG", &
70 description="Provides the order of the Slater orbital expansion of Gaussian-Type Orbitals.", &
71 usage="STO_NG", default_i_val=6)
72 CALL section_add_keyword(section, keyword)
73 CALL keyword_release(keyword)
74
75 CALL keyword_create(keyword, __location__, name="ANALYTICAL_GRADIENTS", &
76 description="Nuclear Gradients are computed analytically or numerically", &
77 usage="ANALYTICAL_GRADIENTS", default_l_val=.true., lone_keyword_l_val=.true.)
78 CALL section_add_keyword(section, keyword)
79 CALL keyword_release(keyword)
80
81 CALL keyword_create(keyword, __location__, name="DELTA", &
82 description="Step size in finite difference force calculation", &
83 usage="DELTA {real} ", default_r_val=1.e-6_dp)
84 CALL section_add_keyword(section, keyword)
85 CALL keyword_release(keyword)
86
87 CALL keyword_create(keyword, __location__, name="INTEGRAL_SCREENING", &
88 description="Specifies the functional form for the ", &
89 usage="INTEGRAL_SCREENING (KDSO|KDSO-D|SLATER)", &
90 enum_c_vals=s2a("KDSO", "KDSO-D", "SLATER"), &
92 enum_desc=s2a("Uses the standard NDDO Klopman-Dewar-Sabelli-Ohno equation "// &
93 "for the screening of the Coulomb interactions.", &
94 "Uses a modified Klopman-Dewar-Sabelli-Ohno equation, dumping the screening "// &
95 "parameter for the Coulomb interactions.", &
96 "Uses an exponential Slater-type function for modelling the Coulomb interactions."), &
97 default_i_val=do_se_is_kdso)
98 CALL section_add_keyword(section, keyword)
99 CALL keyword_release(keyword)
100
101 CALL keyword_create(keyword, __location__, name="PERIODIC", &
102 description="Specifies the type of treatment for the electrostatic long-range part "// &
103 "in semi-empirical calculations.", &
104 usage="PERIODIC (NONE|EWALD|EWALD_R3|EWALD_GKS)", &
105 enum_c_vals=s2a("NONE", "EWALD", "EWALD_R3", "EWALD_GKS"), &
107 enum_desc=s2a("The long-range part is not explicitly treaten. The interaction "// &
108 "depends uniquely on the Cutoffs used for the calculation.", &
109 "Enables the usage of Multipoles Ewald summation schemes. The short-range part "// &
110 "is tapered according the value of RC_COULOMB.", &
111 "Enables the usage of Multipoles Ewald summation schemes together with a long-range "// &
112 "treatment for the 1/R^3 term, deriving from the short-range component. This option "// &
113 "is active only for K-DSO integral screening type.", &
114 "Use Ewald directly in Coulomb integral evaluation, works only with Slater screening"), &
115 default_i_val=do_se_lr_none)
116 CALL section_add_keyword(section, keyword)
117 CALL keyword_release(keyword)
118
119 CALL keyword_create(keyword, __location__, name="FORCE_KDSO-D_EXCHANGE", &
120 description="This keywords forces the usage of the KDSO-D integral screening "// &
121 "for the Exchange integrals (default is to apply the screening only to the "// &
122 "Coulomb integrals.", default_l_val=.false., lone_keyword_l_val=.true.)
123 CALL section_add_keyword(section, keyword)
124 CALL keyword_release(keyword)
125
126 CALL keyword_create(keyword, __location__, name="DISPERSION", &
127 description="Use dispersion correction", &
128 lone_keyword_l_val=.true., &
129 usage="DISPERSION", default_l_val=.false.)
130 CALL section_add_keyword(section, keyword)
131 CALL keyword_release(keyword)
132
133 CALL keyword_create(keyword, __location__, name="DISPERSION_PARAMETER_FILE", &
134 description="Specify file that contains the atomic dispersion parameters", &
135 usage="DISPERSION_PARAMETER_FILE filename", &
136 n_var=1, type_of_var=char_t, default_c_val="")
137 CALL section_add_keyword(section, keyword)
138 CALL keyword_release(keyword)
139
140 CALL keyword_create(keyword, __location__, name="DISPERSION_RADIUS", &
141 description="Define radius of dispersion interaction", &
142 usage="DISPERSION_RADIUS", default_r_val=15._dp)
143 CALL section_add_keyword(section, keyword)
144 CALL keyword_release(keyword)
145
146 CALL keyword_create(keyword, __location__, name="COORDINATION_CUTOFF", &
147 description="Define cutoff for coordination number calculation", &
148 usage="COORDINATION_CUTOFF", default_r_val=1.e-6_dp)
149 CALL section_add_keyword(section, keyword)
150 CALL keyword_release(keyword)
151
152 CALL keyword_create(keyword, __location__, name="D3_SCALING", &
153 description="Scaling parameters (s6,sr6,s8) for the D3 dispersion method,", &
154 usage="D3_SCALING 1.0 1.0 1.0", n_var=3, default_r_vals=(/0.0_dp, 0.0_dp, 0.0_dp/))
155 CALL section_add_keyword(section, keyword)
156 CALL keyword_release(keyword)
157
158 NULLIFY (subsection)
159 CALL create_coulomb_section(subsection)
160 CALL section_add_subsection(section, subsection)
161 CALL section_release(subsection)
162
163 CALL create_exchange_section(subsection)
164 CALL section_add_subsection(section, subsection)
165 CALL section_release(subsection)
166
167 CALL create_screening_section(subsection)
168 CALL section_add_subsection(section, subsection)
169 CALL section_release(subsection)
170
171 CALL create_lr_corr_section(subsection)
172 CALL section_add_subsection(section, subsection)
173 CALL section_release(subsection)
174
175 CALL create_neighbor_lists_section(subsection)
176 CALL section_add_subsection(section, subsection)
177 CALL section_release(subsection)
178
179 CALL create_se_memory_section(subsection)
180 CALL section_add_subsection(section, subsection)
181 CALL section_release(subsection)
182
183 CALL create_se_print_section(subsection)
184 CALL section_add_subsection(section, subsection)
185 CALL section_release(subsection)
186
187 CALL create_se_ga_section(subsection)
188 CALL section_add_subsection(section, subsection)
189 CALL section_release(subsection)
190
191 END SUBROUTINE create_se_control_section
192
193! **************************************************************************************************
194!> \brief Create the COULOMB se section
195!> \param section the section to create
196!> \date 03.2009
197!> \author Teodoro Laino [tlaino]
198! **************************************************************************************************
199 SUBROUTINE create_lr_corr_section(section)
200 TYPE(section_type), POINTER :: section
201
202 TYPE(keyword_type), POINTER :: keyword
203
204 cpassert(.NOT. ASSOCIATED(section))
205 CALL section_create(section, __location__, name="LR_CORRECTION", &
206 description="Setup parameters for the evaluation of the long-range correction term in SE "// &
207 "calculations.", n_keywords=0, n_subsections=1, repeats=.false.)
208 NULLIFY (keyword)
209
210 CALL keyword_create(keyword, __location__, name="CUTOFF", &
211 description="Atomic Cutoff Radius Cutoff for the evaluation of the long-ranbe correction integrals. ", &
212 usage="CUTOFF {real} ", unit_str="angstrom", &
213 default_r_val=cp_unit_to_cp2k(value=6.0_dp, unit_str="angstrom"))
214 CALL section_add_keyword(section, keyword)
215 CALL keyword_release(keyword)
216
217 CALL keyword_create(keyword, __location__, name="RC_TAPER", &
218 description="Atomic Cutoff Radius Cutoff for Tapering the long-range correction integrals. "// &
219 "If not specified it assumes the same value specified for the CUTOFF.", &
220 usage="RC_TAPER {real} ", unit_str="angstrom", type_of_var=real_t)
221 CALL section_add_keyword(section, keyword)
222 CALL keyword_release(keyword)
223
224 CALL keyword_create(keyword, __location__, name="RC_RANGE", &
225 description="Range of cutoff switch function (tapering): 0.5*(1-TANH((r-r0)/RC_RANGE)), "// &
226 "where r0=2.0*RC_TAPER-20.0*RC_RANGE.", &
227 usage="RC_RANGE {real} ", unit_str="angstrom", default_r_val=0.0_dp)
228 CALL section_add_keyword(section, keyword)
229 CALL keyword_release(keyword)
230
231 END SUBROUTINE create_lr_corr_section
232
233! **************************************************************************************************
234!> \brief Create the COULOMB se section
235!> \param section the section to create
236!> \date 03.2009
237!> \author Teodoro Laino [tlaino]
238! **************************************************************************************************
239 SUBROUTINE create_coulomb_section(section)
240 TYPE(section_type), POINTER :: section
241
242 TYPE(keyword_type), POINTER :: keyword
243
244 cpassert(.NOT. ASSOCIATED(section))
245 CALL section_create(section, __location__, name="COULOMB", &
246 description="Setup parameters for the evaluation of the COULOMB term in SE "// &
247 "calculations.", n_keywords=0, n_subsections=1, repeats=.false.)
248 NULLIFY (keyword)
249
250 CALL keyword_create( &
251 keyword, __location__, name="CUTOFF", &
252 description="Atomic Cutoff Radius Cutoff for the evaluation of the Coulomb integrals. "// &
253 "For non-periodic calculation the default value is exactly the full cell dimension, in order "// &
254 "to evaluate all pair interactions. Instead, for periodic calculations the default numerical value is used.", &
255 usage="CUTOFF {real} ", unit_str="angstrom", &
256 default_r_val=cp_unit_to_cp2k(value=12.0_dp, unit_str="angstrom"))
257 CALL section_add_keyword(section, keyword)
258 CALL keyword_release(keyword)
259
260 CALL keyword_create(keyword, __location__, name="RC_TAPER", &
261 description="Atomic Cutoff Radius Cutoff for Tapering Coulomb integrals. "// &
262 "If not specified it assumes the same value specified for the CUTOFF.", &
263 usage="RC_TAPER {real} ", unit_str="angstrom", type_of_var=real_t)
264 CALL section_add_keyword(section, keyword)
265 CALL keyword_release(keyword)
266
267 CALL keyword_create(keyword, __location__, name="RC_RANGE", &
268 description="Range of cutoff switch function (tapering): 0.5*(1-TANH((r-r0)/RC_RANGE)), "// &
269 "where r0=2.0*RC_TAPER-20.0*RC_RANGE.", &
270 usage="RC_RANGE {real} ", unit_str="angstrom", default_r_val=0.0_dp)
271 CALL section_add_keyword(section, keyword)
272 CALL keyword_release(keyword)
273
274 END SUBROUTINE create_coulomb_section
275
276! **************************************************************************************************
277!> \brief Create the EXCHANGE se section
278!> \param section the section to create
279!> \date 03.2009
280!> \author Teodoro Laino [tlaino]
281! **************************************************************************************************
282 SUBROUTINE create_exchange_section(section)
283 TYPE(section_type), POINTER :: section
284
285 TYPE(keyword_type), POINTER :: keyword
286
287 cpassert(.NOT. ASSOCIATED(section))
288 CALL section_create(section, __location__, name="EXCHANGE", &
289 description="Setup parameters for the evaluation of the EXCHANGE and "// &
290 "core Hamiltonian terms in SE calculations.", n_keywords=0, n_subsections=1, &
291 repeats=.false.)
292 NULLIFY (keyword)
293
294 CALL keyword_create(keyword, __location__, name="CUTOFF", &
295 description="Atomic Cutoff Radius Cutoff for the evaluation of the Exchange integrals. "// &
296 "For non-periodic calculation the default value is exactly the full cell dimension, in order "// &
297 "to evaluate all pair interactions. Instead, for periodic calculations the default is the "// &
298 "minimum value between 1/4 of the cell dimension and the value specified in input (either"// &
299 " explicitly defined or the default numerical value).", &
300 usage="CUTOFF {real} ", unit_str="angstrom", &
301 default_r_val=cp_unit_to_cp2k(value=12.0_dp, unit_str="angstrom"))
302 CALL section_add_keyword(section, keyword)
303 CALL keyword_release(keyword)
304
305 CALL keyword_create(keyword, __location__, name="RC_TAPER", &
306 description="Atomic Cutoff Radius Cutoff for Tapering Exchange integrals. "// &
307 "If not specified it assumes the same value specified for the CUTOFF.", &
308 usage="RC_TAPER {real} ", unit_str="angstrom", type_of_var=real_t)
309 CALL section_add_keyword(section, keyword)
310 CALL keyword_release(keyword)
311
312 CALL keyword_create(keyword, __location__, name="RC_RANGE", &
313 description="Range of cutoff switch function (tapering): 0.5*(1-TANH((r-r0)/RC_RANGE)), "// &
314 "where r0=2.0*RC_TAPER-20.0*RC_RANGE.", &
315 usage="RC_RANGE {real} ", unit_str="angstrom", default_r_val=0.0_dp)
316 CALL section_add_keyword(section, keyword)
317 CALL keyword_release(keyword)
318
319 END SUBROUTINE create_exchange_section
320
321! **************************************************************************************************
322!> \brief Create the SCREENING se section
323!> \param section the section to create
324!> \date 03.2009
325!> \author Teodoro Laino [tlaino]
326! **************************************************************************************************
327 SUBROUTINE create_screening_section(section)
328 TYPE(section_type), POINTER :: section
329
330 TYPE(keyword_type), POINTER :: keyword
331
332 cpassert(.NOT. ASSOCIATED(section))
333 CALL section_create(section, __location__, name="SCREENING", &
334 description="Setup parameters for the tapering of the Coulomb/Exchange Screening in "// &
335 "KDSO-D integral scheme,", n_keywords=0, n_subsections=1, repeats=.false.)
336 NULLIFY (keyword)
337
338 CALL keyword_create(keyword, __location__, name="RC_TAPER", &
339 description="Atomic Cutoff Radius Cutoff for Tapering the screening term. ", &
340 usage="RC_TAPER {real} ", unit_str="angstrom", &
341 default_r_val=cp_unit_to_cp2k(value=12.0_dp, unit_str="angstrom"))
342 CALL section_add_keyword(section, keyword)
343 CALL keyword_release(keyword)
344
345 CALL keyword_create(keyword, __location__, name="RC_RANGE", &
346 description="Range of cutoff switch function (tapering): 0.5*(1-TANH((r-r0)/RC_RANGE)), "// &
347 "where r0=2*RC_TAPER-20*RC_RANGE.", &
348 usage="RC_RANGE {real} ", unit_str="angstrom", default_r_val=0.0_dp)
349 CALL section_add_keyword(section, keyword)
350 CALL keyword_release(keyword)
351
352 END SUBROUTINE create_screening_section
353
354! **************************************************************************************************
355!> \brief Create the print se section
356!> \param section the section to create
357!> \author teo
358! **************************************************************************************************
359 SUBROUTINE create_se_print_section(section)
360 TYPE(section_type), POINTER :: section
361
362 TYPE(section_type), POINTER :: print_key
363
364 cpassert(.NOT. ASSOCIATED(section))
365 CALL section_create(section, __location__, name="print", &
366 description="Section of possible print options in SE code.", &
367 n_keywords=0, n_subsections=1, repeats=.false.)
368
369 NULLIFY (print_key)
370 CALL cp_print_key_section_create(print_key, __location__, "NEIGHBOR_LISTS", &
371 description="Activates the printing of the neighbor lists used"// &
372 " for the periodic SE calculations.", &
373 print_level=high_print_level, filename="", unit_str="angstrom")
374 CALL section_add_subsection(section, print_key)
375 CALL section_release(print_key)
376
377 CALL cp_print_key_section_create(print_key, __location__, "SUBCELL", &
378 description="Activates the printing of the subcells used for the "// &
379 "generation of neighbor lists for periodic SE.", &
380 print_level=high_print_level, filename="__STD_OUT__")
381 CALL section_add_subsection(section, print_key)
382 CALL section_release(print_key)
383
384 CALL cp_print_key_section_create(print_key, __location__, "EWALD_INFO", &
385 description="Activates the printing of the information for "// &
386 "Ewald multipole summation in periodic SE.", &
387 print_level=high_print_level, filename="__STD_OUT__")
388 CALL section_add_subsection(section, print_key)
389 CALL section_release(print_key)
390
391 END SUBROUTINE create_se_print_section
392
393! **************************************************************************************************
394!> \brief creates the input section for use with the GA part of the code
395!> \param section the section to create
396!> \author Teodoro Laino [tlaino] - University of Zurich - 05.2008
397! **************************************************************************************************
398 SUBROUTINE create_se_ga_section(section)
399 TYPE(section_type), POINTER :: section
400
401 TYPE(keyword_type), POINTER :: keyword
402
403 cpassert(.NOT. ASSOCIATED(section))
404 CALL section_create(section, __location__, name="GA", &
405 description="Sets up memory parameters for the storage of the integrals", &
406 n_keywords=1, n_subsections=0, repeats=.false.)
407 NULLIFY (keyword)
408
409 CALL keyword_create( &
410 keyword, __location__, &
411 name="NCELLS", &
412 description="Defines the number of linked cells for the neighbor list. "// &
413 "Default value is number of processors", &
414 usage="NCELLS 10", &
415 default_i_val=0)
416 CALL section_add_keyword(section, keyword)
417 CALL keyword_release(keyword)
418 END SUBROUTINE create_se_ga_section
419
420! **************************************************************************************************
421!> \brief creates the input section for the se-memory part integral storage
422!> \param section the section to create
423!> \author Teodoro Laino [tlaino] - University of Zurich - 05.2008
424! **************************************************************************************************
425 SUBROUTINE create_se_memory_section(section)
426 TYPE(section_type), POINTER :: section
427
428 TYPE(keyword_type), POINTER :: keyword
429
430 cpassert(.NOT. ASSOCIATED(section))
431 CALL section_create(section, __location__, name="MEMORY", &
432 description="Sets up memory parameters for the storage of the integrals", &
433 n_keywords=1, n_subsections=0, repeats=.false.)
434 NULLIFY (keyword)
435 CALL keyword_create( &
436 keyword, __location__, &
437 name="EPS_STORAGE", &
438 description="Storage threshold for compression is EPS_STORAGE", &
439 usage="EPS_STORAGE 1.0E-10", &
440 default_r_val=1.0e-10_dp)
441 CALL section_add_keyword(section, keyword)
442 CALL keyword_release(keyword)
443
444 CALL keyword_create( &
445 keyword, __location__, &
446 name="MAX_MEMORY", &
447 description="Defines the maximum amount of memory [MB] used to store precomputed "// &
448 "(possibly compressed) two-electron two-center integrals", &
449 usage="MAX_MEMORY 256", &
450 default_i_val=50)
451 CALL section_add_keyword(section, keyword)
452 CALL keyword_release(keyword)
453
454 CALL keyword_create(keyword, __location__, name="COMPRESS", &
455 description="Enables the compression of the integrals in memory.", &
456 usage="COMPRESS <LOGICAL>", &
457 default_l_val=.false., lone_keyword_l_val=.true.)
458 CALL section_add_keyword(section, keyword)
459 CALL keyword_release(keyword)
460
461 END SUBROUTINE create_se_memory_section
462
463END MODULE input_cp2k_se
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer, parameter, public high_print_level
subroutine, public cp_print_key_section_create(print_key_section, location, name, description, print_level, each_iter_names, each_iter_values, add_last, filename, common_iter_levels, citations, unit_str)
creates a print_key section
unit conversion facility
Definition cp_units.F:30
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
Definition cp_units.F:1150
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_se_lr_ewald_gks
integer, parameter, public do_se_lr_none
integer, parameter, public do_se_lr_ewald
integer, parameter, public do_se_is_kdso_d
integer, parameter, public gaussian
integer, parameter, public do_se_lr_ewald_r3
integer, parameter, public do_se_is_kdso
integer, parameter, public do_se_is_slater
integer, parameter, public numerical
integer, parameter, public slater
creates the mm section of the input
subroutine, public create_neighbor_lists_section(section)
This section specifies the input parameters for generation of neighbor lists.
function that build the semi empirical section of the input
subroutine, public create_se_control_section(section)
...
represents keywords in an input
subroutine, public keyword_release(keyword)
releases the given keyword (see doc/ReferenceCounting.html)
subroutine, public keyword_create(keyword, location, name, description, usage, type_of_var, n_var, repeats, variants, default_val, default_l_val, default_r_val, default_lc_val, default_c_val, default_i_val, default_l_vals, default_r_vals, default_c_vals, default_i_vals, lone_keyword_val, lone_keyword_l_val, lone_keyword_r_val, lone_keyword_c_val, lone_keyword_i_val, lone_keyword_l_vals, lone_keyword_r_vals, lone_keyword_c_vals, lone_keyword_i_vals, enum_c_vals, enum_i_vals, enum, enum_strict, enum_desc, unit_str, citations, deprecation_notice, removed)
creates a keyword object
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_create(section, location, name, description, n_keywords, n_subsections, repeats, citations, deprecation_notice)
creates a list of keywords
subroutine, public section_add_keyword(section, keyword)
adds a keyword to the given section
subroutine, public section_add_subsection(section, subsection)
adds a subsection to the given section
recursive subroutine, public section_release(section)
releases the given keyword list (see doc/ReferenceCounting.html)
a wrapper for basic fortran types.
integer, parameter, public real_t
integer, parameter, public char_t
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Utilities for string manipulations.
represent a keyword in the input
represent a section of the input file