diff options
author | Elena Pourmal <epourmal@hdfgroup.org> | 2001-03-05 20:25:50 (GMT) |
---|---|---|
committer | Elena Pourmal <epourmal@hdfgroup.org> | 2001-03-05 20:25:50 (GMT) |
commit | 2453130d96acf1e63c79208792126d235accc9d7 (patch) | |
tree | a21bea0d63168aef26db167842740b9e74ed8615 /fortran/src | |
parent | c501c12cdabc0504ece42365fe6928c7e18a3405 (diff) | |
download | hdf5-2453130d96acf1e63c79208792126d235accc9d7.zip hdf5-2453130d96acf1e63c79208792126d235accc9d7.tar.gz hdf5-2453130d96acf1e63c79208792126d235accc9d7.tar.bz2 |
[svn-r3546]
Purpose:
Windows port and maintenance
Description:
Windows Fortran requires interface blocks for each C function
called from F90 stub.
I also added comment blocks for each F90 API.
Solution:
Added interface blocks.
Platforms tested:
Linux (eirene)
Diffstat (limited to 'fortran/src')
-rw-r--r-- | fortran/src/H5Gff.f90 | 507 | ||||
-rw-r--r-- | fortran/src/H5Iff.f90 | 46 | ||||
-rw-r--r-- | fortran/src/H5Rff.f90 | 278 |
3 files changed, 790 insertions, 41 deletions
diff --git a/fortran/src/H5Gff.f90 b/fortran/src/H5Gff.f90 index de6a8f0..c4e83c2 100644 --- a/fortran/src/H5Gff.f90 +++ b/fortran/src/H5Gff.f90 @@ -2,13 +2,37 @@ ! This file contains Fortran90 interfaces for H5F functions. ! MODULE H5G - USE H5FORTRAN_TYPES - USE H5FORTRAN_FLAGS + USE H5GLOBAL CONTAINS - !!!============================================================ - +!---------------------------------------------------------------------- +! Name: h5gcreate_f +! +! Purpose: Creates a new group. +! +! Inputs: +! loc_id - location identifier +! name - group name at the specified location +! Outputs: +! grp_id - group identifier +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! size_hint - a parameter indicating the number of bytes +! to reserve for the names that will appear +! in the group +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Comment: +!---------------------------------------------------------------------- SUBROUTINE h5gcreate_f(loc_id, name, grp_id, hdferr, size_hint) IMPLICIT NONE @@ -24,7 +48,24 @@ ! in the group INTEGER :: namelen ! Length of the name character string INTEGER(SIZE_T) :: size_hint_default - INTEGER, EXTERNAL :: h5gcreate_c + +! INTEGER, EXTERNAL :: h5gcreate_c +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5gcreate_c(loc_id, name, namelen, & + size_hint_default, grp_id) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5GCREATE_C'::h5gcreate_c + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(SIZE_T) :: size_hint_default + INTEGER(HID_T), INTENT(OUT) :: grp_id + END FUNCTION h5gcreate_c + END INTERFACE + size_hint_default = OBJECT_NAMELEN_DEFAULT_F if (present(size_hint)) size_hint_default = size_hint namelen = LEN(name) @@ -32,9 +73,32 @@ grp_id) END SUBROUTINE h5gcreate_f - - !!!============================================================ +!---------------------------------------------------------------------- +! Name: h5gopen_f +! +! Purpose: Opens an existing group. +! +! Inputs: +! loc_id - location identifier +! name - name of the group to open +! Outputs: +! grp_id - group identifier +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Comment: +!---------------------------------------------------------------------- SUBROUTINE h5gopen_f(loc_id, name, grp_id, hdferr) IMPLICIT NONE @@ -44,28 +108,100 @@ INTEGER, INTENT(OUT) :: hdferr ! Error code INTEGER :: namelen ! Length of the name character string - INTEGER, EXTERNAL :: h5gopen_c + +! INTEGER, EXTERNAL :: h5gopen_c +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5gopen_c(loc_id, name, namelen, grp_id) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5GOPEN_C'::h5gopen_c + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(HID_T), INTENT(OUT) :: grp_id + END FUNCTION h5gopen_c + END INTERFACE namelen = LEN(name) hdferr = h5gopen_c(loc_id, name, namelen, grp_id) END SUBROUTINE h5gopen_f - - !!!============================================================ +!---------------------------------------------------------------------- +! Name: h5gclose_f +! +! Purpose: Closes the specified group. +! +! Inputs: +! grp_id - group identifier +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Comment: +!---------------------------------------------------------------------- SUBROUTINE h5gclose_f(grp_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: grp_id ! Group identifier INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER, EXTERNAL :: h5gclose_c + +! INTEGER, EXTERNAL :: h5gclose_c +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5gclose_c(grp_id) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5GCLOSE_C'::h5gclose_c + INTEGER(HID_T), INTENT(IN) :: grp_id + END FUNCTION h5gclose_c + END INTERFACE hdferr = h5gclose_c(grp_id) END SUBROUTINE h5gclose_f - !!!============================================================ +!---------------------------------------------------------------------- +! Name: h5gget_obj_info_idx_f +! +! Purpose: Returns name and type of the group member identified by +! its index. +! +! Inputs: +! loc_id - location identifier +! name - name of the group at the specified location +! idx - object index (zero-based) +! Outputs: +! obj_name - object name +! obj_type - object type +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Comment: +!---------------------------------------------------------------------- SUBROUTINE h5gget_obj_info_idx_f(loc_id, name, idx, & obj_name, obj_type, hdferr) @@ -79,7 +215,27 @@ INTEGER :: namelen ! Length of the name character string INTEGER :: obj_namelen ! Length of the obj_name character string - INTEGER, EXTERNAL :: h5gget_obj_info_idx_c + +! INTEGER, EXTERNAL :: h5gget_obj_info_idx_c +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5gget_obj_info_idx_c(loc_id, name, & + namelen, idx, & + obj_name, obj_namelen, obj_type) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5GGET_OBJ_INFO_IDX_C'::h5gget_obj_info_idx_c + !DEC$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: obj_name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER, INTENT(IN) :: idx + CHARACTER(LEN=*), INTENT(OUT) :: obj_name + INTEGER :: obj_namelen + INTEGER, INTENT(OUT) :: obj_type + END FUNCTION h5gget_obj_info_idx_c + END INTERFACE namelen = LEN(name) obj_namelen = LEN(obj_name) @@ -87,8 +243,32 @@ obj_name, obj_namelen, obj_type) END SUBROUTINE h5gget_obj_info_idx_f - - !!!============================================================ + +!---------------------------------------------------------------------- +! Name: h5gn_members_f +! +! Purpose: Returns the number of group members. +! +! Inputs: +! loc_id - location identifier +! name - name of the group at the specified location +! Outputs: +! nmembers - number of group members +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Comment: +!---------------------------------------------------------------------- SUBROUTINE h5gn_members_f(loc_id, name, nmembers, hdferr) @@ -100,15 +280,59 @@ INTEGER, INTENT(OUT) :: hdferr ! Error code INTEGER :: namelen ! Length of the name character string - INTEGER, EXTERNAL :: h5gn_members_c +! INTEGER, EXTERNAL :: h5gn_members_c +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5gn_members_c(loc_id, name, namelen, nmembers) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5GN_MEMBERS_C'::h5gn_members_c + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER, INTENT(OUT) :: nmembers + END FUNCTION h5gn_members_c + END INTERFACE + namelen = LEN(name) hdferr = h5gn_members_c(loc_id, name, namelen, nmembers) END SUBROUTINE h5gn_members_f - !!!============================================================ - +!---------------------------------------------------------------------- +! Name: h5glink_f +! +! Purpose: Creates a link of the specified type from new_name +! to current_name. +! +! Inputs: +! loc_id - location identifier +! link_type - link type +! Possible values are: +! H5G_LINK_HARD_F (0) or +! H5G_LINK_SOFT_F (1) +! current_name - name of the existing object if link is a +! hard link. Can be anything for the soft link. +! new_name - new name for the object +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Comment: +!---------------------------------------------------------------------- + SUBROUTINE h5glink_f(loc_id, link_type, current_name, & new_name, hdferr) @@ -126,7 +350,26 @@ INTEGER :: current_namelen ! Lenghth of the current_name string INTEGER :: new_namelen ! Lenghth of the new_name string - INTEGER, EXTERNAL :: h5glink_c + +! INTEGER, EXTERNAL :: h5glink_c +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5glink_c(loc_id, link_type, current_name, & + current_namelen, new_name, new_namelen) + + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5GLINK_C'::h5glink_c + !DEC$ATTRIBUTES reference :: current_name + !DEC$ATTRIBUTES reference :: new_name + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER, INTENT(IN) :: link_type + CHARACTER(LEN=*), INTENT(IN) :: current_name + INTEGER :: current_namelen + CHARACTER(LEN=*), INTENT(IN) :: new_name + INTEGER :: new_namelen + END FUNCTION h5glink_c + END INTERFACE current_namelen = LEN(current_name) new_namelen = LEN(new_name) @@ -134,7 +377,32 @@ current_namelen, new_name, new_namelen) END SUBROUTINE h5glink_f - !!!============================================================ +!---------------------------------------------------------------------- +! Name: h5gunlink_f +! +! Purpose: Removes the specified name from the group graph and +! decrements the link count for the object to which name +! points +! +! Inputs: +! loc_id - location identifier +! name - name of the object to unlink +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Comment: +!---------------------------------------------------------------------- SUBROUTINE h5gunlink_f(loc_id, name, hdferr) @@ -145,13 +413,50 @@ INTEGER :: namelen ! Lenghth of the name character string - INTEGER, EXTERNAL :: h5gunlink_c +! INTEGER, EXTERNAL :: h5gunlink_c +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5gunlink_c(loc_id, name, namelen) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5GUNLINK_C'::h5gunlink_c + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + END FUNCTION h5gunlink_c + END INTERFACE namelen = LEN(name) hdferr = h5gunlink_c(loc_id, name, namelen) END SUBROUTINE h5gunlink_f - !!!============================================================ +!---------------------------------------------------------------------- +! Name: h5gmove_f +! +! Purpose: Renames an object within an HDF5 file. +! +! Inputs: +! loc_id - location identifier +! name - object's name at specified location +! new_name - object's new name +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Comment: +!---------------------------------------------------------------------- + SUBROUTINE h5gmove_f(loc_id, name, new_name, hdferr) @@ -163,14 +468,58 @@ INTEGER :: namelen ! Lenghth of the current_name string INTEGER :: new_namelen ! Lenghth of the new_name string - INTEGER, EXTERNAL :: h5gmove_c + +! INTEGER, EXTERNAL :: h5gmove_c +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5gmove_c(loc_id, name, namelen, new_name, new_namelen) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5GMOVE_C'::h5gmove_c + !DEC$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: new_name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + CHARACTER(LEN=*), INTENT(IN) :: new_name + INTEGER :: new_namelen + END FUNCTION h5gmove_c + END INTERFACE namelen = LEN(name) new_namelen = LEN(new_name) hdferr = h5gmove_c(loc_id, name, namelen, new_name, new_namelen) END SUBROUTINE h5gmove_f - !!!============================================================ +!---------------------------------------------------------------------- +! Name: h5gget_linkval_f +! +! Purpose: Returns the name of the object that the symbolic link +! points to. +! +! Inputs: +! loc_id - location identifier +! name - symbolic link to the object whose name +! is to be returned. +! size - maximum number of characters to be returned +! Outputs: +! buffer - a buffer to hold the name of the object +! being sought +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Comment: +!---------------------------------------------------------------------- SUBROUTINE h5gget_linkval_f(loc_id, name, size, buffer, hdferr) @@ -185,13 +534,53 @@ INTEGER, INTENT(OUT) :: hdferr ! Error code INTEGER :: namelen ! Lenghth of the current_name string - INTEGER, EXTERNAL :: h5gget_linkval_c + +! INTEGER, EXTERNAL :: h5gget_linkval_c +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5gget_linkval_c(loc_id, name, namelen, size, buffer) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5GGET_LINKVAL_C'::h5gget_linkval_c + !DEC$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: buffer + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(SIZE_T), INTENT(IN) :: size + CHARACTER(LEN=*), INTENT(OUT) :: buffer + END FUNCTION h5gget_linkval_c + END INTERFACE namelen = LEN(name) hdferr = h5gget_linkval_c(loc_id, name, namelen, size, buffer) END SUBROUTINE h5gget_linkval_f - !!!============================================================ +!---------------------------------------------------------------------- +! Name: h5gset_comment_f +! +! Purpose: Sets comment for specified object. +! +! Inputs: +! loc_id - location identifier +! name - name of the object +! comment - comment to set for the object +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Comment: +!---------------------------------------------------------------------- SUBROUTINE h5gset_comment_f(loc_id, name, comment, hdferr) @@ -203,14 +592,56 @@ INTEGER :: namelen ! Lenghth of the current_name string INTEGER :: commentlen ! Lenghth of the comment string - INTEGER, EXTERNAL :: h5gset_comment_c + +! INTEGER, EXTERNAL :: h5gset_comment_c +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5gset_comment_c(loc_id, name, namelen, & + comment, commentlen) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5GSET_COMMENT_C'::h5gset_comment_c + !DEC$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: comment + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + CHARACTER(LEN=*), INTENT(IN) :: comment + INTEGER :: commentlen + END FUNCTION h5gset_comment_c + END INTERFACE namelen = LEN(name) commentlen = LEN(comment) hdferr = h5gset_comment_c(loc_id, name, namelen, comment, commentlen) END SUBROUTINE h5gset_comment_f - !!!============================================================ +!---------------------------------------------------------------------- +! Name: h5gget_comment_f +! +! Purpose: Retrieves comment for specified object. +! +! Inputs: +! loc_id - location identifier +! name - name of the object at specified location +! size - size of the buffer required to hold comment +! Outputs: +! buffer - buffer to hold object's comment +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Comment: +!---------------------------------------------------------------------- SUBROUTINE h5gget_comment_f(loc_id, name, size, buffer, hdferr) @@ -223,12 +654,28 @@ INTEGER, INTENT(OUT) :: hdferr ! Error code INTEGER :: namelen ! Lenghth of the current_name string - INTEGER, EXTERNAL :: h5gget_comment_c + +! INTEGER, EXTERNAL :: h5gget_comment_c +! MS FORTRAN needs explicit interface for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5gget_comment_c(loc_id, name, namelen, & + size, buffer) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5GGET_COMMENT_C'::h5gget_comment_c + !DEC$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: buffer + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(SIZE_T), INTENT(IN) :: size + CHARACTER(LEN=*), INTENT(OUT) :: buffer + END FUNCTION h5gget_comment_c + END INTERFACE namelen = LEN(name) hdferr = h5gget_comment_c(loc_id, name, namelen, size, buffer) END SUBROUTINE h5gget_comment_f - !!!============================================================ END MODULE H5G diff --git a/fortran/src/H5Iff.f90 b/fortran/src/H5Iff.f90 index cd50da3..7f73242 100644 --- a/fortran/src/H5Iff.f90 +++ b/fortran/src/H5Iff.f90 @@ -3,11 +3,40 @@ ! MODULE H5I - USE H5FORTRAN_TYPES - USE H5FORTRAN_FLAGS + USE H5GLOBAL CONTAINS +!---------------------------------------------------------------------- +! Name: h5iget_type_f +! +! Purpose: Retrieves the type of an object. +! +! Inputs: obj_id - object identifier +! Outputs: +! type - type of the object, possible values: +! H5I_FILE_F(1) +! H5I_GROUP_F(2) +! H5I_DATATYPE_F(3) +! H5I_DATASPACE_F(4) +! H5I_DATASET_F(5) +! H5I_ATTR_F(6) +! H5I_BADID_F(-1) +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Comment: +!---------------------------------------------------------------------- SUBROUTINE h5iget_type_f(obj_id, type, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id !Object identifier @@ -21,7 +50,18 @@ !H5I_ATTR_F(6) !H5I_BADID_F(-1) INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER, EXTERNAL :: h5iget_type_c + +! INTEGER, EXTERNAL :: h5iget_type_c +! Interface is needed for MS FORTRAN +! + INTERFACE + INTEGER FUNCTION h5iget_type_c(obj_id, type) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5IGET_TYPE_C':: h5iget_type_c + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER, INTENT(OUT) :: type + END FUNCTION h5iget_type_c + END INTERFACE hdferr = h5iget_type_c(obj_id, type) END SUBROUTINE h5iget_type_f diff --git a/fortran/src/H5Rff.f90 b/fortran/src/H5Rff.f90 index 860fba3..05e4139 100644 --- a/fortran/src/H5Rff.f90 +++ b/fortran/src/H5Rff.f90 @@ -46,6 +46,32 @@ CONTAINS +!---------------------------------------------------------------------- +! Name: h5rcreate_object_f +! +! Purpose: Creates reference to the object +! +! Inputs: +! loc_id - location identifier +! name - name of the object at the specified location +! Outputs: +! ref - reference to the specified object +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! Comment: This is a module procedure for the h5rcreate_f +! subroutine. +!---------------------------------------------------------------------- SUBROUTINE h5rcreate_object_f(loc_id, name, ref, hdferr) IMPLICIT NONE @@ -57,15 +83,58 @@ INTEGER :: namelen ! Name length INTEGER :: ref_f(REF_OBJ_BUF_LEN) ! Local buffer to pass reference - INTEGER, EXTERNAL :: h5rcreate_object_c + +! INTEGER, EXTERNAL :: h5fcreate_object_c +! Interface is needed for MS FORTRAN +! + INTERFACE + INTEGER FUNCTION h5rcreate_object_c(ref_f, loc_id, name, namelen) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5RCREATE_OBJECT_C':: h5rcreate_object_c + !DEC$ATTRIBUTES reference :: name + INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 + INTEGER :: ref_f(REF_OBJ_BUF_LEN) + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + END FUNCTION h5rcreate_object_c + END INTERFACE + namelen = LEN(name) ref_f = 0 hdferr = h5rcreate_object_c(ref_f, loc_id, name, namelen ) ref%ref = ref_f END SUBROUTINE h5rcreate_object_f - +!---------------------------------------------------------------------- +! Name: h5rcreate_region_f +! +! Purpose: Creates r eference to the dataset region +! +! Inputs: +! loc_id - location identifier +! name - name of the dataset at the specified location +! space_id - dataspace identifier that describes selected region +! Outputs: +! ref - reference to the dataset region +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! Comment: This is a module procedure for the h5rcreate_f +! subroutine. +!---------------------------------------------------------------------- + SUBROUTINE h5rcreate_region_f(loc_id, name, space_id, ref, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier @@ -77,7 +146,24 @@ INTEGER :: namelen ! Name length INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference - INTEGER, EXTERNAL :: h5rcreate_region_c + +! INTEGER, EXTERNAL :: h5fcreate_region_c +! Interface is needed for MS FORTRAN +! + INTERFACE + INTEGER FUNCTION h5rcreate_region_c(ref_f, loc_id, name, namelen, space_id) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5RCREATE_REGION_C':: h5rcreate_region_c + !DEC$ATTRIBUTES reference :: name + INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 + INTEGER :: ref_f(REF_REG_BUF_LEN) + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(HID_T), INTENT(IN) :: space_id + END FUNCTION h5rcreate_region_c + END INTERFACE + namelen = LEN(name) ref_f = 0 hdferr = h5rcreate_region_c(ref_f, loc_id, name, namelen, space_id ) @@ -85,6 +171,35 @@ END SUBROUTINE h5rcreate_region_f +!---------------------------------------------------------------------- +! Name: h5rdereference_object_f +! +! Purpose: Opens the HDF5 object referenced +! +! Inputs: +! dset_id - identifier of the dataset containing +! reference +! ref - reference to open +! Outputs: +! obj_id - object_identifier +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! Comment: This is a module procedure for the h5rdereference_f +! subroutine. +!---------------------------------------------------------------------- + + SUBROUTINE h5rdereference_object_f(dset_id, ref, obj_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier @@ -94,28 +209,114 @@ INTEGER :: ref_type ! Reference type INTEGER :: ref_f(REF_OBJ_BUF_LEN) ! Local buffer to pass reference - INTEGER, EXTERNAL :: h5rdereference_object_c + +! INTEGER, EXTERNAL :: h5h5rdereference_object_c +! Interface is needed for MS FORTRAN +! + INTERFACE + INTEGER FUNCTION h5rdereference_object_c(dset_id, ref_f, obj_id) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5RDEREFERENCE_OBJECT_C':: h5rdereference_object_c + INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER :: ref_f(REF_OBJ_BUF_LEN) + INTEGER(HID_T), INTENT(OUT) :: obj_id + END FUNCTION h5rdereference_object_c + END INTERFACE + ref_f = ref%ref hdferr = h5rdereference_object_c(dset_id, ref_f, obj_id ) END SUBROUTINE h5rdereference_object_f +!---------------------------------------------------------------------- +! Name: h5rdereference_region_f +! +! Purpose: Opens the dataset region +! +! Inputs: +! dset_id - identifier of the dataset containing +! reference to teh regions +! ref - reference to open +! Outputs: +! obj_id - dataspace identifier +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! Comment: This is a module procedure for the h5rdereference_f +! subroutine. +!---------------------------------------------------------------------- + + SUBROUTINE h5rdereference_region_f(dset_id, ref, obj_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Object reference - INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier + INTEGER(HID_T), INTENT(OUT) :: obj_id ! Dataspace identifier INTEGER, INTENT(OUT) :: hdferr ! Error code INTEGER :: ref_type ! Reference type INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference - INTEGER, EXTERNAL :: h5rdereference_region_c + +! INTEGER, EXTERNAL :: h5rdereference_region_c +! Interface is needed for MS FORTRAN +! + INTERFACE + INTEGER FUNCTION h5rdereference_region_c(dset_id, ref_f, obj_id) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5RDEREFERENCE_REGION_C':: h5rdereference_region_c + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 + INTEGER :: ref_f(REF_REG_BUF_LEN) + INTEGER(HID_T), INTENT(OUT) :: obj_id + END FUNCTION h5rdereference_region_c + END INTERFACE + ref_type = H5R_DATASET_REGION_F ref_f = ref%ref hdferr = h5rdereference_region_c(dset_id, ref_f, obj_id ) END SUBROUTINE h5rdereference_region_f +!---------------------------------------------------------------------- +! Name: h5rget_region_region_f +! +! Purpose: Retrieves a dataspace with the specified region selected +! +! Inputs: +! dset_id - identifier of the dataset containing +! reference to the regions +! ref - reference to open +! Outputs: +! space_id - dataspace identifier +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! Comment: This is a module procedure for the h5rget_region_f +! subroutine. +!---------------------------------------------------------------------- + + SUBROUTINE h5rget_region_region_f(dset_id, ref, space_id, hdferr) IMPLICIT NONE @@ -125,11 +326,59 @@ INTEGER, INTENT(OUT) :: hdferr ! Error code INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference - INTEGER, EXTERNAL :: h5rget_region_region_c +! INTEGER, EXTERNAL :: h5rget_region_region_c +! Interface is needed for MS FORTRAN +! + INTERFACE + INTEGER FUNCTION h5rget_region_region_c(dset_id, ref_f, space_id) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5RGET_REGION_REGION_C':: h5rget_region_region_c + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 + INTEGER :: ref_f(REF_REG_BUF_LEN) + INTEGER(HID_T), INTENT(OUT) :: space_id + END FUNCTION h5rget_region_region_c + END INTERFACE + ref_f = ref%ref hdferr = h5rget_region_region_c(dset_id, ref_f, space_id ) END SUBROUTINE h5rget_region_region_f + +!---------------------------------------------------------------------- +! Name: h5rget_object_type_obj_f +! +! Purpose: Retrieves the type of object that an object reference points to. +! +! Inputs: +! dset_id - identifier of the dataset containing +! reference to the objects +! ref - reference to open +! Outputs: +! obj_type - object_type, possible values: +! H5G_UNKNOWN_F (-1) +! H5G_LINK_F 0 +! H5G_GROUP_F 1 +! H5G_DATASET_F 2 +! H5G_TYPE_F 3 +! +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! Comment: This is a module procedure for the h5rget_object_type_f +! subroutine. +!---------------------------------------------------------------------- + SUBROUTINE h5rget_object_type_obj_f(dset_id, ref, obj_type, hdferr) IMPLICIT NONE @@ -145,7 +394,20 @@ INTEGER, INTENT(OUT) :: hdferr ! Error code INTEGER :: ref_f(REF_OBJ_BUF_LEN) ! Local buffer to pass reference - INTEGER, EXTERNAL :: h5rget_object_type_obj_c +! INTEGER, EXTERNAL :: h5rget_object_type_obj_c +! Interface is needed for MS FORTRAN +! + INTERFACE + INTEGER FUNCTION h5rget_object_type_obj_c(dset_id, ref_f, obj_type) + USE H5GLOBAL + !MS$ATTRIBUTES C,reference,alias:'_H5RGET_OBJECT_TYPE_OBJ_C':: h5rget_object_type_obj_c + INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER :: ref_f(REF_OBJ_BUF_LEN) + INTEGER, INTENT(OUT) :: obj_type + END FUNCTION h5rget_object_type_obj_c + END INTERFACE + ref_f = ref%ref hdferr = h5rget_object_type_obj_c(dset_id, ref_f, obj_type ) |