42#include "./base/base_uses.f90"
47 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
48 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_check'
68 INTEGER,
INTENT(IN),
OPTIONAL :: output_unit
70 CHARACTER(len=*),
PARAMETER :: routinen =
'check_cp2k_input'
72 INTEGER :: force_eval_method, handle, iforce_eval, &
74 LOGICAL :: apply_ext_potential, do_center, &
75 explicit, explicit_embed, explicit_mix
79 CALL timeset(routinen, handle)
80 cpassert(
ASSOCIATED(input_file))
81 cpassert(input_file%ref_count > 0)
83 IF (
PRESENT(output_unit))
THEN
84 CALL handle_ext_restart(input_declaration, input_file, para_env, output_unit)
94 DO iforce_eval = 1, nforce_eval
96 i_rep_section=iforce_eval)
98 IF (explicit_mix)
EXIT
100 DO iforce_eval = 1, nforce_eval
102 i_rep_section=iforce_eval)
104 IF (explicit_embed)
EXIT
109 IF (((explicit .AND. (nforce_eval == 1)) .OR. (.NOT. explicit .AND. (nforce_eval > 1))) .AND. run_type /=
negf_run)
THEN
110 IF ((explicit_mix .AND. (nforce_eval == 1)) .OR. (.NOT. explicit_mix .AND. (nforce_eval > 1)))
THEN
111 IF ((explicit_embed .AND. (nforce_eval == 1)) .OR. (.NOT. explicit_embed .AND. (nforce_eval > 1)))
THEN
112 CALL cp_abort(__location__, &
113 "Error multiple force_env without RESPA or MIXED or EMBED, or RESPA with one single "// &
114 "or MIXED with only two force_env section.")
118 DO iforce_eval = 1, nforce_eval
138 CALL section_vals_val_get(sections,
"SUBSYS%TOPOLOGY%CENTER_COORDINATES%_SECTION_PARAMETERS_", &
142 "SUBSYS%TOPOLOGY%CENTER_COORDINATES%_SECTION_PARAMETERS_", &
144 cpwarn(
"Turning off CENTER_COORDINATES for a MiMiC run.")
150 IF (apply_ext_potential)
THEN
151 cpabort(
"The EXTERNAL_POTENTIAL section is not allowed for the MiMiC runtype.")
156 IF (force_eval_method /=
do_qs)
THEN
157 cpabort(
"At the moment, only Quickstep method is supported with MiMiC.")
161 CALL timestop(handle)
173 CHARACTER(LEN=512) :: wrn_msg
174 INTEGER :: ifun, nfun, shortcut
185 IF (.NOT.
ASSOCIATED(xc_fun))
EXIT
190 WRITE (wrn_msg,
'(A)')
"User requested a shortcut while defining an explicit XC functional. "// &
191 "This is not recommended as it could lead to spurious behaviour. Please check input parameters."
195 SELECT CASE (shortcut)
214 r_val=0.3998335231_dp)
216 r_val=0.0000000000_dp)
225 r_val=0.6001664769_dp)
310 cpabort(
"unknown shortcut "//trim(adjustl(
cp_to_string(shortcut))))
323 SUBROUTINE handle_ext_restart(input_declaration, input_file, para_env, output_unit)
327 INTEGER,
INTENT(IN) :: output_unit
329 CHARACTER(len=*),
PARAMETER :: routinen =
'handle_ext_restart'
331 CHARACTER(default_path_length) :: r_file_path
335 CALL timeset(routinen, handle)
340 IF (r_file_path /=
" ")
THEN
342 CHARACTER(default_path_length) :: binary_restart_file
343 CHARACTER(default_string_length) :: path
344 CHARACTER(LEN=default_string_length), &
345 DIMENSION(:),
POINTER :: restarted_infos
346 INTEGER :: ensemble, i_rep_val, &
347 iforce_eval, myi, n_rep_val, &
348 nforce_eval1, nforce_eval2
349 INTEGER,
DIMENSION(:),
POINTER :: ivec, iwalkers_status, iwork, &
351 LOGICAL :: bsse_check, check, explicit1, explicit2, &
352 flag, flag2, qmmm_check, subsys_check
354 REAL(kind=
dp),
DIMENSION(:),
POINTER :: vec, work
356 section, section1, section2, &
359 NULLIFY (restarted_infos, iwalkers_status, rwalkers_status, vec, ivec, work, iwork)
366 NULLIFY (restart_file)
368 CALL parser_create(cpparser, file_name=r_file_path, para_env=para_env)
371 default_units=default_units)
381 IF (nforce_eval1 /= nforce_eval2)
THEN
382 cpabort(
"Restart and input file MUST have the number of force_env sections")
385 CALL handle_defaults_restart(r_section)
388 DO iforce_eval = 1, nforce_eval1
390 i_rep_section=iforce_eval)
392 i_rep_section=iforce_eval)
396 subsys_check = (
ASSOCIATED(section1) .EQV.
ASSOCIATED(section2))
397 IF (subsys_check)
THEN
398 IF (
ASSOCIATED(section1))
THEN
403 CALL set_restart_info(
"CELL", restarted_infos)
410 CALL set_restart_info(
"COORDINATES", restarted_infos)
422 CALL set_restart_info(
"RANDOM NUMBER GENERATOR", restarted_infos)
429 CALL set_restart_info(
"VELOCITIES", restarted_infos)
437 IF (check_restart(section1, section2,
"SHELL_COORD"))
THEN
438 CALL set_restart_info(
"SHELL COORDINATES", restarted_infos)
445 IF (check_restart(section1, section2,
"CORE_COORD"))
THEN
446 CALL set_restart_info(
"CORE COORDINATES", restarted_infos)
453 IF (check_restart(section1, section2,
"SHELL_VELOCITY"))
THEN
454 CALL set_restart_info(
"SHELL VELOCITIES", restarted_infos)
461 IF (check_restart(section1, section2,
"CORE_VELOCITY"))
THEN
462 CALL set_restart_info(
"CORE VELOCITIES", restarted_infos)
467 CALL cp_abort(__location__, &
468 "Error while reading the restart file. Two force_eval have incompatible"// &
469 " subsys.One of them has an allocated subsys while the other has not! Check your"// &
470 " input file or whether the restart file is compatible with the input!")
478 qmmm_check = (explicit1 .AND. explicit2)
479 IF (flag .AND. qmmm_check)
THEN
480 CALL set_restart_info(
"QMMM TRANSLATION VECTOR", restarted_infos)
492 bsse_check = (explicit1 .AND. explicit2)
493 IF (flag .AND. bsse_check)
THEN
496 CALL set_restart_info(
"BSSE FRAGMENT ENERGIES", restarted_infos)
502 IF (check_restart(input_file, restart_file,
"MOTION%MD"))
THEN
509 CALL set_restart_info(
"MD COUNTERS", restarted_infos)
512 IF (check_restart(input_file, restart_file,
"MOTION%GEO_OPT"))
THEN
516 CALL set_restart_info(
"GEO_OPT COUNTERS", restarted_infos)
518 IF (check_restart(input_file, restart_file,
"MOTION%GEO_OPT%TRANSITION_STATE%DIMER%ROT_OPT"))
THEN
519 CALL section_vals_val_get(restart_file,
"MOTION%GEO_OPT%TRANSITION_STATE%DIMER%ROT_OPT%STEP_START_VAL", &
521 CALL section_vals_val_set(input_file,
"MOTION%GEO_OPT%TRANSITION_STATE%DIMER%ROT_OPT%STEP_START_VAL", &
523 CALL set_restart_info(
"ROT_OPT COUNTERS", restarted_infos)
527 IF (check_restart(input_file, restart_file,
"MOTION%GEO_OPT"))
THEN
531 CALL set_restart_info(
"CELL_OPT COUNTERS", restarted_infos)
534 IF (check_restart(input_file, restart_file,
"OPTIMIZE_INPUT"))
THEN
537 CALL set_restart_info(
"OPTIMIZE_INPUT ITERATION NUMBER", restarted_infos)
540 IF (check_restart(input_file, restart_file,
"MOTION%PINT"))
THEN
544 CALL set_restart_info(
"PINT ITERATION NUMBER", restarted_infos)
548 IF (flag2 .AND. check_restart(input_file, restart_file,
"MOTION%FREE_ENERGY%METADYN"))
THEN
550 "MOTION%FREE_ENERGY%METADYN%STEP_START_VAL", i_val=myi)
552 "MOTION%FREE_ENERGY%METADYN%STEP_START_VAL", i_val=myi)
554 "MOTION%FREE_ENERGY%METADYN%NHILLS_START_VAL", i_val=myi)
556 "MOTION%FREE_ENERGY%METADYN%NHILLS_START_VAL", i_val=myi)
559 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_NUMBER", i_val=myi)
561 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_NUMBER", i_val=myi)
563 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_STEP", i_val=myi)
565 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_STEP", i_val=myi)
567 CALL set_restart_info(
"METADYNAMIC COUNTERS", restarted_infos)
573 IF (check_restart(input_file, restart_file,
"MOTION%MD"))
THEN
576 CALL set_restart_info(
"MD AVERAGES", restarted_infos)
581 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%BAND"))
THEN
584 CALL set_restart_info(
"BAND CALCULATION", restarted_infos)
588 IF (flag .AND. check_restart(input_file, restart_file,
"OPTIMIZE_INPUT%VARIABLE"))
THEN
591 CALL set_restart_info(
"OPTIMIZE_INPUT: VARIABLES", restarted_infos)
595 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%MD%BAROSTAT"))
THEN
597 "MOTION%MD%BAROSTAT%MASS")
601 "MOTION%MD%BAROSTAT%VELOCITY")
604 CALL set_restart_info(
"BAROSTAT", restarted_infos)
607 flag = check_restart(input_file, restart_file,
"MOTION%MD")
612 check = check_restart(input_file, restart_file,
"MOTION%MD%BAROSTAT")
613 CALL restart_thermostat(flag, input_file, restart_file,
"MOTION%MD%BAROSTAT%THERMOSTAT", &
615 IF (flag .AND. check)
CALL set_restart_info(
"THERMOSTAT OF BAROSTAT", restarted_infos)
619 check = check_restart(input_file, restart_file,
"MOTION%MD%SHELL")
622 CALL restart_thermostat(flag, input_file, restart_file,
"MOTION%MD%SHELL%THERMOSTAT")
623 CALL set_restart_info(
"SHELL THERMOSTAT", restarted_infos)
627 CALL restart_thermostat(flag, input_file, restart_file,
"MOTION%MD%THERMOSTAT")
628 IF (flag)
CALL set_restart_info(
"PARTICLE THERMOSTAT", restarted_infos)
631 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%CONSTRAINT"))
THEN
634 CALL set_restart_info(
"CONSTRAINTS/RESTRAINTS", restarted_infos)
638 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%FREE_ENERGY%METADYN"))
THEN
640 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_POS")
644 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_SCALE")
648 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_HEIGHT")
652 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_INVDT")
657 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_SS0")
661 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_VVP")
665 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_SS")
669 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_FS")
672 CALL set_restart_info(
"METADYNAMICS", restarted_infos)
676 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%MD"))
THEN
677 CALL section_vals_val_get(input_file,
"MOTION%MD%TEMPERATURE_ANNEALING", r_val=myt, explicit=explicit1)
678 IF ((.NOT. explicit1) .OR. (abs(1._dp - myt) <= 1.e-10_dp))
THEN
679 CALL cp_warn(__location__, &
680 "I'm about to override the input temperature "// &
681 "with the temperature found in external restart "// &
682 "but TEMPERATURE_ANNEALING isn't explicitly given or it is set to 1.")
688 CALL cp_warn(__location__, &
689 "I'm not going to override the input temperature "// &
690 "since the temperature isn't explicitly given in the external restart.")
695 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%FREE_ENERGY%METADYN%MULTIPLE_WALKERS"))
THEN
696 CALL section_vals_val_get(restart_file,
"MOTION%FREE_ENERGY%METADYN%MULTIPLE_WALKERS%WALKERS_STATUS", &
697 i_vals=rwalkers_status)
698 ALLOCATE (iwalkers_status(
SIZE(rwalkers_status)))
699 iwalkers_status = rwalkers_status
700 CALL section_vals_val_set(input_file,
"MOTION%FREE_ENERGY%METADYN%MULTIPLE_WALKERS%WALKERS_STATUS", &
701 i_vals_ptr=iwalkers_status)
702 CALL set_restart_info(
"WALKERS INFO", restarted_infos)
706 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%GEO_OPT%TRANSITION_STATE%DIMER"))
THEN
708 "MOTION%GEO_OPT%TRANSITION_STATE%DIMER%DIMER_VECTOR")
711 CALL set_restart_info(
"DIMER TRANSITION STATE SEARCH", restarted_infos)
715 DO i_rep_val = 1, n_rep_val
717 IF (path /=
" ")
THEN
720 CALL set_restart_info(
"USER RESTART: "//trim(path), restarted_infos)
728 "FORCE_EVAL%DFT%REAL_TIME_PROPAGATION")
732 CALL set_restart_info(
"REAL TIME PROPAGATION", restarted_infos)
740 CALL set_restart_info(
"PINT BEAD POSITIONS", restarted_infos)
746 CALL set_restart_info(
"PINT BEAD VELOCITIES", restarted_infos)
754 CALL set_restart_info(
"PINT NOSE THERMOSTAT", restarted_infos)
760 CALL set_restart_info(
"PINT GLE THERMOSTAT", restarted_infos)
769 IF (.NOT. explicit1)
THEN
775 CALL set_restart_info(
"HELIUM BEAD POSITIONS", restarted_infos)
782 IF (.NOT. explicit1)
THEN
788 CALL set_restart_info(
"HELIUM PERMUTATION STATE", restarted_infos)
795 IF (.NOT. explicit1)
THEN
801 CALL set_restart_info(
"HELIUM FORCES ON SOLUTE", restarted_infos)
808 IF (.NOT. explicit1)
THEN
814 CALL set_restart_info(
"HELIUM RNG STATE", restarted_infos)
822 IF (.NOT. explicit1)
THEN
828 CALL set_restart_info(
"HELIUM DENSITIES", restarted_infos)
833 CALL release_restart_info(restarted_infos, r_file_path, binary_restart_file, &
837 CALL timestop(handle)
838 END SUBROUTINE handle_ext_restart
846 SUBROUTINE set_restart_info(label, restarted_infos)
848 CHARACTER(LEN=*),
INTENT(IN) :: label
849 CHARACTER(LEN=default_string_length), &
850 DIMENSION(:),
POINTER :: restarted_infos
855 IF (
ASSOCIATED(restarted_infos)) isize =
SIZE(restarted_infos)
857 CALL reallocate(restarted_infos, 1, isize)
858 restarted_infos(isize) = trim(label)
860 END SUBROUTINE set_restart_info
870 SUBROUTINE release_restart_info(restarted_infos, r_file_path, &
871 binary_restart_file, output_unit)
872 CHARACTER(LEN=default_string_length), &
873 DIMENSION(:),
POINTER :: restarted_infos
874 CHARACTER(LEN=*),
INTENT(IN) :: r_file_path, binary_restart_file
875 INTEGER,
INTENT(IN) :: output_unit
879 IF (output_unit > 0 .AND.
ASSOCIATED(restarted_infos))
THEN
880 WRITE (output_unit,
'(1X,79("*"))')
881 WRITE (output_unit,
'(1X,"*",T30,A,T80,"*")')
" RESTART INFORMATION "
882 WRITE (output_unit,
'(1X,79("*"))')
883 WRITE (output_unit,
'(1X,"*",T80,"*")')
885 WRITE (output_unit,
'(1X,"*",A,T26,A,T80,"*")')
" RESTART FILE NAME: ", &
886 r_file_path(53*(i - 1) + 1:53*i)
887 DO i = 2, ceiling(real(len_trim(r_file_path), kind=dp)/53.0_dp)
888 WRITE (output_unit,
'(T1,1X,"*",T26,A,T80,"*")') r_file_path(53*(i - 1) + 1:53*i)
890 IF (len_trim(binary_restart_file) > 0)
THEN
892 WRITE (output_unit,
'(1X,"*",A,T26,A,T80,"*")')
" BINARY RESTART FILE: ", &
893 binary_restart_file(53*(i - 1) + 1:53*i)
894 DO i = 2, ceiling(real(len_trim(binary_restart_file), kind=dp)/53.0_dp)
895 WRITE (output_unit,
'(T1,1X,"*",T26,A,T80,"*")') binary_restart_file(53*(i - 1) + 1:53*i)
898 WRITE (output_unit,
'(1X,"*",T80,"*")')
899 WRITE (output_unit,
'(1X,"*", A,T80,"*")')
" RESTARTED QUANTITIES: "
900 DO j = 1,
SIZE(restarted_infos)
901 DO i = 1, ceiling(real(len_trim(restarted_infos(j)), kind=dp)/53.0_dp)
902 WRITE (output_unit,
'(T1,1X,"*",T26,A,T80,"*")') restarted_infos(j) (53*(i - 1) + 1:53*i)
905 WRITE (output_unit,
'(1X,79("*"),/)')
907 IF (
ASSOCIATED(restarted_infos))
THEN
908 DEALLOCATE (restarted_infos)
910 END SUBROUTINE release_restart_info
921 SUBROUTINE restart_thermostat(flag, input_file, restart_file, path, check)
922 LOGICAL,
INTENT(IN) :: flag
923 TYPE(section_vals_type),
POINTER :: input_file, restart_file
924 CHARACTER(LEN=*),
INTENT(IN) :: path
925 LOGICAL,
INTENT(IN),
OPTIONAL :: check
927 INTEGER :: input_region, input_type, &
928 restart_region, restart_type
929 LOGICAL :: check_loc, skip_other_checks
930 TYPE(section_vals_type),
POINTER :: section
932 check_loc = check_restart(input_file, restart_file, trim(path))
933 skip_other_checks =
PRESENT(check)
934 IF (skip_other_checks) check_loc = check
935 IF (flag .AND. check_loc)
THEN
938 CALL section_vals_val_get(input_file, trim(path)//
"%TYPE", i_val=input_type)
939 CALL section_vals_val_get(restart_file, trim(path)//
"%TYPE", i_val=restart_type)
941 IF (input_type == do_thermo_same_as_part)
THEN
942 CALL section_vals_val_get(input_file,
"MOTION%MD%THERMOSTAT%TYPE", i_val=input_type)
945 IF (skip_other_checks)
THEN
946 input_region = do_region_global
947 restart_region = do_region_global
950 CALL section_vals_val_get(input_file, trim(path)//
"%REGION", i_val=input_region)
951 CALL section_vals_val_get(restart_file, trim(path)//
"%REGION", i_val=restart_region)
954 IF ((input_type == restart_type) .AND. (input_region == restart_region))
THEN
955 SELECT CASE (input_type)
956 CASE (do_thermo_nose)
957 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%NOSE%COORD")
958 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%NOSE%COORD", section)
960 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%NOSE%VELOCITY")
961 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%NOSE%VELOCITY", section)
963 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%NOSE%MASS")
964 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%NOSE%MASS", section)
966 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%NOSE%FORCE")
967 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%NOSE%FORCE", section)
968 CASE (do_thermo_csvr)
969 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%CSVR%THERMOSTAT_ENERGY")
970 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%CSVR%THERMOSTAT_ENERGY", section)
971 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%CSVR%RNG_INIT")
972 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%CSVR%RNG_INIT", section)
974 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%GLE%THERMOSTAT_ENERGY")
975 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%GLE%THERMOSTAT_ENERGY", section)
976 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%GLE%RNG_INIT")
977 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%GLE%RNG_INIT", section)
978 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%GLE%S")
979 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%GLE%S", section)
981 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%AD_LANGEVIN%CHI")
982 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%AD_LANGEVIN%CHI", section)
983 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%AD_LANGEVIN%MASS")
984 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%AD_LANGEVIN%MASS", section)
987 IF (input_type /= restart_type)
THEN
988 CALL cp_warn(__location__, &
989 "Requested to restart thermostat: "//trim(path)//
". The thermostat "// &
990 "specified in the input file and the information present in the restart "// &
991 "file do not match the same type of thermostat! Restarting is not possible! "// &
992 "Thermostat will not be restarted! ")
994 IF (input_region /= restart_region)
THEN
995 CALL cp_warn(__location__, &
996 "Requested to restart thermostat: "//trim(path)//
". The thermostat "// &
997 "specified in the input file and the information present in the restart "// &
998 "file do not match the same type of REGION! Restarting is not possible! "// &
999 "Thermostat will not be restarted! ")
1003 END SUBROUTINE restart_thermostat
1013 FUNCTION check_restart(input_file, restart_file, tag_section)
RESULT(do_restart)
1014 TYPE(section_vals_type),
POINTER :: input_file, restart_file
1015 CHARACTER(LEN=*),
INTENT(IN) :: tag_section
1016 LOGICAL :: do_restart
1018 CHARACTER(len=*),
PARAMETER :: routinen =
'check_restart'
1021 LOGICAL :: explicit1, explicit2
1022 TYPE(section_vals_type),
POINTER :: work_section
1024 CALL timeset(routinen, handle)
1025 NULLIFY (work_section)
1026 work_section => section_vals_get_subs_vals(input_file, trim(tag_section))
1027 CALL section_vals_get(work_section, explicit=explicit1)
1028 work_section => section_vals_get_subs_vals(restart_file, trim(tag_section))
1029 CALL section_vals_get(work_section, explicit=explicit2)
1031 do_restart = explicit1 .AND. explicit2
1032 CALL timestop(handle)
1033 END FUNCTION check_restart
1042 TYPE(section_vals_type),
POINTER :: input_file
1044 CHARACTER(len=*),
PARAMETER :: routinen =
'remove_restart_info'
1046 INTEGER :: handle, iforce_eval, nforce_eval1
1047 LOGICAL :: explicit1
1048 TYPE(section_vals_type),
POINTER :: md_section, motion_section, section1, &
1049 section_to_delete, sections1, &
1052 CALL timeset(routinen, handle)
1054 NULLIFY (work_section)
1055 section_to_delete => section_vals_get_subs_vals(input_file,
"EXT_RESTART")
1056 CALL section_vals_remove_values(section_to_delete)
1057 sections1 => section_vals_get_subs_vals(input_file,
"FORCE_EVAL")
1058 CALL section_vals_get(sections1, n_repetition=nforce_eval1)
1060 DO iforce_eval = 1, nforce_eval1
1061 section1 => section_vals_get_subs_vals3(sections1,
"SUBSYS", i_rep_section=iforce_eval)
1062 section_to_delete => section_vals_get_subs_vals(section1,
"COORD")
1063 CALL section_vals_remove_values(section_to_delete)
1064 section_to_delete => section_vals_get_subs_vals(section1,
"VELOCITY")
1065 CALL section_vals_remove_values(section_to_delete)
1068 motion_section => section_vals_get_subs_vals(input_file,
"MOTION")
1069 md_section => section_vals_get_subs_vals(motion_section,
"MD")
1070 CALL section_vals_get(md_section, explicit=explicit1)
1072 CALL section_vals_val_unset(md_section,
"STEP_START_VAL")
1073 CALL section_vals_val_unset(md_section,
"TIME_START_VAL")
1074 CALL section_vals_val_unset(md_section,
"ECONS_START_VAL")
1076 work_section => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN")
1077 CALL section_vals_get(work_section, explicit=explicit1)
1079 CALL section_vals_val_unset(motion_section,
"FREE_ENERGY%METADYN%STEP_START_VAL")
1080 CALL section_vals_val_unset(motion_section,
"FREE_ENERGY%METADYN%NHILLS_START_VAL")
1082 section_to_delete => section_vals_get_subs_vals(motion_section,
"BAND%REPLICA")
1083 CALL section_vals_remove_values(section_to_delete)
1084 section_to_delete => section_vals_get_subs_vals(md_section,
"AVERAGES%RESTART_AVERAGES")
1085 CALL section_vals_remove_values(section_to_delete)
1086 section_to_delete => section_vals_get_subs_vals(md_section,
"THERMOSTAT%NOSE%COORD")
1087 CALL section_vals_remove_values(section_to_delete)
1088 section_to_delete => section_vals_get_subs_vals(md_section,
"THERMOSTAT%NOSE%VELOCITY")
1089 CALL section_vals_remove_values(section_to_delete)
1090 section_to_delete => section_vals_get_subs_vals(md_section,
"THERMOSTAT%NOSE%MASS")
1091 CALL section_vals_remove_values(section_to_delete)
1092 section_to_delete => section_vals_get_subs_vals(md_section,
"THERMOSTAT%NOSE%FORCE")
1093 CALL section_vals_remove_values(section_to_delete)
1094 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%MASS")
1095 CALL section_vals_remove_values(section_to_delete)
1096 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%VELOCITY")
1097 CALL section_vals_remove_values(section_to_delete)
1098 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%THERMOSTAT%NOSE%COORD")
1099 CALL section_vals_remove_values(section_to_delete)
1100 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%THERMOSTAT%NOSE%VELOCITY")
1101 CALL section_vals_remove_values(section_to_delete)
1102 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%THERMOSTAT%NOSE%MASS")
1103 CALL section_vals_remove_values(section_to_delete)
1104 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%THERMOSTAT%NOSE%FORCE")
1105 CALL section_vals_remove_values(section_to_delete)
1106 section_to_delete => section_vals_get_subs_vals(md_section,
"SHELL%THERMOSTAT%NOSE%COORD")
1107 CALL section_vals_remove_values(section_to_delete)
1108 section_to_delete => section_vals_get_subs_vals(md_section,
"SHELL%THERMOSTAT%NOSE%VELOCITY")
1109 CALL section_vals_remove_values(section_to_delete)
1110 section_to_delete => section_vals_get_subs_vals(md_section,
"SHELL%THERMOSTAT%NOSE%MASS")
1111 CALL section_vals_remove_values(section_to_delete)
1112 section_to_delete => section_vals_get_subs_vals(md_section,
"SHELL%THERMOSTAT%NOSE%FORCE")
1113 CALL section_vals_remove_values(section_to_delete)
1115 section_to_delete => section_vals_get_subs_vals(motion_section,
"CONSTRAINT%FIX_ATOM_RESTART")
1116 CALL section_vals_remove_values(section_to_delete)
1117 section_to_delete => section_vals_get_subs_vals(motion_section,
"CONSTRAINT%COLVAR_RESTART")
1118 CALL section_vals_remove_values(section_to_delete)
1120 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%SPAWNED_HILLS_POS")
1121 CALL section_vals_remove_values(section_to_delete)
1122 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%SPAWNED_HILLS_SCALE")
1123 CALL section_vals_remove_values(section_to_delete)
1124 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%SPAWNED_HILLS_HEIGHT")
1125 CALL section_vals_remove_values(section_to_delete)
1126 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%SPAWNED_HILLS_INVDT")
1127 CALL section_vals_remove_values(section_to_delete)
1128 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%EXT_LAGRANGE_SS0")
1129 CALL section_vals_remove_values(section_to_delete)
1130 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%EXT_LAGRANGE_VVP")
1131 CALL section_vals_remove_values(section_to_delete)
1132 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%EXT_LAGRANGE_SS")
1133 CALL section_vals_remove_values(section_to_delete)
1134 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%EXT_LAGRANGE_FS")
1135 CALL section_vals_remove_values(section_to_delete)
1136 CALL timestop(handle)
1144 SUBROUTINE handle_defaults_restart(r_section)
1145 TYPE(section_vals_type),
POINTER :: r_section
1147 CHARACTER(len=*),
PARAMETER :: routinen =
'handle_defaults_restart'
1149 INTEGER :: handle, ik, nval
1150 LOGICAL :: restart_default
1151 TYPE(keyword_type),
POINTER :: keyword
1152 TYPE(section_type),
POINTER :: section
1154 CALL timeset(routinen, handle)
1155 NULLIFY (keyword, section)
1156 CALL section_vals_get(r_section, section=section)
1157 CALL section_vals_val_get(r_section,
"RESTART_DEFAULT", l_val=restart_default)
1158 DO ik = -1, section%n_keywords
1159 keyword => section%keywords(ik)%keyword
1160 IF (
ASSOCIATED(keyword))
THEN
1161 IF (keyword%type_of_var == logical_t .AND. keyword%names(1) (1:8) ==
"RESTART_")
THEN
1162 IF (trim(keyword%names(1)) ==
"RESTART_DEFAULT") cycle
1163 CALL section_vals_val_get(r_section, keyword%names(1), n_rep_val=nval)
1166 CALL section_vals_val_set(r_section, keyword%names(1), l_val=restart_default)
1171 CALL timestop(handle)
1173 END SUBROUTINE handle_defaults_restart
various routines to log and control the output. The idea is that decisions about where to log should ...
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.
subroutine, public cp_unit_set_release(unit_set)
releases the given unit set
subroutine, public cp_unit_set_create(unit_set, name)
initializes the given unit set
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
Utility routines for the memory handling.
Interface to the message passing library MPI.
stores the default units to be used
stores all the informations relevant to an mpi environment