(git:6344619)
Loading...
Searching...
No Matches
input_cp2k_check.F
Go to the documentation of this file.
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 checks the input and perform some automatic "magic" on it
10!> \par History
11!> 01.2006 created [fawzi]
12!> \author fawzi
13! **************************************************************************************************
15 USE cell_types, ONLY: use_perd_none
21 USE cp_units, ONLY: cp_unit_set_create,&
24 USE input_constants, ONLY: &
33 USE input_section_types, ONLY: &
38 USE input_val_types, ONLY: logical_t
39 USE kinds, ONLY: default_path_length,&
41 dp
45#include "./base/base_uses.f90"
46
47 IMPLICIT NONE
48 PRIVATE
49
50 LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .true.
51 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_check'
52
54
55CONTAINS
56
57! **************************************************************************************************
58!> \brief performs further checks on an input that parsed successfully
59!> \param input_declaration ...
60!> \param input_file the parsed input
61!> \param para_env ...
62!> \param output_unit ...
63!> \author fawzi
64!> \note
65!> at the moment does nothing
66! **************************************************************************************************
67 SUBROUTINE check_cp2k_input(input_declaration, input_file, para_env, output_unit)
68 TYPE(section_type), POINTER :: input_declaration
69 TYPE(section_vals_type), POINTER :: input_file
70 TYPE(mp_para_env_type), POINTER :: para_env
71 INTEGER, INTENT(IN), OPTIONAL :: output_unit
72
73 CHARACTER(len=*), PARAMETER :: routinen = 'check_cp2k_input'
74
75 INTEGER :: force_eval_method, handle, iforce_eval, &
76 nforce_eval, run_type
77 LOGICAL :: apply_ext_potential, do_center, &
78 explicit, explicit_embed, explicit_mix
79 TYPE(section_vals_type), POINTER :: section, section1, section2, section3, &
80 section4, sections
81
82 CALL timeset(routinen, handle)
83 cpassert(ASSOCIATED(input_file))
84 cpassert(input_file%ref_count > 0)
85 ! ext_restart
86 IF (PRESENT(output_unit)) THEN
87 CALL handle_ext_restart(input_declaration, input_file, para_env, output_unit)
88 END IF
89
90 ! checks on force_eval section
91 sections => section_vals_get_subs_vals(input_file, "FORCE_EVAL")
92 CALL section_vals_get(sections, n_repetition=nforce_eval)
93
94 ! multiple force_eval only if present RESPA, or MIXED or EMBED calculation is performed
95 section2 => section_vals_get_subs_vals(input_file, "MOTION%MD%RESPA")
96 CALL section_vals_get(section2, explicit=explicit)
97 DO iforce_eval = 1, nforce_eval
98 section3 => section_vals_get_subs_vals(sections, "MIXED", &
99 i_rep_section=iforce_eval)
100 CALL section_vals_get(section3, explicit=explicit_mix)
101 IF (explicit_mix) EXIT
102 END DO
103 DO iforce_eval = 1, nforce_eval
104 section4 => section_vals_get_subs_vals(sections, "EMBED", &
105 i_rep_section=iforce_eval)
106 CALL section_vals_get(section4, explicit=explicit_embed)
107 IF (explicit_embed) EXIT
108 END DO
109 ! also allow multiple force_eval for NEGF run
110 CALL section_vals_val_get(input_file, "GLOBAL%RUN_TYPE", i_val=run_type)
111
112 IF (((explicit .AND. (nforce_eval == 1)) .OR. (.NOT. explicit .AND. (nforce_eval > 1))) .AND. run_type /= negf_run) THEN
113 IF ((explicit_mix .AND. (nforce_eval == 1)) .OR. (.NOT. explicit_mix .AND. (nforce_eval > 1))) THEN
114 IF ((explicit_embed .AND. (nforce_eval == 1)) .OR. (.NOT. explicit_embed .AND. (nforce_eval > 1))) THEN
115 CALL cp_abort(__location__, &
116 "Error multiple force_env without RESPA or MIXED or EMBED, or RESPA with one single "// &
117 "or MIXED with only two force_env section.")
118 END IF
119 END IF
120 END IF
121 DO iforce_eval = 1, nforce_eval
122 section => section_vals_get_subs_vals3(sections, "DFT", i_rep_section=iforce_eval)
123 ! xc: expand and fix default for tddfpt
124 section1 => section_vals_get_subs_vals(section, "XC")
125 section2 => section_vals_get_subs_vals(section, "XC%XC_FUNCTIONAL")
126 CALL xc_functionals_expand(section2, section1)
127 section1 => section_vals_get_subs_vals(section, "XAS_TDP%KERNEL")
128 section2 => section_vals_get_subs_vals(section, "XAS_TDP%KERNEL%XC_FUNCTIONAL")
129 CALL xc_functionals_expand(section2, section1)
130 section1 => section_vals_get_subs_vals(sections, "PROPERTIES%RIXS%XAS_TDP%KERNEL")
131 section2 => section_vals_get_subs_vals(sections, "PROPERTIES%RIXS%XAS_TDP%KERNEL%XC_FUNCTIONAL")
132 CALL xc_functionals_expand(section2, section1)
133 section1 => section_vals_get_subs_vals(section, "ACTIVE_SPACE%XC")
134 section2 => section_vals_get_subs_vals(section, "ACTIVE_SPACE%XC%XC_FUNCTIONAL")
135 CALL xc_functionals_expand(section2, section1)
136 CALL check_properties_bse(sections, iforce_eval)
137 END DO
138
139 ! additional checks for a MiMiC run
140 IF (run_type == mimic_run) THEN
141 ! disable CENTER_COORDINATES
142 CALL section_vals_val_get(sections, "SUBSYS%TOPOLOGY%CENTER_COORDINATES%_SECTION_PARAMETERS_", &
143 l_val=do_center)
144 IF (do_center) THEN
145 CALL section_vals_val_set(sections, &
146 "SUBSYS%TOPOLOGY%CENTER_COORDINATES%_SECTION_PARAMETERS_", &
147 l_val=.false.)
148 cpwarn("Turning off CENTER_COORDINATES for a MiMiC run.")
149 END IF
150
151 ! do not allow the use of external potential
152 section => section_vals_get_subs_vals(sections, "DFT%EXTERNAL_POTENTIAL")
153 CALL section_vals_get(section, explicit=apply_ext_potential)
154 IF (apply_ext_potential) THEN
155 cpabort("The EXTERNAL_POTENTIAL section is not allowed for the MiMiC runtype.")
156 END IF
157
158 ! force eval methods supported with MiMiC
159 CALL section_vals_val_get(sections, "METHOD", i_val=force_eval_method)
160 IF (force_eval_method /= do_qs) THEN
161 cpabort("At the moment, only Quickstep method is supported with MiMiC.")
162 END IF
163 END IF
164
165 CALL timestop(handle)
166 END SUBROUTINE check_cp2k_input
167
168! **************************************************************************************************
169!> \brief Refuses, before the SCF, the input combinations PROPERTIES%BSE cannot run: no GW in
170!> PROPERTIES%BANDSTRUCTURE, its RI_RS, a periodic cell, k-points beyond Gamma, an RTBSE in the
171!> same run, NTO cubes (the GW releases the SCF grids they are collocated on)
172!> \param force_env_sections the FORCE_EVAL sections
173!> \param iforce_eval the repetition checked
174! **************************************************************************************************
175 SUBROUTINE check_properties_bse(force_env_sections, iforce_eval)
176 TYPE(section_vals_type), POINTER :: force_env_sections
177 INTEGER, INTENT(IN) :: iforce_eval
178
179 INTEGER :: n_special_kp, periodic, print_level_nto, &
180 rtp_method
181 INTEGER, DIMENSION(:), POINTER :: nkp_grid_dos
182 LOGICAL :: cube_files, do_bse, do_gw, do_ri_rs
183 TYPE(section_vals_type), POINTER :: bs_sec, bse_sec, dft_sec, gw_sec, &
184 properties_sec, subsys_sec
185
186 NULLIFY (bs_sec, bse_sec, dft_sec, gw_sec, nkp_grid_dos, properties_sec, subsys_sec)
187 properties_sec => section_vals_get_subs_vals3(force_env_sections, "PROPERTIES", i_rep_section=iforce_eval)
188 bse_sec => section_vals_get_subs_vals(properties_sec, "BSE")
189 CALL section_vals_get(bse_sec, explicit=do_bse)
190 IF (.NOT. do_bse) RETURN
191
192 bs_sec => section_vals_get_subs_vals(properties_sec, "BANDSTRUCTURE")
193 gw_sec => section_vals_get_subs_vals(bs_sec, "GW")
194 CALL section_vals_get(gw_sec, explicit=do_gw)
195 IF (.NOT. do_gw) cpabort("PROPERTIES%BSE needs PROPERTIES%BANDSTRUCTURE%GW")
196 ! the BSE kernel is built from the three-center RI integrals, which RI_RS replaces by a grid
197 CALL section_vals_val_get(gw_sec, "RI_RS%_SECTION_PARAMETERS_", l_val=do_ri_rs)
198 IF (do_ri_rs) THEN
199 CALL cp_abort(__location__, &
200 "PROPERTIES%BSE needs the three-center RI integrals of the GW: remove the "// &
201 "RI_RS subsection from PROPERTIES%BANDSTRUCTURE%GW")
202 END IF
203 subsys_sec => section_vals_get_subs_vals3(force_env_sections, "SUBSYS", i_rep_section=iforce_eval)
204 CALL section_vals_val_get(subsys_sec, "CELL%PERIODIC", i_val=periodic)
205 IF (periodic /= use_perd_none) THEN
206 CALL cp_abort(__location__, &
207 "The BSE treats non-periodic systems only: PROPERTIES%BSE needs "// &
208 "PERIODIC NONE in the CELL section")
209 END IF
210 ! the BSE reads the MOs and the GW energies at the Gamma point, the only k-point of a
211 ! non-periodic run unless a band path or a DOS k-grid adds more
212 CALL section_vals_val_get(bs_sec, "BANDSTRUCTURE_PATH%SPECIAL_POINT", n_rep_val=n_special_kp)
213 CALL section_vals_val_get(bs_sec, "DOS%KPOINTS", i_vals=nkp_grid_dos)
214 IF (n_special_kp > 0 .OR. any(nkp_grid_dos > 1)) THEN
215 CALL cp_abort(__location__, &
216 "PROPERTIES%BSE needs the Gamma point only: remove BANDSTRUCTURE_PATH and "// &
217 "DOS%KPOINTS from PROPERTIES%BANDSTRUCTURE")
218 END IF
219 ! both read the W(0) and the neighbour list the GW keeps, and PROPERTIES%BSE frees them
220 dft_sec => section_vals_get_subs_vals3(force_env_sections, "DFT", i_rep_section=iforce_eval)
221 CALL section_vals_val_get(dft_sec, "REAL_TIME_PROPAGATION%RTBSE%_SECTION_PARAMETERS_", i_val=rtp_method)
222 IF (rtp_method == rtp_method_bse .OR. rtp_method == rtp_method_bse_linearized) THEN
223 CALL cp_abort(__location__, &
224 "PROPERTIES%BSE and DFT%REAL_TIME_PROPAGATION%RTBSE may not share a run: "// &
225 "remove one of the two sections")
226 END IF
227 ! the GW releases the SCF grids at its init; the NTO cube writer collocates on them
228 ! (CUBE_FILES defaults to true; the print key's level is the switch, OFF encoded as
229 ! debug_print_level + 1, read as read_bse_section reads it)
230 CALL section_vals_val_get(bse_sec, "NTO_ANALYSIS%_SECTION_PARAMETERS_", i_val=print_level_nto)
231 CALL section_vals_val_get(bse_sec, "NTO_ANALYSIS%CUBE_FILES", l_val=cube_files)
232 IF (print_level_nto /= debug_print_level + 1 .AND. cube_files) THEN
233 CALL cp_abort(__location__, &
234 "PROPERTIES%BSE runs after the GW released the SCF grids: set "// &
235 "NTO_ANALYSIS%CUBE_FILES to F, or write the cubes from the BSE of "// &
236 "XC%WF_CORRELATION%RI_RPA%GW")
237 END IF
238
239 END SUBROUTINE check_properties_bse
240
241! **************************************************************************************************
242!> \brief expand a shortcutted functional section
243!> \param functionals the functional section to expand
244!> \param xc_section ...
245!> \author fawzi
246! **************************************************************************************************
247 SUBROUTINE xc_functionals_expand(functionals, xc_section)
248 TYPE(section_vals_type), POINTER :: functionals, xc_section
249
250 CHARACTER(LEN=512) :: wrn_msg
251 INTEGER :: ifun, nfun, shortcut
252 TYPE(section_vals_type), POINTER :: xc_fun
253
254 CALL section_vals_val_get(functionals, "_SECTION_PARAMETERS_", &
255 i_val=shortcut)
256
257 ifun = 0
258 nfun = 0
259 DO
260 ifun = ifun + 1
261 xc_fun => section_vals_get_subs_vals2(functionals, i_section=ifun)
262 IF (.NOT. ASSOCIATED(xc_fun)) EXIT
263 nfun = nfun + 1
264 END DO
265!
266 IF (shortcut /= xc_funct_no_shortcut .AND. shortcut /= xc_none .AND. nfun > 0) THEN
267 WRITE (wrn_msg, '(A)') "User requested a shortcut while defining an explicit XC functional. "// &
268 "This is not recommended as it could lead to spurious behaviour. Please check input parameters."
269 cpwarn(wrn_msg)
270 END IF
271
272 SELECT CASE (shortcut)
274 ! nothing to expand
275 CASE (xc_funct_pbe0)
276 CALL section_vals_val_set(functionals, "PBE%_SECTION_PARAMETERS_", &
277 l_val=.true.)
278 CALL section_vals_val_set(functionals, "PBE%SCALE_X", &
279 r_val=0.75_dp)
280 CALL section_vals_val_set(functionals, "PBE%SCALE_C", &
281 r_val=1.0_dp)
282 ! Hartree Fock Exact Exchange
283 CALL section_vals_val_set(xc_section, "HF%FRACTION", &
284 r_val=0.25_dp)
285 CALL section_vals_val_set(functionals, "_SECTION_PARAMETERS_", &
287 CASE (xc_funct_beefvdw)
288 CALL section_vals_val_set(functionals, "PBE%_SECTION_PARAMETERS_", & !40% PBEc
289 l_val=.true.)
290 CALL section_vals_val_set(functionals, "PBE%SCALE_C", &
291 r_val=0.3998335231_dp)
292 CALL section_vals_val_set(functionals, "PBE%SCALE_X", & !no PBEx
293 r_val=0.0000000000_dp)
294
295 !PW92 correlation functional from libxc is required.
296 !The cp2k-native PW92 gives disagreeing results (in the 0.01E_H
297 !decimal) and yields inconsistent forces in a DEBUG run.
298 !(rk, 6.3.2014)
299 CALL section_vals_val_set(functionals, "LDA_C_PW%_SECTION_PARAMETERS_", & !60%LDA
300 l_val=.true.)
301 CALL section_vals_val_set(functionals, "LDA_C_PW%SCALE", &
302 r_val=0.6001664769_dp)
303
304 CALL section_vals_val_set(functionals, "BEEF%_SECTION_PARAMETERS_", & !BEEF exchange
305 l_val=.true.)
306
307 !NONLOCAL, LMKLL.
308 CALL section_vals_val_set(xc_section, "VDW_POTENTIAL%DISPERSION_FUNCTIONAL", &
309 i_val=xc_vdw_fun_nonloc)
310 CALL section_vals_val_set(xc_section, "VDW_POTENTIAL%NON_LOCAL%TYPE", &
311 i_val=vdw_nl_lmkll)
312 CALL section_vals_val_set(functionals, "_SECTION_PARAMETERS_", &
314 CASE (xc_funct_b3lyp)
315 CALL section_vals_val_set(functionals, "BECKE88%_SECTION_PARAMETERS_", &
316 l_val=.true.)
317 CALL section_vals_val_set(functionals, "BECKE88%SCALE_X", &
318 r_val=0.72_dp)
319 CALL section_vals_val_set(functionals, "LYP%_SECTION_PARAMETERS_", &
320 l_val=.true.)
321 CALL section_vals_val_set(functionals, "LYP%SCALE_C", &
322 r_val=0.81_dp)
323 CALL section_vals_val_set(functionals, "VWN%_SECTION_PARAMETERS_", &
324 l_val=.true.)
325 CALL section_vals_val_set(functionals, "VWN%FUNCTIONAL_TYPE", &
326 i_val=do_vwn5)
327 CALL section_vals_val_set(functionals, "VWN%SCALE_C", &
328 r_val=0.19_dp)
329 CALL section_vals_val_set(functionals, "XALPHA%_SECTION_PARAMETERS_", &
330 l_val=.true.)
331 CALL section_vals_val_set(functionals, "XALPHA%SCALE_X", &
332 r_val=0.08_dp)
333 ! Hartree Fock Exact Exchange
334 CALL section_vals_val_set(xc_section, "HF%FRACTION", &
335 r_val=0.20_dp)
336 CALL section_vals_val_set(functionals, "_SECTION_PARAMETERS_", &
338 CASE (xc_funct_blyp)
339 CALL section_vals_val_set(functionals, "BECKE88%_SECTION_PARAMETERS_", &
340 l_val=.true.)
341 CALL section_vals_val_set(functionals, "LYP%_SECTION_PARAMETERS_", &
342 l_val=.true.)
343 CALL section_vals_val_set(functionals, "_SECTION_PARAMETERS_", &
345 CASE (xc_funct_bp)
346 CALL section_vals_val_set(functionals, "BECKE88%_SECTION_PARAMETERS_", &
347 l_val=.true.)
348 CALL section_vals_val_set(functionals, "P86C%_SECTION_PARAMETERS_", &
349 l_val=.true.)
350 CALL section_vals_val_set(functionals, "_SECTION_PARAMETERS_", &
352 CASE (xc_funct_pade)
353 CALL section_vals_val_set(functionals, "PADE%_SECTION_PARAMETERS_", &
354 l_val=.true.)
355 CALL section_vals_val_set(functionals, "_SECTION_PARAMETERS_", &
357 CASE (xc_funct_pbe)
358 CALL section_vals_val_set(functionals, "PBE%_SECTION_PARAMETERS_", &
359 l_val=.true.)
360 CALL section_vals_val_set(functionals, "_SECTION_PARAMETERS_", &
362 CASE (xc_funct_xwpbe)
363 CALL section_vals_val_set(functionals, "XWPBE%_SECTION_PARAMETERS_", &
364 l_val=.true.)
365 CALL section_vals_val_set(functionals, "_SECTION_PARAMETERS_", &
367 CASE (xc_funct_tpss)
368 CALL section_vals_val_set(functionals, "TPSS%_SECTION_PARAMETERS_", &
369 l_val=.true.)
370 CALL section_vals_val_set(functionals, "_SECTION_PARAMETERS_", &
372 CASE (xc_funct_olyp)
373 CALL section_vals_val_set(functionals, "OPTX%_SECTION_PARAMETERS_", &
374 l_val=.true.)
375 CALL section_vals_val_set(functionals, "LYP%_SECTION_PARAMETERS_", &
376 l_val=.true.)
377 CALL section_vals_val_set(functionals, "_SECTION_PARAMETERS_", &
379 CASE (xc_funct_hcth120)
380 CALL section_vals_val_set(functionals, "HCTH%_SECTION_PARAMETERS_", &
381 l_val=.true.)
382 CALL section_vals_val_set(functionals, "HCTH%PARAMETER_SET", &
383 i_val=120)
384 CALL section_vals_val_set(functionals, "_SECTION_PARAMETERS_", &
386 CASE default
387 cpabort("unknown shortcut "//trim(adjustl(cp_to_string(shortcut))))
388 END SELECT
389 END SUBROUTINE xc_functionals_expand
390
391! **************************************************************************************************
392!> \brief Replaces the requested sections in the input with those found
393!> in the external restart (EXT_RESTART%RESTART_FILE_NAME).
394!> \param input_declaration ...
395!> \param input_file the input file to initialize
396!> \param para_env ...
397!> \param output_unit ...
398!> \author fawzi
399! **************************************************************************************************
400 SUBROUTINE handle_ext_restart(input_declaration, input_file, para_env, output_unit)
401 TYPE(section_type), POINTER :: input_declaration
402 TYPE(section_vals_type), POINTER :: input_file
403 TYPE(mp_para_env_type), POINTER :: para_env
404 INTEGER, INTENT(IN) :: output_unit
405
406 CHARACTER(len=*), PARAMETER :: routinen = 'handle_ext_restart'
407
408 CHARACTER(default_path_length) :: r_file_path
409 INTEGER :: handle
410 TYPE(section_vals_type), POINTER :: r_section
411
412 CALL timeset(routinen, handle)
413 ! Handle restart file
414 r_section => section_vals_get_subs_vals(input_file, "EXT_RESTART")
415 CALL section_vals_val_get(r_section, "RESTART_FILE_NAME", c_val=r_file_path)
416
417 IF (r_file_path /= " ") THEN
418 block
419 CHARACTER(default_path_length) :: binary_restart_file
420 CHARACTER(default_string_length) :: path
421 CHARACTER(LEN=default_string_length), &
422 DIMENSION(:), POINTER :: restarted_infos
423 INTEGER :: ensemble, i_rep_val, &
424 iforce_eval, myi, n_rep_val, &
425 nforce_eval1, nforce_eval2
426 INTEGER, DIMENSION(:), POINTER :: ivec, iwalkers_status, iwork, &
427 rwalkers_status
428 LOGICAL :: bsse_check, check, explicit1, explicit2, &
429 flag, flag2, qmmm_check, subsys_check
430 REAL(kind=dp) :: myt
431 REAL(kind=dp), DIMENSION(:), POINTER :: vec, work
432 TYPE(section_vals_type), POINTER :: rep_sections, restart_file, &
433 section, section1, section2, &
434 sections1, sections2
435
436 NULLIFY (restarted_infos, iwalkers_status, rwalkers_status, vec, ivec, work, iwork)
437 CALL section_vals_val_get(r_section, "BINARY_RESTART_FILE_NAME", c_val=binary_restart_file)
438
439 block
440 TYPE(cp_parser_type) :: cpparser
441 TYPE(cp_unit_set_type) :: default_units
442 ! parse the input
443 NULLIFY (restart_file)
444 CALL section_vals_create(restart_file, input_declaration)
445 CALL parser_create(cpparser, file_name=r_file_path, para_env=para_env)
446 CALL cp_unit_set_create(default_units, "OUTPUT")
447 CALL section_vals_parse(restart_file, cpparser, root_section=.false., &
448 default_units=default_units)
449 CALL cp_unit_set_release(default_units)
450 CALL parser_release(cpparser)
451 END block
452
453 ! Restart and input files same number of force_env sections
454 sections1 => section_vals_get_subs_vals(restart_file, "FORCE_EVAL")
455 CALL section_vals_get(sections1, n_repetition=nforce_eval1)
456 sections2 => section_vals_get_subs_vals(input_file, "FORCE_EVAL")
457 CALL section_vals_get(sections2, n_repetition=nforce_eval2)
458 IF (nforce_eval1 /= nforce_eval2) THEN
459 cpabort("Restart and input file MUST have the number of force_env sections")
460 END IF
461 ! Handle default restarts
462 CALL handle_defaults_restart(r_section)
463
464 ! Real restart of force_evals
465 DO iforce_eval = 1, nforce_eval1
466 section1 => section_vals_get_subs_vals3(sections1, "SUBSYS", &
467 i_rep_section=iforce_eval)
468 section2 => section_vals_get_subs_vals3(sections2, "SUBSYS", &
469 i_rep_section=iforce_eval)
470 ! Some care needs to be handled when treating multiple force_eval
471 ! Both subsys need to be consistently associated or not
472 ! Mixed stuff will be rejected for safety reason..
473 subsys_check = (ASSOCIATED(section1) .EQV. ASSOCIATED(section2))
474 IF (subsys_check) THEN
475 IF (ASSOCIATED(section1)) THEN
476 CALL section_vals_val_get(r_section, "RESTART_CELL", l_val=flag)
477 IF (flag) THEN
478 section => section_vals_get_subs_vals(section1, "CELL")
479 CALL section_vals_set_subs_vals(section2, "CELL", section)
480 CALL set_restart_info("CELL", restarted_infos)
481 END IF
482
483 CALL section_vals_val_get(r_section, "RESTART_POS", l_val=flag)
484 IF (flag) THEN
485 section => section_vals_get_subs_vals(section1, "COORD")
486 CALL section_vals_set_subs_vals(section2, "COORD", section)
487 CALL set_restart_info("COORDINATES", restarted_infos)
488 ! Copy over also the information on the multiple_unit_cell
489 CALL section_vals_val_get(section1, "TOPOLOGY%MULTIPLE_UNIT_CELL", i_vals=ivec)
490 ALLOCATE (iwork(3))
491 iwork = ivec
492 CALL section_vals_val_set(section2, "TOPOLOGY%MULTIPLE_UNIT_CELL", i_vals_ptr=iwork)
493 END IF
494
495 CALL section_vals_val_get(r_section, "RESTART_RANDOMG", l_val=flag)
496 IF (flag) THEN
497 section => section_vals_get_subs_vals(section1, "RNG_INIT")
498 CALL section_vals_set_subs_vals(section2, "RNG_INIT", section)
499 CALL set_restart_info("RANDOM NUMBER GENERATOR", restarted_infos)
500 END IF
501
502 CALL section_vals_val_get(r_section, "RESTART_VEL", l_val=flag)
503 IF (flag) THEN
504 section => section_vals_get_subs_vals(section1, "VELOCITY")
505 CALL section_vals_set_subs_vals(section2, "VELOCITY", section)
506 CALL set_restart_info("VELOCITIES", restarted_infos)
507 END IF
508
509 ! Core-Shell information "restarted" only when strictly necessary
510 CALL section_vals_val_get(r_section, "RESTART_SHELL_POS", l_val=flag)
511 IF (flag) THEN
512 section => section_vals_get_subs_vals(section1, "SHELL_COORD")
513 CALL section_vals_set_subs_vals(section2, "SHELL_COORD", section)
514 IF (check_restart(section1, section2, "SHELL_COORD")) THEN
515 CALL set_restart_info("SHELL COORDINATES", restarted_infos)
516 END IF
517 END IF
518 CALL section_vals_val_get(r_section, "RESTART_CORE_POS", l_val=flag)
519 IF (flag) THEN
520 section => section_vals_get_subs_vals(section1, "CORE_COORD")
521 CALL section_vals_set_subs_vals(section2, "CORE_COORD", section)
522 IF (check_restart(section1, section2, "CORE_COORD")) THEN
523 CALL set_restart_info("CORE COORDINATES", restarted_infos)
524 END IF
525 END IF
526 CALL section_vals_val_get(r_section, "RESTART_SHELL_VELOCITY", l_val=flag)
527 IF (flag) THEN
528 section => section_vals_get_subs_vals(section1, "SHELL_VELOCITY")
529 CALL section_vals_set_subs_vals(section2, "SHELL_VELOCITY", section)
530 IF (check_restart(section1, section2, "SHELL_VELOCITY")) THEN
531 CALL set_restart_info("SHELL VELOCITIES", restarted_infos)
532 END IF
533 END IF
534 CALL section_vals_val_get(r_section, "RESTART_CORE_VELOCITY", l_val=flag)
535 IF (flag) THEN
536 section => section_vals_get_subs_vals(section1, "CORE_VELOCITY")
537 CALL section_vals_set_subs_vals(section2, "CORE_VELOCITY", section)
538 IF (check_restart(section1, section2, "CORE_VELOCITY")) THEN
539 CALL set_restart_info("CORE VELOCITIES", restarted_infos)
540 END IF
541 END IF
542 END IF
543 ELSE
544 CALL cp_abort(__location__, &
545 "Error while reading the restart file. Two force_eval have incompatible"// &
546 " subsys.One of them has an allocated subsys while the other has not! Check your"// &
547 " input file or whether the restart file is compatible with the input!")
548 END IF
549 ! QMMM restarts
550 CALL section_vals_val_get(r_section, "RESTART_QMMM", l_val=flag)
551 section1 => section_vals_get_subs_vals3(sections1, "QMMM", i_rep_section=iforce_eval)
552 section2 => section_vals_get_subs_vals3(sections2, "QMMM", i_rep_section=iforce_eval)
553 CALL section_vals_get(section1, explicit=explicit1)
554 CALL section_vals_get(section2, explicit=explicit2)
555 qmmm_check = (explicit1 .AND. explicit2)
556 IF (flag .AND. qmmm_check) THEN
557 CALL set_restart_info("QMMM TRANSLATION VECTOR", restarted_infos)
558 CALL section_vals_val_get(section1, "INITIAL_TRANSLATION_VECTOR", r_vals=vec)
559 ALLOCATE (work(3))
560 work = vec
561 CALL section_vals_val_set(section2, "INITIAL_TRANSLATION_VECTOR", r_vals_ptr=work)
562 END IF
563 ! BSSE restarts
564 CALL section_vals_val_get(r_section, "RESTART_BSSE", l_val=flag)
565 section1 => section_vals_get_subs_vals3(sections1, "BSSE", i_rep_section=iforce_eval)
566 section2 => section_vals_get_subs_vals3(sections2, "BSSE", i_rep_section=iforce_eval)
567 CALL section_vals_get(section1, explicit=explicit1)
568 CALL section_vals_get(section2, explicit=explicit2)
569 bsse_check = (explicit1 .AND. explicit2)
570 IF (flag .AND. bsse_check) THEN
571 section => section_vals_get_subs_vals(section1, "FRAGMENT_ENERGIES")
572 CALL section_vals_set_subs_vals(section2, "FRAGMENT_ENERGIES", section)
573 CALL set_restart_info("BSSE FRAGMENT ENERGIES", restarted_infos)
574 END IF
575 END DO
576
577 CALL section_vals_val_get(r_section, "RESTART_COUNTERS", l_val=flag)
578 IF (flag) THEN
579 IF (check_restart(input_file, restart_file, "MOTION%MD")) THEN
580 CALL section_vals_val_get(restart_file, "MOTION%MD%STEP_START_VAL", i_val=myi)
581 CALL section_vals_val_set(input_file, "MOTION%MD%STEP_START_VAL", i_val=myi)
582 CALL section_vals_val_get(restart_file, "MOTION%MD%TIME_START_VAL", r_val=myt)
583 CALL section_vals_val_set(input_file, "MOTION%MD%TIME_START_VAL", r_val=myt)
584 CALL section_vals_val_get(restart_file, "MOTION%MD%ECONS_START_VAL", r_val=myt)
585 CALL section_vals_val_set(input_file, "MOTION%MD%ECONS_START_VAL", r_val=myt)
586 CALL set_restart_info("MD COUNTERS", restarted_infos)
587 END IF
588 !
589 IF (check_restart(input_file, restart_file, "MOTION%GEO_OPT")) THEN
590 ! GEO_OPT
591 CALL section_vals_val_get(restart_file, "MOTION%GEO_OPT%STEP_START_VAL", i_val=myi)
592 CALL section_vals_val_set(input_file, "MOTION%GEO_OPT%STEP_START_VAL", i_val=myi)
593 CALL set_restart_info("GEO_OPT COUNTERS", restarted_infos)
594 ! ROT_OPT
595 IF (check_restart(input_file, restart_file, "MOTION%GEO_OPT%TRANSITION_STATE%DIMER%ROT_OPT")) THEN
596 CALL section_vals_val_get(restart_file, "MOTION%GEO_OPT%TRANSITION_STATE%DIMER%ROT_OPT%STEP_START_VAL", &
597 i_val=myi)
598 CALL section_vals_val_set(input_file, "MOTION%GEO_OPT%TRANSITION_STATE%DIMER%ROT_OPT%STEP_START_VAL", &
599 i_val=myi)
600 CALL set_restart_info("ROT_OPT COUNTERS", restarted_infos)
601 END IF
602 END IF
603 !
604 IF (check_restart(input_file, restart_file, "MOTION%GEO_OPT")) THEN
605 ! CELL_OPT
606 CALL section_vals_val_get(restart_file, "MOTION%CELL_OPT%STEP_START_VAL", i_val=myi)
607 CALL section_vals_val_set(input_file, "MOTION%CELL_OPT%STEP_START_VAL", i_val=myi)
608 CALL set_restart_info("CELL_OPT COUNTERS", restarted_infos)
609 END IF
610 !
611 IF (check_restart(input_file, restart_file, "OPTIMIZE_INPUT")) THEN
612 CALL section_vals_val_get(restart_file, "OPTIMIZE_INPUT%ITER_START_VAL", i_val=myi)
613 CALL section_vals_val_set(input_file, "OPTIMIZE_INPUT%ITER_START_VAL", i_val=myi)
614 CALL set_restart_info("OPTIMIZE_INPUT ITERATION NUMBER", restarted_infos)
615 END IF
616 !
617 IF (check_restart(input_file, restart_file, "MOTION%PINT")) THEN
618 ! PINT
619 CALL section_vals_val_get(restart_file, "MOTION%PINT%ITERATION", i_val=myi)
620 CALL section_vals_val_set(input_file, "MOTION%PINT%ITERATION", i_val=myi)
621 CALL set_restart_info("PINT ITERATION NUMBER", restarted_infos)
622 END IF
623 !
624 CALL section_vals_val_get(r_section, "RESTART_METADYNAMICS", l_val=flag2)
625 IF (flag2 .AND. check_restart(input_file, restart_file, "MOTION%FREE_ENERGY%METADYN")) THEN
626 CALL section_vals_val_get(restart_file, &
627 "MOTION%FREE_ENERGY%METADYN%STEP_START_VAL", i_val=myi)
628 CALL section_vals_val_set(input_file, &
629 "MOTION%FREE_ENERGY%METADYN%STEP_START_VAL", i_val=myi)
630 CALL section_vals_val_get(restart_file, &
631 "MOTION%FREE_ENERGY%METADYN%NHILLS_START_VAL", i_val=myi)
632 CALL section_vals_val_set(input_file, &
633 "MOTION%FREE_ENERGY%METADYN%NHILLS_START_VAL", i_val=myi)
634 !RG Adaptive hills
635 CALL section_vals_val_get(restart_file, &
636 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_NUMBER", i_val=myi)
637 CALL section_vals_val_set(input_file, &
638 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_NUMBER", i_val=myi)
639 CALL section_vals_val_get(restart_file, &
640 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_STEP", i_val=myi)
641 CALL section_vals_val_set(input_file, &
642 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_STEP", i_val=myi)
643 !RG Adaptive hills
644 CALL set_restart_info("METADYNAMIC COUNTERS", restarted_infos)
645 END IF
646 END IF
647
648 CALL section_vals_val_get(r_section, "RESTART_AVERAGES", l_val=flag)
649 IF (flag) THEN
650 IF (check_restart(input_file, restart_file, "MOTION%MD")) THEN
651 rep_sections => section_vals_get_subs_vals(restart_file, "MOTION%MD%AVERAGES%RESTART_AVERAGES")
652 CALL section_vals_set_subs_vals(input_file, "MOTION%MD%AVERAGES%RESTART_AVERAGES", rep_sections)
653 CALL set_restart_info("MD AVERAGES", restarted_infos)
654 END IF
655 END IF
656
657 CALL section_vals_val_get(r_section, "RESTART_BAND", l_val=flag)
658 IF (flag .AND. check_restart(input_file, restart_file, "MOTION%BAND")) THEN
659 rep_sections => section_vals_get_subs_vals(restart_file, "MOTION%BAND%REPLICA")
660 CALL section_vals_set_subs_vals(input_file, "MOTION%BAND%REPLICA", rep_sections)
661 CALL set_restart_info("BAND CALCULATION", restarted_infos)
662 END IF
663
664 CALL section_vals_val_get(r_section, "RESTART_OPTIMIZE_INPUT_VARIABLES", l_val=flag)
665 IF (flag .AND. check_restart(input_file, restart_file, "OPTIMIZE_INPUT%VARIABLE")) THEN
666 rep_sections => section_vals_get_subs_vals(restart_file, "OPTIMIZE_INPUT%VARIABLE")
667 CALL section_vals_set_subs_vals(input_file, "OPTIMIZE_INPUT%VARIABLE", rep_sections)
668 CALL set_restart_info("OPTIMIZE_INPUT: VARIABLES", restarted_infos)
669 END IF
670
671 CALL section_vals_val_get(r_section, "RESTART_BAROSTAT", l_val=flag)
672 IF (flag .AND. check_restart(input_file, restart_file, "MOTION%MD%BAROSTAT")) THEN
673 section => section_vals_get_subs_vals(restart_file, &
674 "MOTION%MD%BAROSTAT%MASS")
675 CALL section_vals_set_subs_vals(input_file, "MOTION%MD%BAROSTAT%MASS", &
676 section)
677 section => section_vals_get_subs_vals(restart_file, &
678 "MOTION%MD%BAROSTAT%VELOCITY")
679 CALL section_vals_set_subs_vals(input_file, "MOTION%MD%BAROSTAT%VELOCITY", &
680 section)
681 CALL set_restart_info("BAROSTAT", restarted_infos)
682 END IF
683
684 flag = check_restart(input_file, restart_file, "MOTION%MD")
685 IF (flag) THEN
686 CALL section_vals_val_get(input_file, "MOTION%MD%ENSEMBLE", i_val=ensemble)
687 IF (ensemble == npt_i_ensemble .OR. ensemble == npt_f_ensemble .OR. ensemble == npt_ia_ensemble) THEN
688 CALL section_vals_val_get(r_section, "RESTART_BAROSTAT_THERMOSTAT", l_val=flag)
689 check = check_restart(input_file, restart_file, "MOTION%MD%BAROSTAT")
690 CALL restart_thermostat(flag, input_file, restart_file, "MOTION%MD%BAROSTAT%THERMOSTAT", &
691 check=check)
692 IF (flag .AND. check) CALL set_restart_info("THERMOSTAT OF BAROSTAT", restarted_infos)
693 END IF
694 END IF
695
696 check = check_restart(input_file, restart_file, "MOTION%MD%SHELL")
697 IF (check) THEN
698 CALL section_vals_val_get(r_section, "RESTART_SHELL_THERMOSTAT", l_val=flag)
699 CALL restart_thermostat(flag, input_file, restart_file, "MOTION%MD%SHELL%THERMOSTAT")
700 CALL set_restart_info("SHELL THERMOSTAT", restarted_infos)
701 END IF
702
703 CALL section_vals_val_get(r_section, "RESTART_THERMOSTAT", l_val=flag)
704 CALL restart_thermostat(flag, input_file, restart_file, "MOTION%MD%THERMOSTAT")
705 IF (flag) CALL set_restart_info("PARTICLE THERMOSTAT", restarted_infos)
706
707 CALL section_vals_val_get(r_section, "RESTART_CONSTRAINT", l_val=flag)
708 IF (flag .AND. check_restart(input_file, restart_file, "MOTION%CONSTRAINT")) THEN
709 section => section_vals_get_subs_vals(restart_file, "MOTION%CONSTRAINT")
710 CALL section_vals_set_subs_vals(input_file, "MOTION%CONSTRAINT", section)
711 CALL set_restart_info("CONSTRAINTS/RESTRAINTS", restarted_infos)
712 END IF
713
714 CALL section_vals_val_get(r_section, "RESTART_METADYNAMICS", l_val=flag)
715 IF (flag .AND. check_restart(input_file, restart_file, "MOTION%FREE_ENERGY%METADYN")) THEN
716 section => section_vals_get_subs_vals(restart_file, &
717 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_POS")
718 CALL section_vals_set_subs_vals(input_file, "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_POS", &
719 section)
720 section => section_vals_get_subs_vals(restart_file, &
721 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_SCALE")
722 CALL section_vals_set_subs_vals(input_file, "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_SCALE", &
723 section)
724 section => section_vals_get_subs_vals(restart_file, &
725 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_HEIGHT")
726 CALL section_vals_set_subs_vals(input_file, "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_HEIGHT", &
727 section)
728 section => section_vals_get_subs_vals(restart_file, &
729 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_INVDT")
730 CALL section_vals_set_subs_vals(input_file, "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_INVDT", &
731 section)
732 ! Extended Lagrangian
733 section => section_vals_get_subs_vals(restart_file, &
734 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_SS0")
735 CALL section_vals_set_subs_vals(input_file, "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_SS0", &
736 section)
737 section => section_vals_get_subs_vals(restart_file, &
738 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_VVP")
739 CALL section_vals_set_subs_vals(input_file, "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_VVP", &
740 section)
741 section => section_vals_get_subs_vals(restart_file, &
742 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_SS")
743 CALL section_vals_set_subs_vals(input_file, "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_SS", &
744 section)
745 section => section_vals_get_subs_vals(restart_file, &
746 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_FS")
747 CALL section_vals_set_subs_vals(input_file, "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_FS", &
748 section)
749 CALL set_restart_info("METADYNAMICS", restarted_infos)
750 END IF
751
752 CALL section_vals_val_get(r_section, "RESTART_TEMPERATURE_ANNEALING", l_val=flag)
753 IF (flag .AND. check_restart(input_file, restart_file, "MOTION%MD")) THEN
754 CALL section_vals_val_get(input_file, "MOTION%MD%TEMPERATURE_ANNEALING", r_val=myt, explicit=explicit1)
755 IF ((.NOT. explicit1) .OR. (abs(1._dp - myt) <= 1.e-10_dp)) THEN
756 CALL cp_warn(__location__, &
757 "I'm about to override the input temperature "// &
758 "with the temperature found in external restart "// &
759 "but TEMPERATURE_ANNEALING isn't explicitly given or it is set to 1.")
760 END IF
761 CALL section_vals_val_get(restart_file, "MOTION%MD%TEMPERATURE", r_val=myt, explicit=explicit1)
762 IF (explicit1) THEN
763 CALL section_vals_val_get(input_file, "MOTION%MD%TEMPERATURE", r_val=myt)
764 ELSE
765 CALL cp_warn(__location__, &
766 "I'm not going to override the input temperature "// &
767 "since the temperature isn't explicitly given in the external restart.")
768 END IF
769 END IF
770
771 CALL section_vals_val_get(r_section, "RESTART_WALKERS", l_val=flag)
772 IF (flag .AND. check_restart(input_file, restart_file, "MOTION%FREE_ENERGY%METADYN%MULTIPLE_WALKERS")) THEN
773 CALL section_vals_val_get(restart_file, "MOTION%FREE_ENERGY%METADYN%MULTIPLE_WALKERS%WALKERS_STATUS", &
774 i_vals=rwalkers_status)
775 ALLOCATE (iwalkers_status(SIZE(rwalkers_status)))
776 iwalkers_status = rwalkers_status
777 CALL section_vals_val_set(input_file, "MOTION%FREE_ENERGY%METADYN%MULTIPLE_WALKERS%WALKERS_STATUS", &
778 i_vals_ptr=iwalkers_status)
779 CALL set_restart_info("WALKERS INFO", restarted_infos)
780 END IF
781
782 CALL section_vals_val_get(r_section, "RESTART_DIMER", l_val=flag)
783 IF (flag .AND. check_restart(input_file, restart_file, "MOTION%GEO_OPT%TRANSITION_STATE%DIMER")) THEN
784 section => section_vals_get_subs_vals(restart_file, &
785 "MOTION%GEO_OPT%TRANSITION_STATE%DIMER%DIMER_VECTOR")
786 CALL section_vals_set_subs_vals(input_file, "MOTION%GEO_OPT%TRANSITION_STATE%DIMER%DIMER_VECTOR", &
787 section)
788 CALL set_restart_info("DIMER TRANSITION STATE SEARCH", restarted_infos)
789 END IF
790
791 CALL section_vals_val_get(r_section, "CUSTOM_PATH", n_rep_val=n_rep_val)
792 DO i_rep_val = 1, n_rep_val
793 CALL section_vals_val_get(r_section, "CUSTOM_PATH", i_rep_val=i_rep_val, c_val=path)
794 IF (path /= " ") THEN
795 section => section_vals_get_subs_vals(restart_file, path)
796 CALL section_vals_set_subs_vals(input_file, path, section)
797 CALL set_restart_info("USER RESTART: "//trim(path), restarted_infos)
798 END IF
799 END DO
800
801 CALL section_vals_val_get(r_section, "RESTART_RTP", l_val=flag)
802 ! IF(flag.AND.check_restart(input_file, restart_file, "FORCE_EVAL%DFT%REAL_TIME_PROPAGATION")) THEN
803 IF (flag) THEN
804 section => section_vals_get_subs_vals(restart_file, &
805 "FORCE_EVAL%DFT%REAL_TIME_PROPAGATION")
806 CALL section_vals_val_get(section, "INITIAL_WFN", i_val=myi)
807 CALL section_vals_val_set(input_file, "FORCE_EVAL%DFT%REAL_TIME_PROPAGATION%INITIAL_WFN", &
808 i_val=myi)
809 CALL set_restart_info("REAL TIME PROPAGATION", restarted_infos)
810 END IF
811
812 ! PIMD
813 CALL section_vals_val_get(r_section, "RESTART_PINT_POS", l_val=flag)
814 IF (flag) THEN
815 section => section_vals_get_subs_vals(restart_file, "MOTION%PINT%BEADS%COORD")
816 CALL section_vals_set_subs_vals(input_file, "MOTION%PINT%BEADS%COORD", section)
817 CALL set_restart_info("PINT BEAD POSITIONS", restarted_infos)
818 END IF
819 CALL section_vals_val_get(r_section, "RESTART_PINT_VEL", l_val=flag)
820 IF (flag) THEN
821 section => section_vals_get_subs_vals(restart_file, "MOTION%PINT%BEADS%VELOCITY")
822 CALL section_vals_set_subs_vals(input_file, "MOTION%PINT%BEADS%VELOCITY", section)
823 CALL set_restart_info("PINT BEAD VELOCITIES", restarted_infos)
824 END IF
825 CALL section_vals_val_get(r_section, "RESTART_PINT_NOSE", l_val=flag)
826 IF (flag) THEN
827 section => section_vals_get_subs_vals(restart_file, "MOTION%PINT%NOSE%COORD")
828 CALL section_vals_set_subs_vals(input_file, "MOTION%PINT%NOSE%COORD", section)
829 section => section_vals_get_subs_vals(restart_file, "MOTION%PINT%NOSE%VELOCITY")
830 CALL section_vals_set_subs_vals(input_file, "MOTION%PINT%NOSE%VELOCITY", section)
831 CALL set_restart_info("PINT NOSE THERMOSTAT", restarted_infos)
832 END IF
833 CALL section_vals_val_get(r_section, "RESTART_PINT_GLE", l_val=flag)
834 IF (flag) THEN
835 section => section_vals_get_subs_vals(restart_file, "MOTION%PINT%GLE")
836 CALL section_vals_set_subs_vals(input_file, "MOTION%PINT%GLE", section)
837 CALL set_restart_info("PINT GLE THERMOSTAT", restarted_infos)
838 END IF
839
840 ! PIMC
841 !
842 CALL section_vals_val_get(r_section, "RESTART_HELIUM_POS", l_val=flag)
843 IF (flag) THEN
844 CALL section_vals_val_get(input_file, "MOTION%PINT%HELIUM%NUM_ENV", &
845 explicit=explicit1)
846 IF (.NOT. explicit1) THEN
847 CALL section_vals_val_get(restart_file, "MOTION%PINT%HELIUM%NUM_ENV", i_val=myi)
848 CALL section_vals_val_set(input_file, "MOTION%PINT%HELIUM%NUM_ENV", i_val=myi)
849 END IF
850 section => section_vals_get_subs_vals(restart_file, "MOTION%PINT%HELIUM%COORD")
851 CALL section_vals_set_subs_vals(input_file, "MOTION%PINT%HELIUM%COORD", section)
852 CALL set_restart_info("HELIUM BEAD POSITIONS", restarted_infos)
853 END IF
854 !
855 CALL section_vals_val_get(r_section, "RESTART_HELIUM_PERMUTATION", l_val=flag)
856 IF (flag) THEN
857 CALL section_vals_val_get(input_file, "MOTION%PINT%HELIUM%NUM_ENV", &
858 explicit=explicit1)
859 IF (.NOT. explicit1) THEN
860 CALL section_vals_val_get(restart_file, "MOTION%PINT%HELIUM%NUM_ENV", i_val=myi)
861 CALL section_vals_val_set(input_file, "MOTION%PINT%HELIUM%NUM_ENV", i_val=myi)
862 END IF
863 section => section_vals_get_subs_vals(restart_file, "MOTION%PINT%HELIUM%PERM")
864 CALL section_vals_set_subs_vals(input_file, "MOTION%PINT%HELIUM%PERM", section)
865 CALL set_restart_info("HELIUM PERMUTATION STATE", restarted_infos)
866 END IF
867 !
868 CALL section_vals_val_get(r_section, "RESTART_HELIUM_FORCE", l_val=flag)
869 IF (flag) THEN
870 CALL section_vals_val_get(input_file, "MOTION%PINT%HELIUM%NUM_ENV", &
871 explicit=explicit1)
872 IF (.NOT. explicit1) THEN
873 CALL section_vals_val_get(restart_file, "MOTION%PINT%HELIUM%NUM_ENV", i_val=myi)
874 CALL section_vals_val_set(input_file, "MOTION%PINT%HELIUM%NUM_ENV", i_val=myi)
875 END IF
876 section => section_vals_get_subs_vals(restart_file, "MOTION%PINT%HELIUM%FORCE")
877 CALL section_vals_set_subs_vals(input_file, "MOTION%PINT%HELIUM%FORCE", section)
878 CALL set_restart_info("HELIUM FORCES ON SOLUTE", restarted_infos)
879 END IF
880 !
881 CALL section_vals_val_get(r_section, "RESTART_HELIUM_RNG", l_val=flag)
882 IF (flag) THEN
883 CALL section_vals_val_get(input_file, "MOTION%PINT%HELIUM%NUM_ENV", &
884 explicit=explicit1)
885 IF (.NOT. explicit1) THEN
886 CALL section_vals_val_get(restart_file, "MOTION%PINT%HELIUM%NUM_ENV", i_val=myi)
887 CALL section_vals_val_set(input_file, "MOTION%PINT%HELIUM%NUM_ENV", i_val=myi)
888 END IF
889 section => section_vals_get_subs_vals(restart_file, "MOTION%PINT%HELIUM%RNG_STATE")
890 CALL section_vals_set_subs_vals(input_file, "MOTION%PINT%HELIUM%RNG_STATE", section)
891 CALL set_restart_info("HELIUM RNG STATE", restarted_infos)
892 END IF
893 !
894 !
895 CALL section_vals_val_get(r_section, "RESTART_HELIUM_DENSITIES", l_val=flag)
896 IF (flag) THEN
897 CALL section_vals_val_get(input_file, "MOTION%PINT%HELIUM%NUM_ENV", &
898 explicit=explicit1)
899 IF (.NOT. explicit1) THEN
900 CALL section_vals_val_get(restart_file, "MOTION%PINT%HELIUM%NUM_ENV", i_val=myi)
901 CALL section_vals_val_set(input_file, "MOTION%PINT%HELIUM%NUM_ENV", i_val=myi)
902 END IF
903 section => section_vals_get_subs_vals(restart_file, "MOTION%PINT%HELIUM%RHO")
904 CALL section_vals_set_subs_vals(input_file, "MOTION%PINT%HELIUM%RHO", section)
905 CALL set_restart_info("HELIUM DENSITIES", restarted_infos)
906 END IF
907 !
908 CALL section_vals_val_set(r_section, "RESTART_FILE_NAME", c_val=" ")
909 CALL section_vals_release(restart_file)
910 CALL release_restart_info(restarted_infos, r_file_path, binary_restart_file, &
911 output_unit)
912 END block
913 END IF
914 CALL timestop(handle)
915 END SUBROUTINE handle_ext_restart
916
917! **************************************************************************************************
918!> \brief store information on the restarted quantities
919!> \param label ...
920!> \param restarted_infos ...
921!> \author Teodoro Laino [tlaino] 09.2008 - University of Zurich
922! **************************************************************************************************
923 SUBROUTINE set_restart_info(label, restarted_infos)
924
925 CHARACTER(LEN=*), INTENT(IN) :: label
926 CHARACTER(LEN=default_string_length), &
927 DIMENSION(:), POINTER :: restarted_infos
928
929 INTEGER :: isize
930
931 isize = 0
932 IF (ASSOCIATED(restarted_infos)) isize = SIZE(restarted_infos)
933 isize = isize + 1
934 CALL reallocate(restarted_infos, 1, isize)
935 restarted_infos(isize) = trim(label)
936
937 END SUBROUTINE set_restart_info
938
939! **************************************************************************************************
940!> \brief dumps on output the information on the information effectively restarted
941!> \param restarted_infos ...
942!> \param r_file_path ...
943!> \param binary_restart_file ...
944!> \param output_unit ...
945!> \author Teodoro Laino [tlaino] 09.2008 - University of Zurich
946! **************************************************************************************************
947 SUBROUTINE release_restart_info(restarted_infos, r_file_path, &
948 binary_restart_file, output_unit)
949 CHARACTER(LEN=default_string_length), &
950 DIMENSION(:), POINTER :: restarted_infos
951 CHARACTER(LEN=*), INTENT(IN) :: r_file_path, binary_restart_file
952 INTEGER, INTENT(IN) :: output_unit
953
954 INTEGER :: i, j
955
956 IF (output_unit > 0 .AND. ASSOCIATED(restarted_infos)) THEN
957 WRITE (output_unit, '(1X,79("*"))')
958 WRITE (output_unit, '(1X,"*",T30,A,T80,"*")') " RESTART INFORMATION "
959 WRITE (output_unit, '(1X,79("*"))')
960 WRITE (output_unit, '(1X,"*",T80,"*")')
961 i = 1
962 WRITE (output_unit, '(1X,"*",A,T26,A,T80,"*")') " RESTART FILE NAME: ", &
963 r_file_path(53*(i - 1) + 1:53*i)
964 DO i = 2, ceiling(real(len_trim(r_file_path), kind=dp)/53.0_dp)
965 WRITE (output_unit, '(T1,1X,"*",T26,A,T80,"*")') r_file_path(53*(i - 1) + 1:53*i)
966 END DO
967 IF (len_trim(binary_restart_file) > 0) THEN
968 i = 1
969 WRITE (output_unit, '(1X,"*",A,T26,A,T80,"*")') " BINARY RESTART FILE: ", &
970 binary_restart_file(53*(i - 1) + 1:53*i)
971 DO i = 2, ceiling(real(len_trim(binary_restart_file), kind=dp)/53.0_dp)
972 WRITE (output_unit, '(T1,1X,"*",T26,A,T80,"*")') binary_restart_file(53*(i - 1) + 1:53*i)
973 END DO
974 END IF
975 WRITE (output_unit, '(1X,"*",T80,"*")')
976 WRITE (output_unit, '(1X,"*", A,T80,"*")') " RESTARTED QUANTITIES: "
977 DO j = 1, SIZE(restarted_infos)
978 DO i = 1, ceiling(real(len_trim(restarted_infos(j)), kind=dp)/53.0_dp)
979 WRITE (output_unit, '(T1,1X,"*",T26,A,T80,"*")') restarted_infos(j) (53*(i - 1) + 1:53*i)
980 END DO
981 END DO
982 WRITE (output_unit, '(1X,79("*"),/)')
983 END IF
984 IF (ASSOCIATED(restarted_infos)) THEN
985 DEALLOCATE (restarted_infos)
986 END IF
987 END SUBROUTINE release_restart_info
988
989! **************************************************************************************************
990!> \brief Possibly restart thermostats information
991!> \param flag ...
992!> \param input_file the input file to initialize
993!> \param restart_file ...
994!> \param path ...
995!> \param check ...
996!> \author Teodoro Laino [tlaino] 10.2007- University of Zurich
997! **************************************************************************************************
998 SUBROUTINE restart_thermostat(flag, input_file, restart_file, path, check)
999 LOGICAL, INTENT(IN) :: flag
1000 TYPE(section_vals_type), POINTER :: input_file, restart_file
1001 CHARACTER(LEN=*), INTENT(IN) :: path
1002 LOGICAL, INTENT(IN), OPTIONAL :: check
1003
1004 INTEGER :: input_region, input_type, &
1005 restart_region, restart_type
1006 LOGICAL :: check_loc, skip_other_checks
1007 TYPE(section_vals_type), POINTER :: section
1008
1009 check_loc = check_restart(input_file, restart_file, trim(path))
1010 skip_other_checks = PRESENT(check)
1011 IF (skip_other_checks) check_loc = check
1012 IF (flag .AND. check_loc) THEN
1013 ! Let's check if the thermostat type is different otherwise it does not make any
1014 ! sense to do any kind of restart
1015 CALL section_vals_val_get(input_file, trim(path)//"%TYPE", i_val=input_type)
1016 CALL section_vals_val_get(restart_file, trim(path)//"%TYPE", i_val=restart_type)
1017
1018 IF (input_type == do_thermo_same_as_part) THEN
1019 CALL section_vals_val_get(input_file, "MOTION%MD%THERMOSTAT%TYPE", i_val=input_type)
1020 END IF
1021
1022 IF (skip_other_checks) THEN
1023 input_region = do_region_global
1024 restart_region = do_region_global
1025 ELSE
1026 ! Also the regions must be the same..
1027 CALL section_vals_val_get(input_file, trim(path)//"%REGION", i_val=input_region)
1028 CALL section_vals_val_get(restart_file, trim(path)//"%REGION", i_val=restart_region)
1029 END IF
1030
1031 IF ((input_type == restart_type) .AND. (input_region == restart_region)) THEN
1032 SELECT CASE (input_type)
1033 CASE (do_thermo_nose)
1034 section => section_vals_get_subs_vals(restart_file, trim(path)//"%NOSE%COORD")
1035 CALL section_vals_set_subs_vals(input_file, trim(path)//"%NOSE%COORD", section)
1036
1037 section => section_vals_get_subs_vals(restart_file, trim(path)//"%NOSE%VELOCITY")
1038 CALL section_vals_set_subs_vals(input_file, trim(path)//"%NOSE%VELOCITY", section)
1039
1040 section => section_vals_get_subs_vals(restart_file, trim(path)//"%NOSE%MASS")
1041 CALL section_vals_set_subs_vals(input_file, trim(path)//"%NOSE%MASS", section)
1042
1043 section => section_vals_get_subs_vals(restart_file, trim(path)//"%NOSE%FORCE")
1044 CALL section_vals_set_subs_vals(input_file, trim(path)//"%NOSE%FORCE", section)
1045 CASE (do_thermo_csvr)
1046 section => section_vals_get_subs_vals(restart_file, trim(path)//"%CSVR%THERMOSTAT_ENERGY")
1047 CALL section_vals_set_subs_vals(input_file, trim(path)//"%CSVR%THERMOSTAT_ENERGY", section)
1048 section => section_vals_get_subs_vals(restart_file, trim(path)//"%CSVR%RNG_INIT")
1049 CALL section_vals_set_subs_vals(input_file, trim(path)//"%CSVR%RNG_INIT", section)
1050 CASE (do_thermo_gle)
1051 section => section_vals_get_subs_vals(restart_file, trim(path)//"%GLE%THERMOSTAT_ENERGY")
1052 CALL section_vals_set_subs_vals(input_file, trim(path)//"%GLE%THERMOSTAT_ENERGY", section)
1053 section => section_vals_get_subs_vals(restart_file, trim(path)//"%GLE%RNG_INIT")
1054 CALL section_vals_set_subs_vals(input_file, trim(path)//"%GLE%RNG_INIT", section)
1055 section => section_vals_get_subs_vals(restart_file, trim(path)//"%GLE%S")
1056 CALL section_vals_set_subs_vals(input_file, trim(path)//"%GLE%S", section)
1057 CASE (do_thermo_al)
1058 section => section_vals_get_subs_vals(restart_file, trim(path)//"%AD_LANGEVIN%CHI")
1059 CALL section_vals_set_subs_vals(input_file, trim(path)//"%AD_LANGEVIN%CHI", section)
1060 section => section_vals_get_subs_vals(restart_file, trim(path)//"%AD_LANGEVIN%MASS")
1061 CALL section_vals_set_subs_vals(input_file, trim(path)//"%AD_LANGEVIN%MASS", section)
1062 END SELECT
1063 ELSE
1064 IF (input_type /= restart_type) THEN
1065 CALL cp_warn(__location__, &
1066 "Requested to restart thermostat: "//trim(path)//". The thermostat "// &
1067 "specified in the input file and the information present in the restart "// &
1068 "file do not match the same type of thermostat! Restarting is not possible! "// &
1069 "Thermostat will not be restarted! ")
1070 END IF
1071 IF (input_region /= restart_region) THEN
1072 CALL cp_warn(__location__, &
1073 "Requested to restart thermostat: "//trim(path)//". The thermostat "// &
1074 "specified in the input file and the information present in the restart "// &
1075 "file do not match the same type of REGION! Restarting is not possible! "// &
1076 "Thermostat will not be restarted! ")
1077 END IF
1078 END IF
1079 END IF
1080 END SUBROUTINE restart_thermostat
1081
1082! **************************************************************************************************
1083!> \brief Checks if there are the proper conditions to do a restart
1084!> \param input_file the input file to initialize
1085!> \param restart_file ...
1086!> \param tag_section ...
1087!> \return ...
1088!> \author teo
1089! **************************************************************************************************
1090 FUNCTION check_restart(input_file, restart_file, tag_section) RESULT(do_restart)
1091 TYPE(section_vals_type), POINTER :: input_file, restart_file
1092 CHARACTER(LEN=*), INTENT(IN) :: tag_section
1093 LOGICAL :: do_restart
1094
1095 CHARACTER(len=*), PARAMETER :: routinen = 'check_restart'
1096
1097 INTEGER :: handle
1098 LOGICAL :: explicit1, explicit2
1099 TYPE(section_vals_type), POINTER :: work_section
1100
1101 CALL timeset(routinen, handle)
1102 NULLIFY (work_section)
1103 work_section => section_vals_get_subs_vals(input_file, trim(tag_section))
1104 CALL section_vals_get(work_section, explicit=explicit1)
1105 work_section => section_vals_get_subs_vals(restart_file, trim(tag_section))
1106 CALL section_vals_get(work_section, explicit=explicit2)
1107
1108 do_restart = explicit1 .AND. explicit2
1109 CALL timestop(handle)
1110 END FUNCTION check_restart
1111
1112! **************************************************************************************************
1113!> \brief Removes section used to restart a calculation from an
1114!> input file in memory
1115!> \param input_file the input file to initialize
1116!> \author teo
1117! **************************************************************************************************
1118 SUBROUTINE remove_restart_info(input_file)
1119 TYPE(section_vals_type), POINTER :: input_file
1120
1121 CHARACTER(len=*), PARAMETER :: routinen = 'remove_restart_info'
1122
1123 INTEGER :: handle, iforce_eval, nforce_eval1
1124 LOGICAL :: explicit1
1125 TYPE(section_vals_type), POINTER :: md_section, motion_section, section1, &
1126 section_to_delete, sections1, &
1127 work_section
1128
1129 CALL timeset(routinen, handle)
1130
1131 NULLIFY (work_section)
1132 section_to_delete => section_vals_get_subs_vals(input_file, "EXT_RESTART")
1133 CALL section_vals_remove_values(section_to_delete)
1134 sections1 => section_vals_get_subs_vals(input_file, "FORCE_EVAL")
1135 CALL section_vals_get(sections1, n_repetition=nforce_eval1)
1136
1137 DO iforce_eval = 1, nforce_eval1
1138 section1 => section_vals_get_subs_vals3(sections1, "SUBSYS", i_rep_section=iforce_eval)
1139 section_to_delete => section_vals_get_subs_vals(section1, "COORD")
1140 CALL section_vals_remove_values(section_to_delete)
1141 section_to_delete => section_vals_get_subs_vals(section1, "VELOCITY")
1142 CALL section_vals_remove_values(section_to_delete)
1143 END DO
1144
1145 motion_section => section_vals_get_subs_vals(input_file, "MOTION")
1146 md_section => section_vals_get_subs_vals(motion_section, "MD")
1147 CALL section_vals_get(md_section, explicit=explicit1)
1148 IF (explicit1) THEN
1149 CALL section_vals_val_unset(md_section, "STEP_START_VAL")
1150 CALL section_vals_val_unset(md_section, "TIME_START_VAL")
1151 CALL section_vals_val_unset(md_section, "ECONS_START_VAL")
1152 END IF
1153 work_section => section_vals_get_subs_vals(motion_section, "FREE_ENERGY%METADYN")
1154 CALL section_vals_get(work_section, explicit=explicit1)
1155 IF (explicit1) THEN
1156 CALL section_vals_val_unset(motion_section, "FREE_ENERGY%METADYN%STEP_START_VAL")
1157 CALL section_vals_val_unset(motion_section, "FREE_ENERGY%METADYN%NHILLS_START_VAL")
1158 END IF
1159 section_to_delete => section_vals_get_subs_vals(motion_section, "BAND%REPLICA")
1160 CALL section_vals_remove_values(section_to_delete)
1161 section_to_delete => section_vals_get_subs_vals(md_section, "AVERAGES%RESTART_AVERAGES")
1162 CALL section_vals_remove_values(section_to_delete)
1163 section_to_delete => section_vals_get_subs_vals(md_section, "THERMOSTAT%NOSE%COORD")
1164 CALL section_vals_remove_values(section_to_delete)
1165 section_to_delete => section_vals_get_subs_vals(md_section, "THERMOSTAT%NOSE%VELOCITY")
1166 CALL section_vals_remove_values(section_to_delete)
1167 section_to_delete => section_vals_get_subs_vals(md_section, "THERMOSTAT%NOSE%MASS")
1168 CALL section_vals_remove_values(section_to_delete)
1169 section_to_delete => section_vals_get_subs_vals(md_section, "THERMOSTAT%NOSE%FORCE")
1170 CALL section_vals_remove_values(section_to_delete)
1171 section_to_delete => section_vals_get_subs_vals(md_section, "BAROSTAT%MASS")
1172 CALL section_vals_remove_values(section_to_delete)
1173 section_to_delete => section_vals_get_subs_vals(md_section, "BAROSTAT%VELOCITY")
1174 CALL section_vals_remove_values(section_to_delete)
1175 section_to_delete => section_vals_get_subs_vals(md_section, "BAROSTAT%THERMOSTAT%NOSE%COORD")
1176 CALL section_vals_remove_values(section_to_delete)
1177 section_to_delete => section_vals_get_subs_vals(md_section, "BAROSTAT%THERMOSTAT%NOSE%VELOCITY")
1178 CALL section_vals_remove_values(section_to_delete)
1179 section_to_delete => section_vals_get_subs_vals(md_section, "BAROSTAT%THERMOSTAT%NOSE%MASS")
1180 CALL section_vals_remove_values(section_to_delete)
1181 section_to_delete => section_vals_get_subs_vals(md_section, "BAROSTAT%THERMOSTAT%NOSE%FORCE")
1182 CALL section_vals_remove_values(section_to_delete)
1183 section_to_delete => section_vals_get_subs_vals(md_section, "SHELL%THERMOSTAT%NOSE%COORD")
1184 CALL section_vals_remove_values(section_to_delete)
1185 section_to_delete => section_vals_get_subs_vals(md_section, "SHELL%THERMOSTAT%NOSE%VELOCITY")
1186 CALL section_vals_remove_values(section_to_delete)
1187 section_to_delete => section_vals_get_subs_vals(md_section, "SHELL%THERMOSTAT%NOSE%MASS")
1188 CALL section_vals_remove_values(section_to_delete)
1189 section_to_delete => section_vals_get_subs_vals(md_section, "SHELL%THERMOSTAT%NOSE%FORCE")
1190 CALL section_vals_remove_values(section_to_delete)
1191 ! Constrained/Restrained section
1192 section_to_delete => section_vals_get_subs_vals(motion_section, "CONSTRAINT%FIX_ATOM_RESTART")
1193 CALL section_vals_remove_values(section_to_delete)
1194 section_to_delete => section_vals_get_subs_vals(motion_section, "CONSTRAINT%COLVAR_RESTART")
1195 CALL section_vals_remove_values(section_to_delete)
1196 ! Free energies restarts
1197 section_to_delete => section_vals_get_subs_vals(motion_section, "FREE_ENERGY%METADYN%SPAWNED_HILLS_POS")
1198 CALL section_vals_remove_values(section_to_delete)
1199 section_to_delete => section_vals_get_subs_vals(motion_section, "FREE_ENERGY%METADYN%SPAWNED_HILLS_SCALE")
1200 CALL section_vals_remove_values(section_to_delete)
1201 section_to_delete => section_vals_get_subs_vals(motion_section, "FREE_ENERGY%METADYN%SPAWNED_HILLS_HEIGHT")
1202 CALL section_vals_remove_values(section_to_delete)
1203 section_to_delete => section_vals_get_subs_vals(motion_section, "FREE_ENERGY%METADYN%SPAWNED_HILLS_INVDT")
1204 CALL section_vals_remove_values(section_to_delete)
1205 section_to_delete => section_vals_get_subs_vals(motion_section, "FREE_ENERGY%METADYN%EXT_LAGRANGE_SS0")
1206 CALL section_vals_remove_values(section_to_delete)
1207 section_to_delete => section_vals_get_subs_vals(motion_section, "FREE_ENERGY%METADYN%EXT_LAGRANGE_VVP")
1208 CALL section_vals_remove_values(section_to_delete)
1209 section_to_delete => section_vals_get_subs_vals(motion_section, "FREE_ENERGY%METADYN%EXT_LAGRANGE_SS")
1210 CALL section_vals_remove_values(section_to_delete)
1211 section_to_delete => section_vals_get_subs_vals(motion_section, "FREE_ENERGY%METADYN%EXT_LAGRANGE_FS")
1212 CALL section_vals_remove_values(section_to_delete)
1213 CALL timestop(handle)
1214 END SUBROUTINE remove_restart_info
1215
1216! **************************************************************************************************
1217!> \brief This subroutine controls the defaults for the restartable quantities..
1218!> \param r_section ...
1219!> \author teo - University of Zurich - 09.2007 [tlaino]
1220! **************************************************************************************************
1221 SUBROUTINE handle_defaults_restart(r_section)
1222 TYPE(section_vals_type), POINTER :: r_section
1223
1224 CHARACTER(len=*), PARAMETER :: routinen = 'handle_defaults_restart'
1225
1226 INTEGER :: handle, ik, nval
1227 LOGICAL :: restart_default
1228 TYPE(keyword_type), POINTER :: keyword
1229 TYPE(section_type), POINTER :: section
1230
1231 CALL timeset(routinen, handle)
1232 NULLIFY (keyword, section)
1233 CALL section_vals_get(r_section, section=section)
1234 CALL section_vals_val_get(r_section, "RESTART_DEFAULT", l_val=restart_default)
1235 DO ik = -1, section%n_keywords
1236 keyword => section%keywords(ik)%keyword
1237 IF (ASSOCIATED(keyword)) THEN
1238 IF (keyword%type_of_var == logical_t .AND. keyword%names(1) (1:8) == "RESTART_") THEN
1239 IF (trim(keyword%names(1)) == "RESTART_DEFAULT") cycle
1240 CALL section_vals_val_get(r_section, keyword%names(1), n_rep_val=nval)
1241 IF (nval == 0) THEN
1242 ! User didn't specify any value, use the value of the RESTART_DEFAULT keyword..
1243 CALL section_vals_val_set(r_section, keyword%names(1), l_val=restart_default)
1244 END IF
1245 END IF
1246 END IF
1247 END DO
1248 CALL timestop(handle)
1249
1250 END SUBROUTINE handle_defaults_restart
1251
1252END MODULE input_cp2k_check
Handles all functions related to the CELL.
Definition cell_types.F:15
integer, parameter, public use_perd_none
Definition cell_types.F:42
various routines to log and control the output. The idea is that decisions about where to log should ...
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
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_release(parser)
releases the parser
subroutine, public parser_create(parser, file_name, unit_nr, para_env, end_section_label, separator_chars, comment_char, continuation_char, quote_char, section_char, parse_white_lines, initial_variables, apply_preprocessing)
Start a parser run. Initial variables allow to @SET stuff before opening the file.
unit conversion facility
Definition cp_units.F:30
subroutine, public cp_unit_set_release(unit_set)
releases the given unit set
Definition cp_units.F:1437
subroutine, public cp_unit_set_create(unit_set, name)
initializes the given unit set
Definition cp_units.F:1360
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_thermo_nose
integer, parameter, public xc_funct_tpss
integer, parameter, public rtp_method_bse_linearized
integer, parameter, public xc_funct_xwpbe
integer, parameter, public xc_funct_bp
integer, parameter, public xc_funct_olyp
integer, parameter, public xc_funct_pbe
integer, parameter, public xc_funct_no_shortcut
integer, parameter, public npt_i_ensemble
integer, parameter, public xc_vdw_fun_nonloc
integer, parameter, public xc_funct_pbe0
integer, parameter, public xc_funct_beefvdw
integer, parameter, public xc_funct_pade
integer, parameter, public xc_funct_blyp
integer, parameter, public do_thermo_al
integer, parameter, public do_thermo_csvr
integer, parameter, public mimic_run
integer, parameter, public rtp_method_bse
integer, parameter, public vdw_nl_lmkll
integer, parameter, public do_thermo_gle
integer, parameter, public npt_ia_ensemble
integer, parameter, public npt_f_ensemble
integer, parameter, public do_region_global
integer, parameter, public negf_run
integer, parameter, public do_qs
integer, parameter, public xc_funct_b3lyp
integer, parameter, public xc_none
integer, parameter, public xc_funct_hcth120
integer, parameter, public do_thermo_same_as_part
checks the input and perform some automatic "magic" on it
subroutine, public check_cp2k_input(input_declaration, input_file, para_env, output_unit)
performs further checks on an input that parsed successfully
subroutine, public remove_restart_info(input_file)
Removes section used to restart a calculation from an input file in memory.
subroutine, public xc_functionals_expand(functionals, xc_section)
expand a shortcutted functional section
represents keywords in an input
routines that parse the input
recursive subroutine, public section_vals_parse(section_vals, parser, default_units, root_section)
...
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_vals_val_unset(section_vals, keyword_name, i_rep_section, i_rep_val)
unsets (removes) the requested value (if it is a keyword repetitions removes the repetition,...
recursive subroutine, public section_vals_create(section_vals, section)
creates a object where to store the values of a section
subroutine, public section_vals_val_set(section_vals, keyword_name, i_rep_section, i_rep_val, val, l_val, i_val, r_val, c_val, l_vals_ptr, i_vals_ptr, r_vals_ptr, c_vals_ptr)
sets the requested value
type(section_vals_type) function, pointer, public section_vals_get_subs_vals2(section_vals, i_section, i_rep_section)
returns the values of the n-th non default subsection (null if no such section exists (not so many no...
subroutine, public section_vals_remove_values(section_vals)
removes the values of a repetition of the section
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_get(section_vals, ref_count, n_repetition, n_subs_vals_rep, section, explicit)
returns various attributes about the section_vals
type(section_vals_type) function, pointer, public section_vals_get_subs_vals3(section_vals, subsection_name, i_rep_section)
returns the values of the n-th non default subsection (null if no such section exists (not so many no...
subroutine, public section_vals_set_subs_vals(section_vals, subsection_name, new_section_vals, i_rep_section)
replaces of the requested subsection with the one given
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
recursive subroutine, public section_vals_release(section_vals)
releases the given object
a wrapper for basic fortran types.
integer, parameter, public logical_t
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
integer, parameter, public default_path_length
Definition kinds.F:58
Utility routines for the memory handling.
Interface to the message passing library MPI.
input constants for xc
integer, parameter, public do_vwn5
subroutine check(condition, label)
Stops with an error message if a test fails.
stores the default units to be used
Definition cp_units.F:161
represent a keyword in the input
represent a section of the input file
stores all the informations relevant to an mpi environment