hdf5_obj_Close Subroutine

private impure subroutine hdf5_obj_Close(this)

Closes hdf5 file.

Type Bound

hdf5_obj

Arguments

Type IntentOptional Attributes Name
class(hdf5_obj), intent(inout) :: this

A HDF5 object


Calls

proc~~hdf5_obj_close~~CallsGraph proc~hdf5_obj_close hdf5_obj%hdf5_obj_Close h5fclose_f h5fclose_f proc~hdf5_obj_close->h5fclose_f h5pclose_f h5pclose_f proc~hdf5_obj_close->h5pclose_f

Source Code

    impure subroutine hdf5_obj_Close(this)
      !> Closes hdf5 file.
      implicit none
      class(hdf5_obj), intent(inout) :: this                                   !! A HDF5 object
      ! Work variables
      integer :: ierr

      if (.not. this%is_open) return

      ! Close the file
      call H5Fclose_f(this%fid, ierr)
      if (ierr.ne.0) &
        call this%parallel%Stop("Failed closing HDF5 file: "//this%filename)

      ! Close property list
      call H5Pclose_f(this%plistid, ierr)
      if (ierr.ne.0) &
        call this%parallel%Stop("Failed closing property list for HDF5 file: "//this%filename)

      ! Toggle switch
      this%is_open = .false.

      return
    end subroutine hdf5_obj_Close