!
! The following example shows how to use the file family
! property list identifier. 
!

     PROGRAM DSETFAMILY

     USE HDF5 ! This module contains all necessary modules 
        
     IMPLICIT NONE

     CHARACTER(LEN=10), PARAMETER :: filename = 'dset%df.h5'  ! File name
     CHARACTER(LEN=4), PARAMETER :: dsetname = "family-dset" ! Dataset name

     INTEGER(HID_T) :: file_id       ! File identifier 
     INTEGER(HID_T) :: dset_id       ! Dataset identifier 
     INTEGER(HID_T) :: dspace_id     ! Dataspace identifier
     INTEGER(HID_T) :: fapl          ! File Access Property List ID


     INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions
     INTEGER     ::   rank = 2                        ! Dataset rank
     INTEGER(HSIZE_T) :: family_size = 1000

     INTEGER     ::   error ! Error flag

     ! Initialize FORTRAN predefined datatypes.
     !
     CALL h5open_f (error)

     ! Set up file family access property
     !
     CALL h5pcreate_f (H5P_FILE_ACCESS_F, fapl, error)
     CALL h5pset_fapl_family_f (fapl, family_size, H5P_DEFAULT_F, error)
  
     ! Create a new file 
     ! 
     CALL h5fcreate_f (filename, H5F_ACC_TRUNC_F, file_id, error, &
                       H5P_DEFAULT_F, fapl)

     ! Create the dataspace.
     !
     CALL h5screate_simple_f (rank, dims, dspace_id, error)

     ! Create the dataset with default properties.
     !
     CALL h5dcreate_f (file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, &
                       dset_id, error)

     ! End access to the dataset, dataspace, property list, and file.
     ! 
     CALL h5dclose_f (dset_id, error)
     CALL h5sclose_f (dspace_id, error)
     CALL h5pclose_f (fapl, error)
     CALL h5fclose_f (file_id, error)

     ! Close FORTRAN predefined datatypes.
     !
     CALL h5close_f (error)

     END PROGRAM DSETFAMILY
     
 
