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)) &
84 CALL handle_ext_restart(input_declaration, input_file, para_env, output_unit)
93 DO iforce_eval = 1, nforce_eval
95 i_rep_section=iforce_eval)
97 IF (explicit_mix)
EXIT
99 DO iforce_eval = 1, nforce_eval
101 i_rep_section=iforce_eval)
103 IF (explicit_embed)
EXIT
108 IF (((explicit .AND. (nforce_eval == 1)) .OR. (.NOT. explicit .AND. (nforce_eval > 1))) .AND. run_type /=
negf_run)
THEN
109 IF ((explicit_mix .AND. (nforce_eval == 1)) .OR. (.NOT. explicit_mix .AND. (nforce_eval > 1)))
THEN
110 IF ((explicit_embed .AND. (nforce_eval == 1)) .OR. (.NOT. explicit_embed .AND. (nforce_eval > 1)))
THEN
111 CALL cp_abort(__location__, &
112 "Error multiple force_env without RESPA or MIXED or EMBED, or RESPA with one single "// &
113 "or MIXED with only two force_env section.")
117 DO iforce_eval = 1, nforce_eval
137 CALL section_vals_val_get(sections,
"SUBSYS%TOPOLOGY%CENTER_COORDINATES%_SECTION_PARAMETERS_", &
141 "SUBSYS%TOPOLOGY%CENTER_COORDINATES%_SECTION_PARAMETERS_", &
143 cpwarn(
"Turning off CENTER_COORDINATES for a MiMiC run.")
149 IF (apply_ext_potential) &
150 cpabort(
"The EXTERNAL_POTENTIAL section is not allowed for the MiMiC runtype.")
154 IF (force_eval_method /=
do_qs) &
155 cpabort(
"At the moment, only Quickstep method is supported with MiMiC.")
158 CALL timestop(handle)
170 CHARACTER(LEN=512) :: wrn_msg
171 INTEGER :: ifun, nfun, shortcut
182 IF (.NOT.
ASSOCIATED(xc_fun))
EXIT
187 WRITE (wrn_msg,
'(A)')
"User requested a shortcut while defining an explicit XC functional. "// &
188 "This is not recommended as it could lead to spurious behaviour. Please check input parameters."
192 SELECT CASE (shortcut)
211 r_val=0.3998335231_dp)
213 r_val=0.0000000000_dp)
222 r_val=0.6001664769_dp)
307 cpabort(
"unknown shortcut "//trim(adjustl(
cp_to_string(shortcut))))
320 SUBROUTINE handle_ext_restart(input_declaration, input_file, para_env, output_unit)
324 INTEGER,
INTENT(IN) :: output_unit
326 CHARACTER(len=*),
PARAMETER :: routinen =
'handle_ext_restart'
328 CHARACTER(default_path_length) :: r_file_path
332 CALL timeset(routinen, handle)
337 IF (r_file_path /=
" ")
THEN
339 CHARACTER(default_path_length) :: binary_restart_file
340 CHARACTER(default_string_length) :: path
341 CHARACTER(LEN=default_string_length), &
342 DIMENSION(:),
POINTER :: restarted_infos
343 INTEGER :: ensemble, i_rep_val, &
344 iforce_eval, myi, n_rep_val, &
345 nforce_eval1, nforce_eval2
346 INTEGER,
DIMENSION(:),
POINTER :: ivec, iwalkers_status, iwork, &
348 LOGICAL :: bsse_check, check, explicit1, explicit2, &
349 flag, flag2, qmmm_check, subsys_check
351 REAL(kind=
dp),
DIMENSION(:),
POINTER :: vec, work
353 section, section1, section2, &
356 NULLIFY (restarted_infos, iwalkers_status, rwalkers_status, vec, ivec, work, iwork)
363 NULLIFY (restart_file)
365 CALL parser_create(cpparser, file_name=r_file_path, para_env=para_env)
368 default_units=default_units)
378 IF (nforce_eval1 /= nforce_eval2)
THEN
379 cpabort(
"Restart and input file MUST have the number of force_env sections")
382 CALL handle_defaults_restart(r_section)
385 DO iforce_eval = 1, nforce_eval1
387 i_rep_section=iforce_eval)
389 i_rep_section=iforce_eval)
393 subsys_check = (
ASSOCIATED(section1) .EQV.
ASSOCIATED(section2))
394 IF (subsys_check)
THEN
395 IF (
ASSOCIATED(section1))
THEN
400 CALL set_restart_info(
"CELL", restarted_infos)
407 CALL set_restart_info(
"COORDINATES", restarted_infos)
419 CALL set_restart_info(
"RANDOM NUMBER GENERATOR", restarted_infos)
426 CALL set_restart_info(
"VELOCITIES", restarted_infos)
434 IF (check_restart(section1, section2,
"SHELL_COORD")) &
435 CALL set_restart_info(
"SHELL COORDINATES", restarted_infos)
441 IF (check_restart(section1, section2,
"CORE_COORD")) &
442 CALL set_restart_info(
"CORE COORDINATES", restarted_infos)
448 IF (check_restart(section1, section2,
"SHELL_VELOCITY")) &
449 CALL set_restart_info(
"SHELL VELOCITIES", restarted_infos)
455 IF (check_restart(section1, section2,
"CORE_VELOCITY")) &
456 CALL set_restart_info(
"CORE VELOCITIES", restarted_infos)
460 CALL cp_abort(__location__, &
461 "Error while reading the restart file. Two force_eval have incompatible"// &
462 " subsys.One of them has an allocated subsys while the other has not! Check your"// &
463 " input file or whether the restart file is compatible with the input!")
471 qmmm_check = (explicit1 .AND. explicit2)
472 IF (flag .AND. qmmm_check)
THEN
473 CALL set_restart_info(
"QMMM TRANSLATION VECTOR", restarted_infos)
485 bsse_check = (explicit1 .AND. explicit2)
486 IF (flag .AND. bsse_check)
THEN
489 CALL set_restart_info(
"BSSE FRAGMENT ENERGIES", restarted_infos)
495 IF (check_restart(input_file, restart_file,
"MOTION%MD"))
THEN
502 CALL set_restart_info(
"MD COUNTERS", restarted_infos)
505 IF (check_restart(input_file, restart_file,
"MOTION%GEO_OPT"))
THEN
509 CALL set_restart_info(
"GEO_OPT COUNTERS", restarted_infos)
511 IF (check_restart(input_file, restart_file,
"MOTION%GEO_OPT%TRANSITION_STATE%DIMER%ROT_OPT"))
THEN
512 CALL section_vals_val_get(restart_file,
"MOTION%GEO_OPT%TRANSITION_STATE%DIMER%ROT_OPT%STEP_START_VAL", &
514 CALL section_vals_val_set(input_file,
"MOTION%GEO_OPT%TRANSITION_STATE%DIMER%ROT_OPT%STEP_START_VAL", &
516 CALL set_restart_info(
"ROT_OPT COUNTERS", restarted_infos)
520 IF (check_restart(input_file, restart_file,
"MOTION%GEO_OPT"))
THEN
524 CALL set_restart_info(
"CELL_OPT COUNTERS", restarted_infos)
527 IF (check_restart(input_file, restart_file,
"OPTIMIZE_INPUT"))
THEN
530 CALL set_restart_info(
"OPTIMIZE_INPUT ITERATION NUMBER", restarted_infos)
533 IF (check_restart(input_file, restart_file,
"MOTION%PINT"))
THEN
537 CALL set_restart_info(
"PINT ITERATION NUMBER", restarted_infos)
541 IF (flag2 .AND. check_restart(input_file, restart_file,
"MOTION%FREE_ENERGY%METADYN"))
THEN
543 "MOTION%FREE_ENERGY%METADYN%STEP_START_VAL", i_val=myi)
545 "MOTION%FREE_ENERGY%METADYN%STEP_START_VAL", i_val=myi)
547 "MOTION%FREE_ENERGY%METADYN%NHILLS_START_VAL", i_val=myi)
549 "MOTION%FREE_ENERGY%METADYN%NHILLS_START_VAL", i_val=myi)
552 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_NUMBER", i_val=myi)
554 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_NUMBER", i_val=myi)
556 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_STEP", i_val=myi)
558 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_STEP", i_val=myi)
560 CALL set_restart_info(
"METADYNAMIC COUNTERS", restarted_infos)
566 IF (check_restart(input_file, restart_file,
"MOTION%MD"))
THEN
569 CALL set_restart_info(
"MD AVERAGES", restarted_infos)
574 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%BAND"))
THEN
577 CALL set_restart_info(
"BAND CALCULATION", restarted_infos)
581 IF (flag .AND. check_restart(input_file, restart_file,
"OPTIMIZE_INPUT%VARIABLE"))
THEN
584 CALL set_restart_info(
"OPTIMIZE_INPUT: VARIABLES", restarted_infos)
588 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%MD%BAROSTAT"))
THEN
590 "MOTION%MD%BAROSTAT%MASS")
594 "MOTION%MD%BAROSTAT%VELOCITY")
597 CALL set_restart_info(
"BAROSTAT", restarted_infos)
600 flag = check_restart(input_file, restart_file,
"MOTION%MD")
605 check = check_restart(input_file, restart_file,
"MOTION%MD%BAROSTAT")
606 CALL restart_thermostat(flag, input_file, restart_file,
"MOTION%MD%BAROSTAT%THERMOSTAT", &
608 IF (flag .AND. check)
CALL set_restart_info(
"THERMOSTAT OF BAROSTAT", restarted_infos)
612 check = check_restart(input_file, restart_file,
"MOTION%MD%SHELL")
615 CALL restart_thermostat(flag, input_file, restart_file,
"MOTION%MD%SHELL%THERMOSTAT")
616 CALL set_restart_info(
"SHELL THERMOSTAT", restarted_infos)
620 CALL restart_thermostat(flag, input_file, restart_file,
"MOTION%MD%THERMOSTAT")
621 IF (flag)
CALL set_restart_info(
"PARTICLE THERMOSTAT", restarted_infos)
624 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%CONSTRAINT"))
THEN
627 CALL set_restart_info(
"CONSTRAINTS/RESTRAINTS", restarted_infos)
631 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%FREE_ENERGY%METADYN"))
THEN
633 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_POS")
637 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_SCALE")
641 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_HEIGHT")
645 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_INVDT")
650 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_SS0")
654 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_VVP")
658 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_SS")
662 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_FS")
665 CALL set_restart_info(
"METADYNAMICS", restarted_infos)
669 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%MD"))
THEN
670 CALL section_vals_val_get(input_file,
"MOTION%MD%TEMPERATURE_ANNEALING", r_val=myt, explicit=explicit1)
671 IF ((.NOT. explicit1) .OR. (abs(1._dp - myt) <= 1.e-10_dp))
THEN
672 CALL cp_warn(__location__, &
673 "I'm about to override the input temperature "// &
674 "with the temperature found in external restart "// &
675 "but TEMPERATURE_ANNEALING isn't explicitly given or it is set to 1.")
681 CALL cp_warn(__location__, &
682 "I'm not going to override the input temperature "// &
683 "since the temperature isn't explicitly given in the external restart.")
688 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%FREE_ENERGY%METADYN%MULTIPLE_WALKERS"))
THEN
689 CALL section_vals_val_get(restart_file,
"MOTION%FREE_ENERGY%METADYN%MULTIPLE_WALKERS%WALKERS_STATUS", &
690 i_vals=rwalkers_status)
691 ALLOCATE (iwalkers_status(
SIZE(rwalkers_status)))
692 iwalkers_status = rwalkers_status
693 CALL section_vals_val_set(input_file,
"MOTION%FREE_ENERGY%METADYN%MULTIPLE_WALKERS%WALKERS_STATUS", &
694 i_vals_ptr=iwalkers_status)
695 CALL set_restart_info(
"WALKERS INFO", restarted_infos)
699 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%GEO_OPT%TRANSITION_STATE%DIMER"))
THEN
701 "MOTION%GEO_OPT%TRANSITION_STATE%DIMER%DIMER_VECTOR")
704 CALL set_restart_info(
"DIMER TRANSITION STATE SEARCH", restarted_infos)
708 DO i_rep_val = 1, n_rep_val
710 IF (path /=
" ")
THEN
713 CALL set_restart_info(
"USER RESTART: "//trim(path), restarted_infos)
721 "FORCE_EVAL%DFT%REAL_TIME_PROPAGATION")
725 CALL set_restart_info(
"REAL TIME PROPAGATION", restarted_infos)
733 CALL set_restart_info(
"PINT BEAD POSITIONS", restarted_infos)
739 CALL set_restart_info(
"PINT BEAD VELOCITIES", restarted_infos)
747 CALL set_restart_info(
"PINT NOSE THERMOSTAT", restarted_infos)
753 CALL set_restart_info(
"PINT GLE THERMOSTAT", restarted_infos)
762 IF (.NOT. explicit1)
THEN
768 CALL set_restart_info(
"HELIUM BEAD POSITIONS", restarted_infos)
775 IF (.NOT. explicit1)
THEN
781 CALL set_restart_info(
"HELIUM PERMUTATION STATE", restarted_infos)
788 IF (.NOT. explicit1)
THEN
794 CALL set_restart_info(
"HELIUM FORCES ON SOLUTE", restarted_infos)
801 IF (.NOT. explicit1)
THEN
807 CALL set_restart_info(
"HELIUM RNG STATE", restarted_infos)
815 IF (.NOT. explicit1)
THEN
821 CALL set_restart_info(
"HELIUM DENSITIES", restarted_infos)
826 CALL release_restart_info(restarted_infos, r_file_path, binary_restart_file, &
830 CALL timestop(handle)
831 END SUBROUTINE handle_ext_restart
839 SUBROUTINE set_restart_info(label, restarted_infos)
841 CHARACTER(LEN=*),
INTENT(IN) :: label
842 CHARACTER(LEN=default_string_length), &
843 DIMENSION(:),
POINTER :: restarted_infos
848 IF (
ASSOCIATED(restarted_infos)) isize =
SIZE(restarted_infos)
850 CALL reallocate(restarted_infos, 1, isize)
851 restarted_infos(isize) = trim(label)
853 END SUBROUTINE set_restart_info
863 SUBROUTINE release_restart_info(restarted_infos, r_file_path, &
864 binary_restart_file, output_unit)
865 CHARACTER(LEN=default_string_length), &
866 DIMENSION(:),
POINTER :: restarted_infos
867 CHARACTER(LEN=*),
INTENT(IN) :: r_file_path, binary_restart_file
868 INTEGER,
INTENT(IN) :: output_unit
872 IF (output_unit > 0 .AND.
ASSOCIATED(restarted_infos))
THEN
873 WRITE (output_unit,
'(1X,79("*"))')
874 WRITE (output_unit,
'(1X,"*",T30,A,T80,"*")')
" RESTART INFORMATION "
875 WRITE (output_unit,
'(1X,79("*"))')
876 WRITE (output_unit,
'(1X,"*",T80,"*")')
878 WRITE (output_unit,
'(1X,"*",A,T26,A,T80,"*")')
" RESTART FILE NAME: ", &
879 r_file_path(53*(i - 1) + 1:53*i)
880 DO i = 2, ceiling(real(len_trim(r_file_path), kind=dp)/53.0_dp)
881 WRITE (output_unit,
'(T1,1X,"*",T26,A,T80,"*")') r_file_path(53*(i - 1) + 1:53*i)
883 IF (len_trim(binary_restart_file) > 0)
THEN
885 WRITE (output_unit,
'(1X,"*",A,T26,A,T80,"*")')
" BINARY RESTART FILE: ", &
886 binary_restart_file(53*(i - 1) + 1:53*i)
887 DO i = 2, ceiling(real(len_trim(binary_restart_file), kind=dp)/53.0_dp)
888 WRITE (output_unit,
'(T1,1X,"*",T26,A,T80,"*")') binary_restart_file(53*(i - 1) + 1:53*i)
891 WRITE (output_unit,
'(1X,"*",T80,"*")')
892 WRITE (output_unit,
'(1X,"*", A,T80,"*")')
" RESTARTED QUANTITIES: "
893 DO j = 1,
SIZE(restarted_infos)
894 DO i = 1, ceiling(real(len_trim(restarted_infos(j)), kind=dp)/53.0_dp)
895 WRITE (output_unit,
'(T1,1X,"*",T26,A,T80,"*")') restarted_infos(j) (53*(i - 1) + 1:53*i)
898 WRITE (output_unit,
'(1X,79("*"),/)')
900 IF (
ASSOCIATED(restarted_infos))
THEN
901 DEALLOCATE (restarted_infos)
903 END SUBROUTINE release_restart_info
914 SUBROUTINE restart_thermostat(flag, input_file, restart_file, path, check)
915 LOGICAL,
INTENT(IN) :: flag
916 TYPE(section_vals_type),
POINTER :: input_file, restart_file
917 CHARACTER(LEN=*),
INTENT(IN) :: path
918 LOGICAL,
INTENT(IN),
OPTIONAL :: check
920 INTEGER :: input_region, input_type, &
921 restart_region, restart_type
922 LOGICAL :: check_loc, skip_other_checks
923 TYPE(section_vals_type),
POINTER :: section
925 check_loc = check_restart(input_file, restart_file, trim(path))
926 skip_other_checks =
PRESENT(check)
927 IF (skip_other_checks) check_loc = check
928 IF (flag .AND. check_loc)
THEN
931 CALL section_vals_val_get(input_file, trim(path)//
"%TYPE", i_val=input_type)
932 CALL section_vals_val_get(restart_file, trim(path)//
"%TYPE", i_val=restart_type)
934 IF (input_type == do_thermo_same_as_part)
THEN
935 CALL section_vals_val_get(input_file,
"MOTION%MD%THERMOSTAT%TYPE", i_val=input_type)
938 IF (skip_other_checks)
THEN
939 input_region = do_region_global
940 restart_region = do_region_global
943 CALL section_vals_val_get(input_file, trim(path)//
"%REGION", i_val=input_region)
944 CALL section_vals_val_get(restart_file, trim(path)//
"%REGION", i_val=restart_region)
947 IF ((input_type == restart_type) .AND. (input_region == restart_region))
THEN
948 SELECT CASE (input_type)
949 CASE (do_thermo_nose)
950 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%NOSE%COORD")
951 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%NOSE%COORD", section)
953 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%NOSE%VELOCITY")
954 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%NOSE%VELOCITY", section)
956 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%NOSE%MASS")
957 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%NOSE%MASS", section)
959 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%NOSE%FORCE")
960 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%NOSE%FORCE", section)
961 CASE (do_thermo_csvr)
962 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%CSVR%THERMOSTAT_ENERGY")
963 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%CSVR%THERMOSTAT_ENERGY", section)
964 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%CSVR%RNG_INIT")
965 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%CSVR%RNG_INIT", section)
967 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%GLE%THERMOSTAT_ENERGY")
968 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%GLE%THERMOSTAT_ENERGY", section)
969 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%GLE%RNG_INIT")
970 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%GLE%RNG_INIT", section)
971 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%GLE%S")
972 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%GLE%S", section)
974 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%AD_LANGEVIN%CHI")
975 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%AD_LANGEVIN%CHI", section)
976 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%AD_LANGEVIN%MASS")
977 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%AD_LANGEVIN%MASS", section)
980 IF (input_type /= restart_type) &
981 CALL cp_warn(__location__, &
982 "Requested to restart thermostat: "//trim(path)//
". The thermostat "// &
983 "specified in the input file and the information present in the restart "// &
984 "file do not match the same type of thermostat! Restarting is not possible! "// &
985 "Thermostat will not be restarted! ")
986 IF (input_region /= restart_region) &
987 CALL cp_warn(__location__, &
988 "Requested to restart thermostat: "//trim(path)//
". The thermostat "// &
989 "specified in the input file and the information present in the restart "// &
990 "file do not match the same type of REGION! Restarting is not possible! "// &
991 "Thermostat will not be restarted! ")
994 END SUBROUTINE restart_thermostat
1004 FUNCTION check_restart(input_file, restart_file, tag_section)
RESULT(do_restart)
1005 TYPE(section_vals_type),
POINTER :: input_file, restart_file
1006 CHARACTER(LEN=*),
INTENT(IN) :: tag_section
1007 LOGICAL :: do_restart
1009 CHARACTER(len=*),
PARAMETER :: routinen =
'check_restart'
1012 LOGICAL :: explicit1, explicit2
1013 TYPE(section_vals_type),
POINTER :: work_section
1015 CALL timeset(routinen, handle)
1016 NULLIFY (work_section)
1017 work_section => section_vals_get_subs_vals(input_file, trim(tag_section))
1018 CALL section_vals_get(work_section, explicit=explicit1)
1019 work_section => section_vals_get_subs_vals(restart_file, trim(tag_section))
1020 CALL section_vals_get(work_section, explicit=explicit2)
1022 do_restart = explicit1 .AND. explicit2
1023 CALL timestop(handle)
1024 END FUNCTION check_restart
1033 TYPE(section_vals_type),
POINTER :: input_file
1035 CHARACTER(len=*),
PARAMETER :: routinen =
'remove_restart_info'
1037 INTEGER :: handle, iforce_eval, nforce_eval1
1038 LOGICAL :: explicit1
1039 TYPE(section_vals_type),
POINTER :: md_section, motion_section, section1, &
1040 section_to_delete, sections1, &
1043 CALL timeset(routinen, handle)
1045 NULLIFY (work_section)
1046 section_to_delete => section_vals_get_subs_vals(input_file,
"EXT_RESTART")
1047 CALL section_vals_remove_values(section_to_delete)
1048 sections1 => section_vals_get_subs_vals(input_file,
"FORCE_EVAL")
1049 CALL section_vals_get(sections1, n_repetition=nforce_eval1)
1051 DO iforce_eval = 1, nforce_eval1
1052 section1 => section_vals_get_subs_vals3(sections1,
"SUBSYS", i_rep_section=iforce_eval)
1053 section_to_delete => section_vals_get_subs_vals(section1,
"COORD")
1054 CALL section_vals_remove_values(section_to_delete)
1055 section_to_delete => section_vals_get_subs_vals(section1,
"VELOCITY")
1056 CALL section_vals_remove_values(section_to_delete)
1059 motion_section => section_vals_get_subs_vals(input_file,
"MOTION")
1060 md_section => section_vals_get_subs_vals(motion_section,
"MD")
1061 CALL section_vals_get(md_section, explicit=explicit1)
1063 CALL section_vals_val_unset(md_section,
"STEP_START_VAL")
1064 CALL section_vals_val_unset(md_section,
"TIME_START_VAL")
1065 CALL section_vals_val_unset(md_section,
"ECONS_START_VAL")
1067 work_section => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN")
1068 CALL section_vals_get(work_section, explicit=explicit1)
1070 CALL section_vals_val_unset(motion_section,
"FREE_ENERGY%METADYN%STEP_START_VAL")
1071 CALL section_vals_val_unset(motion_section,
"FREE_ENERGY%METADYN%NHILLS_START_VAL")
1073 section_to_delete => section_vals_get_subs_vals(motion_section,
"BAND%REPLICA")
1074 CALL section_vals_remove_values(section_to_delete)
1075 section_to_delete => section_vals_get_subs_vals(md_section,
"AVERAGES%RESTART_AVERAGES")
1076 CALL section_vals_remove_values(section_to_delete)
1077 section_to_delete => section_vals_get_subs_vals(md_section,
"THERMOSTAT%NOSE%COORD")
1078 CALL section_vals_remove_values(section_to_delete)
1079 section_to_delete => section_vals_get_subs_vals(md_section,
"THERMOSTAT%NOSE%VELOCITY")
1080 CALL section_vals_remove_values(section_to_delete)
1081 section_to_delete => section_vals_get_subs_vals(md_section,
"THERMOSTAT%NOSE%MASS")
1082 CALL section_vals_remove_values(section_to_delete)
1083 section_to_delete => section_vals_get_subs_vals(md_section,
"THERMOSTAT%NOSE%FORCE")
1084 CALL section_vals_remove_values(section_to_delete)
1085 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%MASS")
1086 CALL section_vals_remove_values(section_to_delete)
1087 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%VELOCITY")
1088 CALL section_vals_remove_values(section_to_delete)
1089 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%THERMOSTAT%NOSE%COORD")
1090 CALL section_vals_remove_values(section_to_delete)
1091 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%THERMOSTAT%NOSE%VELOCITY")
1092 CALL section_vals_remove_values(section_to_delete)
1093 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%THERMOSTAT%NOSE%MASS")
1094 CALL section_vals_remove_values(section_to_delete)
1095 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%THERMOSTAT%NOSE%FORCE")
1096 CALL section_vals_remove_values(section_to_delete)
1097 section_to_delete => section_vals_get_subs_vals(md_section,
"SHELL%THERMOSTAT%NOSE%COORD")
1098 CALL section_vals_remove_values(section_to_delete)
1099 section_to_delete => section_vals_get_subs_vals(md_section,
"SHELL%THERMOSTAT%NOSE%VELOCITY")
1100 CALL section_vals_remove_values(section_to_delete)
1101 section_to_delete => section_vals_get_subs_vals(md_section,
"SHELL%THERMOSTAT%NOSE%MASS")
1102 CALL section_vals_remove_values(section_to_delete)
1103 section_to_delete => section_vals_get_subs_vals(md_section,
"SHELL%THERMOSTAT%NOSE%FORCE")
1104 CALL section_vals_remove_values(section_to_delete)
1106 section_to_delete => section_vals_get_subs_vals(motion_section,
"CONSTRAINT%FIX_ATOM_RESTART")
1107 CALL section_vals_remove_values(section_to_delete)
1108 section_to_delete => section_vals_get_subs_vals(motion_section,
"CONSTRAINT%COLVAR_RESTART")
1109 CALL section_vals_remove_values(section_to_delete)
1111 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%SPAWNED_HILLS_POS")
1112 CALL section_vals_remove_values(section_to_delete)
1113 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%SPAWNED_HILLS_SCALE")
1114 CALL section_vals_remove_values(section_to_delete)
1115 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%SPAWNED_HILLS_HEIGHT")
1116 CALL section_vals_remove_values(section_to_delete)
1117 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%SPAWNED_HILLS_INVDT")
1118 CALL section_vals_remove_values(section_to_delete)
1119 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%EXT_LAGRANGE_SS0")
1120 CALL section_vals_remove_values(section_to_delete)
1121 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%EXT_LAGRANGE_VVP")
1122 CALL section_vals_remove_values(section_to_delete)
1123 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%EXT_LAGRANGE_SS")
1124 CALL section_vals_remove_values(section_to_delete)
1125 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%EXT_LAGRANGE_FS")
1126 CALL section_vals_remove_values(section_to_delete)
1127 CALL timestop(handle)
1135 SUBROUTINE handle_defaults_restart(r_section)
1136 TYPE(section_vals_type),
POINTER :: r_section
1138 CHARACTER(len=*),
PARAMETER :: routinen =
'handle_defaults_restart'
1140 INTEGER :: handle, ik, nval
1141 LOGICAL :: restart_default
1142 TYPE(keyword_type),
POINTER :: keyword
1143 TYPE(section_type),
POINTER :: section
1145 CALL timeset(routinen, handle)
1146 NULLIFY (keyword, section)
1147 CALL section_vals_get(r_section, section=section)
1148 CALL section_vals_val_get(r_section,
"RESTART_DEFAULT", l_val=restart_default)
1149 DO ik = -1, section%n_keywords
1150 keyword => section%keywords(ik)%keyword
1151 IF (
ASSOCIATED(keyword))
THEN
1152 IF (keyword%type_of_var == logical_t .AND. keyword%names(1) (1:8) ==
"RESTART_")
THEN
1153 IF (trim(keyword%names(1)) ==
"RESTART_DEFAULT") cycle
1154 CALL section_vals_val_get(r_section, keyword%names(1), n_rep_val=nval)
1157 CALL section_vals_val_set(r_section, keyword%names(1), l_val=restart_default)
1162 CALL timestop(handle)
1164 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