From d8a425b4643be043eb2161b4f4c753b5197718e4 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 17 Nov 2018 15:00:51 +0100 Subject: [PATCH] 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 --- src/quit.f90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/quit.f90 b/src/quit.f90 index 4219830a5..ad61943e4 100644 --- a/src/quit.f90 +++ b/src/quit.f90 @@ -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