Help us improve by taking our short survey: https://www.hdfgroup.org/website-survey/

| HDF5 Last Updated on 2025-11-11 The HDF5 Field Guide

- Main Page
- Getting started
- User Guide
- Reference Manual
- Cookbook
- Technical Notes
- RFCs
- Specifications
- Glossary
- Full-Text Search
- About

Loading...
Searching...
No Matches
Modules | Data Types | Functions/Subroutines | Variables
FH5R

## Detailed Description

hobj_ref_t_f derived type

## Modules
module | h5r
| This module contains Fortran interfaces for H5R functions.

## Data Types
type | hdset_reg_ref_t_f
| hdset_reg_ref_t_f derived type More...
type | hobj_ref_t_f

## Functions/Subroutines
subroutine | h5rcopy_f (src_ref_ptr, dst_ref_ptr, hdferr)
| Copies an existing reference.
subroutine | h5rcreate_attr_f (loc_id, name, attr_name, ref_ptr, hdferr, oapl_id)
| Creates an attribute reference.
subroutine | h5rcreate_f (loc_id, name, ref_type, ref, hdferr, space_id)
| Creates a reference.
subroutine | h5rcreate_object_f (loc_id, name, ref, hdferr, oapl_id)
| Creates a reference.
subroutine | h5rcreate_region_f (loc_id, name, space_id, ref_ptr, hdferr, oapl_id)
| Creates a region reference.
subroutine | h5rdestroy_f (ref_ptr, hdferr)
| Closes a reference.
subroutine | h5requal_f (ref1_ptr, ref2_ptr, equal, hdferr)
| Determines whether two references are equal.
subroutine | h5rget_attr_name_f (ref_ptr, name, hdferr, name_len)
| Retrieves the attribute name for a referenced object.
subroutine | h5rget_file_name_f (ref_ptr, name, hdferr, name_len)
| Retrieves the file name for a referenced object.
subroutine | h5rget_name_f (loc_id, ref_type, ref, name, hdferr, size)
| Retrieves a name of a referenced object.
subroutine | h5rget_obj_name_f (ref_ptr, name, hdferr, rapl_id, name_len)
| Retrieves the object name for a referenced object.
subroutine | h5rget_obj_type_f (loc_id, ref_type, ref, obj_type, hdferr)
| Retrieves the type of object that an object reference points to.
subroutine | h5rget_object_type_f (dset_id, ref, obj_type, hdferr)
| Retrieves the type of object that an object reference points to.
subroutine | h5rget_region_f (dset_id, ref, space_id, hdferr)
| Retrieves a dataspace with the specified region selected using pointer.
subroutine | h5rget_type_f (ref_ptr, ref_type, hdferr)
| Retrieves the type of a reference.
subroutine | h5ropen_attr_f (ref_ptr, obj_id, hdferr, rapl_id, aapl_id)
| Opens the HDF5 attribute referenced.
subroutine | h5ropen_object_f (ref_ptr, obj_id, hdferr, rapl_id, oapl_id)
| Opens the HDF5 object referenced.
subroutine | h5ropen_region_f (ref_ptr, space_id, hdferr, rapl_id, oapl_id)
| Sets up a dataspace and selection as specified by a region reference.

## Variables
integer | h5r_attr_f
| H5R_ATTR.
integer | h5r_badtype_f
| H5R_BADTYPE.
integer | h5r_dataset_region1_f
| H5R_DATASET_REGION1.
integer | h5r_dataset_region2_f
| H5R_DATASET_REGION2.
integer | h5r_dataset_region_f
| H5R_DATASET_REGION.
integer | h5r_maxtype_f
| H5R_MAXTYPE.
integer | h5r_object1_f
| H5R_OBJECT1.
integer | h5r_object2_f
| H5R_OBJECT2.
integer | h5r_object_f
| H5R_OBJECT.
integer, dimension(1:ref_reg_buf_len) | ref
integer(haddr_t) | ref

## Function/Subroutine Documentation

## ◆ h5rcopy_f()

subroutine h5rcopy_f | ( | type(c_ptr) | src_ref_ptr,
|  | type(c_ptr) | dst_ref_ptr,
|  | integer, intent(out) | hdferr )

Copies an existing reference.

