prevent error

h5close_f will give an error if h5open_f was not called.
according to the manual, calling h5open_f multiple time is not a problem
This commit is contained in:
Martin Diehl 2018-11-17 15:00:51 +01:00
parent d5963b403a
commit d8a425b464
1 changed files with 2 additions and 0 deletions

View File

@ -23,6 +23,8 @@ subroutine quit(stop_id)
integer(pInt) :: error = 0_pInt
PetscErrorCode :: ierr = 0
call h5open_f(hdferr)
if (hdferr /= 0) write(6,'(a,i5)') ' Error in h5open_f',hdferr ! prevents error if not opened yet
call h5close_f(hdferr)
if (hdferr /= 0) write(6,'(a,i5)') ' Error in h5close_f',hdferr