42 #include "./base/base_uses.f90"
47 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
48 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_check'
65 TYPE(section_type),
POINTER :: input_declaration
66 TYPE(section_vals_type),
POINTER :: input_file
67 TYPE(mp_para_env_type),
POINTER :: para_env
68 INTEGER,
INTENT(IN),
OPTIONAL :: output_unit
70 CHARACTER(len=*),
PARAMETER :: routinen =
'check_cp2k_input'
72 INTEGER :: handle, iforce_eval, nforce_eval, &
74 LOGICAL :: explicit, explicit_embed, explicit_mix
75 TYPE(section_vals_type),
POINTER :: section, section1, section2, section3, &
78 CALL timeset(routinen, handle)
79 cpassert(
ASSOCIATED(input_file))
80 cpassert(input_file%ref_count > 0)
82 IF (
PRESENT(output_unit)) &
83 CALL handle_ext_restart(input_declaration, input_file, para_env, output_unit)
92 DO iforce_eval = 1, nforce_eval
94 i_rep_section=iforce_eval)
96 IF (explicit_mix)
EXIT
98 DO iforce_eval = 1, nforce_eval
100 i_rep_section=iforce_eval)
102 IF (explicit_embed)
EXIT
107 IF (((explicit .AND. (nforce_eval == 1)) .OR. (.NOT. explicit .AND. (nforce_eval > 1))) .AND. run_type /=
negf_run)
THEN
108 IF ((explicit_mix .AND. (nforce_eval == 1)) .OR. (.NOT. explicit_mix .AND. (nforce_eval > 1)))
THEN
109 IF ((explicit_embed .AND. (nforce_eval == 1)) .OR. (.NOT. explicit_embed .AND. (nforce_eval > 1)))
THEN
110 CALL cp_abort(__location__, &
111 "Error multiple force_env without RESPA or MIXED or EMBED, or RESPA with one single "// &
112 "or MIXED with only two force_env section.")
116 DO iforce_eval = 1, nforce_eval
136 CALL timestop(handle)
146 TYPE(section_vals_type),
POINTER :: functionals, xc_section
148 CHARACTER(LEN=512) :: wrn_msg
149 INTEGER :: ifun, nfun, shortcut
150 TYPE(section_vals_type),
POINTER :: xc_fun
160 IF (.NOT.
ASSOCIATED(xc_fun))
EXIT
165 WRITE (wrn_msg,
'(A)')
"User requested a shortcut while defining an explicit XC functional. "// &
166 "This is not recommended as it could lead to spurious behaviour. Please check input parameters."
170 SELECT CASE (shortcut)
189 r_val=0.3998335231_dp)
191 r_val=0.0000000000_dp)
200 r_val=0.6001664769_dp)
285 cpabort(
"unknown shortcut "//trim(adjustl(cp_to_string(shortcut))))
298 SUBROUTINE handle_ext_restart(input_declaration, input_file, para_env, output_unit)
299 TYPE(section_type),
POINTER :: input_declaration
300 TYPE(section_vals_type),
POINTER :: input_file
301 TYPE(mp_para_env_type),
POINTER :: para_env
302 INTEGER,
INTENT(IN) :: output_unit
304 CHARACTER(len=*),
PARAMETER :: routinen =
'handle_ext_restart'
306 CHARACTER(default_path_length) :: r_file_path
308 TYPE(section_vals_type),
POINTER :: r_section
310 CALL timeset(routinen, handle)
315 IF (r_file_path /=
" ")
THEN
317 CHARACTER(default_path_length) :: binary_restart_file
318 CHARACTER(default_string_length) :: path
319 CHARACTER(LEN=default_string_length), &
320 DIMENSION(:),
POINTER :: restarted_infos
321 INTEGER :: ensemble, i_rep_val, &
322 iforce_eval, myi, n_rep_val, &
323 nforce_eval1, nforce_eval2
324 INTEGER,
DIMENSION(:),
POINTER :: ivec, iwalkers_status, iwork, &
326 LOGICAL :: bsse_check, check, explicit1, explicit2, &
327 flag, flag2, qmmm_check, subsys_check
329 REAL(kind=
dp),
DIMENSION(:),
POINTER :: vec, work
330 TYPE(section_vals_type),
POINTER :: rep_sections, restart_file, &
331 section, section1, section2, &
334 NULLIFY (restarted_infos, iwalkers_status, rwalkers_status, vec, ivec, work, iwork)
338 TYPE(cp_parser_type) :: cpparser
339 TYPE(cp_unit_set_type) :: default_units
341 NULLIFY (restart_file)
343 CALL parser_create(cpparser, file_name=r_file_path, para_env=para_env)
346 default_units=default_units)
356 IF (nforce_eval1 /= nforce_eval2)
THEN
357 cpabort(
"Restart and input file MUST have the number of force_env sections")
360 CALL handle_defaults_restart(r_section)
363 DO iforce_eval = 1, nforce_eval1
365 i_rep_section=iforce_eval)
367 i_rep_section=iforce_eval)
371 subsys_check = (
ASSOCIATED(section1) .EQV.
ASSOCIATED(section2))
372 IF (subsys_check)
THEN
373 IF (
ASSOCIATED(section1))
THEN
378 CALL set_restart_info(
"CELL", restarted_infos)
385 CALL set_restart_info(
"COORDINATES", restarted_infos)
397 CALL set_restart_info(
"RANDOM NUMBER GENERATOR", restarted_infos)
404 CALL set_restart_info(
"VELOCITIES", restarted_infos)
412 IF (check_restart(section1, section2,
"SHELL_COORD")) &
413 CALL set_restart_info(
"SHELL COORDINATES", restarted_infos)
419 IF (check_restart(section1, section2,
"CORE_COORD")) &
420 CALL set_restart_info(
"CORE COORDINATES", restarted_infos)
426 IF (check_restart(section1, section2,
"SHELL_VELOCITY")) &
427 CALL set_restart_info(
"SHELL VELOCITIES", restarted_infos)
433 IF (check_restart(section1, section2,
"CORE_VELOCITY")) &
434 CALL set_restart_info(
"CORE VELOCITIES", restarted_infos)
438 CALL cp_abort(__location__, &
439 "Error while reading the restart file. Two force_eval have incompatible"// &
440 " subsys.One of them has an allocated subsys while the other has not! Check your"// &
441 " input file or whether the restart file is compatible with the input!")
449 qmmm_check = (explicit1 .AND. explicit2)
450 IF (flag .AND. qmmm_check)
THEN
451 CALL set_restart_info(
"QMMM TRANSLATION VECTOR", restarted_infos)
463 bsse_check = (explicit1 .AND. explicit2)
464 IF (flag .AND. bsse_check)
THEN
467 CALL set_restart_info(
"BSSE FRAGMENT ENERGIES", restarted_infos)
473 IF (check_restart(input_file, restart_file,
"MOTION%MD"))
THEN
480 CALL set_restart_info(
"MD COUNTERS", restarted_infos)
483 IF (check_restart(input_file, restart_file,
"MOTION%GEO_OPT"))
THEN
487 CALL set_restart_info(
"GEO_OPT COUNTERS", restarted_infos)
489 IF (check_restart(input_file, restart_file,
"MOTION%GEO_OPT%TRANSITION_STATE%DIMER%ROT_OPT"))
THEN
490 CALL section_vals_val_get(restart_file,
"MOTION%GEO_OPT%TRANSITION_STATE%DIMER%ROT_OPT%STEP_START_VAL", &
492 CALL section_vals_val_set(input_file,
"MOTION%GEO_OPT%TRANSITION_STATE%DIMER%ROT_OPT%STEP_START_VAL", &
494 CALL set_restart_info(
"ROT_OPT COUNTERS", restarted_infos)
498 IF (check_restart(input_file, restart_file,
"MOTION%GEO_OPT"))
THEN
502 CALL set_restart_info(
"CELL_OPT COUNTERS", restarted_infos)
505 IF (check_restart(input_file, restart_file,
"OPTIMIZE_INPUT"))
THEN
508 CALL set_restart_info(
"OPTIMIZE_INPUT ITERATION NUMBER", restarted_infos)
511 IF (check_restart(input_file, restart_file,
"MOTION%PINT"))
THEN
515 CALL set_restart_info(
"PINT ITERATION NUMBER", restarted_infos)
519 IF (flag2 .AND. check_restart(input_file, restart_file,
"MOTION%FREE_ENERGY%METADYN"))
THEN
521 "MOTION%FREE_ENERGY%METADYN%STEP_START_VAL", i_val=myi)
523 "MOTION%FREE_ENERGY%METADYN%STEP_START_VAL", i_val=myi)
525 "MOTION%FREE_ENERGY%METADYN%NHILLS_START_VAL", i_val=myi)
527 "MOTION%FREE_ENERGY%METADYN%NHILLS_START_VAL", i_val=myi)
530 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_NUMBER", i_val=myi)
532 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_NUMBER", i_val=myi)
534 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_STEP", i_val=myi)
536 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_STEP", i_val=myi)
538 CALL set_restart_info(
"METADYNAMIC COUNTERS", restarted_infos)
544 IF (check_restart(input_file, restart_file,
"MOTION%MD"))
THEN
547 CALL set_restart_info(
"MD AVERAGES", restarted_infos)
552 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%BAND"))
THEN
555 CALL set_restart_info(
"BAND CALCULATION", restarted_infos)
559 IF (flag .AND. check_restart(input_file, restart_file,
"OPTIMIZE_INPUT%VARIABLE"))
THEN
562 CALL set_restart_info(
"OPTIMIZE_INPUT: VARIABLES", restarted_infos)
566 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%MD%BAROSTAT"))
THEN
568 "MOTION%MD%BAROSTAT%MASS")
572 "MOTION%MD%BAROSTAT%VELOCITY")
575 CALL set_restart_info(
"BAROSTAT", restarted_infos)
578 flag = check_restart(input_file, restart_file,
"MOTION%MD")
583 check = check_restart(input_file, restart_file,
"MOTION%MD%BAROSTAT")
584 CALL restart_thermostat(flag, input_file, restart_file,
"MOTION%MD%BAROSTAT%THERMOSTAT", &
586 IF (flag .AND. check)
CALL set_restart_info(
"THERMOSTAT OF BAROSTAT", restarted_infos)
590 check = check_restart(input_file, restart_file,
"MOTION%MD%SHELL")
593 CALL restart_thermostat(flag, input_file, restart_file,
"MOTION%MD%SHELL%THERMOSTAT")
594 CALL set_restart_info(
"SHELL THERMOSTAT", restarted_infos)
598 CALL restart_thermostat(flag, input_file, restart_file,
"MOTION%MD%THERMOSTAT")
599 IF (flag)
CALL set_restart_info(
"PARTICLE THERMOSTAT", restarted_infos)
602 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%CONSTRAINT"))
THEN
605 CALL set_restart_info(
"CONSTRAINTS/RESTRAINTS", restarted_infos)
609 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%FREE_ENERGY%METADYN"))
THEN
611 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_POS")
615 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_SCALE")
619 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_HEIGHT")
623 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_INVDT")
628 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_SS0")
632 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_VVP")
636 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_SS")
640 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_FS")
643 CALL set_restart_info(
"METADYNAMICS", restarted_infos)
647 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%MD"))
THEN
648 CALL section_vals_val_get(input_file,
"MOTION%MD%TEMPERATURE_ANNEALING", r_val=myt, explicit=explicit1)
649 IF ((.NOT. explicit1) .OR. (abs(1._dp - myt) <= 1.e-10_dp))
THEN
650 CALL cp_warn(__location__, &
651 "I'm about to override the input temperature "// &
652 "with the temperature found in external restart "// &
653 "but TEMPERATURE_ANNEALING isn't explicitly given or it is set to 1.")
659 CALL cp_warn(__location__, &
660 "I'm not going to override the input temperature "// &
661 "since the temperature isn't explicitly given in the external restart.")
666 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%FREE_ENERGY%METADYN%MULTIPLE_WALKERS"))
THEN
667 CALL section_vals_val_get(restart_file,
"MOTION%FREE_ENERGY%METADYN%MULTIPLE_WALKERS%WALKERS_STATUS", &
668 i_vals=rwalkers_status)
669 ALLOCATE (iwalkers_status(
SIZE(rwalkers_status)))
670 iwalkers_status = rwalkers_status
671 CALL section_vals_val_set(input_file,
"MOTION%FREE_ENERGY%METADYN%MULTIPLE_WALKERS%WALKERS_STATUS", &
672 i_vals_ptr=iwalkers_status)
673 CALL set_restart_info(
"WALKERS INFO", restarted_infos)
677 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%GEO_OPT%TRANSITION_STATE%DIMER"))
THEN
679 "MOTION%GEO_OPT%TRANSITION_STATE%DIMER%DIMER_VECTOR")
682 CALL set_restart_info(
"DIMER TRANSITION STATE SEARCH", restarted_infos)
686 DO i_rep_val = 1, n_rep_val
688 IF (path /=
" ")
THEN
691 CALL set_restart_info(
"USER RESTART: "//trim(path), restarted_infos)
699 "FORCE_EVAL%DFT%REAL_TIME_PROPAGATION")
703 CALL set_restart_info(
"REAL TIME PROPAGATION", restarted_infos)
711 CALL set_restart_info(
"PINT BEAD POSITIONS", restarted_infos)
717 CALL set_restart_info(
"PINT BEAD VELOCITIES", restarted_infos)
725 CALL set_restart_info(
"PINT NOSE THERMOSTAT", restarted_infos)
731 CALL set_restart_info(
"PINT GLE THERMOSTAT", restarted_infos)
740 IF (.NOT. explicit1)
THEN
746 CALL set_restart_info(
"HELIUM BEAD POSITIONS", restarted_infos)
753 IF (.NOT. explicit1)
THEN
759 CALL set_restart_info(
"HELIUM PERMUTATION STATE", restarted_infos)
766 IF (.NOT. explicit1)
THEN
772 CALL set_restart_info(
"HELIUM FORCES ON SOLUTE", restarted_infos)
779 IF (.NOT. explicit1)
THEN
785 CALL set_restart_info(
"HELIUM RNG STATE", restarted_infos)
793 IF (.NOT. explicit1)
THEN
799 CALL set_restart_info(
"HELIUM DENSITIES", restarted_infos)
804 CALL release_restart_info(restarted_infos, r_file_path, binary_restart_file, &
808 CALL timestop(handle)
809 END SUBROUTINE handle_ext_restart
817 SUBROUTINE set_restart_info(label, restarted_infos)
819 CHARACTER(LEN=*),
INTENT(IN) :: label
820 CHARACTER(LEN=default_string_length), &
821 DIMENSION(:),
POINTER :: restarted_infos
826 IF (
ASSOCIATED(restarted_infos)) isize =
SIZE(restarted_infos)
828 CALL reallocate(restarted_infos, 1, isize)
829 restarted_infos(isize) = trim(label)
831 END SUBROUTINE set_restart_info
841 SUBROUTINE release_restart_info(restarted_infos, r_file_path, &
842 binary_restart_file, output_unit)
843 CHARACTER(LEN=default_string_length), &
844 DIMENSION(:),
POINTER :: restarted_infos
845 CHARACTER(LEN=*),
INTENT(IN) :: r_file_path, binary_restart_file
846 INTEGER,
INTENT(IN) :: output_unit
850 IF (output_unit > 0 .AND.
ASSOCIATED(restarted_infos))
THEN
851 WRITE (output_unit,
'(1X,79("*"))')
852 WRITE (output_unit,
'(1X,"*",T30,A,T80,"*")')
" RESTART INFORMATION "
853 WRITE (output_unit,
'(1X,79("*"))')
854 WRITE (output_unit,
'(1X,"*",T80,"*")')
856 WRITE (output_unit,
'(1X,"*",A,T26,A,T80,"*")')
" RESTART FILE NAME: ", &
857 r_file_path(53*(i - 1) + 1:53*i)
858 DO i = 2, ceiling(real(len_trim(r_file_path), kind=dp)/53.0_dp)
859 WRITE (output_unit,
'(T1,1X,"*",T26,A,T80,"*")') r_file_path(53*(i - 1) + 1:53*i)
861 IF (len_trim(binary_restart_file) > 0)
THEN
863 WRITE (output_unit,
'(1X,"*",A,T26,A,T80,"*")')
" BINARY RESTART FILE: ", &
864 binary_restart_file(53*(i - 1) + 1:53*i)
865 DO i = 2, ceiling(real(len_trim(binary_restart_file), kind=dp)/53.0_dp)
866 WRITE (output_unit,
'(T1,1X,"*",T26,A,T80,"*")') binary_restart_file(53*(i - 1) + 1:53*i)
869 WRITE (output_unit,
'(1X,"*",T80,"*")')
870 WRITE (output_unit,
'(1X,"*", A,T80,"*")')
" RESTARTED QUANTITIES: "
871 DO j = 1,
SIZE(restarted_infos)
872 DO i = 1, ceiling(real(len_trim(restarted_infos(j)), kind=dp)/53.0_dp)
873 WRITE (output_unit,
'(T1,1X,"*",T26,A,T80,"*")') restarted_infos(j) (53*(i - 1) + 1:53*i)
876 WRITE (output_unit,
'(1X,79("*"),/)')
878 IF (
ASSOCIATED(restarted_infos))
THEN
879 DEALLOCATE (restarted_infos)
881 END SUBROUTINE release_restart_info
892 SUBROUTINE restart_thermostat(flag, input_file, restart_file, path, check)
893 LOGICAL,
INTENT(IN) :: flag
894 TYPE(section_vals_type),
POINTER :: input_file, restart_file
895 CHARACTER(LEN=*),
INTENT(IN) :: path
896 LOGICAL,
INTENT(IN),
OPTIONAL :: check
898 INTEGER :: input_region, input_type, &
899 restart_region, restart_type
900 LOGICAL :: check_loc, skip_other_checks
901 TYPE(section_vals_type),
POINTER :: section
903 check_loc = check_restart(input_file, restart_file, trim(path))
904 skip_other_checks =
PRESENT(check)
905 IF (skip_other_checks) check_loc = check
906 IF (flag .AND. check_loc)
THEN
909 CALL section_vals_val_get(input_file, trim(path)//
"%TYPE", i_val=input_type)
910 CALL section_vals_val_get(restart_file, trim(path)//
"%TYPE", i_val=restart_type)
912 IF (input_type == do_thermo_same_as_part)
THEN
913 CALL section_vals_val_get(input_file,
"MOTION%MD%THERMOSTAT%TYPE", i_val=input_type)
916 IF (skip_other_checks)
THEN
917 input_region = do_region_global
918 restart_region = do_region_global
921 CALL section_vals_val_get(input_file, trim(path)//
"%REGION", i_val=input_region)
922 CALL section_vals_val_get(restart_file, trim(path)//
"%REGION", i_val=restart_region)
925 IF ((input_type == restart_type) .AND. (input_region == restart_region))
THEN
926 SELECT CASE (input_type)
927 CASE (do_thermo_nose)
928 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%NOSE%COORD")
929 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%NOSE%COORD", section)
931 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%NOSE%VELOCITY")
932 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%NOSE%VELOCITY", section)
934 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%NOSE%MASS")
935 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%NOSE%MASS", section)
937 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%NOSE%FORCE")
938 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%NOSE%FORCE", section)
939 CASE (do_thermo_csvr)
940 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%CSVR%THERMOSTAT_ENERGY")
941 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%CSVR%THERMOSTAT_ENERGY", section)
942 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%CSVR%RNG_INIT")
943 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%CSVR%RNG_INIT", section)
945 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%GLE%THERMOSTAT_ENERGY")
946 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%GLE%THERMOSTAT_ENERGY", section)
947 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%GLE%RNG_INIT")
948 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%GLE%RNG_INIT", section)
949 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%GLE%S")
950 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%GLE%S", section)
952 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%AD_LANGEVIN%CHI")
953 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%AD_LANGEVIN%CHI", section)
954 section => section_vals_get_subs_vals(restart_file, trim(path)//
"%AD_LANGEVIN%MASS")
955 CALL section_vals_set_subs_vals(input_file, trim(path)//
"%AD_LANGEVIN%MASS", section)
958 IF (input_type /= restart_type) &
959 CALL cp_warn(__location__, &
960 "Requested to restart thermostat: "//trim(path)//
". The thermostat "// &
961 "specified in the input file and the information present in the restart "// &
962 "file do not match the same type of thermostat! Restarting is not possible! "// &
963 "Thermostat will not be restarted! ")
964 IF (input_region /= restart_region) &
965 CALL cp_warn(__location__, &
966 "Requested to restart thermostat: "//trim(path)//
". The thermostat "// &
967 "specified in the input file and the information present in the restart "// &
968 "file do not match the same type of REGION! Restarting is not possible! "// &
969 "Thermostat will not be restarted! ")
972 END SUBROUTINE restart_thermostat
982 FUNCTION check_restart(input_file, restart_file, tag_section)
RESULT(do_restart)
983 TYPE(section_vals_type),
POINTER :: input_file, restart_file
984 CHARACTER(LEN=*),
INTENT(IN) :: tag_section
985 LOGICAL :: do_restart
987 CHARACTER(len=*),
PARAMETER :: routinen =
'check_restart'
990 LOGICAL :: explicit1, explicit2
991 TYPE(section_vals_type),
POINTER :: work_section
993 CALL timeset(routinen, handle)
994 NULLIFY (work_section)
995 work_section => section_vals_get_subs_vals(input_file, trim(tag_section))
996 CALL section_vals_get(work_section, explicit=explicit1)
997 work_section => section_vals_get_subs_vals(restart_file, trim(tag_section))
998 CALL section_vals_get(work_section, explicit=explicit2)
1000 do_restart = explicit1 .AND. explicit2
1001 CALL timestop(handle)
1002 END FUNCTION check_restart
1011 TYPE(section_vals_type),
POINTER :: input_file
1013 CHARACTER(len=*),
PARAMETER :: routinen =
'remove_restart_info'
1015 INTEGER :: handle, iforce_eval, nforce_eval1
1016 LOGICAL :: explicit1
1017 TYPE(section_vals_type),
POINTER :: md_section, motion_section, section1, &
1018 section_to_delete, sections1, &
1021 CALL timeset(routinen, handle)
1023 NULLIFY (work_section)
1024 section_to_delete => section_vals_get_subs_vals(input_file,
"EXT_RESTART")
1025 CALL section_vals_remove_values(section_to_delete)
1026 sections1 => section_vals_get_subs_vals(input_file,
"FORCE_EVAL")
1027 CALL section_vals_get(sections1, n_repetition=nforce_eval1)
1029 DO iforce_eval = 1, nforce_eval1
1030 section1 => section_vals_get_subs_vals3(sections1,
"SUBSYS", i_rep_section=iforce_eval)
1031 section_to_delete => section_vals_get_subs_vals(section1,
"COORD")
1032 CALL section_vals_remove_values(section_to_delete)
1033 section_to_delete => section_vals_get_subs_vals(section1,
"VELOCITY")
1034 CALL section_vals_remove_values(section_to_delete)
1037 motion_section => section_vals_get_subs_vals(input_file,
"MOTION")
1038 md_section => section_vals_get_subs_vals(motion_section,
"MD")
1039 CALL section_vals_get(md_section, explicit=explicit1)
1041 CALL section_vals_val_unset(md_section,
"STEP_START_VAL")
1042 CALL section_vals_val_unset(md_section,
"TIME_START_VAL")
1043 CALL section_vals_val_unset(md_section,
"ECONS_START_VAL")
1045 work_section => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN")
1046 CALL section_vals_get(work_section, explicit=explicit1)
1048 CALL section_vals_val_unset(motion_section,
"FREE_ENERGY%METADYN%STEP_START_VAL")
1049 CALL section_vals_val_unset(motion_section,
"FREE_ENERGY%METADYN%NHILLS_START_VAL")
1051 section_to_delete => section_vals_get_subs_vals(motion_section,
"BAND%REPLICA")
1052 CALL section_vals_remove_values(section_to_delete)
1053 section_to_delete => section_vals_get_subs_vals(md_section,
"AVERAGES%RESTART_AVERAGES")
1054 CALL section_vals_remove_values(section_to_delete)
1055 section_to_delete => section_vals_get_subs_vals(md_section,
"THERMOSTAT%NOSE%COORD")
1056 CALL section_vals_remove_values(section_to_delete)
1057 section_to_delete => section_vals_get_subs_vals(md_section,
"THERMOSTAT%NOSE%VELOCITY")
1058 CALL section_vals_remove_values(section_to_delete)
1059 section_to_delete => section_vals_get_subs_vals(md_section,
"THERMOSTAT%NOSE%MASS")
1060 CALL section_vals_remove_values(section_to_delete)
1061 section_to_delete => section_vals_get_subs_vals(md_section,
"THERMOSTAT%NOSE%FORCE")
1062 CALL section_vals_remove_values(section_to_delete)
1063 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%MASS")
1064 CALL section_vals_remove_values(section_to_delete)
1065 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%VELOCITY")
1066 CALL section_vals_remove_values(section_to_delete)
1067 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%THERMOSTAT%NOSE%COORD")
1068 CALL section_vals_remove_values(section_to_delete)
1069 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%THERMOSTAT%NOSE%VELOCITY")
1070 CALL section_vals_remove_values(section_to_delete)
1071 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%THERMOSTAT%NOSE%MASS")
1072 CALL section_vals_remove_values(section_to_delete)
1073 section_to_delete => section_vals_get_subs_vals(md_section,
"BAROSTAT%THERMOSTAT%NOSE%FORCE")
1074 CALL section_vals_remove_values(section_to_delete)
1075 section_to_delete => section_vals_get_subs_vals(md_section,
"SHELL%THERMOSTAT%NOSE%COORD")
1076 CALL section_vals_remove_values(section_to_delete)
1077 section_to_delete => section_vals_get_subs_vals(md_section,
"SHELL%THERMOSTAT%NOSE%VELOCITY")
1078 CALL section_vals_remove_values(section_to_delete)
1079 section_to_delete => section_vals_get_subs_vals(md_section,
"SHELL%THERMOSTAT%NOSE%MASS")
1080 CALL section_vals_remove_values(section_to_delete)
1081 section_to_delete => section_vals_get_subs_vals(md_section,
"SHELL%THERMOSTAT%NOSE%FORCE")
1082 CALL section_vals_remove_values(section_to_delete)
1084 section_to_delete => section_vals_get_subs_vals(motion_section,
"CONSTRAINT%FIX_ATOM_RESTART")
1085 CALL section_vals_remove_values(section_to_delete)
1086 section_to_delete => section_vals_get_subs_vals(motion_section,
"CONSTRAINT%COLVAR_RESTART")
1087 CALL section_vals_remove_values(section_to_delete)
1089 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%SPAWNED_HILLS_POS")
1090 CALL section_vals_remove_values(section_to_delete)
1091 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%SPAWNED_HILLS_SCALE")
1092 CALL section_vals_remove_values(section_to_delete)
1093 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%SPAWNED_HILLS_HEIGHT")
1094 CALL section_vals_remove_values(section_to_delete)
1095 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%SPAWNED_HILLS_INVDT")
1096 CALL section_vals_remove_values(section_to_delete)
1097 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%EXT_LAGRANGE_SS0")
1098 CALL section_vals_remove_values(section_to_delete)
1099 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%EXT_LAGRANGE_VVP")
1100 CALL section_vals_remove_values(section_to_delete)
1101 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%EXT_LAGRANGE_SS")
1102 CALL section_vals_remove_values(section_to_delete)
1103 section_to_delete => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN%EXT_LAGRANGE_FS")
1104 CALL section_vals_remove_values(section_to_delete)
1105 CALL timestop(handle)
1113 SUBROUTINE handle_defaults_restart(r_section)
1114 TYPE(section_vals_type),
POINTER :: r_section
1116 CHARACTER(len=*),
PARAMETER :: routinen =
'handle_defaults_restart'
1118 INTEGER :: handle, ik, nval
1119 LOGICAL :: restart_default
1120 TYPE(keyword_type),
POINTER :: keyword
1121 TYPE(section_type),
POINTER :: section
1123 CALL timeset(routinen, handle)
1124 NULLIFY (keyword, section)
1125 CALL section_vals_get(r_section, section=section)
1126 CALL section_vals_val_get(r_section,
"RESTART_DEFAULT", l_val=restart_default)
1127 DO ik = -1, section%n_keywords
1128 keyword => section%keywords(ik)%keyword
1129 IF (
ASSOCIATED(keyword))
THEN
1130 IF (keyword%type_of_var == logical_t .AND. keyword%names(1) (1:8) ==
"RESTART_")
THEN
1131 IF (trim(keyword%names(1)) ==
"RESTART_DEFAULT") cycle
1132 CALL section_vals_val_get(r_section, keyword%names(1), n_rep_val=nval)
1135 CALL section_vals_val_set(r_section, keyword%names(1), l_val=restart_default)
1140 CALL timestop(handle)
1142 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.