Parameters

  src_ref_ptr | Pointer to reference to copy, of TYPE(H5R_ref_t)
  dst_ref_ptr | Pointer to output reference, of TYPE(H5R_ref_t)
  hdferr | Returns 0 if successful and -1 if it fails.

See C API: H5Rcopy()

## ◆ h5rcreate_attr_f()

subroutine h5rcreate_attr_f | ( | integer(hid_t), intent(in) | loc_id,
|  | character(len=*), intent(in) | name,
|  | character(len=*), intent(in) | attr_name,
|  | type(c_ptr) | ref_ptr,
|  | integer, intent(out) | hdferr,
|  | integer(hid_t), intent(in), optional | oapl_id )

Creates an attribute reference.

Attention
  The preferred API, Fortran 2003 version.

Parameters

  loc_id | Location identifier
  name | Name of object
  attr_name | Name of attribute
  ref_ptr | Pointer to reference
  hdferr | Returns 0 if successful and -1 if it fails.
  oapl_id | Object access property list identifier

See C API: H5Rcreate_attr()

## ◆ h5rcreate_f()

subroutine h5rcreate_f | ( | integer(hid_t), intent(in) | loc_id,
|  | character(len=*), intent(in) | name,
|  | integer, intent(in) | ref_type,
|  | type(c_ptr), intent(inout) | ref,
|  | integer, intent(out) | hdferr,
|  | integer(hid_t), intent(in), optional | space_id )

Creates a reference.

Attention
  The preferred API, Fortran 2003 version.

Parameters

  loc_id | Location identifier.
  name | Name of the dataset at the specified location.
  ref_type | Type of reference: H5R_OBJECT_F H5T_STD_REF_DSETREG_F
  ref | Reference created by the function call.
  hdferr | Returns 0 if successful and -1 if it fails.
  space_id | Dataspace identifier that describes selected region.

## ◆ h5rcreate_object_f()

subroutine h5rcreate_object_f | ( | integer(hid_t), intent(in) | loc_id,
|  | character(len=*), intent(in) | name,
|  | type(c_ptr) | ref,
|  | integer, intent(out) | hdferr,
|  | integer(hid_t), intent(in), optional | oapl_id )

Creates a reference.

Attention
  The preferred API, Fortran 2003 version.

Parameters

  loc_id | Location identifier.
  name | Name of the dataset at the specified location
  ref | Reference created by the function call
  hdferr | Returns 0 if successful and -1 if it fails.
  oapl_id | Object access property list identifier

See C API: H5Rcreate_object()

## ◆ h5rcreate_region_f()

subroutine h5rcreate_region_f | ( | integer(hid_t), intent(in) | loc_id,
|  | character(len=*), intent(in) | name,
|  | integer(hid_t), intent(in) | space_id,
|  | type(c_ptr) | ref_ptr,
|  | integer, intent(out) | hdferr,
|  | integer(hid_t), intent(in), optional | oapl_id )

Creates a region reference.

Attention
  The preferred API, Fortran 2003 version.

Parameters

  loc_id | Location identifier
  name | Name of object
  space_id | Dataspace identifier
  ref_ptr | Pointer to reference
  hdferr | Returns 0 if successful and -1 if it fails.
  oapl_id | Object access property list identifier

See C API: H5Rcreate_region()

## ◆ h5rdestroy_f()

subroutine h5rdestroy_f | ( | type(c_ptr) | ref_ptr,
|  | integer, intent(out) | hdferr )

Closes a reference.

Parameters

  ref_ptr | Pointer to reference, of TYPE(H5R_ref_t)
  hdferr | Returns 0 if successful and -1 if it fails.

See C API: H5Rdestroy()

## ◆ h5requal_f()

subroutine h5requal_f | ( | type(c_ptr) | ref1_ptr,
|  | type(c_ptr) | ref2_ptr,
|  | logical, intent(out) | equal,
|  | integer, intent(out) | hdferr )

Determines whether two references are equal.

Parameters

  ref1_ptr | Pointer to reference to compare, of TYPE(H5R_ref_t)
  ref2_ptr | Pointer to reference to compare, of TYPE(H5R_ref_t)
  equal | If reference are equal
  hdferr | Returns 0 if successful and -1 if it fails.

