51#include "./base/base_uses.f90"
56 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
57 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_force_eval'
74 cpassert(.NOT.
ASSOCIATED(section))
76 description=
"parameters needed to calculate energy and forces and"// &
77 " describe the system you want to analyze.", &
78 n_keywords=1, n_subsections=10, repeats=.true.)
83 description=
"Which method should be used to compute forces", &
84 usage=
"METHOD <STRING>", &
85 enum_c_vals=
s2a(
"QS", &
95 enum_desc=
s2a(
"Alias for QUICKSTEP", &
96 "PW DFT using the SIRIUS library", &
97 "Molecular Mechanics", &
98 "Hybrid quantum classical", &
99 "Empirical Interatomic Potential", &
100 "Electronic structure methods (DFT, ...)", &
101 "Neural Network Potentials", &
102 "Use a combination of two of the above", &
103 "Perform an embedded calculation", &
104 –
"Recieve forces from iPI client"), &
105 enum_i_vals=(/
do_qs,
do_sirius,
do_fist,
do_qmmm,
do_eip,
do_qs,
do_nnp,
do_mixed,
do_embed,
do_ipi/), &
110 CALL keyword_create(keyword, __location__, name=
"STRESS_TENSOR", &
111 description=
"Controls the calculation of the stress tensor. The combinations defined below"// &
112 " are not implemented for all methods.", &
113 usage=
"stress_tensor (NONE|ANALYTICAL|NUMERICAL|DIAGONAL_ANA|DIAGONAL_NUM)", &
115 enum_c_vals=
s2a(
"NONE",
"ANALYTICAL",
"NUMERICAL",
"DIAGONAL_ANALYTICAL",
"DIAGONAL_NUMERICAL"), &
118 enum_desc=
s2a(
"Do not compute stress tensor", &
119 "Compute the stress tensor analytically (if available).", &
120 "Compute the stress tensor numerically.", &
121 "Compute the diagonal part only of the stress tensor analytically (if available).", &
122 "Compute the diagonal part only of the stress tensor numerically"))
127 CALL create_ext_pot_section(subsection)
131 CALL create_rescale_force_section(subsection)
179 CALL create_f_env_print_section(subsection)
191 SUBROUTINE create_ext_pot_section(section)
196 cpassert(.NOT.
ASSOCIATED(section))
197 CALL section_create(section, __location__, name=
"EXTERNAL_POTENTIAL", &
198 description=
"Section controlling the presence of an external potential dependent "// &
199 "on the atomic positions (X,Y,Z)", &
200 n_keywords=7, n_subsections=0, repeats=.true.)
204 description=
"Specifies the atoms on which the external potential will act", &
205 usage=
"ATOMS_LIST {INT} {INT} ..", repeats=.true., &
211 description=
"Specifies the functional form in mathematical notation. Variables must be the atomic "// &
212 "coordinates (X,Y,Z).", usage=
"FUNCTION X^2+Y^2+Z^2+LOG(ABS(X+Y))", &
218 description=
"Defines the parameters of the functional form", &
219 usage=
"PARAMETERS a b D", type_of_var=
char_t, &
220 n_var=-1, repeats=.true.)
225 description=
"Defines the values of parameter of the functional form", &
226 usage=
"VALUES ", type_of_var=
real_t, &
227 n_var=-1, repeats=.true., unit_str=
"internal_cp2k")
232 description=
"Optionally, allows to define valid CP2K unit strings for each parameter value. "// &
233 "It is assumed that the corresponding parameter value is specified in this unit.", &
234 usage=
"UNITS angstrom eV*angstrom^-1 angstrom^1 K", type_of_var=
char_t, &
235 n_var=-1, repeats=.true.)
240 description=
"Parameter used for computing the derivative with the Ridders' method.", &
241 usage=
"DX <REAL>", default_r_val=0.1_dp, unit_str=
"bohr")
246 description=
"Checks that the error in computing the derivative is not larger than "// &
247 "the value set; in case error is larger a warning message is printed.", &
248 usage=
"ERROR_LIMIT <REAL>", default_r_val=1.0e-12_dp)
252 END SUBROUTINE create_ext_pot_section
259 SUBROUTINE create_rescale_force_section(section)
264 cpassert(.NOT.
ASSOCIATED(section))
265 CALL section_create(section, __location__, name=
"RESCALE_FORCES", &
266 description=
"Section controlling the rescaling of forces. Useful when"// &
267 " starting from quite bad geometries with unphysically large forces.", &
268 n_keywords=1, n_subsections=0, repeats=.false.)
272 description=
"Specify the Maximum Values of the force. If the force"// &
273 " of one atom exceed this value it's rescaled to the MAX_FORCE"// &
276 unit_str=
"kcalmol*angstrom^-1"), &
277 unit_str=
"hartree*bohr^-1")
281 END SUBROUTINE create_rescale_force_section
288 SUBROUTINE create_f_env_print_section(section)
297 cpassert(.NOT.
ASSOCIATED(section))
301 description=
"Properties that you want to output and that are common to all methods", &
302 n_keywords=0, n_subsections=10, repeats=.false.)
305 name=
"PROGRAM_RUN_INFO", &
306 description=
"Controls the printing of basic information generated by FORCE_EVAL", &
309 name=
"ENERGY_UNIT", &
310 description=
"Specifies the physical unit used for the printing of the total energy. "// &
311 "Note that the meaningfulness of the unit is not checked.", &
312 usage=
"ENERGY_UNIT eV", &
313 default_c_val=
"hartree", &
322 description=
"Controls the printing of the forces after each force evaluation", &
326 description=
"Specifies the number of digits used "// &
327 "for the printing of the forces", &
335 variants=(/
"UNIT"/), &
336 description=
"Specifies the physical unit used for the printing of the forces. "// &
337 "Note that the meaningfulness of the unit is not checked.", &
338 usage=
"FORCE_UNIT eV/angstrom", &
339 default_c_val=
"hartree/bohr", &
347 name=
"GRID_INFORMATION", &
348 description=
"Controls the printing of information regarding the PW and RS grid structures.", &
354 name=
"TOTAL_NUMBERS", &
355 description=
"Controls the printing of the total number of atoms, kinds, ...", &
361 name=
"DISTRIBUTION", &
362 description=
"Controls the printing of the distribution of molecules, atoms, ...", &
368 name=
"DISTRIBUTION2D", &
369 description=
"Controls the printing of the distribution of matrix blocks, ...", &
375 name=
"DISTRIBUTION1D", &
376 description=
"Each node prints out its distribution info ...", &
382 name=
"STRESS_TENSOR", &
383 description=
"Controls the printing of the stress tensor", &
387 description=
"Print all GPW/GAPW components contributing to the stress tensor", &
388 usage=
"COMPONENTS", &
389 default_l_val=.false., &
390 lone_keyword_l_val=.true.)
394 name=
"STRESS_UNIT", &
395 description=
"Specifies the physical unit used for the printing of the stress tensor. "// &
396 "Note that the meaningfulness of the unit is not checked.", &
397 usage=
"STRESS_UNIT kbar", &
398 default_c_val=
"bar", &
407 description=
"Controls the printing of the GRRM interface file", &
414 description=
"Controls the printing of the SCINE interface file", &
419 END SUBROUTINE create_f_env_print_section
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer, parameter, public debug_print_level
integer, parameter, public low_print_level
integer, parameter, public medium_print_level
integer, parameter, public high_print_level
integer, parameter, public add_last_numeric
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
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
Defines the basic variable types.
integer, parameter, public dp
Utilities for string manipulations.