H5D (F03)

[ Top ] [ Modules ]

NAME

  H5D_PROVISIONAL

PURPOSE

  This file contains Fortran 90 and Fortran 2003 interfaces for H5D functions.
  It contains the same functions as H5Dff_DEPRECIATE.f90 but includes the
  Fortran 2003 functions and the interface listings. This file will be compiled
  instead of H5Dff_DEPRECIATE.f90 if Fortran 2003 functions are enabled.

NOTES

  (1) The maximum rank of an array allowed in Fortran is 7, therefore
  we only provide an interface for arrays up to and including rank 7.

  (2) Unfortunately we are using a generic interface and one of the factors
  used in determining the proper routine to select is that of the array
  rank being passed. Therefore, we can not create just one subroutine for
  each array type (integer, real, etc...) and use a
  rank 1 array of assumed size to handle multiple ranks, i.e.
  (i.e. integer, dimension(*) :: ... )
  (i.e. real   , dimension(*) :: ... ) etc...

  (3) Could not place the USE ISO_C_BINDING in the module header because it may
  conflict with the USE ISO_C_BINDING included in the user's program. Moved
  the statement instead to each subroutine.


  (4) C_LOC and character strings according to the Fortran 2003 standard:

  15.1.2.5 C_LOC(X)

  Argument. X shall either

  (A) have interoperable type and type parameters and be
  (a) a variable that has the TARGET attribute and is interoperable,
  (b) an allocated allocatable variable that has the TARGET attribute
  and is not an array of zero size, or
  (c) an associated scalar pointer, or
  (B) be a nonpolymorphic scalar, have no length type parameters, and be
  (a) a nonallocatable, nonpointer variable that has the TARGET attribute,
  (b) an allocated allocatable variable that has the TARGET attribute, or
  (c) an associated pointer.

        - When X is a character, for interoperability the standard is:

  15.2.1 Interoperability of intrinsic types

  ...if the type is character, interoperability also requires that the length type parameter
  be omitted or be specified by an initialization expression whose value is one.

  THEREFORE compilers that have not extended the standard require the
  argument in C_LOC to be of the variant:

  CHARACTER(LEN=1), TARGET :: chr
  or
  CHARACTER, TARGET :: chr
  (B)
                         *** IMPORTANT ***
  If you add a new H5D function you must add the function name to the
  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
  This is needed for Windows based operating systems.

h5dvlen_reclaim

[ Top ] [ H5D ] [ Subroutines ]

NAME

  h5dvlen_reclaim

PURPOSE

  Reclaims VL datatype memory buffers. 

INPUTS

  type_id  - Identifier of the datatype. 
  space_id - Identifier of the dataspace. 
  plist_id - Identifier of the property list used to create the buffer. 
       buf - Pointer to the buffer to be reclaimed. 

OUTPUTS

  hdferr   - error code
               Success:  0
               Failure: -1

AUTHOR

 M. Scot Breitenfeld
 January 11, 2011

SOURCE

  SUBROUTINE H5Dvlen_reclaim_f(type_id, space_id, plist_id, buf, hdferr)

    USE ISO_C_BINDING
    IMPLICIT NONE

    INTEGER(HID_T), INTENT(IN) :: type_id   ! Identifier of the datatype. 
    INTEGER(HID_T), INTENT(IN) :: space_id  ! Identifier of the dataspace. 
    INTEGER(HID_T), INTENT(IN) :: plist_id  ! Identifier of the property list used to create the buffer. 
    TYPE(C_PTR), INTENT(INOUT) :: buf       ! Pointer to the buffer to be reclaimed. 
    INTEGER, INTENT(OUT) :: hdferr          ! Error code.