See C API: H5Requal()

## ◆ h5rget_attr_name_f()

subroutine h5rget_attr_name_f | ( | type(c_ptr) | ref_ptr,
|  | character(len=*) | name,
|  | integer, intent(out) | hdferr,
|  | integer(size_t), intent(out), optional | name_len )

Retrieves the attribute name for a referenced object.

Parameters

  ref_ptr | Pointer to reference to query
  name | Buffer to place the attribute name of the reference
  hdferr | Returns 0 if successful and -1 if it fails.
  name_len | Maximum length of the name to retrieve

## ◆ h5rget_file_name_f()

subroutine h5rget_file_name_f | ( | type(c_ptr) | ref_ptr,
|  | character(len=*) | name,
|  | integer, intent(out) | hdferr,
|  | integer(size_t), intent(out), optional | name_len )

Retrieves the file name for a referenced object.

Parameters

  ref_ptr | Pointer to reference to query
  name | Buffer to place the file name of the reference
  hdferr | Returns 0 if successful and -1 if it fails.
  name_len | The size of the name buffer

See C API: H5Rget_file_name()

## ◆ h5rget_name_f()

subroutine h5rget_name_f | ( | integer(hid_t), intent(in) | loc_id,
|  | integer, intent(in) | ref_type,
|  | type(c_ptr), intent(in) | ref,
|  | character(len=*), intent(inout) | name,
|  | integer, intent(out) | hdferr,
|  | integer(size_t), intent(out), optional | size )

Retrieves a name of a referenced object.

Attention
  The preferred API, Fortran 2003 version.

Parameters

  loc_id | Identifier for the file containing the reference or for any object in that file.
  ref_type | Type of reference.
  ref | An object or dataset region reference.
  name | A name associated with the referenced object or dataset ptr.
  hdferr | Returns 0 if successful and -1 if it fails.
  size | The size of the name buffer, returning 0 (zero) if no name is associated with the identifier.

## ◆ h5rget_obj_name_f()

subroutine h5rget_obj_name_f | ( | type(c_ptr) | ref_ptr,
|  | character(len=*) | name,
|  | integer, intent(out) | hdferr,
|  | integer(hid_t), intent(in), optional | rapl_id,
|  | integer(size_t), intent(out), optional | name_len )

Retrieves the object name for a referenced object.

Parameters

  ref_ptr | Pointer to reference to query
  name | Buffer to place the file name of the reference
  hdferr | Returns 0 if successful and -1 if it fails.
  rapl_id | Reference access property list identifier
  name_len | Maximum length of the name to retrieve

## ◆ h5rget_obj_type_f()

subroutine h5rget_obj_type_f | ( | integer(hid_t), intent(in) | loc_id,
|  | integer, intent(in) | ref_type,
|  | type(c_ptr), intent(in) | ref,
|  | integer, intent(out) | obj_type,
|  | integer, intent(out) | hdferr )

Retrieves the type of object that an object reference points to.

Parameters

  loc_id | Identifier for the dataset containing the reference or for the group that dataset is in.
  ref_type | Type of reference to query.
  ref | Reference to query.
  obj_type | Type of referenced object: H5G_UNKNOWN_F H5G_GROUP_F H5G_DATASET_F H5G_TYPE_F
  hdferr | Returns 0 if successful and -1 if it fails.

See C API: H5Rget_obj_type3()

## ◆ h5rget_object_type_f()

subroutine h5rget_object_type_f | ( | integer(hid_t), intent(in) | dset_id,
|  | type(hobj_ref_t_f), intent(in) | ref,
|  | integer, intent(out) | obj_type,
|  | integer, intent(out) | hdferr )

Retrieves the type of object that an object reference points to.

Attention
  Obsolete API, use the Fortran 2003 version instead.

Parameters

  dset_id | Identifier of the dataset containing reference to the objects.
  ref | Reference to open.
  obj_type | Object_type, possible values: H5G_UNKNOWN_F H5G_GROUP_F H5G_DATASET_F H5G_TYPE_F
  hdferr | Returns 0 if successful and -1 if it fails.

## ◆ h5rget_region_f()

