45#include "./base/base_uses.f90"
50 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .true.
51 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_check'
71 INTEGER,
INTENT(IN),
OPTIONAL :: output_unit
73 CHARACTER(len=*),
PARAMETER :: routinen =
'check_cp2k_input'
75 INTEGER :: force_eval_method, handle, iforce_eval, &
77 LOGICAL :: apply_ext_potential, do_center, &
78 explicit, explicit_embed, explicit_mix
82 CALL timeset(routinen, handle)
83 cpassert(
ASSOCIATED(input_file))
84 cpassert(input_file%ref_count > 0)
86 IF (
PRESENT(output_unit))
THEN
87 CALL handle_ext_restart(input_declaration, input_file, para_env, output_unit)
97 DO iforce_eval = 1, nforce_eval
99 i_rep_section=iforce_eval)
101 IF (explicit_mix)
EXIT
103 DO iforce_eval = 1, nforce_eval
105 i_rep_section=iforce_eval)
107 IF (explicit_embed)
EXIT
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.")
121 DO iforce_eval = 1, nforce_eval
136 CALL check_properties_bse(sections, iforce_eval)
142 CALL section_vals_val_get(sections,
"SUBSYS%TOPOLOGY%CENTER_COORDINATES%_SECTION_PARAMETERS_", &
146 "SUBSYS%TOPOLOGY%CENTER_COORDINATES%_SECTION_PARAMETERS_", &
148 cpwarn(
"Turning off CENTER_COORDINATES for a MiMiC run.")
154 IF (apply_ext_potential)
THEN
155 cpabort(
"The EXTERNAL_POTENTIAL section is not allowed for the MiMiC runtype.")
160 IF (force_eval_method /=
do_qs)
THEN
161 cpabort(
"At the moment, only Quickstep method is supported with MiMiC.")
165 CALL timestop(handle)
175 SUBROUTINE check_properties_bse(force_env_sections, iforce_eval)
177 INTEGER,
INTENT(IN) :: iforce_eval
179 INTEGER :: n_special_kp, periodic, print_level_nto, &
181 INTEGER,
DIMENSION(:),
POINTER :: nkp_grid_dos
182 LOGICAL :: cube_files, do_bse, do_gw, do_ri_rs
184 properties_sec, subsys_sec
186 NULLIFY (bs_sec, bse_sec, dft_sec, gw_sec, nkp_grid_dos, properties_sec, subsys_sec)
190 IF (.NOT. do_bse)
RETURN
195 IF (.NOT. do_gw) cpabort(
"PROPERTIES%BSE needs PROPERTIES%BANDSTRUCTURE%GW")
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")
206 CALL cp_abort(__location__, &
207 "The BSE treats non-periodic systems only: PROPERTIES%BSE needs "// &
208 "PERIODIC NONE in the CELL section")
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")
221 CALL section_vals_val_get(dft_sec,
"REAL_TIME_PROPAGATION%RTBSE%_SECTION_PARAMETERS_", i_val=rtp_method)
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")
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")
239 END SUBROUTINE check_properties_bse
250 CHARACTER(LEN=512) :: wrn_msg
251 INTEGER :: ifun, nfun, shortcut
262 IF (.NOT.
ASSOCIATED(xc_fun))
EXIT
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."
272 SELECT CASE (shortcut)
291 r_val=0.3998335231_dp)
293 r_val=0.0000000000_dp)
302 r_val=0.6001664769_dp)
387 cpabort(
"unknown shortcut "//trim(adjustl(
cp_to_string(shortcut))))
400 SUBROUTINE handle_ext_restart(input_declaration, input_file, para_env, output_unit)
404 INTEGER,
INTENT(IN) :: output_unit
406 CHARACTER(len=*),
PARAMETER :: routinen =
'handle_ext_restart'
408 CHARACTER(default_path_length) :: r_file_path
412 CALL timeset(routinen, handle)
417 IF (r_file_path /=
" ")
THEN
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, &
428 LOGICAL :: bsse_check,
check, explicit1, explicit2, &
429 flag, flag2, qmmm_check, subsys_check
431 REAL(kind=
dp),
DIMENSION(:),
POINTER :: vec, work
433 section, section1, section2, &
436 NULLIFY (restarted_infos, iwalkers_status, rwalkers_status, vec, ivec, work, iwork)
443 NULLIFY (restart_file)
445 CALL parser_create(cpparser, file_name=r_file_path, para_env=para_env)
448 default_units=default_units)
458 IF (nforce_eval1 /= nforce_eval2)
THEN
459 cpabort(
"Restart and input file MUST have the number of force_env sections")
462 CALL handle_defaults_restart(r_section)
465 DO iforce_eval = 1, nforce_eval1
467 i_rep_section=iforce_eval)
469 i_rep_section=iforce_eval)
473 subsys_check = (
ASSOCIATED(section1) .EQV.
ASSOCIATED(section2))
474 IF (subsys_check)
THEN
475 IF (
ASSOCIATED(section1))
THEN
480 CALL set_restart_info(
"CELL", restarted_infos)
487 CALL set_restart_info(
"COORDINATES", restarted_infos)
499 CALL set_restart_info(
"RANDOM NUMBER GENERATOR", restarted_infos)
506 CALL set_restart_info(
"VELOCITIES", restarted_infos)
514 IF (check_restart(section1, section2,
"SHELL_COORD"))
THEN
515 CALL set_restart_info(
"SHELL COORDINATES", restarted_infos)
522 IF (check_restart(section1, section2,
"CORE_COORD"))
THEN
523 CALL set_restart_info(
"CORE COORDINATES", restarted_infos)
530 IF (check_restart(section1, section2,
"SHELL_VELOCITY"))
THEN
531 CALL set_restart_info(
"SHELL VELOCITIES", restarted_infos)
538 IF (check_restart(section1, section2,
"CORE_VELOCITY"))
THEN
539 CALL set_restart_info(
"CORE VELOCITIES", restarted_infos)
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!")
555 qmmm_check = (explicit1 .AND. explicit2)
556 IF (flag .AND. qmmm_check)
THEN
557 CALL set_restart_info(
"QMMM TRANSLATION VECTOR", restarted_infos)
569 bsse_check = (explicit1 .AND. explicit2)
570 IF (flag .AND. bsse_check)
THEN
573 CALL set_restart_info(
"BSSE FRAGMENT ENERGIES", restarted_infos)
579 IF (check_restart(input_file, restart_file,
"MOTION%MD"))
THEN
586 CALL set_restart_info(
"MD COUNTERS", restarted_infos)
589 IF (check_restart(input_file, restart_file,
"MOTION%GEO_OPT"))
THEN
593 CALL set_restart_info(
"GEO_OPT COUNTERS", restarted_infos)
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", &
598 CALL section_vals_val_set(input_file,
"MOTION%GEO_OPT%TRANSITION_STATE%DIMER%ROT_OPT%STEP_START_VAL", &
600 CALL set_restart_info(
"ROT_OPT COUNTERS", restarted_infos)
604 IF (check_restart(input_file, restart_file,
"MOTION%GEO_OPT"))
THEN
608 CALL set_restart_info(
"CELL_OPT COUNTERS", restarted_infos)
611 IF (check_restart(input_file, restart_file,
"OPTIMIZE_INPUT"))
THEN
614 CALL set_restart_info(
"OPTIMIZE_INPUT ITERATION NUMBER", restarted_infos)
617 IF (check_restart(input_file, restart_file,
"MOTION%PINT"))
THEN
621 CALL set_restart_info(
"PINT ITERATION NUMBER", restarted_infos)
625 IF (flag2 .AND. check_restart(input_file, restart_file,
"MOTION%FREE_ENERGY%METADYN"))
THEN
627 "MOTION%FREE_ENERGY%METADYN%STEP_START_VAL", i_val=myi)
629 "MOTION%FREE_ENERGY%METADYN%STEP_START_VAL", i_val=myi)
631 "MOTION%FREE_ENERGY%METADYN%NHILLS_START_VAL", i_val=myi)
633 "MOTION%FREE_ENERGY%METADYN%NHILLS_START_VAL", i_val=myi)
636 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_NUMBER", i_val=myi)
638 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_NUMBER", i_val=myi)
640 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_STEP", i_val=myi)
642 "MOTION%FREE_ENERGY%METADYN%OLD_HILL_STEP", i_val=myi)
644 CALL set_restart_info(
"METADYNAMIC COUNTERS", restarted_infos)
650 IF (check_restart(input_file, restart_file,
"MOTION%MD"))
THEN
653 CALL set_restart_info(
"MD AVERAGES", restarted_infos)
658 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%BAND"))
THEN
661 CALL set_restart_info(
"BAND CALCULATION", restarted_infos)
665 IF (flag .AND. check_restart(input_file, restart_file,
"OPTIMIZE_INPUT%VARIABLE"))
THEN
668 CALL set_restart_info(
"OPTIMIZE_INPUT: VARIABLES", restarted_infos)
672 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%MD%BAROSTAT"))
THEN
674 "MOTION%MD%BAROSTAT%MASS")
678 "MOTION%MD%BAROSTAT%VELOCITY")
681 CALL set_restart_info(
"BAROSTAT", restarted_infos)
684 flag = check_restart(input_file, restart_file,
"MOTION%MD")
689 check = check_restart(input_file, restart_file,
"MOTION%MD%BAROSTAT")
690 CALL restart_thermostat(flag, input_file, restart_file,
"MOTION%MD%BAROSTAT%THERMOSTAT", &
692 IF (flag .AND.
check)
CALL set_restart_info(
"THERMOSTAT OF BAROSTAT", restarted_infos)
696 check = check_restart(input_file, restart_file,
"MOTION%MD%SHELL")
699 CALL restart_thermostat(flag, input_file, restart_file,
"MOTION%MD%SHELL%THERMOSTAT")
700 CALL set_restart_info(
"SHELL THERMOSTAT", restarted_infos)
704 CALL restart_thermostat(flag, input_file, restart_file,
"MOTION%MD%THERMOSTAT")
705 IF (flag)
CALL set_restart_info(
"PARTICLE THERMOSTAT", restarted_infos)
708 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%CONSTRAINT"))
THEN
711 CALL set_restart_info(
"CONSTRAINTS/RESTRAINTS", restarted_infos)
715 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%FREE_ENERGY%METADYN"))
THEN
717 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_POS")
721 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_SCALE")
725 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_HEIGHT")
729 "MOTION%FREE_ENERGY%METADYN%SPAWNED_HILLS_INVDT")
734 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_SS0")
738 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_VVP")
742 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_SS")
746 "MOTION%FREE_ENERGY%METADYN%EXT_LAGRANGE_FS")
749 CALL set_restart_info(
"METADYNAMICS", restarted_infos)
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.")
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.")
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)
783 IF (flag .AND. check_restart(input_file, restart_file,
"MOTION%GEO_OPT%TRANSITION_STATE%DIMER"))
THEN
785 "MOTION%GEO_OPT%TRANSITION_STATE%DIMER%DIMER_VECTOR")
788 CALL set_restart_info(
"DIMER TRANSITION STATE SEARCH", restarted_infos)
792 DO i_rep_val = 1, n_rep_val
794 IF (path /=
" ")
THEN
797 CALL set_restart_info(
"USER RESTART: "//trim(path), restarted_infos)
805 "FORCE_EVAL%DFT%REAL_TIME_PROPAGATION")
809 CALL set_restart_info(
"REAL TIME PROPAGATION", restarted_infos)
817 CALL set_restart_info(
"PINT BEAD POSITIONS", restarted_infos)
823 CALL set_restart_info(
"PINT BEAD VELOCITIES", restarted_infos)
831 CALL set_restart_info(
"PINT NOSE THERMOSTAT", restarted_infos)
837 CALL set_restart_info(
"PINT GLE THERMOSTAT", restarted_infos)
846 IF (.NOT. explicit1)
THEN
852 CALL set_restart_info(
"HELIUM BEAD POSITIONS", restarted_infos)
859 IF (.NOT. explicit1)
THEN
865 CALL set_restart_info(
"HELIUM PERMUTATION STATE", restarted_infos)
872 IF (.NOT. explicit1)
THEN
878 CALL set_restart_info(
"HELIUM FORCES ON SOLUTE", restarted_infos)
885 IF (.NOT. explicit1)
THEN
891 CALL set_restart_info(
"HELIUM RNG STATE", restarted_infos)
899 IF (.NOT. explicit1)
THEN
905 CALL set_restart_info(
"HELIUM DENSITIES", restarted_infos)
910 CALL release_restart_info(restarted_infos, r_file_path, binary_restart_file, &
914 CALL timestop(handle)
915 END SUBROUTINE handle_ext_restart
923 SUBROUTINE set_restart_info(label, restarted_infos)
925 CHARACTER(LEN=*),
INTENT(IN) :: label
926 CHARACTER(LEN=default_string_length), &
927 DIMENSION(:),
POINTER :: restarted_infos
932 IF (
ASSOCIATED(restarted_infos)) isize =
SIZE(restarted_infos)
934 CALL reallocate(restarted_infos, 1, isize)
935 restarted_infos(isize) = trim(label)
937 END SUBROUTINE set_restart_info
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
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,"*")')
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)
967 IF (len_trim(binary_restart_file) > 0)
THEN
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)
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)
982 WRITE (output_unit,
'(1X,79("*"),/)')
984 IF (
ASSOCIATED(restarted_infos))
THEN
985 DEALLOCATE (restarted_infos)
987 END SUBROUTINE release_restart_info
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
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
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
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)
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)
1022 IF (skip_other_checks)
THEN
1023 input_region = do_region_global
1024 restart_region = do_region_global
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)
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)
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)
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)
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)
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)
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! ")
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! ")
1080 END SUBROUTINE restart_thermostat
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
1095 CHARACTER(len=*),
PARAMETER :: routinen =
'check_restart'
1098 LOGICAL :: explicit1, explicit2
1099 TYPE(section_vals_type),
POINTER :: work_section
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)
1108 do_restart = explicit1 .AND. explicit2
1109 CALL timestop(handle)
1110 END FUNCTION check_restart
1119 TYPE(section_vals_type),
POINTER :: input_file
1121 CHARACTER(len=*),
PARAMETER :: routinen =
'remove_restart_info'
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, &
1129 CALL timeset(routinen, handle)
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)
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)
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)
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")
1153 work_section => section_vals_get_subs_vals(motion_section,
"FREE_ENERGY%METADYN")
1154 CALL section_vals_get(work_section, explicit=explicit1)
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")
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)
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)
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)
1221 SUBROUTINE handle_defaults_restart(r_section)
1222 TYPE(section_vals_type),
POINTER :: r_section
1224 CHARACTER(len=*),
PARAMETER :: routinen =
'handle_defaults_restart'
1226 INTEGER :: handle, ik, nval
1227 LOGICAL :: restart_default
1228 TYPE(keyword_type),
POINTER :: keyword
1229 TYPE(section_type),
POINTER :: section
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)
1243 CALL section_vals_val_set(r_section, keyword%names(1), l_val=restart_default)
1248 CALL timestop(handle)
1250 END SUBROUTINE handle_defaults_restart
Handles all functions related to the CELL.
integer, parameter, public use_perd_none
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.
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.
subroutine check(condition, label)
Stops with an error message if a test fails.
stores the default units to be used
stores all the informations relevant to an mpi environment