Writes the metadata to a HDF5 file using the
fields :
* /metadata/{group}/name/{varid}
* /metadata/{group}/description/{varid}
* /metadata/{group}/units/{varid}
This method assumes that an HDF5 file is already
open for writing and is associated with the fileId
input.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Metadata), | intent(in) | :: | mtd | |||
character, | intent(in) | :: | group | |||
integer, | intent(in) | :: | varid | |||
integer(kind=HID_T), | intent(in) | :: | fileId |
subroutine WriteHDF5_Metadata(mtd,group,varid,fileId)
!! Writes the metadata to a HDF5 file using the
!! fields :
!! * `/metadata/{group}/name/{varid}`
!! * `/metadata/{group}/description/{varid}`
!! * `/metadata/{group}/units/{varid}`
!!
!! This method assumes that an HDF5 file is already
!! open for writing and is associated with the `fileId`
!! input.
class(Metadata),intent(in) :: mtd
character(*),intent(in) :: group
integer,intent(in) :: varid
integer(HID_T),intent(in) :: fileId
! Local
character(4) :: varNumber
! Add variable names to the file
call CreateGroup_HDF5(fileId,trim(group)//"/metadata")
call CreateGroup_HDF5(fileId,trim(group)//"/metadata/name")
call CreateGroup_HDF5(fileId,trim(group)//"/metadata/description")
call CreateGroup_HDF5(fileId,trim(group)//"/metadata/units")
write(varNumber,"(I0)") varid
call WriteCharacter_HDF5(fileId,trim(group)//"/metadata/name/"//trim(varnumber), &
trim(mtd%name))
call WriteCharacter_HDF5(fileId,trim(group)//"/metadata/description/"//trim(varnumber), &
trim(mtd%description))
call WriteCharacter_HDF5(fileId,trim(group)//"/metadata/units/"//trim(varnumber), &
trim(mtd%units))
endsubroutine WriteHDF5_Metadata