iload_from_hdf5 Subroutine

private subroutine iload_from_hdf5(h5file_id, dset, idatum, attr)

Arguments

Type IntentOptional AttributesName
integer(kind=HID_T), intent(in) :: h5file_id
character(len=MAX_STRING_LENGTH), intent(in) :: dset
integer, intent(out) :: idatum
character(len=MAX_STRING_LENGTH), intent(out), optional :: attr

Contents

Source Code


Source Code

  subroutine iload_from_hdf5(h5file_id,dset,idatum,attr)
    INTEGER(HID_T), INTENT(IN) 				:: h5file_id
    CHARACTER(MAX_STRING_LENGTH), INTENT(IN) 		:: dset
    INTEGER, INTENT(OUT) 				:: idatum
    CHARACTER(MAX_STRING_LENGTH), OPTIONAL, INTENT(OUT) :: attr
    CHARACTER(4) 					:: aname = "Info"
    INTEGER(HID_T) 					:: dset_id
    INTEGER(HID_T) 					:: dspace_id
    INTEGER(HID_T) 					:: aspace_id
    INTEGER(HID_T) 					:: attr_id
    INTEGER(HID_T) 					:: atype_id
    INTEGER(HSIZE_T), DIMENSION(1) 			:: dims = (/1/)
    INTEGER(HSIZE_T), DIMENSION(1) 			:: adims = (/1/)
    INTEGER 						:: h5error

    ! * * * Read datum from file * * *

    call h5dopen_f(h5file_id, TRIM(dset), dset_id, h5error)
    if (h5error .EQ. -1) then
       write(6,'("KORC ERROR: Something went wrong in: iload_from_hdf5 &
            --> h5dopen_f")')
    end if

    call h5dread_f(dset_id, H5T_NATIVE_INTEGER, idatum, dims, h5error)

    if (h5error .EQ. -1) then
       write(6,'("KORC ERROR: Something went wrong in: iload_from_hdf5 &
            --> h5dread_f")')
    end if

    call h5dclose_f(dset_id, h5error)
    if (h5error .EQ. -1) then
       write(6,'("KORC ERROR: Something went wrong in: iload_from_hdf5 &
            --> h5dclose_f")')
    end if

    if (PRESENT(attr)) then
       ! * * * Read attribute from file * * *

       ! * * * Read attribute from file * * *
    end if

    ! * * * Read datum from file * * *
  end subroutine iload_from_hdf5