subroutine h5rget_region_f | ( | integer(hid_t), intent(in) | dset_id,
|  | type(c_ptr), intent(in) | ref,
|  | integer(hid_t), intent(out) | space_id,
|  | integer, intent(out) | hdferr )

Retrieves a dataspace with the specified region selected using pointer.

Attention
  The preferred API, Fortran 2003 version.

Parameters

  dset_id | Identifier of the dataset containing reference to the regions.
  ref | Reference to open.
  space_id | Dataspace identifier.
  hdferr | Returns 0 if successful and -1 if it fails.

See C API: H5Rget_region()

## ◆ h5rget_type_f()

subroutine h5rget_type_f | ( | type(c_ptr) | ref_ptr,
|  | integer, intent(out) | ref_type,
|  | integer, intent(out) | hdferr )

Retrieves the type of a reference.

Parameters

  ref_ptr | Pointer to reference to copy, of TYPE(H5R_ref_t)
  ref_type | A reference type
  hdferr | Returns 0 if successful and -1 if it fails.

See C API: H5Rget_type()

## ◆ h5ropen_attr_f()

subroutine h5ropen_attr_f | ( | type(c_ptr) | ref_ptr,
|  | integer(hid_t), intent(out) | obj_id,
|  | integer, intent(out) | hdferr,
|  | integer(hid_t), intent(in), optional | rapl_id,
|  | integer(hid_t), intent(in), optional | aapl_id )

Opens the HDF5 attribute referenced.

Parameters

  ref_ptr | Pointer to reference to open, points object of TYPE(H5R_ref_t)
  obj_id | Object identifier
  hdferr | Returns 0 if successful and -1 if it fails.
  rapl_id | Reference access property list identifier
  aapl_id | Attribute access property list identifier

See C API: H5Ropen_attr()

## ◆ h5ropen_object_f()

subroutine h5ropen_object_f | ( | type(c_ptr) | ref_ptr,
|  | integer(hid_t), intent(out) | obj_id,
|  | integer, intent(out) | hdferr,
|  | integer(hid_t), intent(in), optional | rapl_id,
|  | integer(hid_t), intent(in), optional | oapl_id )

Opens the HDF5 object referenced.

Parameters

  ref_ptr | Pointer to reference to open, points object of TYPE(H5R_ref_t)
  obj_id | Object identifier
  hdferr | Returns 0 if successful and -1 if it fails.
  rapl_id | Reference access property list identifier
  oapl_id | Object access property list identifier

See C API: H5Ropen_object()

## ◆ h5ropen_region_f()

subroutine h5ropen_region_f | ( | type(c_ptr) | ref_ptr,
|  | integer(hid_t), intent(out) | space_id,
|  | integer, intent(out) | hdferr,
|  | integer(hid_t), intent(in), optional | rapl_id,
|  | integer(hid_t), intent(in), optional | oapl_id )

Sets up a dataspace and selection as specified by a region reference.

Parameters

  ref_ptr | Pointer to reference to open, points object of TYPE(H5R_ref_t)
  space_id | Dataspace identifier
  hdferr | Returns 0 if successful and -1 if it fails.
  rapl_id | Reference access property list identifier
  oapl_id | Object access property list identifier

See C API: H5Ropen_region()

## Variable Documentation

## ◆ h5r_attr_f

integer h5r_attr_f

H5R_ATTR.

## ◆ h5r_badtype_f

integer h5r_badtype_f

H5R_BADTYPE.

## ◆ h5r_dataset_region1_f

integer h5r_dataset_region1_f

H5R_DATASET_REGION1.

## ◆ h5r_dataset_region2_f

integer h5r_dataset_region2_f

H5R_DATASET_REGION2.

## ◆ h5r_dataset_region_f

integer h5r_dataset_region_f

H5R_DATASET_REGION.

## ◆ h5r_maxtype_f

integer h5r_maxtype_f

H5R_MAXTYPE.

## ◆ h5r_object1_f

integer h5r_object1_f

H5R_OBJECT1.

## ◆ h5r_object2_f

integer h5r_object2_f

H5R_OBJECT2.

## ◆ h5r_object_f

integer h5r_object_f

H5R_OBJECT.

## ◆ ref [1/2]

integer, dimension(1:ref_reg_buf_len) ref

## ◆ ref [2/2]

integer(haddr_t) ref