ReadAttribute_HDF5_character Subroutine

private subroutine ReadAttribute_HDF5_character(fileId, attributeName, attribute)

Arguments

TypeIntentOptionalAttributesName
integer(kind=HID_T), intent(in) :: fileId
character, intent(in) :: attributeName
character, intent(out) :: attribute

Contents


Source Code

  subroutine ReadAttribute_HDF5_character(fileId,attributeName,attribute)
    implicit none
    integer(HID_T),intent(in) :: fileId
    character(*),intent(in) :: attributeName
    character(*),intent(out) :: attribute
    ! Local
    integer(HID_T) :: attrId
    integer(HID_T) :: typeId
    integer(HSIZE_T) :: dims(1:1)
    integer :: error

    dims(1) = 1
    call h5aopen_f(fileId,trim(attributeName),attrId,error)
    call h5aget_type_f(attrId,typeId,error)

    call h5aread_f(attrId,typeId,attribute,dims,error)

    call h5tclose_f(typeId,error)
    call h5aclose_f(attrId,error)

  endsubroutine ReadAttribute_HDF5_character