Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=HID_T), | intent(in) | :: | h5file_id | |||
character(len=MAX_STRING_LENGTH), | intent(in) | :: | dset | |||
real(kind=rp), | intent(out) | :: | rdatum | |||
character(len=MAX_STRING_LENGTH), | intent(out), | optional | :: | attr |
subroutine rload_from_hdf5(h5file_id,dset,rdatum,attr)
INTEGER(HID_T), INTENT(IN) :: h5file_id
CHARACTER(MAX_STRING_LENGTH), INTENT(IN) :: dset
REAL(rp), INTENT(OUT) :: rdatum
REAL :: raw_datum
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(output_unit_write,'("KORC ERROR: Something went wrong in: rload_from_hdf5 &
--> h5dopen_f")')
call KORC_ABORT(14)
end if
call h5dread_f(dset_id, H5T_NATIVE_REAL, raw_datum, dims, h5error)
if (h5error .EQ. -1) then
write(output_unit_write,'("KORC ERROR: Something went wrong in: rload_from_hdf5 &
--> h5dread_f")')
call KORC_ABORT(14)
end if
rdatum = REAL(raw_datum,rp)
call h5dclose_f(dset_id, h5error)
if (h5error .EQ. -1) then
write(output_unit_write,'("KORC ERROR: Something went wrong in: rload_from_hdf5 &
--> h5dclose_f")')
call KORC_ABORT(14)
end if
if (PRESENT(attr)) then
! * * * Read attribute from file * * *
! * * * Read attribute from file * * *
end if
! * * * Read datum from file * * *
end subroutine rload_from_hdf5