mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 14:15:19 -04:00
Use default Hessian restart file name if no name is specified
This commit is contained in:
parent
7a48e47ee1
commit
27a2d10681
1 changed files with 14 additions and 1 deletions
|
|
@ -150,6 +150,7 @@ CONTAINS
|
|||
conv = .FALSE.
|
||||
rat = 0.0_dp
|
||||
wildcard = " BFGS"
|
||||
hes_filename = ""
|
||||
|
||||
! Stop if not yet implemented
|
||||
SELECT CASE (gopt_env%type_id)
|
||||
|
|
@ -307,8 +308,20 @@ CONTAINS
|
|||
IF (((its - iter_nr) == 1) .AND. hesrest) THEN
|
||||
IF (ionode) THEN
|
||||
CALL section_vals_val_get(geo_section, "BFGS%RESTART_FILE_NAME", c_val=hes_filename)
|
||||
CALL open_file(file_name=hes_filename, file_status="OLD", &
|
||||
IF (LEN_TRIM(hes_filename) == 0) THEN
|
||||
! Set default Hessian restart file name if no file name is defined
|
||||
hes_filename = TRIM(logger%iter_info%project_name)//"-BFGS.Hessian"
|
||||
END IF
|
||||
IF (output_unit > 0) THEN
|
||||
WRITE (UNIT=output_unit, FMT="(/,T2,A)") &
|
||||
"BFGS| Checking for Hessian restart file <"//TRIM(ADJUSTL(hes_filename))//">"
|
||||
END IF
|
||||
CALL open_file(file_name=TRIM(hes_filename), file_status="OLD", &
|
||||
file_form="UNFORMATTED", file_action="READ", unit_number=hesunit_read)
|
||||
IF (output_unit > 0) THEN
|
||||
WRITE (UNIT=output_unit, FMT="(T2,A)") &
|
||||
"BFGS| Hessian restart file read"
|
||||
END IF
|
||||
END IF
|
||||
CALL cp_fm_read_unformatted(hess_mat, hesunit_read)
|
||||
IF (ionode) CALL close_file(unit_number=hesunit_read)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue