Page tree

The license could not be verified: License Certificate has expired!

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

 

JAVA

FORTRAN

C++

C

 

Link

H5G_CREATE1

Creates a new empty group and links it to a location in the file. 

This function is renamed from H5Gcreate and deprecated in favor of the functions H5Gcreate2 and H5Gcreate_anon, or the new macro H5Gcreate.

 

Procedure:

H5G_CREATE1(loc_id, name, size_hint)

Signature:

hid_t H5Gcreate1( hid_t loc_id, const char *name, size_t size_hint )

SUBROUTINE h5gcreate_f(loc_id, name, grp_id, hdferr, &
                        size_hint, lcpl_id, gcpl_id, gapl_id)
  IMPLICIT NONE
  INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier 
  CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the group 
  INTEGER(HID_T), INTENT(OUT) :: grp_id  ! Group identifier 
  INTEGER, INTENT(OUT) :: hdferr         ! Error code  
                                         ! 0 on success and -1 on failure
  INTEGER(SIZE_T), OPTIONAL, INTENT(IN) :: size_hint 
                                         ! Parameter indicating the number of 
                                         ! bytes to reserve for the names that 
                                         ! will appear in the group. 
                                         ! Note, set to OBJECT_NAMELEN_DEFAULT_F
                                         ! if using any of the optional 
                                         ! parameters lcpl_id, gcpl_id, 
                                         ! and/or gapl_id when not
                                         ! using keywords in specifying the 
                                         ! optional parameters.
  INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id  
                                         ! Property list for link creation
  INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id  
                                         ! Property list for group creation
  INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id  
                                         ! Property list for group access
END SUBROUTINE h5gcreate_f

Parameters:
hid_t loc_idIN: File or group identifier.
const char *nameIN: Absolute or relative name of the o new group.
size_t size_hint    IN: Optional parameter indicating the number of bytes to reserve for the names that will appear in the group. A conservative estimate could result in multiple system-level I/O requests to read the group name heap; a liberal estimate could result in a single large I/O request even when the group has just a few names. HDF5 stores each name with a null terminator.

Description:

H5Gcreate1 creates a new group with the specified name at the specified location, loc_id. The location is identified by a file or group identifier. The name, name, must not already be taken by some other object and all parent groups must already exist.

name can be a relative path based at loc_id or an absolute path from the root of the file. Use of this function requires that any intermediate groups specified in the path already exist.

The length of a group name, or of the name of any object within a group, is not limited.

size_hint is a hint for the number of bytes to reserve to store the names which will be eventually added to the new group. Passing a value of zero for size_hint is usually adequate since the library is able to dynamically resize the name heap, but a correct hint may result in better performance. If a non-positive value is supplied for size_hint, then a default size is chosen.

The return value is a group identifier for the open group. This group identifier should be closed by calling H5Gclose when it is no longer needed.

See H5Gcreate_anon for a discussion of the differences between H5Gcreate1 and H5Gcreate_anon.

Returns:

Returns a valid group identifier for the open group if successful; otherwise returns a negative value. 

Example:

examples / h5_subset.c [32:42]  1.10/master  HDFFV/hdf5
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

c++ / examples / create.cpp [33:43]  1.10/master  HDFFV/hdf5
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    C
1.8.0Function H5Gcreate renamed to H5Gcreate1 and deprecated in this release.

--- Last Modified: November 09, 2017 | 08:12 AM