- Created by Mike McGreevy on Nov 15, 2017
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
Version 1 Current »
H5LT_MAKE_DATASET_FLOAT
Creates and writes a dataset.
Procedure:
H5LT_MAKE_DATASET_FLOAT(loc_id, dset_name, rank, dims, buffer)
Signature:
herr_t H5LTmake_dataset_float ( hid_t loc_id, const char *dset_name, int rank, const hsize_t *dims, const float *buffer )
subroutine h5ltmake_dataset_float_f(loc_id, dset_name, rank, dims, &
buf, errcode)
implicit none
integer(HID_T), intent(IN) :: loc_id ! file or group identifier
character(LEN=*), intent(IN) :: dset_name ! name of the dataset
integer, intent(IN) :: rank ! rank
integer(HSIZE_T), dimension(*), intent(IN) :: dims
! size of the buffer buf
real, intent(IN), dimension(*) :: buf ! data buffer
integer :: errcode ! error code
end subroutine h5ltmake_dataset_float_f
Parameters:
hid_t loc_id | IN: Identifier of the file or group to create the dataset within. |
const char *dset_name | IN: The name of the dataset to create. |
int rank | IN: Number of dimensions of dataspace. |
const hsize_t * dims | IN: An array of the size of each dimension. |
const float * buffer | IN: Buffer with data to be written to the dataset. |
Description:
H5LTmake_dataset
creates and writes a dataset named dset_name
attached to the object specified by the identifier loc_id
.
The dataset’s datatype will be native floating point, H5T_NATIVE_FLOAT
.
Returns:
Returns a non-negative value if successful; otherwise returns a negative value.
Example:
int main (void) { hsize_t dims[2], dimsm[2]; int data[DIM0][DIM1]; /* data to write */ int sdata[DIM0_SUB][DIM1_SUB]; /* subset to write */ int rdata[DIM0][DIM1]; /* buffer for read */ hid_t file_id, dataset_id; /* handles */ hid_t dataspace_id, memspace_id;
PROGRAM COMPOUNDEXAMPLE USE HDF5 ! This module contains all necessary modules IMPLICIT NONE CHARACTER(LEN=11), PARAMETER :: filename = "compound.h5" ! File name CHARACTER(LEN=8), PARAMETER :: dsetname = "Compound" ! Dataset name INTEGER, PARAMETER :: dimsize = 6 ! Size of the dataset INTEGER(HID_T) :: file_id ! File identifier
int main (void) { /* * Data initialization. */ int i, j; int data[NX][NY]; // buffer for data to write for (j = 0; j < NX; j++) { for (i = 0; i < NY; i++)
public class H5Ex_D_Chunk { private static String FILENAME = "H5Ex_D_Chunk.h5"; private static String DATASETNAME = "DS1"; private static final int DIM_X = 6; private static final int DIM_Y = 8; private static final int CHUNK_X = 4; private static final int CHUNK_Y = 4; private static final int RANK = 2; private static final int NDIMS = 2;
History:
Release | Change |
1.8.7 | Fortran subroutine modified in this release to accomodate arrays with more than three dimensions. |
--- Last Modified: November 15, 2017 | 11:00 AM