Line data Source code
1 : !--------------------------------------------------------------------------------------------------!
2 : ! CP2K: A general program to perform molecular dynamics simulations !
3 : ! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4 : ! !
5 : ! SPDX-License-Identifier: GPL-2.0-or-later !
6 : !--------------------------------------------------------------------------------------------------!
7 :
8 : ! **************************************************************************************************
9 : !> \brief function that build the dft section of the input
10 : !> \par History
11 : !> 10.2005 moved out of input_cp2k [fawzi]
12 : !> \author fawzi
13 : ! **************************************************************************************************
14 : MODULE input_cp2k_opt
15 : USE cp_output_handling, ONLY: add_last_numeric,&
16 : cp_print_key_section_create,&
17 : high_print_level,&
18 : silent_print_level
19 : USE input_constants, ONLY: &
20 : do_lri_opt_all, do_lri_opt_coeff, do_lri_opt_exps, embed_diff, embed_fa, &
21 : embed_grid_angstrom, embed_grid_bohr, embed_level_shift, embed_none, embed_quasi_newton, &
22 : embed_resp, embed_steep_desc, gaussian
23 : USE input_keyword_types, ONLY: keyword_create,&
24 : keyword_release,&
25 : keyword_type
26 : USE input_section_types, ONLY: section_add_keyword,&
27 : section_add_subsection,&
28 : section_create,&
29 : section_release,&
30 : section_type
31 : USE input_val_types, ONLY: integer_t,&
32 : lchar_t,&
33 : logical_t
34 : USE kinds, ONLY: dp
35 : USE string_utilities, ONLY: s2a
36 : #include "./base/base_uses.f90"
37 :
38 : IMPLICIT NONE
39 : PRIVATE
40 :
41 : CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_opt'
42 :
43 : PUBLIC :: create_optimize_lri_basis_section
44 : PUBLIC :: create_optimize_embed
45 : PUBLIC :: create_optimize_dmfet
46 :
47 : CONTAINS
48 :
49 : ! **************************************************************************************************
50 : !> \brief input section for optimization of the auxililary basis for LRIGPW
51 : !> \param section the section to create
52 : !> \author Dorothea Golze [05.2014]
53 : ! **************************************************************************************************
54 10278 : SUBROUTINE create_optimize_lri_basis_section(section)
55 : TYPE(section_type), POINTER :: section
56 :
57 : TYPE(keyword_type), POINTER :: keyword
58 : TYPE(section_type), POINTER :: subsection
59 :
60 10278 : CPASSERT(.NOT. ASSOCIATED(section))
61 : CALL section_create(section, __LOCATION__, name="OPTIMIZE_LRI_BASIS", &
62 : description="This section specifies the parameters for optimizing "// &
63 : "the lri auxiliary basis sets for LRIGPW. The Powell optimizer is used.", &
64 10278 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
65 :
66 10278 : NULLIFY (keyword, subsection)
67 :
68 : CALL keyword_create(keyword, __LOCATION__, name="ACCURACY", &
69 : description="Target accuracy for the objective function (RHOEND)", &
70 10278 : usage="ACCURACY 5.0E-4", default_r_val=1.0E-5_dp)
71 10278 : CALL section_add_keyword(section, keyword)
72 10278 : CALL keyword_release(keyword)
73 :
74 : CALL keyword_create(keyword, __LOCATION__, name="MAX_FUN", &
75 : description="Maximum number of function evaluations", &
76 10278 : usage="MAX_FUN 200", default_i_val=4000)
77 10278 : CALL section_add_keyword(section, keyword)
78 10278 : CALL keyword_release(keyword)
79 :
80 : CALL keyword_create(keyword, __LOCATION__, name="STEP_SIZE", &
81 : description="Initial step size for search algorithm (RHOBEG)", &
82 10278 : usage="STEP_SIZE 1.0E-1", default_r_val=5.0E-2_dp)
83 10278 : CALL section_add_keyword(section, keyword)
84 10278 : CALL keyword_release(keyword)
85 :
86 : CALL keyword_create(keyword, __LOCATION__, name="CONDITION_WEIGHT", &
87 : description="This keyword allows to give different weight "// &
88 : "factors to the condition number (LOG(cond) is used).", &
89 10278 : usage="CONDITION_WEIGHT 1.0E-4", default_r_val=1.0E-6_dp)
90 10278 : CALL section_add_keyword(section, keyword)
91 10278 : CALL keyword_release(keyword)
92 :
93 : CALL keyword_create(keyword, __LOCATION__, name="USE_CONDITION_NUMBER", &
94 : description="Determines whether condition number should be part "// &
95 : "of optimization or not", &
96 : usage="USE_CONDITION_NUMBER", &
97 10278 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
98 10278 : CALL section_add_keyword(section, keyword)
99 10278 : CALL keyword_release(keyword)
100 :
101 : CALL keyword_create(keyword, __LOCATION__, name="GEOMETRIC_SEQUENCE", &
102 : description="Exponents are assumed to be a geometric sequence. "// &
103 : "Only the minimal and maximal exponents of one set are optimized and "// &
104 : "the other exponents are obtained by geometric progression.", &
105 : usage="GEOMETRIC_SEQUENCE", &
106 10278 : default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
107 10278 : CALL section_add_keyword(section, keyword)
108 10278 : CALL keyword_release(keyword)
109 :
110 : CALL keyword_create(keyword, __LOCATION__, name="DEGREES_OF_FREEDOM", &
111 : description="Specifies the degrees of freedom in the basis "// &
112 : "optimization.", &
113 : usage="DEGREES_OF_FREEDOM ALL", &
114 : enum_c_vals=s2a("ALL", "COEFFICIENTS", "EXPONENTS"), &
115 : enum_desc=s2a("Set all parameters in the basis to be variable.", &
116 : "Set all coefficients in the basis set to be variable.", &
117 : "Set all exponents in the basis to be variable."), &
118 : enum_i_vals=[do_lri_opt_all, do_lri_opt_coeff, do_lri_opt_exps], &
119 10278 : default_i_val=do_lri_opt_exps)
120 10278 : CALL section_add_keyword(section, keyword)
121 10278 : CALL keyword_release(keyword)
122 :
123 10278 : CALL create_constrain_exponents_section(subsection)
124 10278 : CALL section_add_subsection(section, subsection)
125 10278 : CALL section_release(subsection)
126 :
127 10278 : END SUBROUTINE create_optimize_lri_basis_section
128 :
129 : ! **************************************************************************************************
130 : !> \brief Input for DFT embedding
131 : !> \param section ...
132 : !> \author Vladimir Rybkin [08.2017]
133 : ! **************************************************************************************************
134 10278 : SUBROUTINE create_optimize_embed(section)
135 : TYPE(section_type), POINTER :: section
136 :
137 : TYPE(keyword_type), POINTER :: keyword
138 :
139 10278 : CPASSERT(.NOT. ASSOCIATED(section))
140 : CALL section_create(section, __LOCATION__, name="OPT_EMBED", &
141 : description="This section specifies optional parameters for DFT embedding potential optimization.", &
142 10278 : n_keywords=19, n_subsections=4, repeats=.FALSE.)
143 :
144 10278 : NULLIFY (keyword)
145 :
146 : CALL keyword_create(keyword, __LOCATION__, name="REG_LAMBDA", &
147 : description="Parameter for Yang's regularization "// &
148 : "involving kinetic matrix.", &
149 10278 : usage="REG_LAMBDA 0.0001", default_r_val=0.0001_dp)
150 10278 : CALL section_add_keyword(section, keyword)
151 10278 : CALL keyword_release(keyword)
152 :
153 : CALL keyword_create(keyword, __LOCATION__, name="N_ITER", &
154 : description="Maximum number of iterations "// &
155 : "in the optimization procedure.", &
156 10278 : usage="N_ITER 75", default_i_val=50)
157 10278 : CALL section_add_keyword(section, keyword)
158 10278 : CALL keyword_release(keyword)
159 :
160 : CALL keyword_create(keyword, __LOCATION__, name="TRUST_RAD", &
161 : description="Maximum number of iterations "// &
162 : "in the optimization procedure.", &
163 10278 : usage="TRUST_RAD 0.5", default_r_val=0.5_dp)
164 10278 : CALL section_add_keyword(section, keyword)
165 10278 : CALL keyword_release(keyword)
166 :
167 : CALL keyword_create(keyword, __LOCATION__, name="DENS_CONV_MAX", &
168 : description="Convergence criterion for "// &
169 : "the maximum electron density difference.", &
170 10278 : usage="DENS_CONV_MAX 0.01", default_r_val=0.01_dp)
171 10278 : CALL section_add_keyword(section, keyword)
172 10278 : CALL keyword_release(keyword)
173 :
174 : CALL keyword_create(keyword, __LOCATION__, name="DENS_CONV_INT", &
175 : description="Convergence criterion for "// &
176 : "the integrated electron density difference.", &
177 10278 : usage="DENS_CONV_INT 0.1", default_r_val=0.1_dp)
178 10278 : CALL section_add_keyword(section, keyword)
179 10278 : CALL keyword_release(keyword)
180 :
181 : CALL keyword_create(keyword, __LOCATION__, name="SPIN_DENS_CONV_MAX", &
182 : description="Convergence criterion for "// &
183 : "the maximum electron density difference.", &
184 10278 : usage="SPIN_DENS_CONV_MAX 0.01", default_r_val=0.01_dp)
185 10278 : CALL section_add_keyword(section, keyword)
186 10278 : CALL keyword_release(keyword)
187 :
188 : CALL keyword_create(keyword, __LOCATION__, name="SPIN_DENS_CONV_INT", &
189 : description="Convergence criterion for "// &
190 : "the integrated electron density difference.", &
191 10278 : usage="SPIN_DENS_CONV_INT 0.1", default_r_val=0.1_dp)
192 10278 : CALL section_add_keyword(section, keyword)
193 10278 : CALL keyword_release(keyword)
194 :
195 : CALL keyword_create(keyword, __LOCATION__, name="OPTIMIZER", &
196 : description="Optimize embedding potential.", &
197 : usage="OPTIMIZER LEVEL_SHIFT", &
198 : default_i_val=embed_steep_desc, &
199 : enum_c_vals=s2a("STEEPEST_DESCENT", "QUASI_NEWTON", "LEVEL_SHIFT"), &
200 : enum_desc=s2a("Steepest descent.", "Quasi-Newton.", "Level shift."), &
201 10278 : enum_i_vals=[embed_steep_desc, embed_quasi_newton, embed_level_shift])
202 10278 : CALL section_add_keyword(section, keyword)
203 10278 : CALL keyword_release(keyword)
204 :
205 : CALL keyword_create(keyword, __LOCATION__, name="GRID_OPT", &
206 : description="Optimize embedding potential on the grid. ", &
207 : usage="GRID_OPT .TRUE.", &
208 10278 : default_l_val=.TRUE.)
209 10278 : CALL section_add_keyword(section, keyword)
210 10278 : CALL keyword_release(keyword)
211 :
212 : CALL keyword_create(keyword, __LOCATION__, name="LEEUWEN-BAERENDS", &
213 : description="Van Leeuwen-Baerends iterative update. Alternative to Wu-Yang "// &
214 : "optimizer. Use only with ADD_CONTST_POT.", &
215 : usage="LEEUWEN-BAERENDS .TRUE.", &
216 10278 : default_l_val=.FALSE.)
217 10278 : CALL section_add_keyword(section, keyword)
218 10278 : CALL keyword_release(keyword)
219 :
220 : CALL keyword_create(keyword, __LOCATION__, name="FAB", &
221 : description="Finzel-Ayers-Bultinck iterative update. Generally, not reliable. ", &
222 : usage="FAB .TRUE.", &
223 10278 : default_l_val=.FALSE.)
224 10278 : CALL section_add_keyword(section, keyword)
225 10278 : CALL keyword_release(keyword)
226 :
227 : CALL keyword_create(keyword, __LOCATION__, name="VW_CUTOFF", &
228 : description="Cutoff for von Weizsacker potential in "// &
229 : "the FAB optimization procedure.", &
230 10278 : usage="VW_CUTOFF 0.01", default_r_val=0.01_dp)
231 10278 : CALL section_add_keyword(section, keyword)
232 10278 : CALL keyword_release(keyword)
233 :
234 : CALL keyword_create(keyword, __LOCATION__, name="VW_SMOOTH_CUT_RANGE", &
235 : description="Smooth cutoff range for von Weizsacker potential in "// &
236 : "the FAB optimization procedure.", &
237 10278 : usage="VW_SMOOTH_CUT_RANGE 1.0", default_r_val=1.0_dp)
238 10278 : CALL section_add_keyword(section, keyword)
239 10278 : CALL keyword_release(keyword)
240 :
241 : CALL keyword_create(keyword, __LOCATION__, name="POT_GUESS", &
242 : description="Specifies the guess of the embedding "// &
243 : "potential. For optimization in finite basis (not grid optimization) "// &
244 : "in is a constant part to be added to the one in finite basis. ", &
245 : usage="POT_GUESS NONE", &
246 : enum_c_vals=s2a("NONE", "DIFF", "Fermi_Amaldi", "RESP"), &
247 : enum_desc=s2a("Initial guess is zero grid.", &
248 : "Initial density difference. A euristic but working approach.", &
249 : "Fermi-Amaldi potential. More rigorous than DIFF, although less efficient.", &
250 : "Coulomb interaction between the subsystem using RESP charges)"// &
251 : " on the total system."), &
252 : enum_i_vals=[embed_none, embed_diff, embed_fa, embed_resp], &
253 10278 : default_i_val=embed_none)
254 10278 : CALL section_add_keyword(section, keyword)
255 10278 : CALL keyword_release(keyword)
256 :
257 : CALL keyword_create(keyword, __LOCATION__, name="CHARGE_DISTR_WIDTH", &
258 : description="Width of the Gaussian representing "// &
259 : "point charges. To be used with ADD_COULOMB_POT.", &
260 10278 : usage="CHARGE_DISTR_WIDTH 3.000", default_r_val=1.12490_dp)
261 10278 : CALL section_add_keyword(section, keyword)
262 10278 : CALL keyword_release(keyword)
263 :
264 : CALL keyword_create(keyword, __LOCATION__, name="READ_EMBED_POT", &
265 : description="Read the embedding potential "// &
266 : "restart vector as a guess.", &
267 10278 : usage="READ_EMBED_POT .FALSE.", default_l_val=.FALSE.)
268 10278 : CALL section_add_keyword(section, keyword)
269 10278 : CALL keyword_release(keyword)
270 :
271 : CALL keyword_create(keyword, __LOCATION__, name="READ_EMBED_POT_CUBE", &
272 : description="Read the embedding potential "// &
273 : "(restart) from the cube file. Whitespace-separated cube values are accepted. If "// &
274 : "adjacent values are written without whitespace, each value must occupy a "// &
275 : "13-character E13.5 field, as in CP2K-generated cube files.", &
276 10278 : usage="READ_EMBED_POT_CUBE .FALSE.", default_l_val=.FALSE.)
277 10278 : CALL section_add_keyword(section, keyword)
278 10278 : CALL keyword_release(keyword)
279 :
280 : CALL keyword_create(keyword, __LOCATION__, name="EMBED_RESTART_FILE_NAME", &
281 : description="Root of the file name where to read the embedding "// &
282 : "potential guess.", &
283 : usage="EMBED_RESTART_FILE_NAME <FILENAME>", &
284 10278 : type_of_var=lchar_t)
285 10278 : CALL section_add_keyword(section, keyword)
286 10278 : CALL keyword_release(keyword)
287 :
288 : CALL keyword_create(keyword, __LOCATION__, name="EMBED_CUBE_FILE_NAME", &
289 : description="Root of the file name where to read the embedding "// &
290 : "potential (guess) as a cube. Whitespace-separated cube values are accepted. If "// &
291 : "adjacent values are written without whitespace, each value must occupy a "// &
292 : "13-character E13.5 field, as in CP2K-generated cube files.", &
293 : usage="EMBED_CUBE_FILE_NAME <FILENAME>", &
294 10278 : type_of_var=lchar_t)
295 10278 : CALL section_add_keyword(section, keyword)
296 10278 : CALL keyword_release(keyword)
297 :
298 : CALL keyword_create(keyword, __LOCATION__, name="EMBED_SPIN_CUBE_FILE_NAME", &
299 : description="Root of the file name where to read the spin part "// &
300 : "of the embedding potential (guess) as a cube. Whitespace-separated cube values are "// &
301 : "accepted. If adjacent values are written without whitespace, each value must occupy "// &
302 : "a 13-character E13.5 field, as in CP2K-generated cube files.", &
303 : usage="EMBED_SPIN_CUBE_FILE_NAME <FILENAME>", &
304 10278 : type_of_var=lchar_t)
305 10278 : CALL section_add_keyword(section, keyword)
306 10278 : CALL keyword_release(keyword)
307 :
308 10278 : CALL create_print_embed_diff(section)
309 :
310 10278 : CALL create_print_embed_pot_cube(section)
311 :
312 10278 : CALL create_print_embed_restart_vec(section)
313 :
314 10278 : CALL create_print_simple_grid(section)
315 :
316 10278 : END SUBROUTINE create_optimize_embed
317 :
318 : ! **************************************************************************************************
319 : !> \brief Input for density matrix functional embedding, DMFET
320 : !> \param section ...
321 : !> \author Vladimir Rybkin [08.2018]
322 : ! **************************************************************************************************
323 10278 : SUBROUTINE create_optimize_dmfet(section)
324 : TYPE(section_type), POINTER :: section
325 :
326 : TYPE(keyword_type), POINTER :: keyword
327 :
328 10278 : CPASSERT(.NOT. ASSOCIATED(section))
329 : CALL section_create(section, __LOCATION__, name="OPT_DMFET", &
330 : description="This section specifies optional parameters for DMFET matrix potential optimization.", &
331 10278 : n_keywords=8, n_subsections=4, repeats=.FALSE.)
332 :
333 10278 : NULLIFY (keyword)
334 :
335 : CALL keyword_create(keyword, __LOCATION__, name="N_ITER", &
336 : description="Maximum number of iterations "// &
337 : "in the optimization procedure.", &
338 10278 : usage="N_ITER 75", default_i_val=50)
339 10278 : CALL section_add_keyword(section, keyword)
340 10278 : CALL keyword_release(keyword)
341 :
342 : CALL keyword_create(keyword, __LOCATION__, name="TRUST_RAD", &
343 : description="Step length "// &
344 : "in the optimization procedure.", &
345 10278 : usage="TRUST_RAD 0.5", default_r_val=0.5_dp)
346 10278 : CALL section_add_keyword(section, keyword)
347 10278 : CALL keyword_release(keyword)
348 :
349 : CALL keyword_create(keyword, __LOCATION__, name="DM_CONV_MAX", &
350 : description="Convergence criterion for "// &
351 : "the maximum element of density matrix difference.", &
352 10278 : usage="DM_CONV_MAX 0.01", default_r_val=0.01_dp)
353 10278 : CALL section_add_keyword(section, keyword)
354 10278 : CALL keyword_release(keyword)
355 :
356 : CALL keyword_create(keyword, __LOCATION__, name="DM_CONV_INT", &
357 : description="Convergence criterion for "// &
358 : "the total density matrix difference.", &
359 10278 : usage="DM_CONV_INT 0.1", default_r_val=0.1_dp)
360 10278 : CALL section_add_keyword(section, keyword)
361 10278 : CALL keyword_release(keyword)
362 :
363 : CALL keyword_create(keyword, __LOCATION__, name="BETA_DM_CONV_MAX", &
364 : description="Convergence criterion for "// &
365 : "the maximum element of the beta-spin density "// &
366 : "matrix difference.", &
367 10278 : usage="BETA_DM_CONV_MAX 0.01", default_r_val=0.01_dp)
368 10278 : CALL section_add_keyword(section, keyword)
369 10278 : CALL keyword_release(keyword)
370 :
371 : CALL keyword_create(keyword, __LOCATION__, name="BETA_DM_CONV_INT", &
372 : description="Convergence criterion for "// &
373 : "the total beta-spin density matrix difference.", &
374 10278 : usage="BETA_DM_CONV_INT 0.1", default_r_val=0.1_dp)
375 10278 : CALL section_add_keyword(section, keyword)
376 10278 : CALL keyword_release(keyword)
377 :
378 : CALL keyword_create(keyword, __LOCATION__, name="READ_DMFET_POT", &
379 : description="Read the matrix embedding potential "// &
380 : "(restart) from the cube file.", &
381 10278 : usage="READ_DMFET_POT .FALSE.", default_l_val=.FALSE.)
382 10278 : CALL section_add_keyword(section, keyword)
383 10278 : CALL keyword_release(keyword)
384 :
385 : CALL keyword_create(keyword, __LOCATION__, name="DMFET_RESTART_FILE_NAME", &
386 : description="Root of the file name where to read the matrix "// &
387 : "potential guess.", &
388 : usage="DMFET_RESTART_FILE_NAME <FILENAME>", &
389 10278 : type_of_var=lchar_t)
390 10278 : CALL section_add_keyword(section, keyword)
391 10278 : CALL keyword_release(keyword)
392 :
393 10278 : END SUBROUTINE create_optimize_dmfet
394 :
395 : ! **************************************************************************************************
396 : !> \brief ...
397 : !> \param section ...
398 : ! **************************************************************************************************
399 10278 : SUBROUTINE create_print_embed_diff(section)
400 : TYPE(section_type), POINTER :: section
401 :
402 : TYPE(keyword_type), POINTER :: keyword
403 : TYPE(section_type), POINTER :: print_key
404 :
405 10278 : NULLIFY (print_key, keyword)
406 : CALL cp_print_key_section_create(print_key, __LOCATION__, "EMBED_DENS_DIFF", &
407 : description="Controls the printing of cube files with "// &
408 : "embedding densisty differences", &
409 10278 : print_level=high_print_level, add_last=add_last_numeric, filename="")
410 : CALL keyword_create(keyword, __LOCATION__, name="stride", &
411 : description="The stride (X,Y,Z) used to write the cube file "// &
412 : "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
413 : " 1 number valid for all components.", &
414 10278 : usage="STRIDE 2 2 2", n_var=-1, default_i_vals=[2, 2, 2], type_of_var=integer_t)
415 10278 : CALL section_add_keyword(print_key, keyword)
416 10278 : CALL keyword_release(keyword)
417 :
418 10278 : CALL section_add_subsection(section, print_key)
419 10278 : CALL section_release(print_key)
420 :
421 10278 : END SUBROUTINE create_print_embed_diff
422 :
423 : ! **************************************************************************************************
424 : !> \brief ...
425 : !> \param section ...
426 : ! **************************************************************************************************
427 10278 : SUBROUTINE create_print_embed_pot_cube(section)
428 : TYPE(section_type), POINTER :: section
429 :
430 : TYPE(keyword_type), POINTER :: keyword
431 : TYPE(section_type), POINTER :: print_key
432 :
433 10278 : NULLIFY (print_key, keyword)
434 : CALL cp_print_key_section_create(print_key, __LOCATION__, "EMBED_POT_CUBE", &
435 : description="Controls the printing of cube files with "// &
436 : "with embedding potential", &
437 10278 : print_level=high_print_level, add_last=add_last_numeric, filename="")
438 : CALL keyword_create(keyword, __LOCATION__, name="stride", &
439 : description="The stride (X,Y,Z) used to write the cube file "// &
440 : "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
441 : " 1 number valid for all components.", &
442 10278 : usage="STRIDE 1 1 1", n_var=-1, default_i_vals=[1, 1, 1], type_of_var=integer_t)
443 10278 : CALL section_add_keyword(print_key, keyword)
444 10278 : CALL keyword_release(keyword)
445 :
446 10278 : CALL section_add_subsection(section, print_key)
447 10278 : CALL section_release(print_key)
448 :
449 10278 : END SUBROUTINE create_print_embed_pot_cube
450 :
451 : ! **************************************************************************************************
452 : !> \brief ...
453 : !> \param section ...
454 : ! **************************************************************************************************
455 10278 : SUBROUTINE create_print_embed_restart_vec(section)
456 : TYPE(section_type), POINTER :: section
457 :
458 : TYPE(section_type), POINTER :: print_key
459 :
460 10278 : NULLIFY (print_key)
461 : CALL cp_print_key_section_create(print_key, __LOCATION__, "EMBED_POT_VECTOR", &
462 : description="Controls the printing of cube files with "// &
463 : "with embedding potential", &
464 10278 : print_level=silent_print_level, add_last=add_last_numeric, filename="")
465 10278 : CALL section_add_subsection(section, print_key)
466 10278 : CALL section_release(print_key)
467 :
468 10278 : END SUBROUTINE create_print_embed_restart_vec
469 :
470 : ! **************************************************************************************************
471 : !> \brief ...
472 : !> \param section ...
473 : ! **************************************************************************************************
474 10278 : SUBROUTINE create_print_simple_grid(section)
475 : TYPE(section_type), POINTER :: section
476 :
477 : TYPE(keyword_type), POINTER :: keyword
478 : TYPE(section_type), POINTER :: print_key
479 :
480 10278 : NULLIFY (print_key, keyword)
481 : CALL cp_print_key_section_create(print_key, __LOCATION__, "WRITE_SIMPLE_GRID", &
482 : description="Controls the printing of simple grid "// &
483 : "files with embedding potential: X Y Z value", &
484 10278 : print_level=high_print_level, add_last=add_last_numeric, filename="")
485 :
486 : CALL keyword_create(keyword, __LOCATION__, name="STRIDE", &
487 : description="The stride (X,Y,Z) used to write the cube file "// &
488 : "(larger values result in smaller cube files). You can provide 3 numbers (for X,Y,Z) or"// &
489 : " 1 number valid for all components.", &
490 10278 : usage="STRIDE 1 1 1", n_var=-1, default_i_vals=[1, 1, 1], type_of_var=integer_t)
491 10278 : CALL section_add_keyword(print_key, keyword)
492 10278 : CALL keyword_release(keyword)
493 :
494 : CALL keyword_create(keyword, __LOCATION__, name="UNITS", &
495 : description="Units of the volumetric file: Angstrom or Bohr.", &
496 : usage="UNITS BOHR", &
497 : default_i_val=embed_grid_bohr, &
498 : enum_c_vals=s2a("BOHR", "ANGSTROM"), &
499 : enum_desc=s2a("Atomic units: Bohr", "Metric units: Angstrom."), &
500 10278 : enum_i_vals=[embed_grid_bohr, embed_grid_angstrom])
501 10278 : CALL section_add_keyword(print_key, keyword)
502 10278 : CALL keyword_release(keyword)
503 :
504 : CALL keyword_create(keyword, __LOCATION__, name="FOLD_COORD", &
505 : description="Activates printing folded coordinates corresponding "// &
506 : "to the simple grid. Used as input for external programs.", &
507 : usage="FOLD_COORD .TRUE.", n_var=1, type_of_var=logical_t, &
508 10278 : default_l_val=.TRUE., lone_keyword_l_val=.TRUE.)
509 10278 : CALL section_add_keyword(print_key, keyword)
510 :
511 10278 : CALL keyword_release(keyword)
512 10278 : CALL section_add_subsection(section, print_key)
513 10278 : CALL section_release(print_key)
514 :
515 10278 : END SUBROUTINE create_print_simple_grid
516 :
517 : ! **************************************************************************************************
518 : !> \brief input section for constraints for auxiliary basis set optimization
519 : !> \param section the section to create
520 : !> \author Dorothea Golze [11.2014]
521 : ! **************************************************************************************************
522 10278 : SUBROUTINE create_constrain_exponents_section(section)
523 : TYPE(section_type), POINTER :: section
524 :
525 : TYPE(keyword_type), POINTER :: keyword
526 :
527 : CALL section_create(section, __LOCATION__, name="CONSTRAIN_EXPONENTS", &
528 : description="specifies constraints for the exponents of the "// &
529 : "lri auxiliary basis sets in the optimization.", &
530 10278 : n_keywords=1, n_subsections=0, repeats=.FALSE.)
531 :
532 10278 : NULLIFY (keyword)
533 :
534 : CALL keyword_create(keyword, __LOCATION__, name="SCALE", &
535 : description="Defines the upper and lower boundaries as "// &
536 : "(1+scale)*exp and (1-scale)*exp. Fermi-like constraint "// &
537 : "function", &
538 10278 : usage="SCALE 0.3", default_r_val=0.3_dp)
539 10278 : CALL section_add_keyword(section, keyword)
540 10278 : CALL keyword_release(keyword)
541 :
542 : CALL keyword_create(keyword, __LOCATION__, name="FERMI_EXP", &
543 : description="Exponent in the fermi-like constraint function. ", &
544 10278 : usage="FERMI_EXP 2.63", default_r_val=2.63391_dp)
545 10278 : CALL section_add_keyword(section, keyword)
546 10278 : CALL keyword_release(keyword)
547 :
548 10278 : END SUBROUTINE create_constrain_exponents_section
549 :
550 : END MODULE input_cp2k_opt
|