Last modified: 15 May 2009
Name: H5Dset_extent
Signature:
herr_t H5Dset_extent( hid_t dset_id, const hsize_t *size )

Purpose:
Changes the sizes of a dataset’s dimensions.

Description:
H5Dset_extent sets the current dimensions of the chunked dataset dset_id to the sizes specified in size.

size is a 1-dimensional array with n elements, where n is the rank of the dataset’s current dataspace.

This function can be applied to the following datasets:

Space on disk is immediately allocated for the new dataset extent if the dataset’s space allocation time is set to H5D_ALLOC_TIME_EARLY. Fill values will be written to the dataset if the dataset’s fill time is set to H5D_FILL_TIME_IFSET  or  H5D_FILL_TIME_ALLOC. (See H5Pset_fill_time and H5Pset_alloc_time.)

Note:
If the sizes specified in size are smaller than the dataset’s current dimension sizes, H5Dset_extent will reduce the dataset’s dimension sizes to the specified values. It is the user’s responsibility to ensure that valuable data is not lost; H5Dset_extent does not check.

If it is necessary to ensure that current dimension sizes are not reduced, the function H5Dextend can be used.

Except for external datasets, H5Dset_extent is for use with chunked datasets only, not contiguous datasets.

Parameters:
hid_t dset_id IN: Dataset identifier
const hsize_t *size     IN: Array containing the new magnitude of each dimension of the dataset.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: H5Dset_extent
SUBROUTINE h5dset_extent_f(dataset_id, size, hdferr)
  IMPLICIT NONE 
  INTEGER(HID_T), INTENT(IN) :: dataset_id   ! Dataset identifier
  INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: size 
                                             ! Array containing 
                                             ! dimensions’ sizes   
  INTEGER, INTENT(OUT) :: hdferr             ! Error code:
                                             ! 0 on success and -1 on failure
END SUBROUTINE h5dset_extent_f
    

History:
Release     C
1.8.0 Function introduced in this release.