From fe2cf94d704c4ee72602eee3f0f31b0eb1c4b187 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 10 Aug 2023 23:06:31 +0200 Subject: [PATCH 1/2] use central functionality --- src/CLI.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CLI.f90 b/src/CLI.f90 index ed7fbcd5e..a3503bd43 100644 --- a/src/CLI.f90 +++ b/src/CLI.f90 @@ -178,7 +178,7 @@ subroutine CLI_init() case ('-r', '--rs', '--restart') if (.not. hasArg) call IO_error(610,ext_msg='--jobname') arg = getArg(i+1) - read(arg,*,iostat=stat) CLI_restartInc + CLI_restartInc = IO_strAsInt(arg) if (CLI_restartInc < 0 .or. stat /= 0) call IO_error(611,ext_msg=arg) end select end do From 7d08286192d2fb4297aa312be53bf4773f172125 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 10 Aug 2023 23:08:58 +0200 Subject: [PATCH 2/2] clearer error message --- src/HDF5_utilities.f90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/HDF5_utilities.f90 b/src/HDF5_utilities.f90 index b87dbad3d..77b87c7ed 100644 --- a/src/HDF5_utilities.f90 +++ b/src/HDF5_utilities.f90 @@ -6,6 +6,7 @@ !> @author Philip Eisenlohr, Michigan State University !-------------------------------------------------------------------------------------------------- module HDF5_utilities + use IO use HDF5 #ifdef PETSC #include @@ -190,6 +191,7 @@ integer(HID_T) function HDF5_openFile(fileName,mode,parallel) character :: m integer(HID_T) :: plist_id integer :: hdferr + logical :: exist m = misc_optional(mode,'r') @@ -214,6 +216,8 @@ integer(HID_T) function HDF5_openFile(fileName,mode,parallel) call H5Fopen_f(fileName,H5F_ACC_RDWR_F,HDF5_openFile,hdferr,access_prp = plist_id) call HDF5_chkerr(hdferr) elseif (m == 'r') then + inquire(file=fileName,exist=exist) + if (.not. exist) call IO_error(100,trim(fileName)) call H5Fopen_f(fileName,H5F_ACC_RDONLY_F,HDF5_openFile,hdferr,access_prp = plist_id) call HDF5_chkerr(hdferr) else