Name: H5Rcreate
Signature:
herr_t H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t space_id )
Purpose:
Creates a reference.
Description:
H5Rcreate creates the reference, ref, of the type specified in ref_type, pointing to the object name located at loc_id.

The HDF5 library maps the void type specified above for ref to the type specified in ref_type, which will be one of those appearing in the first column of the following table. The second column of the table lists the HDF5 constant associated with each reference type.

hdset_reg_ref_t   H5R_DATASET_REGION   Dataset region reference
hobj_ref_t H5R_OBJECT Object reference

The parameters loc_id and name are used to locate the object.

The parameter space_id identifies the dataset region that a dataset region reference points to. This parameter is used only with dataset region references and should be set to -1 if the reference is an object reference, H5R_OBJECT.

Parameters:
Returns:
Returns a non-negative value if successful; otherwise returns a negative value.
Fortran90 Interface: h5rcreate_f

To create an object reference

SUBROUTINE h5rcreate_f(loc_id, name, ref, hdferr) 
  IMPLICIT NONE
  INTEGER(HID_T), INTENT(IN) :: loc_id     ! Location identifier 
  CHARACTER(LEN=*), INTENT(IN) :: name     ! Name of the object at location 
                                           ! specified by loc_id identifier 
  TYPE(hobj_ref_t_f), INTENT(OUT) :: ref   ! Object reference 
  INTEGER, INTENT(OUT) :: hdferr           ! Error code  
                                           ! 0 on success and -1 on failure

END SUBROUTINE h5rcreate_f
	
To create a region reference
SUBROUTINE h5rcreate_f(loc_id, name, space_id, ref, hdferr) 
  IMPLICIT NONE
  INTEGER(HID_T), INTENT(IN) :: loc_id        ! Location identifier 
  CHARACTER(LEN=*), INTENT(IN) :: name        ! Name of the dataset at location 
                                              ! specified by loc_id identifier 
  INTEGER(HID_T), INTENT(IN) :: space_id      ! Dataset's dataspace identifier 
  TYPE(hdset_reg_ref_t_f), INTENT(OUT) :: ref ! Dataset region reference 
  INTEGER, INTENT(OUT) :: hdferr              ! Error code 
                                              ! 0 on success and -1 on failure 

END SUBROUTINE h5rcreate_f