WriteAttribute_HDF5_int32 Subroutine

private subroutine WriteAttribute_HDF5_int32(fileId, attributeName, attribute)

Arguments

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

Contents


Source Code

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

    dims(1) = 1
    call h5screate_f(H5S_SCALAR_F,aspaceId,error)
    call h5acreate_f(fileId,trim(attributeName),H5T_STD_I32LE, &
                     aspaceId,attrId,error)
    call h5awrite_f(attrId,H5T_STD_I32LE,attribute,dims,error)
    call h5sclose_f(aspaceId,error)
    call h5aclose_f(attrId,error)

  endsubroutine WriteAttribute_HDF5_int32