51 #include "./base/base_uses.f90"
56 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
57 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_force_eval'
69 TYPE(section_type),
POINTER :: section
71 TYPE(keyword_type),
POINTER :: keyword
72 TYPE(section_type),
POINTER :: subsection
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", &
94 enum_desc=s2a(
"Alias for QUICKSTEP", &
95 "PW DFT using the SIRIUS library", &
96 "Molecular Mechanics", &
97 "Hybrid quantum classical", &
98 "Empirical Interatomic Potential", &
99 "Electronic structure methods (DFT, ...)", &
100 "Neural Network Potentials", &
101 "Use a combination of two of the above", &
102 "Perform an embedded calculation"), &
108 CALL keyword_create(keyword, __location__, name=
"STRESS_TENSOR", &
109 description=
"Controls the calculation of the stress tensor. The combinations defined below"// &
110 " are not implemented for all methods.", &
111 usage=
"stress_tensor (NONE|ANALYTICAL|NUMERICAL|DIAGONAL_ANA|DIAGONAL_NUM)", &
113 enum_c_vals=s2a(
"NONE",
"ANALYTICAL",
"NUMERICAL",
"DIAGONAL_ANALYTICAL",
"DIAGONAL_NUMERICAL"), &
116 enum_desc=s2a(
"Do not compute stress tensor", &
117 "Compute the stress tensor analytically (if available).", &
118 "Compute the stress tensor numerically.", &
119 "Compute the diagonal part only of the stress tensor analytically (if available).", &
120 "Compute the diagonal part only of the stress tensor numerically"))
125 CALL create_ext_pot_section(subsection)
129 CALL create_rescale_force_section(subsection)
177 CALL create_f_env_print_section(subsection)
189 SUBROUTINE create_ext_pot_section(section)
190 TYPE(section_type),
POINTER :: section
192 TYPE(keyword_type),
POINTER :: keyword
194 cpassert(.NOT.
ASSOCIATED(section))
195 CALL section_create(section, __location__, name=
"EXTERNAL_POTENTIAL", &
196 description=
"Section controlling the presence of an external potential dependent "// &
197 "on the atomic positions (X,Y,Z)", &
198 n_keywords=7, n_subsections=0, repeats=.true.)
202 description=
"Specifies the atoms on which the external potential will act", &
203 usage=
"ATOMS_LIST {INT} {INT} ..", repeats=.true., &
209 description=
"Specifies the functional form in mathematical notation. Variables must be the atomic "// &
210 "coordinates (X,Y,Z).", usage=
"FUNCTION X^2+Y^2+Z^2+LOG(ABS(X+Y))", &
216 description=
"Defines the parameters of the functional form", &
217 usage=
"PARAMETERS a b D", type_of_var=
char_t, &
218 n_var=-1, repeats=.true.)
223 description=
"Defines the values of parameter of the functional form", &
224 usage=
"VALUES ", type_of_var=
real_t, &
225 n_var=-1, repeats=.true., unit_str=
"internal_cp2k")
230 description=
"Optionally, allows to define valid CP2K unit strings for each parameter value. "// &
231 "It is assumed that the corresponding parameter value is specified in this unit.", &
232 usage=
"UNITS angstrom eV*angstrom^-1 angstrom^1 K", type_of_var=
char_t, &
233 n_var=-1, repeats=.true.)
238 description=
"Parameter used for computing the derivative with the Ridders' method.", &
239 usage=
"DX <REAL>", default_r_val=0.1_dp, unit_str=
"bohr")
244 description=
"Checks that the error in computing the derivative is not larger than "// &
245 "the value set; in case error is larger a warning message is printed.", &
246 usage=
"ERROR_LIMIT <REAL>", default_r_val=1.0e-12_dp)
250 END SUBROUTINE create_ext_pot_section
257 SUBROUTINE create_rescale_force_section(section)
258 TYPE(section_type),
POINTER :: section
260 TYPE(keyword_type),
POINTER :: keyword
262 cpassert(.NOT.
ASSOCIATED(section))
263 CALL section_create(section, __location__, name=
"RESCALE_FORCES", &
264 description=
"Section controlling the rescaling of forces. Useful when"// &
265 " starting from quite bad geometries with unphysically large forces.", &
266 n_keywords=1, n_subsections=0, repeats=.false.)
270 description=
"Specify the Maximum Values of the force. If the force"// &
271 " of one atom exceed this value it's rescaled to the MAX_FORCE"// &
274 unit_str=
"kcalmol*angstrom^-1"), &
275 unit_str=
"hartree*bohr^-1")
279 END SUBROUTINE create_rescale_force_section
286 SUBROUTINE create_f_env_print_section(section)
287 TYPE(section_type),
POINTER :: section
289 TYPE(keyword_type),
POINTER :: keyword
290 TYPE(section_type),
POINTER :: print_key
295 cpassert(.NOT.
ASSOCIATED(section))
298 description=
"Properties that you want to output and that are common to all methods", &
299 n_keywords=0, n_subsections=5, repeats=.false.)
302 description=
"Controls the printing of basic information generated by force_eval", &
308 description=
"Controls the printing of the forces after each force evaluation", &
312 description=
"Specifies the number of digits used "// &
313 "for the printing of the forces", &
323 print_key, __location__,
"GRID_INFORMATION", &
324 description=
"Controls the printing of information regarding the PW and RS grid structures.", &
330 description=
"Controls the printing of the total number of atoms, kinds,...", &
336 description=
"Controls the printing of the distribution of molecules, atoms, ...", &
342 description=
"Controls the printing of the distribution of matrix blocks, ...", &
348 description=
"Each node prints out its distribution info ...", &
354 description=
"Controls the printing of the stress tensor", &
358 description=
"Print all GPW/GAPW components contributing to the stress tensor", &
359 usage=
"COMPONENTS", &
360 default_l_val=.false., &
361 lone_keyword_l_val=.true.)
368 description=
"Controls the printing of the GRRM interface file", &
374 description=
"Controls the printing of the SCINE interface file", &
379 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.