diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2015-04-15 22:03:33 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2015-04-15 22:03:33 (GMT) |
commit | 7984de553e8ad2bbafa0840b207e762e2ed68f58 (patch) | |
tree | b3c6bbddfb64fd00628d842bb804c9105b2d0cc5 /fortran/src/H5Fff.F90 | |
parent | 9f4ed2197a8ce8c99ee84c7a7be9ecfa42d21044 (diff) | |
download | hdf5-7984de553e8ad2bbafa0840b207e762e2ed68f58.zip hdf5-7984de553e8ad2bbafa0840b207e762e2ed68f58.tar.gz hdf5-7984de553e8ad2bbafa0840b207e762e2ed68f58.tar.bz2 |
[svn-r26819] Updated H5A, H5E, H5D, H5F APIs to F2003, added ifdef for parallel.
Diffstat (limited to 'fortran/src/H5Fff.F90')
-rw-r--r-- | fortran/src/H5Fff.F90 | 165 |
1 files changed, 68 insertions, 97 deletions
diff --git a/fortran/src/H5Fff.F90 b/fortran/src/H5Fff.F90 index 53df8c5..206f71b 100644 --- a/fortran/src/H5Fff.F90 +++ b/fortran/src/H5Fff.F90 @@ -34,8 +34,9 @@ !***** MODULE H5F + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_NULL_PTR USE H5GLOBAL - USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE CONTAINS !****s* H5F/h5fcreate_f @@ -89,13 +90,10 @@ CONTAINS INTERFACE INTEGER FUNCTION h5fcreate_c(name, namelen, access_flags, & - creation_prp_default, access_prp_default, file_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FCREATE_C':: h5fcreate_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - CHARACTER(LEN=*), INTENT(IN) :: name + creation_prp_default, access_prp_default, file_id) BIND(C,NAME='h5fcreate_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name INTEGER, INTENT(IN) :: access_flags INTEGER(HID_T), INTENT(OUT) :: file_id INTEGER(HID_T), INTENT(IN) :: creation_prp_default @@ -166,11 +164,9 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code !***** INTERFACE - INTEGER FUNCTION h5fflush_c(object_id, scope) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FFLUSH_C':: h5fflush_c - !DEC$ENDIF + INTEGER FUNCTION h5fflush_c(object_id, scope) BIND(C,NAME='h5fflush_c') + IMPORT :: HID_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: object_id INTEGER, INTENT(IN) :: scope END FUNCTION h5fflush_c @@ -225,14 +221,12 @@ CONTAINS INTERFACE INTEGER FUNCTION h5fmount_c(loc_id, name, namelen, & - child_id, access_prp_default) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FMOUNT_C':: h5fmount_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name + child_id, access_prp_default) BIND(C,NAME='h5fmount_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name INTEGER(HID_T), INTENT(IN) :: child_id INTEGER(HID_T), INTENT(IN) :: access_prp_default INTEGER :: namelen @@ -281,14 +275,12 @@ CONTAINS INTEGER :: namelen ! Length of the name character string INTERFACE - INTEGER FUNCTION h5funmount_c(loc_id, name, namelen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FUNMOUNT_C':: h5funmount_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name + INTEGER FUNCTION h5funmount_c(loc_id, name, namelen) BIND(C,NAME='h5funmount_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name INTEGER :: namelen END FUNCTION h5funmount_c END INTERFACE @@ -341,13 +333,11 @@ CONTAINS INTERFACE INTEGER FUNCTION h5fopen_c(name, namelen, access_flags, & - access_prp_default, file_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FOPEN_C':: h5fopen_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - CHARACTER(LEN=*), INTENT(IN) :: name + access_prp_default, file_id) BIND(C,NAME='h5fopen_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name INTEGER :: namelen INTEGER, INTENT(IN) :: access_flags INTEGER(HID_T), INTENT(IN) :: access_prp_default @@ -392,11 +382,9 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code !***** INTERFACE - INTEGER FUNCTION h5freopen_c(file_id, ret_file_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FREOPEN_C':: h5freopen_c - !DEC$ENDIF + INTEGER FUNCTION h5freopen_c(file_id, ret_file_id) BIND(C,NAME='h5freopen_c') + IMPORT :: HID_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: file_id INTEGER(HID_T), INTENT(OUT) :: ret_file_id END FUNCTION h5freopen_c @@ -437,11 +425,9 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code !***** INTERFACE - INTEGER FUNCTION h5fget_create_plist_c(file_id, prop_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_CREATE_PLIST_C':: h5fget_create_plist_c - !DEC$ENDIF + INTEGER FUNCTION h5fget_create_plist_c(file_id, prop_id) BIND(C,NAME='h5fget_create_plist_c') + IMPORT :: HID_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: file_id INTEGER(HID_T), INTENT(OUT) :: prop_id END FUNCTION h5fget_create_plist_c @@ -481,11 +467,9 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code !***** INTERFACE - INTEGER FUNCTION h5fget_access_plist_c(file_id, access_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_CREATE_PLIST_C':: h5fget_access_plist_c - !DEC$ENDIF + INTEGER FUNCTION h5fget_access_plist_c(file_id, access_id) BIND(C,NAME='h5fget_access_plist_c') + IMPORT :: HID_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: file_id INTEGER(HID_T), INTENT(OUT) :: access_id END FUNCTION h5fget_access_plist_c @@ -530,13 +514,10 @@ CONTAINS ! to define status value. INTERFACE - INTEGER FUNCTION h5fis_hdf5_c(name, namelen, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FIS_HDF5_C':: h5fis_hdf5_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER FUNCTION h5fis_hdf5_c(name, namelen, flag) BIND(C,NAME='h5fis_hdf5_c') + IMPORT :: C_CHAR + IMPLICIT NONE + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name INTEGER :: namelen INTEGER :: flag END FUNCTION h5fis_hdf5_c @@ -576,11 +557,9 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code !***** INTERFACE - INTEGER FUNCTION h5fclose_c(file_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FCLOSE_C':: h5fclose_c - !DEC$ENDIF + INTEGER FUNCTION h5fclose_c(file_id) BIND(C,NAME='h5fclose_c') + IMPORT :: HID_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: file_id END FUNCTION h5fclose_c END INTERFACE @@ -619,22 +598,18 @@ CONTAINS ! SOURCE SUBROUTINE h5fget_obj_count_f(file_id, obj_type, obj_count, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier - INTEGER, INTENT(IN) :: obj_type ! Object type + INTEGER(HID_T), INTENT(IN) :: file_id + INTEGER, INTENT(IN) :: obj_type INTEGER(SIZE_T), INTENT(OUT) :: obj_count - ! Number of open objects - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: hdferr !***** INTERFACE - INTEGER FUNCTION h5fget_obj_count_c(file_id, obj_type, obj_count) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_OBJ_COUNT_C':: h5fget_obj_count_c - !DEC$ENDIF + INTEGER FUNCTION h5fget_obj_count_c(file_id, obj_type, obj_count) BIND(C,NAME='h5fget_obj_count_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER, INTENT(IN) :: obj_type ! Object type + INTEGER, INTENT(IN) :: obj_type INTEGER(SIZE_T), INTENT(OUT) :: obj_count - ! Number of open objects END FUNCTION h5fget_obj_count_c END INTERFACE @@ -689,11 +664,10 @@ CONTAINS INTEGER(SIZE_T) :: c_num_objs ! Number of open objects of the specified type INTERFACE - INTEGER FUNCTION h5fget_obj_ids_c(file_id, obj_type, max_objs, obj_ids, c_num_objs) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_OBJ_IDS_C':: h5fget_obj_ids_c - !DEC$ENDIF + INTEGER FUNCTION h5fget_obj_ids_c(file_id, obj_type, max_objs, obj_ids, c_num_objs) & + BIND(C,NAME='h5fget_obj_ids_c') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: file_id INTEGER, INTENT(IN) :: obj_type INTEGER(SIZE_T), INTENT(IN) :: max_objs @@ -733,11 +707,10 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code !***** INTERFACE - INTEGER FUNCTION h5fget_freespace_c(file_id, free_space) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_FREESPACE_C':: h5fget_freespace_c - !DEC$ENDIF + INTEGER FUNCTION h5fget_freespace_c(file_id, free_space) & + BIND(C,NAME='h5fget_freespace_c') + IMPORT :: HID_T, HSSIZE_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: file_id INTEGER(HSSIZE_T), INTENT(OUT) :: free_space END FUNCTION h5fget_freespace_c @@ -777,16 +750,15 @@ CONTAINS INTEGER(SIZE_T) :: buflen INTERFACE - INTEGER FUNCTION h5fget_name_c(obj_id, size, buf, buflen) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_NAME_C'::h5fget_name_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf + INTEGER FUNCTION h5fget_name_c(obj_id, size, buf, buflen) & + BIND(C,NAME='h5fget_name_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id INTEGER(SIZE_T), INTENT(OUT) :: size INTEGER(SIZE_T) :: buflen - CHARACTER(LEN=*), INTENT(OUT) :: buf + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: buf END FUNCTION h5fget_name_c END INTERFACE buflen = LEN_TRIM(buf) @@ -819,11 +791,10 @@ CONTAINS ! -1 if fail !***** INTERFACE - INTEGER FUNCTION h5fget_filesize_c(file_id, size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_FILESIZE_C'::h5fget_filesize_c - !DEC$ENDIF + INTEGER FUNCTION h5fget_filesize_c(file_id, size) & + BIND(C,NAME='h5fget_filesize_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: file_id INTEGER(HSIZE_T), INTENT(OUT) :: size END FUNCTION h5fget_filesize_c @@ -857,7 +828,6 @@ CONTAINS ! ! Fortran2003 Interface: SUBROUTINE h5fget_file_image_f(file_id, buf_ptr, buf_len, hdferr, buf_size) - USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE INTEGER(HID_T) , INTENT(IN) :: file_id TYPE(C_PTR) , INTENT(INOUT) :: buf_ptr @@ -870,8 +840,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5fget_file_image_c(file_id, buf_ptr, buf_len, buf_size) BIND(C, NAME='h5fget_file_image_c') - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR - USE H5GLOBAL + IMPORT :: C_PTR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE INTEGER(HID_T) , INTENT(IN) :: file_id TYPE(C_PTR) , VALUE :: buf_ptr INTEGER(SIZE_T), INTENT(IN) :: buf_len |