/* This program creates two datasets and stores them in HDF5 file */ #include "hdf5.h" /* Define data type, dimensionlity, architecture and name for the first dataset */ #define DATA1_BASE H5T_INT #define DATA1_LEN 2 #define DATA1_RANK 2 #define DATA1_DIM1 10 #define DATA1_DIM2 5 #define DATA1_ARCH H5T_BIGENDIAN #define DATA1_NAME "ShortIntegers" /* Define data type, dimensionality, architecture and name for the second dataset */ #define DATA2_BASE H5T_FLOAT #define DATA2_LEN 8 #define DATA2_RANK 1 #define DATA2_DIM1 8 #define DATA2_ARCH H5T_LITTLEENDIAN #define DATA2_NAME "DoubleFloats" main(void) { hid_t file1_id, file2_id; /* HDF5 file IDs */ hid_t t1_id; /* Type ID for the first dataset */ hid_t d1_id; /* Dimensionality ID for the first dataset */ hid_t data1_id; /* Data ID for the first dataset */ uint32 dims1[DATA1_RANK] = {DATA1_DIM1, DATA1_DIM2}; int16 data1[DATA1_DIM1][DATA1_DIM2]; hid_t t2_id; /* Type ID for the second dataset */ hid_t d2_id; /* Dimensionality ID for the second dataset */ hid_t data2_id; /* Data ID for the second dataset */ uint32 dims2[DATA2_RANK] = {DATA2_DIM1}; float64 data2[DATA2_DIM1]; herr_t ret; intn k,l; /* Initialize datasets */ for (k=0; k