      PROGRAM EMPTY ARRAY

      integer*4 sd_id, sds_id, dimsizes(2), rank
      integer sfstart, sfcreate, sfendacc, sfend
      integer*4 X_LENGTH, Y_LENGTH
      parameter (X_LENGTH = 16, Y_LENGTH = 5)

C     DFACC_CREATE and DFNT_INT16 are defined in hdf.h.
      integer*4 DFACC_CREATE, DFNT_INT16
      parameter (DFACC_CREATE = 4, DFNT_INT16 = 22)

C     Create and open the file and initiate the SD interface.
      sd_id = sfstart('Example2.hdf', DFACC_CREATE)

C     Define the rank and dimensions of the array to be created.
      rank = 2
      dimsizes(1) = Y_LENGTH
      dimsizes(2) = X_LENGTH

C     Create the array.
      sds_id = sfcreate(sd_id, 'Ex_array_1', DFNT_INT16, rank, dimsizes)

C     Terminate access to the array.
      status = sfendacc(sds_id)

C     Terminate access to the SD interface and close the file.
      status = sfend(sd_id)

      end
