diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2015-04-17 16:01:16 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2015-04-17 16:01:16 (GMT) |
commit | ec2327200da42befb984a92d1b0444f0e014ffb2 (patch) | |
tree | c7ece82c47b0e2e1e8dad333aaf43fcb4f2c7136 | |
parent | d7fd1ed9c789dedad5d623a41abf8006e360f410 (diff) | |
download | hdf5-ec2327200da42befb984a92d1b0444f0e014ffb2.zip hdf5-ec2327200da42befb984a92d1b0444f0e014ffb2.tar.gz hdf5-ec2327200da42befb984a92d1b0444f0e014ffb2.tar.bz2 |
[svn-r26831] Added H5S BIND(C)
-rw-r--r-- | fortran/src/H5Sf.c | 62 | ||||
-rw-r--r-- | fortran/src/H5Sff.F90 | 1260 | ||||
-rw-r--r-- | fortran/src/H5f90proto.h | 97 |
3 files changed, 629 insertions, 790 deletions
diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c index 6947d64..53dd6ab 100644 --- a/fortran/src/H5Sf.c +++ b/fortran/src/H5Sf.c @@ -46,7 +46,7 @@ */ int_f -nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id ) +h5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id ) /******/ { hsize_t c_dims[H5S_MAX_RANK]; @@ -91,7 +91,7 @@ done: */ int_f -nh5sclose_c ( hid_t_f *space_id ) +h5sclose_c ( hid_t_f *space_id ) /******/ { int ret_value = 0; @@ -122,7 +122,7 @@ nh5sclose_c ( hid_t_f *space_id ) */ int_f -nh5screate_c ( int_f *classtype, hid_t_f *space_id ) +h5screate_c ( int_f *classtype, hid_t_f *space_id ) /******/ { H5S_class_t c_classtype; @@ -156,7 +156,7 @@ nh5screate_c ( int_f *classtype, hid_t_f *space_id ) */ int_f -nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) +h5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) /******/ { int ret_value = 0; @@ -194,7 +194,7 @@ nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) */ int_f -nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks) +h5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks) /******/ { int ret_value = 0; @@ -232,7 +232,7 @@ nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks) */ int_f -nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points) +h5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points) /******/ { int ret_value = 0; @@ -278,7 +278,7 @@ nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points) */ int_f -nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f *startblock, +h5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f *startblock, hsize_t_f *num_blocks, hsize_t_f *buf) /******/ { @@ -351,7 +351,7 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f *startblock, */ int_f -nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end) +h5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end) /******/ { hid_t c_space_id; @@ -406,7 +406,7 @@ done: */ int_f -nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, +h5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, hsize_t_f * numpoints, hsize_t_f * buf) /******/ { @@ -467,7 +467,7 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, */ int_f -nh5sselect_all_c ( hid_t_f *space_id ) +h5sselect_all_c ( hid_t_f *space_id ) /******/ { int ret_value = 0; @@ -496,7 +496,7 @@ nh5sselect_all_c ( hid_t_f *space_id ) */ int_f -nh5sselect_none_c ( hid_t_f *space_id ) +h5sselect_none_c ( hid_t_f *space_id ) /******/ { int ret_value = 0; @@ -529,7 +529,7 @@ nh5sselect_none_c ( hid_t_f *space_id ) */ int_f -nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag ) +h5sselect_valid_c ( hid_t_f *space_id , int_f *flag ) /******/ { int ret_value = 0; @@ -564,7 +564,7 @@ nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag ) */ int_f -nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ) +h5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ) /******/ { int ret_value = 0; @@ -599,7 +599,7 @@ nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ) */ int_f -nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ) +h5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ) /******/ { int ret_value = 0; @@ -634,7 +634,7 @@ nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ) */ int_f -nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ) +h5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ) /******/ { int ret_value = 0; @@ -670,7 +670,7 @@ nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ) */ int_f -nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype) +h5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype) /******/ { int ret_value = 0; @@ -709,7 +709,7 @@ nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype) */ int_f -nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset) +h5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset) /******/ { hid_t c_space_id; @@ -758,7 +758,7 @@ done: */ int_f -nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_size, hsize_t_f *maximum_size) +h5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_size, hsize_t_f *maximum_size) /******/ { hsize_t c_current_size[H5S_MAX_RANK]; @@ -804,7 +804,7 @@ done: */ int_f -nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims) +h5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims) /******/ { hid_t c_space_id; @@ -858,7 +858,7 @@ done: */ int_f -nh5sis_simple_c ( hid_t_f *space_id , int_f *flag ) +h5sis_simple_c ( hid_t_f *space_id , int_f *flag ) /******/ { int ret_value = 0; @@ -892,7 +892,7 @@ nh5sis_simple_c ( hid_t_f *space_id , int_f *flag ) */ int_f -nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id) +h5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id) /******/ { int ret_value = 0; @@ -924,7 +924,7 @@ nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id) */ int_f -nh5sset_extent_none_c ( hid_t_f *space_id ) +h5sset_extent_none_c ( hid_t_f *space_id ) /******/ { int ret_value = 0; @@ -962,7 +962,7 @@ nh5sset_extent_none_c ( hid_t_f *space_id ) */ int_f -nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block) +h5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block) /******/ { hsize_t c_start[H5S_MAX_RANK]; @@ -1023,7 +1023,7 @@ done: */ int_f -nh5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id) +h5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id) /******/ { int ret_value = -1; @@ -1102,7 +1102,7 @@ DONE: */ int_f -nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id) +h5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id) /******/ { int ret_value = -1; @@ -1141,7 +1141,7 @@ nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t */ int_f -nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) +h5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) /******/ { int ret_value = -1; @@ -1177,7 +1177,7 @@ nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) * SOURCE */ int_f -nh5sget_select_type_c ( hid_t_f *space_id , int_f *type) +h5sget_select_type_c ( hid_t_f *space_id , int_f *type) /******/ { int ret_value = -1; @@ -1216,7 +1216,7 @@ nh5sget_select_type_c ( hid_t_f *space_id , int_f *type) */ int_f -nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord) +h5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord) /******/ { int ret_value = -1; @@ -1272,7 +1272,7 @@ nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsi */ int_f -nh5sdecode_c ( _fcd buf, hid_t_f *obj_id ) +h5sdecode_c ( _fcd buf, hid_t_f *obj_id ) /******/ { int ret_value = -1; @@ -1316,7 +1316,7 @@ nh5sdecode_c ( _fcd buf, hid_t_f *obj_id ) */ int_f -nh5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) +h5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) /******/ { int ret_value = -1; @@ -1387,7 +1387,7 @@ nh5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) */ int_f -nh5sextent_equal_c ( hid_t_f * space1_id, hid_t_f *space2_id, hid_t_f *c_equal) +h5sextent_equal_c ( hid_t_f * space1_id, hid_t_f *space2_id, hid_t_f *c_equal) /******/ { int ret_value = -1; diff --git a/fortran/src/H5Sff.F90 b/fortran/src/H5Sff.F90 index c493d46..c95d4be 100644 --- a/fortran/src/H5Sff.F90 +++ b/fortran/src/H5Sff.F90 @@ -7,10 +7,7 @@ ! fortran/src/H5Sff.f90 ! ! PURPOSE -! This file contains Fortran interfaces for H5S functions. It includes -! all the functions that are independent on whether the Fortran 2003 functions -! are enabled or disabled. -! +! This file contains Fortran interfaces for H5S functions. ! ! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -37,10 +34,10 @@ !***** MODULE H5S + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR USE H5GLOBAL CONTAINS - ! !****s* H5S/h5screate_simple_f ! @@ -66,50 +63,44 @@ CONTAINS ! HISTORY ! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 6, 2001 + ! port). March 6, 2001 ! SOURCE - SUBROUTINE h5screate_simple_f(rank, dims, space_id, hdferr, maxdims) - - IMPLICIT NONE - INTEGER, INTENT(IN) :: rank ! Number of dataspace dimensions - INTEGER(HSIZE_T), INTENT(IN) :: dims(rank) - ! Array with the dimension - ! sizes - INTEGER(HID_T), INTENT(OUT) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HSIZE_T), OPTIONAL, INTENT(IN) :: maxdims(rank) - ! Array with the maximum - ! dimension sizes + SUBROUTINE h5screate_simple_f(rank, dims, space_id, hdferr, maxdims) + + IMPLICIT NONE + INTEGER, INTENT(IN) :: rank + INTEGER(HSIZE_T), INTENT(IN) :: dims(rank) + INTEGER(HID_T), INTENT(OUT) :: space_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HSIZE_T), OPTIONAL, INTENT(IN) :: maxdims(rank) !***** - INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: f_maxdims - - INTERFACE - INTEGER FUNCTION h5screate_simple_c(rank, dims, maxdims, space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCREATE_SIMPLE_C'::h5screate_simple_c - !DEC$ENDIF - INTEGER, INTENT(IN) :: rank - INTEGER(HSIZE_T), INTENT(IN) :: dims(rank) - INTEGER(HSIZE_T), DIMENSION(:),INTENT(IN) :: maxdims(rank) - INTEGER(HID_T), INTENT(OUT) :: space_id - END FUNCTION h5screate_simple_c - END INTERFACE - - allocate (f_maxdims(rank), stat=hdferr) - if (hdferr .NE. 0) then - hdferr = -1 - return - endif - if (present(maxdims)) then - f_maxdims = maxdims - else - f_maxdims = dims - endif - hdferr = h5screate_simple_c(rank, dims, f_maxdims, space_id) - deallocate(f_maxdims) - - END SUBROUTINE h5screate_simple_f + INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: f_maxdims + + INTERFACE + INTEGER FUNCTION h5screate_simple_c(rank, dims, maxdims, space_id) BIND(C,NAME='h5screate_simple_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER, INTENT(IN) :: rank + INTEGER(HSIZE_T), INTENT(IN) :: dims(rank) + INTEGER(HSIZE_T), DIMENSION(:),INTENT(IN) :: maxdims(rank) + INTEGER(HID_T), INTENT(OUT) :: space_id + END FUNCTION h5screate_simple_c + END INTERFACE + + ALLOCATE (f_maxdims(rank), stat=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + IF (PRESENT(maxdims)) THEN + f_maxdims = maxdims + ELSE + f_maxdims = dims + ENDIF + hdferr = h5screate_simple_c(rank, dims, f_maxdims, space_id) + DEALLOCATE(f_maxdims) + + END SUBROUTINE h5screate_simple_f ! !****s* H5S/h5sclose_f @@ -134,24 +125,22 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sclose_f(space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sclose_f(space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code !***** - INTERFACE - INTEGER FUNCTION h5sclose_c(space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCLOSE_C'::h5sclose_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - END FUNCTION h5sclose_c - END INTERFACE - - hdferr = h5sclose_c(space_id) - - END SUBROUTINE h5sclose_f + INTERFACE + INTEGER FUNCTION h5sclose_c(space_id) BIND(C,NAME='h5sclose_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + END FUNCTION h5sclose_c + END INTERFACE + + hdferr = h5sclose_c(space_id) + + END SUBROUTINE h5sclose_f ! !****s* H5S/h5screate_f @@ -163,9 +152,13 @@ CONTAINS ! Creates a new dataspace of a specified type. ! ! INPUTS -! classtype - the type of the dataspace to be created +! classtype - The type of the dataspace to be created +! Possible values are: +! H5S_SCALAR_F +! H5S_SIMPLE_F +! H5S_NULL_F ! OUTPUTS -! space_id - dataspace identifier +! space_id - Dataspace identifier ! hdferr - Returns 0 if successful and -1 if fails ! ! AUTHOR @@ -181,31 +174,24 @@ CONTAINS ! ! SOURCE - SUBROUTINE h5screate_f(classtype, space_id, hdferr) - IMPLICIT NONE - INTEGER, INTENT(IN) :: classtype ! The type of the dataspace - ! to be created. - ! Possible values are: - ! H5S_SCALAR_F (0) - ! H5S_SIMPLE_F(1) - ! H5S_NULL_F(2) - INTEGER(HID_T), INTENT(OUT) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5screate_f(classtype, space_id, hdferr) + IMPLICIT NONE + INTEGER, INTENT(IN) :: classtype + INTEGER(HID_T), INTENT(OUT) :: space_id + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5screate_c(classtype, space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCREATE_C'::h5screate_c - !DEC$ENDIF - INTEGER, INTENT(IN) :: classtype - INTEGER(HID_T), INTENT(OUT) :: space_id - END FUNCTION h5screate_c - END INTERFACE - - hdferr = h5screate_c(classtype, space_id) - - END SUBROUTINE h5screate_f + INTERFACE + INTEGER FUNCTION h5screate_c(classtype, space_id) BIND(C,NAME='h5screate_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER, INTENT(IN) :: classtype + INTEGER(HID_T), INTENT(OUT) :: space_id + END FUNCTION h5screate_c + END INTERFACE + + hdferr = h5screate_c(classtype, space_id) + + END SUBROUTINE h5screate_f ! !****s* H5S/h5scopy_f @@ -235,27 +221,24 @@ CONTAINS ! ! SOURCE - SUBROUTINE h5scopy_f(space_id, new_space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HID_T), INTENT(OUT) :: new_space_id - ! Identifier of dataspace's copy - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5scopy_f(space_id, new_space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), INTENT(OUT) :: new_space_id + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5scopy_c(space_id, new_space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCOPY_C'::h5scopy_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HID_T), INTENT(OUT):: new_space_id - END FUNCTION h5scopy_c - END INTERFACE + INTERFACE + INTEGER FUNCTION h5scopy_c(space_id, new_space_id) BIND(C,NAME='h5scopy_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), INTENT(OUT):: new_space_id + END FUNCTION h5scopy_c + END INTERFACE - hdferr = h5scopy_c(space_id, new_space_id) + hdferr = h5scopy_c(space_id, new_space_id) - END SUBROUTINE h5scopy_f + END SUBROUTINE h5scopy_f ! !****s* H5S/h5sget_select_hyper_nblocks_f @@ -282,29 +265,25 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sget_select_hyper_nblocks_f(space_id, num_blocks, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSSIZE_T), INTENT(OUT) :: num_blocks - !number of hyperslab blocks - !in the current dataspace - !selection - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sget_select_hyper_nblocks_f(space_id, num_blocks, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), INTENT(OUT) :: num_blocks + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5sget_select_hyper_nblocks_c (space_id, num_blocks) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) -! DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_HYPER_NBLOCKS_C'::h5sget_select_hyper_nblocks_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSSIZE_T), INTENT(OUT) :: num_blocks - END FUNCTION h5sget_select_hyper_nblocks_c - END INTERFACE - - hdferr = h5sget_select_hyper_nblocks_c (space_id, num_blocks) + INTERFACE + INTEGER FUNCTION h5sget_select_hyper_nblocks_c (space_id, num_blocks) & + BIND(C,NAME='h5sget_select_hyper_nblocks_c') + IMPORT :: HID_T, HSSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), INTENT(OUT) :: num_blocks + END FUNCTION h5sget_select_hyper_nblocks_c + END INTERFACE - END SUBROUTINE h5sget_select_hyper_nblocks_f + hdferr = h5sget_select_hyper_nblocks_c (space_id, num_blocks) + + END SUBROUTINE h5sget_select_hyper_nblocks_f ! !****s* H5S/h5sget_select_hyper_blocklist_f @@ -332,40 +311,30 @@ CONTAINS ! called C functions (it is needed for Windows ! port). March 6, 2001 ! SOURCE - SUBROUTINE h5sget_select_hyper_blocklist_f(space_id, startblock, & + SUBROUTINE h5sget_select_hyper_blocklist_f(space_id, startblock, & num_blocks, buf, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSIZE_T), INTENT(IN) :: startblock - !Hyperslab block to start with. - INTEGER(HSIZE_T), INTENT(IN) :: num_blocks - !number of hyperslab blocks - !to get in the current dataspace - !selection - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf - !List of hyperslab blocks selected - INTEGER, INTENT(OUT) :: hdferr ! Error code + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), INTENT(IN) :: startblock + INTEGER(HSIZE_T), INTENT(IN) :: num_blocks + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf + INTEGER, INTENT(OUT) :: hdferr !***** + INTERFACE + INTEGER FUNCTION h5sget_select_hyper_blocklist_c(space_id, startblock, & + num_blocks, buf ) BIND(C,NAME='h5sget_select_hyper_blocklist_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), INTENT(IN) :: startblock + INTEGER(HSIZE_T), INTENT(IN) :: num_blocks + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf + END FUNCTION h5sget_select_hyper_blocklist_c + END INTERFACE - INTERFACE - INTEGER FUNCTION h5sget_select_hyper_blocklist_c(space_id, startblock, & - num_blocks, buf ) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_HYPER_BLOCKLIST_C'::h5sget_select_hyper_blocklist_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSIZE_T), INTENT(IN) :: startblock - INTEGER(HSIZE_T), INTENT(IN) :: num_blocks - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf - END FUNCTION h5sget_select_hyper_blocklist_c - END INTERFACE - - - hdferr = h5sget_select_hyper_blocklist_c(space_id, startblock, & - num_blocks, buf ) + hdferr = h5sget_select_hyper_blocklist_c(space_id, startblock, num_blocks, buf ) - END SUBROUTINE h5sget_select_hyper_blocklist_f + END SUBROUTINE h5sget_select_hyper_blocklist_f ! !****s* H5S/h5sget_select_bounds_f @@ -382,6 +351,7 @@ CONTAINS ! OUTPUTS ! start - starting coordinates of bounding box ! end - ending coordinates of bounding box +! i.e., the coordinates of the diagonally opposite corner ! hdferr - Returns 0 if successful and -1 if fails ! OPTIONAL PARAMETERS ! NONE @@ -397,21 +367,16 @@ CONTAINS ! SOURCE SUBROUTINE h5sget_select_bounds_f(space_id, start, END, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier + INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: start - ! Starting coordinates of the bounding box. INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: END - !Ending coordinates of the bounding box, - !i.e., the coordinates of the diagonally - !opposite corner - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: hdferr !***** INTERFACE - INTEGER FUNCTION h5sget_select_bounds_c(space_id, start, END) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_BOUNDS_C'::h5sget_select_bounds_c - !DEC$ENDIF + INTEGER FUNCTION h5sget_select_bounds_c(space_id, start, end) & + BIND(C,NAME='h5sget_select_bounds_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: start INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: END @@ -447,29 +412,23 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sget_select_elem_npoints_f(space_id, num_points, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSSIZE_T), INTENT(OUT) :: num_points - !number of element points - !in the current dataspace - !selection - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sget_select_elem_npoints_f(space_id, num_points, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), INTENT(OUT) :: num_points + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5sget_select_elem_npoints_c (space_id, num_points) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) -! DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_ELEM_NPOINTS_C'::h5sget_select_elem_npoints_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSSIZE_T), INTENT(OUT) :: num_points - END FUNCTION h5sget_select_elem_npoints_c - END INTERFACE - - hdferr = h5sget_select_elem_npoints_c (space_id, num_points) + INTERFACE + INTEGER FUNCTION h5sget_select_elem_npoints_c (space_id, num_points) BIND(C,NAME='h5sget_select_elem_npoints_c') + IMPORT :: HID_T, HSSIZE_T + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), INTENT(OUT) :: num_points + END FUNCTION h5sget_select_elem_npoints_c + END INTERFACE - END SUBROUTINE h5sget_select_elem_npoints_f + hdferr = h5sget_select_elem_npoints_c (space_id, num_points) + + END SUBROUTINE h5sget_select_elem_npoints_f ! !****s* H5S/h5sget_select_elem_pointlist_f @@ -497,36 +456,31 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sget_select_elem_pointlist_f(space_id, startpoint, & - num_points, buf, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSIZE_T), INTENT(IN) :: startpoint - !Element point to start with. - INTEGER(HSIZE_T), INTENT(IN) :: num_points - !Number of element points to get - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf - !List of element points selected - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sget_select_elem_pointlist_f(space_id, startpoint, & + num_points, buf, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), INTENT(IN) :: startpoint + INTEGER(HSIZE_T), INTENT(IN) :: num_points + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5sget_select_elem_pointlist_c(space_id, startpoint, & - num_points, buf ) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) -! DEC$ ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_ELEM_POINTLIST_C'::h5sget_select_elem_pointlist_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSIZE_T), INTENT(IN) :: startpoint - INTEGER(HSIZE_T), INTENT(IN) :: num_points - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf - END FUNCTION h5sget_select_elem_pointlist_c - END INTERFACE - - hdferr = h5sget_select_elem_pointlist_c(space_id, startpoint, & - num_points, buf ) - - END SUBROUTINE h5sget_select_elem_pointlist_f + INTERFACE + INTEGER FUNCTION h5sget_select_elem_pointlist_c(space_id, startpoint, & + num_points, buf ) BIND(C,NAME='h5sget_select_elem_pointlist_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), INTENT(IN) :: startpoint + INTEGER(HSIZE_T), INTENT(IN) :: num_points + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf + END FUNCTION h5sget_select_elem_pointlist_c + END INTERFACE + + hdferr = h5sget_select_elem_pointlist_c(space_id, startpoint, & + num_points, buf ) + + END SUBROUTINE h5sget_select_elem_pointlist_f ! !****s* H5S/h5sselect_elements_f @@ -575,11 +529,9 @@ CONTAINS INTERFACE INTEGER FUNCTION h5sselect_elements_c(space_id, OPERATOR,& - num_elements,c_c_coord) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_ELEMENTS_C'::h5sselect_elements_c - !DEC$ENDIF + num_elements,c_c_coord) BIND(C,NAME='h5sselect_elements_c') + IMPORT :: HID_T, SIZE_T, HSIZE_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id INTEGER, INTENT(IN) :: OPERATOR INTEGER(SIZE_T), INTENT(IN) :: num_elements @@ -635,24 +587,22 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sselect_all_f(space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sselect_all_f(space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5sselect_all_c(space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_ALL_C'::h5sselect_all_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - END FUNCTION h5sselect_all_c - END INTERFACE - - hdferr = h5sselect_all_c(space_id) - - END SUBROUTINE h5sselect_all_f + INTERFACE + INTEGER FUNCTION h5sselect_all_c(space_id) BIND(C,NAME='h5sselect_all_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + END FUNCTION h5sselect_all_c + END INTERFACE + + hdferr = h5sselect_all_c(space_id) + + END SUBROUTINE h5sselect_all_f ! !****s* H5S/h5sselect_none_f @@ -679,24 +629,22 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sselect_none_f(space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sselect_none_f(space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5sselect_none_c(space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_NONE_C'::h5sselect_none_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - END FUNCTION h5sselect_none_c - END INTERFACE - - hdferr = h5sselect_none_c(space_id) - - END SUBROUTINE h5sselect_none_f + INTERFACE + INTEGER FUNCTION h5sselect_none_c(space_id) BIND(C,NAME='h5sselect_none_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + END FUNCTION h5sselect_none_c + END INTERFACE + + hdferr = h5sselect_none_c(space_id) + + END SUBROUTINE h5sselect_none_f ! !****s* H5S/h5sselect_valid_f @@ -709,10 +657,12 @@ CONTAINS ! the dataspace. ! ! INPUTS -! space_id - identifier for the dataspace for which -! selection is verified +! space_id - identifier for the dataspace for which +! selection is verified ! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails +! status - TRUE if the selection is contained within +! the extent, FALSE otherwise. +! hdferr - Returns 0 if successful and -1 if fails ! ! AUTHOR ! Elena Pourmal @@ -724,32 +674,28 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sselect_valid_f(space_id, status, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - LOGICAL, INTENT(OUT) :: status ! TRUE if the selection is - ! contained within the extent, - ! FALSE otherwise. - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sselect_valid_f(space_id, status, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + LOGICAL, INTENT(OUT) :: status + INTEGER, INTENT(OUT) :: hdferr !***** - INTEGER :: flag ! "TRUE/FALSE/ERROR" flag from C routine + INTEGER :: flag ! "TRUE/FALSE/ERROR" flag from C routine - INTERFACE - INTEGER FUNCTION h5sselect_valid_c(space_id, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_VALID_C'::h5sselect_valid_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER :: flag - END FUNCTION h5sselect_valid_c - END INTERFACE - - hdferr = h5sselect_valid_c(space_id, flag) - status = .TRUE. - if (flag .EQ. 0) status = .FALSE. - - END SUBROUTINE h5sselect_valid_f + INTERFACE + INTEGER FUNCTION h5sselect_valid_c(space_id, flag) BIND(C,NAME='h5sselect_valid_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER :: flag + END FUNCTION h5sselect_valid_c + END INTERFACE + + hdferr = h5sselect_valid_c(space_id, flag) + status = .TRUE. + IF (flag .EQ. 0) status = .FALSE. + + END SUBROUTINE h5sselect_valid_f ! !****s* H5S/h5sget_simple_extent_npoints_f @@ -776,27 +722,24 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sget_simple_extent_npoints_f(space_id, npoints, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSIZE_T), INTENT(OUT) :: npoints ! Number of elements in - ! dataspace - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sget_simple_extent_npoints_f(space_id, npoints, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), INTENT(OUT) :: npoints + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5sget_simple_extent_npoints_c( space_id, npoints) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_NPOINTS_C'::h5sget_simple_extent_npoints_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSIZE_T), INTENT(OUT) :: npoints - END FUNCTION h5sget_simple_extent_npoints_c - END INTERFACE + INTERFACE + INTEGER FUNCTION h5sget_simple_extent_npoints_c( space_id, npoints) BIND(C,NAME='h5sget_simple_extent_npoints_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), INTENT(OUT) :: npoints + END FUNCTION h5sget_simple_extent_npoints_c + END INTERFACE - hdferr = h5sget_simple_extent_npoints_c( space_id, npoints) + hdferr = h5sget_simple_extent_npoints_c( space_id, npoints) - END SUBROUTINE h5sget_simple_extent_npoints_f + END SUBROUTINE h5sget_simple_extent_npoints_f ! !****s* H5S/h5sget_select_npoints_f @@ -808,10 +751,10 @@ CONTAINS ! Determines the number of elements in a dataspace selection. ! ! INPUTS -! space_id - dataspace identifier +! space_id - dataspace identifier ! OUTPUTS -! npoints - number of points in the dataspace selection -! hdferr - Returns 0 if successful and -1 if fails +! npoints - number of points in the dataspace selection +! hdferr - Returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal ! August 12, 1999 @@ -821,27 +764,24 @@ CONTAINS ! called C functions (it is needed for Windows ! port). March 6, 2001 ! SOURCE - SUBROUTINE h5sget_select_npoints_f(space_id, npoints, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSSIZE_T), INTENT(OUT) :: npoints ! Number of elements in the - ! selection - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sget_select_npoints_f(space_id, npoints, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), INTENT(OUT) :: npoints + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5sget_select_npoints_c(space_id, npoints) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_NPOINTS_C'::h5sget_select_npoints_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSSIZE_T), INTENT(OUT) :: npoints - END FUNCTION h5sget_select_npoints_c - END INTERFACE - - hdferr = h5sget_select_npoints_c(space_id, npoints) + INTERFACE + INTEGER FUNCTION h5sget_select_npoints_c(space_id, npoints) BIND(C,NAME='h5sget_select_npoints_c') + IMPORT :: HID_T, HSSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), INTENT(OUT) :: npoints + END FUNCTION h5sget_select_npoints_c + END INTERFACE + + hdferr = h5sget_select_npoints_c(space_id, npoints) - END SUBROUTINE h5sget_select_npoints_f + END SUBROUTINE h5sget_select_npoints_f ! !****s* H5S/h5sget_simple_extent_ndims_f @@ -867,26 +807,24 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sget_simple_extent_ndims_f(space_id, rank, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: rank ! Number of dimensions - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sget_simple_extent_ndims_f(space_id, rank, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: rank + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5sget_simple_extent_ndims_c(space_id, rank) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_NDIMS_C'::h5sget_simple_extent_ndims_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER, INTENT(OUT) :: rank - END FUNCTION h5sget_simple_extent_ndims_c - END INTERFACE - - hdferr = h5sget_simple_extent_ndims_c(space_id, rank) - - END SUBROUTINE h5sget_simple_extent_ndims_f + INTERFACE + INTEGER FUNCTION h5sget_simple_extent_ndims_c(space_id, rank) BIND(C,NAME='h5sget_simple_extent_ndims_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: rank + END FUNCTION h5sget_simple_extent_ndims_c + END INTERFACE + + hdferr = h5sget_simple_extent_ndims_c(space_id, rank) + + END SUBROUTINE h5sget_simple_extent_ndims_f ! !****s* H5S/h5sget_simple_extent_dims_f ! @@ -897,12 +835,13 @@ CONTAINS ! Retrieves dataspace dimension size and maximum size. ! ! INPUTS -! space_id - dataspace identifier +! space_id - dataspace identifier +! ! OUTPUTS -! dims - array to store size of each dimension -! maxdims - array to store maximum size of each -! dimension -! hdferr - Returns 0 if successful and -1 if fails +! dims - array to store size of each dimension +! maxdims - array to store maximum size of each dimension +! hdferr - Returns 0 if successful and -1 if fails +! ! AUTHOR ! Elena Pourmal ! August 12, 1999 @@ -913,33 +852,26 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims - ! Array to store dimension sizes - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: maxdims - ! Array to store max dimension - ! sizes - INTEGER, INTENT(OUT) :: hdferr ! Error code: -1 on failure, - ! number of dimensions on - ! on success + SUBROUTINE h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: maxdims + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5sget_simple_extent_dims_c(space_id, dims, maxdims) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_DIMS_C'::h5sget_simple_extent_dims_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: maxdims - END FUNCTION h5sget_simple_extent_dims_c - END INTERFACE - - hdferr = h5sget_simple_extent_dims_c(space_id, dims, maxdims) - - END SUBROUTINE h5sget_simple_extent_dims_f + INTERFACE + INTEGER FUNCTION h5sget_simple_extent_dims_c(space_id, dims, maxdims) BIND(C,NAME='h5sget_simple_extent_dims_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: maxdims + END FUNCTION h5sget_simple_extent_dims_c + END INTERFACE + + hdferr = h5sget_simple_extent_dims_c(space_id, dims, maxdims) + + END SUBROUTINE h5sget_simple_extent_dims_f ! !****s* H5S/h5sget_simple_extent_type_f @@ -954,10 +886,10 @@ CONTAINS ! space_id - dataspace identifier ! OUTPUTS ! classtype - class type, possible values are: -! H5S_NO_CLASS_F (-1) -! H5S_SCALAR_F (0) -! H5S_SIMPLE_F (1) -! H5S_NULL_F (2) +! H5S_NO_CLASS_F +! H5S_SCALAR_F +! H5S_SIMPLE_F +! H5S_NULL_F ! hdferr - Returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal @@ -969,32 +901,25 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sget_simple_extent_type_f(space_id, classtype, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: classtype ! Class type , possible values - ! are: - ! H5S_NO_CLASS_F (-1) - ! H5S_SCALAR_F (0) - ! H5S_SIMPLE_F (1) - ! H5S_NULL_F (2) - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sget_simple_extent_type_f(space_id, classtype, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: classtype + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5sget_simple_extent_type_c(space_id, classtype) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SIMPLE_EXTENT_TYPE_C'::h5sget_simple_extent_type_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER, INTENT(OUT) :: classtype - END FUNCTION h5sget_simple_extent_type_c - END INTERFACE - - hdferr = h5sget_simple_extent_type_c(space_id, classtype) - - END SUBROUTINE h5sget_simple_extent_type_f -! + INTERFACE + INTEGER FUNCTION h5sget_simple_extent_type_c(space_id, classtype) BIND(C,NAME='h5sget_simple_extent_type_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: classtype + END FUNCTION h5sget_simple_extent_type_c + END INTERFACE + + hdferr = h5sget_simple_extent_type_c(space_id, classtype) + + END SUBROUTINE h5sget_simple_extent_type_f + ! !****s* H5S/h5sset_extent_simple_f ! ! NAME @@ -1021,38 +946,30 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sset_extent_simple_f(space_id, rank, current_size, & - maximum_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(IN) :: rank ! Dataspace rank - INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: current_size - ! Array with the new sizes - ! of dimensions - INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: maximum_size - ! Array with the new maximum - ! sizes of dimensions - ! sizes - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sset_extent_simple_f(space_id, rank, current_size, & + maximum_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(IN) :: rank + INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: current_size + INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: maximum_size + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5sset_extent_simple_c(space_id, rank, & - current_size, maximum_size) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSET_EXTENT_SIMPLE_C'::h5sset_extent_simple_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER, INTENT(IN) :: rank - INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: current_size - INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: maximum_size - END FUNCTION h5sset_extent_simple_c - END INTERFACE - - hdferr = h5sset_extent_simple_c(space_id, rank, current_size, & - maximum_size) - - END SUBROUTINE h5sset_extent_simple_f + INTERFACE + INTEGER FUNCTION h5sset_extent_simple_c(space_id, rank, & + current_size, maximum_size) BIND(C,NAME='h5sset_extent_simple_c') + IMPORT :: HID_T, HSIZE_T + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(IN) :: rank + INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: current_size + INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: maximum_size + END FUNCTION h5sset_extent_simple_c + END INTERFACE + + hdferr = h5sset_extent_simple_c(space_id, rank, current_size, & + maximum_size) + + END SUBROUTINE h5sset_extent_simple_f ! !****s* H5S/h5sis_simple_f ! @@ -1066,8 +983,8 @@ CONTAINS ! space_id - dataspace identifier ! OUTPUTS ! status - flag to indicate if dataspace -! is simple or not -! hdferr - Returns 0 if successful and -1 if fails +! is simple or not (TRUE or FALSE) +! hdferr - Returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal ! August 12, 1999 @@ -1078,32 +995,28 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sis_simple_f(space_id, status, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - LOGICAL, INTENT(OUT) :: status ! Flag, idicates if dataspace - ! is simple or not ( TRUE or - ! FALSE) - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sis_simple_f(space_id, status, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + LOGICAL, INTENT(OUT) :: status + INTEGER, INTENT(OUT) :: hdferr !***** - INTEGER :: flag ! "TRUE/FALSE/ERROR from C" - - INTERFACE - INTEGER FUNCTION h5sis_simple_c(space_id, flag) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SIS_SIMPLE_C'::h5sis_simple_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER :: flag - END FUNCTION h5sis_simple_c - END INTERFACE + INTEGER :: flag ! "TRUE/FALSE/ERROR from C" - hdferr = h5sis_simple_c(space_id, flag) - status = .TRUE. - if (flag .EQ. 0) status = .FALSE. - - END SUBROUTINE h5sis_simple_f + INTERFACE + INTEGER FUNCTION h5sis_simple_c(space_id, flag) BIND(C,NAME='h5sis_simple_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER :: flag + END FUNCTION h5sis_simple_c + END INTERFACE + + hdferr = h5sis_simple_c(space_id, flag) + status = .TRUE. + IF (flag .EQ. 0) status = .FALSE. + + END SUBROUTINE h5sis_simple_f ! !****s* H5S/h5soffset_simple_f @@ -1117,7 +1030,7 @@ CONTAINS ! INPUTS ! space_id - dataspace identifier ! offset - the offset at which to position the -! selection +! selection ! OUTPUTS ! hdferr - Returns 0 if successful and -1 if fails ! OPTIONAL PARAMETERS @@ -1133,28 +1046,24 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5soffset_simple_f(space_id, offset, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: offset - ! The offset at which to position - ! the selection - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5soffset_simple_f(space_id, offset, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: offset + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5soffset_simple_c(space_id, offset) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SOFFSET_SIMPLE_C'::h5soffset_simple_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: offset - END FUNCTION h5soffset_simple_c - END INTERFACE + INTERFACE + INTEGER FUNCTION h5soffset_simple_c(space_id, offset) BIND(C,NAME='h5soffset_simple_c') + IMPORT :: HID_T, HSSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: offset + END FUNCTION h5soffset_simple_c + END INTERFACE - hdferr = h5soffset_simple_c(space_id, offset) + hdferr = h5soffset_simple_c(space_id, offset) - END SUBROUTINE h5soffset_simple_f + END SUBROUTINE h5soffset_simple_f ! !****s* H5S/h5sextent_copy_f @@ -1166,12 +1075,12 @@ CONTAINS ! Copies the extent of a dataspace. ! ! INPUTS -! dest_space_id - the identifier for the dataspace to which -! the extent is copied -! source_space_id - the identifier for the dataspace from -! which the extent is copied +! dest_space_id - the identifier for the dataspace to which +! the extent is copied +! source_space_id - the identifier for the dataspace from +! which the extent is copied ! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails +! hdferr - Returns 0 if successful and -1 if fails ! OPTIONAL PARAMETERS ! NONE ! @@ -1188,28 +1097,24 @@ CONTAINS ! ! SOURCE - SUBROUTINE h5sextent_copy_f(dest_space_id, source_space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dest_space_id ! Identifier of destination - ! dataspace - INTEGER(HID_T), INTENT(IN) :: source_space_id ! Identifier of source - ! dataspace - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sextent_copy_f(dest_space_id, source_space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dest_space_id + INTEGER(HID_T), INTENT(IN) :: source_space_id + INTEGER, INTENT(OUT) :: hdferr ! Error code !***** - INTERFACE - INTEGER FUNCTION h5sextent_copy_c(dest_space_id, source_space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SEXTENT_COPY_C'::h5sextent_copy_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: dest_space_id - INTEGER(HID_T), INTENT(IN) :: source_space_id - END FUNCTION h5sextent_copy_c - END INTERFACE + INTERFACE + INTEGER FUNCTION h5sextent_copy_c(dest_space_id, source_space_id) BIND(C,NAME='h5sextent_copy_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dest_space_id + INTEGER(HID_T), INTENT(IN) :: source_space_id + END FUNCTION h5sextent_copy_c + END INTERFACE - hdferr = h5sextent_copy_c(dest_space_id, source_space_id) + hdferr = h5sextent_copy_c(dest_space_id, source_space_id) - END SUBROUTINE h5sextent_copy_f + END SUBROUTINE h5sextent_copy_f ! !****s* H5S/h5sset_extent_none_f @@ -1234,25 +1139,22 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sset_extent_none_f(space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sset_extent_none_f(space_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5sset_extent_none_c(space_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSET_EXTENT_NONE_C'::h5sset_extent_none_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - END FUNCTION h5sset_extent_none_c - END INTERFACE - - hdferr = h5sset_extent_none_c(space_id) - - END SUBROUTINE h5sset_extent_none_f - + INTERFACE + INTEGER FUNCTION h5sset_extent_none_c(space_id) BIND(C,NAME='h5sset_extent_none_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + END FUNCTION h5sset_extent_none_c + END INTERFACE + + hdferr = h5sset_extent_none_c(space_id) + + END SUBROUTINE h5sset_extent_none_f ! !****s* H5S/h5sselect_hyperslab_f ! @@ -1266,13 +1168,12 @@ CONTAINS ! INPUTS ! space_id - dataspace identifier ! operator - flag, valid values are: -! H5S_SELECT_SET_F (0) -! H5S_SELECT_OR_F (1) +! H5S_SELECT_SET_F +! H5S_SELECT_OR_F ! start - array with hyperslab offsets -! count - number of blocks included in the -! hyperslab +! count - number of blocks included in the hyperslab ! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails +! hdferr - Returns 0 if successful and -1 if fails ! OPTIONAL PARAMETERS ! stride - array with hyperslab strides ! block - array with hyperslab block sizes @@ -1287,99 +1188,88 @@ CONTAINS ! port). March 6, 2001 ! ! SOURCE - SUBROUTINE h5sselect_hyperslab_f(space_id, operator, start, count, & - hdferr, stride, block) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(IN) :: operator ! Flag, valid values are: - ! H5S_SELECT_SET_F (0) - ! H5S_SELECT_OR_F (1) - ! - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start - ! Starting coordinates of the hyperslab - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count - ! Number of blocks to select - ! from dataspace - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: stride - ! Array of how many elements to move - ! in each direction - INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: block - ! Sizes of element block + SUBROUTINE h5sselect_hyperslab_f(space_id, OPERATOR, start, count, & + hdferr, stride, BLOCK) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(IN) :: OPERATOR + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: stride + INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: BLOCK !***** - INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_block - INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_stride - INTEGER :: rank - INTEGER :: error1, error2 - - INTERFACE - INTEGER FUNCTION h5sselect_hyperslab_c(space_id, operator, & - start, count, stride, block) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_HYPERSLAB_C'::h5sselect_hyperslab_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER, INTENT(IN) :: operator - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: stride - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: block - END FUNCTION h5sselect_hyperslab_c - END INTERFACE - - if (present(stride).and. present(block)) then - hdferr = h5sselect_hyperslab_c(space_id, operator, start, count, & - stride, block) - return - endif - ! Case of optional parameters. - ! - ! Find the rank of the dataspace to allocate memery for - ! default stride and block arrays. - ! - CALL h5sget_simple_extent_ndims_f(space_id, rank, hdferr) - if( hdferr .EQ. -1) return - ! - if (present(stride).and. .not.present(block)) then - allocate(def_block(rank), stat=error1) - if (error1.NE.0) then - hdferr = -1 - return - endif - def_block = 1 - hdferr = h5sselect_hyperslab_c(space_id, operator, start, count, & - stride, def_block) - deallocate(def_block) - return - endif - - if (.not.present(stride).and. present(block)) then - allocate(def_stride(rank), stat=error2) - if (error2.NE.0) then - hdferr = -1 - return - endif - def_stride = 1 - hdferr = h5sselect_hyperslab_c(space_id, operator, start, count, & - def_stride, block) - deallocate(def_stride) - return - endif - allocate(def_block(rank), stat=error1) - allocate(def_stride(rank), stat=error2) - if ((error1.NE.0) .OR. (error2.NE.0)) then - hdferr = -1 - return - endif - def_block = 1 - def_stride = 1 - hdferr = h5sselect_hyperslab_c(space_id, operator, start, count, & - def_stride, def_block) - deallocate(def_block) - deallocate(def_stride) - - END SUBROUTINE h5sselect_hyperslab_f + INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_block + INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_stride + INTEGER :: rank + INTEGER :: error1, error2 + + INTERFACE + INTEGER FUNCTION h5sselect_hyperslab_c(space_id, OPERATOR, & + start, count, stride, BLOCK) BIND(C,NAME='h5sselect_hyperslab_c') + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(IN) :: OPERATOR + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: stride + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: BLOCK + END FUNCTION h5sselect_hyperslab_c + END INTERFACE + + IF (PRESENT(stride).AND. PRESENT(BLOCK)) THEN + hdferr = h5sselect_hyperslab_c(space_id, OPERATOR, start, count, & + stride, BLOCK) + RETURN + ENDIF + ! Case of optional parameters. + ! + ! Find the rank of the dataspace to allocate memery for + ! default stride and block arrays. + ! + CALL h5sget_simple_extent_ndims_f(space_id, rank, hdferr) + IF( hdferr .EQ. -1) RETURN + ! + IF (PRESENT(stride).AND. .NOT.PRESENT(BLOCK)) THEN + ALLOCATE(def_block(rank), stat=error1) + IF (error1.NE.0) THEN + hdferr = -1 + RETURN + ENDIF + def_block = 1 + hdferr = h5sselect_hyperslab_c(space_id, OPERATOR, start, count, & + stride, def_block) + DEALLOCATE(def_block) + RETURN + ENDIF + + IF (.NOT.PRESENT(stride).AND. PRESENT(BLOCK)) THEN + ALLOCATE(def_stride(rank), stat=error2) + IF (error2.NE.0) THEN + hdferr = -1 + RETURN + ENDIF + def_stride = 1 + hdferr = h5sselect_hyperslab_c(space_id, OPERATOR, start, count, & + def_stride, BLOCK) + DEALLOCATE(def_stride) + RETURN + ENDIF + ALLOCATE(def_block(rank), stat=error1) + ALLOCATE(def_stride(rank), stat=error2) + IF ((error1.NE.0) .OR. (error2.NE.0)) THEN + hdferr = -1 + RETURN + ENDIF + def_block = 1 + def_stride = 1 + hdferr = h5sselect_hyperslab_c(space_id, OPERATOR, start, count, & + def_stride, def_block) + DEALLOCATE(def_block) + DEALLOCATE(def_stride) + + END SUBROUTINE h5sselect_hyperslab_f ! !$! ! !$!****s* H5S/h5scombine_hyperslab_f ! !$! @@ -1695,46 +1585,39 @@ CONTAINS ! Retrieve the type of selection ! ! INPUTS -! space_id - dataspace iidentifier with selection +! space_id - dataspace identifier with selection ! OUTPUTS -! type - flag, valid values are: +! type - selection type flag, valid values are: ! H5S_SEL_ERROR_F ! H5S_SEL_NONE_F ! H5S_SEL_POINTS_F ! H5S_SEL_HYPERSLABS_F ! H5S_SEL_ALL_F -! hdferr - Returns 0 if successful and -1 if fails +! hdferr - Returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal ! October 7, 2002 ! ! SOURCE - SUBROUTINE h5sget_select_type_f(space_id, type, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(INOUT) :: space_id ! Dataspace identifier to - INTEGER, INTENT(OUT) :: type ! Selection type - ! H5S_SEL_ERROR_F - ! H5S_SEL_NONE_F - ! H5S_SEL_POINTS_F - ! H5S_SEL_HYPERSLABS_F - ! H5S_SEL_ALL_F - INTEGER, INTENT(OUT) :: hdferr ! Error code + SUBROUTINE h5sget_select_type_f(space_id, TYPE, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(INOUT) :: space_id + INTEGER, INTENT(OUT) :: TYPE + INTEGER, INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5sget_select_type_c(space_id, type) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SGET_SELECT_TYPE_C'::h5sget_select_type_c - !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER, INTENT(OUT) :: type - END FUNCTION h5sget_select_type_c - END INTERFACE - - hdferr = h5sget_select_type_c(space_id, type) - return - - END SUBROUTINE h5sget_select_type_f + INTERFACE + INTEGER FUNCTION h5sget_select_type_c(space_id, TYPE) BIND(C,NAME='h5sget_select_type_c') + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(OUT) :: TYPE + END FUNCTION h5sget_select_type_c + END INTERFACE + + hdferr = h5sget_select_type_c(space_id, TYPE) + RETURN + + END SUBROUTINE h5sget_select_type_f ! !****s* H5S/H5Sdecode_f @@ -1746,10 +1629,10 @@ CONTAINS ! Decode a binary object description of data space and return a new object handle. ! ! INPUTS -! buf - Buffer for the data space object to be decoded. -! obj_id - Object ID +! buf - Buffer for the data space object to be decoded. +! obj_id - Object ID ! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails +! hdferr - Returns 0 if successful and -1 if fails ! ! AUTHOR ! M. Scot Breitenfeld @@ -1757,18 +1640,15 @@ CONTAINS ! SOURCE SUBROUTINE h5sdecode_f(buf, obj_id, hdferr) IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: buf ! Buffer for the data space object to be decoded. - INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object ID - INTEGER, INTENT(OUT) :: hdferr ! Error code + CHARACTER(LEN=*), INTENT(IN) :: buf + INTEGER(HID_T), INTENT(OUT) :: obj_id + INTEGER, INTENT(OUT) :: hdferr !***** INTERFACE - INTEGER FUNCTION h5sdecode_c(buf, obj_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SDECODE_C'::h5sdecode_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf - CHARACTER(LEN=*), INTENT(IN) :: buf + INTEGER FUNCTION h5sdecode_c(buf, obj_id) BIND(C,NAME='h5sdecode_c') + IMPORT :: C_CHAR + IMPORT :: HID_T + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: buf INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object ID END FUNCTION h5sdecode_c END INTERFACE @@ -1787,12 +1667,12 @@ CONTAINS ! Encode a data space object description into a binary buffer. ! ! INPUTS -! obj_id - Identifier of the object to be encoded. -! buf - Buffer for the object to be encoded into. -! nalloc - The size of the allocated buffer. +! obj_id - Identifier of the object to be encoded. +! buf - Buffer for the object to be encoded into. +! nalloc - The size of the allocated buffer. ! OUTPUTS -! nalloc - The size of the buffer needed. -! hdferr - Returns 0 if successful and -1 if fails. +! nalloc - The size of the buffer needed. +! hdferr - Returns 0 if successful and -1 if fails. ! ! AUTHOR ! M. Scot Breitenfeld @@ -1800,21 +1680,18 @@ CONTAINS ! SOURCE SUBROUTINE h5sencode_f(obj_id, buf, nalloc, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Identifier of the object to be encoded. - CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer for the object to be encoded into. - INTEGER(SIZE_T), INTENT(INOUT) :: nalloc ! The size of the allocated buffer. - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: obj_id + CHARACTER(LEN=*), INTENT(OUT) :: buf + INTEGER(SIZE_T), INTENT(INOUT) :: nalloc + INTEGER, INTENT(OUT) :: hdferr !***** INTERFACE - INTEGER FUNCTION h5sencode_c(buf, obj_id, nalloc) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SENCODE_C'::h5sencode_c - !DEC$ENDIF - !DEC$ATTRIBUTES reference :: buf + INTEGER FUNCTION h5sencode_c(buf, obj_id, nalloc) BIND(C,NAME='h5sencode_c') + IMPORT :: C_CHAR + IMPORT :: HID_T, SIZE_T INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(OUT) :: buf + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: buf INTEGER(SIZE_T), INTENT(INOUT) :: nalloc END FUNCTION h5sencode_c END INTERFACE @@ -1832,11 +1709,11 @@ CONTAINS ! Determines whether two dataspace extents are equal. ! ! INPUTS -! space1_id - First dataspace identifier. -! space2_id - Second dataspace identifier. +! space1_id - First dataspace identifier. +! space2_id - Second dataspace identifier. ! OUTPUTS -! Equal - .TRUE. if equal, .FALSE. if unequal. -! hdferr - Returns 0 if successful and -1 if fails +! Equal - .TRUE. if equal, .FALSE. if unequal. +! hdferr - Returns 0 if successful and -1 if fails ! AUTHOR ! M. Scot Breitenfeld ! April 2, 2008 @@ -1844,19 +1721,17 @@ CONTAINS ! SOURCE SUBROUTINE h5sextent_equal_f(space1_id, space2_id, equal, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space1_id ! First dataspace identifier. - INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier. - LOGICAL, INTENT(OUT) :: Equal ! .TRUE. if equal, .FALSE. if unequal. - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: space1_id + INTEGER(HID_T), INTENT(IN) :: space2_id + LOGICAL, INTENT(OUT) :: Equal + INTEGER, INTENT(OUT) :: hdferr !***** INTEGER(HID_T) :: c_equal INTERFACE - INTEGER FUNCTION h5sextent_equal_c(space1_id, space2_id, c_equal) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SEXTENT_EQUAL_C'::h5sextent_equal_c - !DEC$ENDIF + INTEGER FUNCTION h5sextent_equal_c(space1_id, space2_id, c_equal) BIND(C,NAME='h5sextent_equal_c') + IMPORT :: HID_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space1_id INTEGER(HID_T), INTENT(IN) :: space2_id INTEGER(HID_T) :: c_equal @@ -1864,12 +1739,9 @@ CONTAINS END INTERFACE hdferr = h5sextent_equal_c(space1_id, space2_id, c_equal) - - equal = .FALSE. IF(c_equal.GT.0) equal = .TRUE. - END SUBROUTINE h5sextent_equal_f END MODULE H5S diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index f51136e..676444c 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -100,71 +100,38 @@ H5_FCDLL int_f h5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size); /* * Functions from H5Sf.c */ -#define nh5screate_simple_c H5_FC_FUNC_(h5screate_simple_c, H5SCREATE_SIMPLE_C) -#define nh5sclose_c H5_FC_FUNC_(h5sclose_c, H5SCLOSE_C) -#define nh5screate_c H5_FC_FUNC_(h5screate_c, H5SCREATE_C) -#define nh5scopy_c H5_FC_FUNC_(h5scopy_c, H5SCOPY_C) -#define nh5sget_select_hyper_nblocks_c H5_FC_FUNC_(h5sget_select_hyper_nblocks_c, H5SGET_SELECT_HYPER_NBLOCKS_C) -#define nh5sget_select_hyper_blocklist_c H5_FC_FUNC_(h5sget_select_hyper_blocklist_c, H5SGET_SELECT_HYPER_BLOCKLIST_C) -#define nh5sget_select_elem_npoints_c H5_FC_FUNC_(h5sget_select_elem_npoints_c, H5SGET_SELECT_ELEM_NPOINTS_C) -#define nh5sget_select_elem_pointlist_c H5_FC_FUNC_(h5sget_select_elem_pointlist_c, H5SGET_SELECT_ELEM_POINTLIST_C) -#define nh5sget_select_bounds_c H5_FC_FUNC_(h5sget_select_bounds_c, H5SGET_SELECT_BOUNDS_C) -#define nh5sselect_all_c H5_FC_FUNC_(h5sselect_all_c, H5SSELECT_ALL_C) -#define nh5sselect_none_c H5_FC_FUNC_(h5sselect_none_c, H5SSELECT_NONE_C) -#define nh5sselect_valid_c H5_FC_FUNC_(h5sselect_valid_c, H5SSELECT_VALID_C) -#define nh5sget_simple_extent_npoints_c H5_FC_FUNC_(h5sget_simple_extent_npoints_c, H5SGET_SIMPLE_EXTENT_NPOINTS_C) -#define nh5sget_select_npoints_c H5_FC_FUNC_(h5sget_select_npoints_c, H5SGET_SELECT_NPOINTS_C) -#define nh5sget_simple_extent_ndims_c H5_FC_FUNC_(h5sget_simple_extent_ndims_c, H5SGET_SIMPLE_EXTENT_NDIMS_C) -#define nh5sget_simple_extent_type_c H5_FC_FUNC_(h5sget_simple_extent_type_c, H5SGET_SIMPLE_EXTENT_TYPE_C) -#define nh5soffset_simple_c H5_FC_FUNC_(h5soffset_simple_c, H5SOFFSET_SIMPLE_C) -#define nh5sset_extent_simple_c H5_FC_FUNC_(h5sset_extent_simple_c, H5SSET_EXTENT_SIMPLE_C) -#define nh5sis_simple_c H5_FC_FUNC_(h5sis_simple_c, H5SIS_SIMPLE_C) -#define nh5sextent_class_c H5_FC_FUNC_(h5sextent_class_c, H5SEXTENT_CLASS_C) -#define nh5sget_simple_extent_dims_c H5_FC_FUNC_(h5sget_simple_extent_dims_c, H5SGET_SIMPLE_EXTENT_DIMS_C) -#define nh5sextent_copy_c H5_FC_FUNC_(h5sextent_copy_c, H5SEXTENT_COPY_C) -#define nh5sset_extent_none_c H5_FC_FUNC_(h5sset_extent_none_c, H5SSET_EXTENT_NONE_C) -#define nh5sselect_hyperslab_c H5_FC_FUNC_(h5sselect_hyperslab_c, H5SSELECT_HYPERSLAB_C) -#define nh5scombine_hyperslab_c H5_FC_FUNC_(h5scombine_hyperslab_c, H5SCOMBINE_HYPERSLAB_C) -#define nh5scombine_select_c H5_FC_FUNC_(h5scombine_select_c, H5SCOMBINE_SELECT_C) -#define nh5sselect_select_c H5_FC_FUNC_(h5sselect_select_c, H5SSELECT_SELECT_C) -#define nh5sget_select_type_c H5_FC_FUNC_(h5sget_select_type_c, H5SGET_SELECT_TYPE_C) -#define nh5sselect_elements_c H5_FC_FUNC_(h5sselect_elements_c, H5SSELECT_ELEMENTS_C) -#define nh5sdecode_c H5_FC_FUNC_(h5sdecode_c, H5SDECODE_C) -#define nh5sencode_c H5_FC_FUNC_(h5sencode_c, H5SENCODE_C) -#define nh5sextent_equal_c H5_FC_FUNC_(h5sextent_equal_c, H5SEXTENT_EQUAL_C) - -H5_FCDLL int_f nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id ); -H5_FCDLL int_f nh5sclose_c ( hid_t_f *space_id ); -H5_FCDLL int_f nh5screate_c ( int_f *classtype, hid_t_f *space_id ); -H5_FCDLL int_f nh5scopy_c ( hid_t_f *space_id , hid_t_f *new_space_id); -H5_FCDLL int_f nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks); -H5_FCDLL int_f nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, hsize_t_f * num_blocks, hsize_t_f * buf); -H5_FCDLL int_f nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end); -H5_FCDLL int_f nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points); -H5_FCDLL int_f nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, hsize_t_f * numpoints, hsize_t_f * buf); -H5_FCDLL int_f nh5sselect_all_c ( hid_t_f *space_id ); -H5_FCDLL int_f nh5sselect_none_c ( hid_t_f *space_id ); -H5_FCDLL int_f nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag ); -H5_FCDLL int_f nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ); -H5_FCDLL int_f nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ); -H5_FCDLL int_f nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ); -H5_FCDLL int_f nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype); -H5_FCDLL int_f nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset); -H5_FCDLL int_f nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f * current_size, hsize_t_f *maximum_size); -H5_FCDLL int_f nh5sis_simple_c ( hid_t_f *space_id , int_f *flag ); -H5_FCDLL int_f nh5sextent_class_c ( hid_t_f *space_id , int_f *classtype); -H5_FCDLL int_f nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims); -H5_FCDLL int_f nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id); -H5_FCDLL int_f nh5sset_extent_none_c ( hid_t_f *space_id ); -H5_FCDLL int_f nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block); -H5_FCDLL int_f nh5sget_select_type_c ( hid_t_f *space_id , int_f *op); -H5_FCDLL int_f nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord); -H5_FCDLL int_f nh5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id); -H5_FCDLL int_f nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id); -H5_FCDLL int_f nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id); -H5_FCDLL int_f nh5sdecode_c ( _fcd buf, hid_t_f *obj_id ); -H5_FCDLL int_f nh5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ); -H5_FCDLL int_f nh5sextent_equal_c ( hid_t_f * space1_id, hid_t_f *space2_id, hid_t_f *c_equal); +H5_FCDLL int_f h5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id ); +H5_FCDLL int_f h5sclose_c ( hid_t_f *space_id ); +H5_FCDLL int_f h5screate_c ( int_f *classtype, hid_t_f *space_id ); +H5_FCDLL int_f h5scopy_c ( hid_t_f *space_id , hid_t_f *new_space_id); +H5_FCDLL int_f h5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks); +H5_FCDLL int_f h5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, hsize_t_f * num_blocks, hsize_t_f * buf); +H5_FCDLL int_f h5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end); +H5_FCDLL int_f h5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points); +H5_FCDLL int_f h5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, hsize_t_f * numpoints, hsize_t_f * buf); +H5_FCDLL int_f h5sselect_all_c ( hid_t_f *space_id ); +H5_FCDLL int_f h5sselect_none_c ( hid_t_f *space_id ); +H5_FCDLL int_f h5sselect_valid_c ( hid_t_f *space_id , int_f *flag ); +H5_FCDLL int_f h5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ); +H5_FCDLL int_f h5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ); +H5_FCDLL int_f h5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ); +H5_FCDLL int_f h5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype); +H5_FCDLL int_f h5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset); +H5_FCDLL int_f h5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f * current_size, hsize_t_f *maximum_size); +H5_FCDLL int_f h5sis_simple_c ( hid_t_f *space_id , int_f *flag ); +H5_FCDLL int_f h5sextent_class_c ( hid_t_f *space_id , int_f *classtype); +H5_FCDLL int_f h5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims); +H5_FCDLL int_f h5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id); +H5_FCDLL int_f h5sset_extent_none_c ( hid_t_f *space_id ); +H5_FCDLL int_f h5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block); +H5_FCDLL int_f h5sget_select_type_c ( hid_t_f *space_id , int_f *op); +H5_FCDLL int_f h5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord); +H5_FCDLL int_f h5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id); +H5_FCDLL int_f h5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id); +H5_FCDLL int_f h5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id); +H5_FCDLL int_f h5sdecode_c ( _fcd buf, hid_t_f *obj_id ); +H5_FCDLL int_f h5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ); +H5_FCDLL int_f h5sextent_equal_c ( hid_t_f * space1_id, hid_t_f *space2_id, hid_t_f *c_equal); /* * Functions from H5Df.c |