HDF5 File Format Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
HDF5 Reference Manual Release 1.8.7 May 2011 http://www.HDFGroup.org Copyright Notice and License Terms for HDF5 (Hierarchical Data Format 5) Software Library and Utilities HDF5 (Hierarchical Data Format 5) Software Library and Utilities Copyright 2006-2011 by The HDF Group. NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities Copyright 1998-2006 by the Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted for any purpose (including commercial purposes) provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation and/or materials provided with the distribution. 3. In addition, redistributions of modified forms of the source or binary code must carry prominent notices stating that the original code was changed and the date of the change. 4. All publications or advertising materials mentioning features or use of this software are asked, but not required, to acknowledge that it was developed by The HDF Group and by the National Center for Supercomputing Applications at the University of Illinois at Urbana-Champaign and credit the contributors. 5. Neither the name of The HDF Group, the name of the University, nor the name of any Contributor may be used to endorse or promote products derived from this software without specific prior written permission from The HDF Group, the University, or the Contributor, respectively. DISCLAIMER: THIS SOFTWARE IS PROVIDED BY THE HDF GROUP AND THE CONTRIBUTORS "AS IS" WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. In no event shall The HDF Group or the Contributors be liable for any damages suffered by the users arising out of the use of this software, even if advised of the possibility of such damage. Contributors: National Center for Supercomputing Applications (NCSA) at the University of Illinois, Fortner Software, Unidata Program Center (netCDF), The Independent JPEG Group (JPEG), Jean-loup Gailly and Mark Adler (gzip), and Digital Equipment Corporation (DEC). Portions of HDF5 were developed with support from the Lawrence Berkeley National Laboratory (LBNL) and the United States Department of Energy under Prime Contract No. DE-AC02-05CH11231. Portions of HDF5 were developed with support from the University of California, Lawrence Livermore National Laboratory (UC LLNL). The following statement applies to those portions of the product and must be retained in any redistribution of source code, binaries, documentation, and/or accompanying materials: This work was partially produced at the University of California, Lawrence Livermore National Laboratory (UC LLNL) under contract no. W-7405-ENG-48 (Contract 48) between the U.S. Department of Energy (DOE) and The Regents of the University of California (University) for the operation of UC LLNL. DISCLAIMER: This work was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the University of California nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately- owned rights. Reference herein to any specific commercial products, process, or service by trade name, trademark, manufacturer, or otherwise, does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or the University of California. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or the University of California, and shall not be used for advertising or product endorsement purposes. Table of Contents Overview 1 Fortran90 and C++ APIs 2 H5: General Library Functions 3 H5A: Attribute Interface 17 H5D: Datasets Interface 65 H5E: Error Interface 101 H5F: File Interface 137 H5G: Group Interface 177 H5I: Identifier Interface 213 H5L: Link Interface 235 H5O: Object Interface 281 H5P: Property List Interface 307 H5R: Reference Interface 551 H5S: Dataspace Interface 565 H5T: Datatype Interface 599 H5Z: Compression Interface 685 HDF5 Tools 695 h5dump 697 h5ls 704 h5diff and ph5diff 706 h5repack 711 h5repart 714 h5jam and j5unjam 715 h5copy 717 h5mkgrp 719 h5import 721 gif2h5 729 h52gif 730 Java-based tools (HDFview, etc.) * H4toH5 Conversion Library * h5toh4 731 h4toh5 733 * Links to descriptions of these tools appear on the HDF5 Tools page: http://hdfgroup.org/HDF5/doc/RM/Tools.html HDF5 Tools (continued) h5stat 734 h5check 735 h5perf 737 h5perf_serial 742 h5redeploy 744 h5cc and h5pcc 745 h5fc and h5pfc 747 h5c++ 749 HDF5 Predefined Datatypes 751 HDF5 Fortran90 Flags, Datatypes, 755 and User’s Notes API Compatibility Macros 759 in HDF5 Collective Calls in 767 Parallel HDF5 Applications HDF5 Glossary 771 HDF5 Reference Manual HDF5: API Specification Reference Manual The HDF5 library provides several interfaces, each of which provides the tools required to meet specific aspects of the HDF5 data-handling requirements. Notes regarding Fortran90 and C++ APIs appear on the next page. Main HDF5 Library, or Low-level APIs The main HDF5 Library includes all of the low-level APIs, providing user applications with fine-grain control of HDF5 functionality. Library Functions The general-purpose H5 functions. Attribute Interface The H5A API for attributes. Dataset Interface The H5D API for manipulating scientific datasets. Error Interface The H5E API for error handling. File Interface The H5F API for accessing HDF5 files. Group Interface The H5G API for creating physical groups of objects on disk. Identifier Interface The H5I API for working with object identifiers. Link Interface The H5L API for working with links. Object Interface The H5O API for manipulating objects and reference counts. Property List Interface The H5P API for manipulating object property lists. Reference Interface The H5R API for references. Dataspace Interface The H5S API for defining dataset dataspace. Datatype Interface The H5T API for defining dataset element information. Filters and The H5Z API for inline data filters and data compression. Compression Interface Tools Interactive tools for the examination of existing HDF5 files. Predefined Datatypes Predefined datatypes in HDF5. HDF5 Fortran90 Flags, Flags and datatypes used in the HDF5 Fortran interface. Datatypes, User Notes User notes for the HDF5 Fortran interface. API Compatibility API compatibility macros provided in HDF5. Macros Collective Calling Requirements for collective function calls and coordinated use Requirements of properties in parallel HDF5 applications. 1 HDF5 Reference Manual The Fortran90 and C++ APIs to HDF5 The HDF5 Library distribution includes FORTRAN90 and C++ APIs, which are described in the following documents. Fortran90 API Fortran90 APIs in the HDF5 Reference Manual: The HDF5 Reference Manual includes descriptions of the HDF5 Fortran90 APIs. Fortran subroutines exist in the H5, H5A, H5D, H5E, H5F, H5G, H5I, H5P, H5R, H5S, H5T, and H5Z interfaces and are described on those pages. In general, each Fortran subroutine performs exactly the same task as the corresponding C function, with which it is described. HDF5 Fortran90 Flags, Datatypes and User’s Notes lists the flags employed in the Fortran90 interface, contains a pointer to the HDF5 Fortran90 datatypes, and includes the document HDF5 Fortran90 User's Notes. HDF5 Fortran90 User’s Notes provides important information for users regarding the Fortran90 source code and the Fortran90 API. C++ API HDF5 C++ Reference Manual provides a complete reference for the HDF5 C++ interface. 2 HDF5 Reference Manual H5: General Library Functions These functions and macros serve general-purpose needs of the HDF5 library and its users. The C Interfaces: • H5open • H5set_free_list_limits • H5get_libversion • H5close • H5garbage_collect • H5check_version • H5dont_atexit • H5_VERSION_GE • H5_VERSION_LE Alphabetical Listing • H5check_version • H5garbage_collect • H5set_free_list_limits • H5close • H5get_libversion • H5_VERSION_GE • H5dont_atexit • H5open • H5_VERSION_LE The Fortran Interfaces: In general, each Fortran subroutine performs exactly the same task as the corresponding C function. • h5open_f • h5get_libversion_f • h5set_free_list_limits_f • h5close_f • h5check_version_f • h5garbage_collect_f • h5dont_atexit_f 3 HDF5 Reference Manual 4 HDF5 Reference Manual H5_VERSION_GE Last modified: 22 April 2011 Name: H5_VERSION_GE Signature: H5_VERSION_GE( int maj, int min, int rel ) Purpose: Determines whether the version of the library being used is greater than or equal to the specified version. Motivation: The H5_VERSION_GE and H5_VERSION_LE macros are used at compile time to conditionally include or exclude code based on the version of the HDF5 library against which an application will be linked. Description: The H5_VERSION_GE macro compares the version of the HDF5 library being used against the version number specified in the parameters. For more information, see “HDF5 Software Updates” at www.hdfgroup.org/HDF5/doc/TechNotes/Version.html. Parameters: int maj IN: Major version number A non-negative integer