summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2022-04-07 13:52:31 (GMT)
committerGitHub <noreply@github.com>2022-04-07 13:52:31 (GMT)
commitb9d77ec8be0aa633869b1d10510f96f756adf6f9 (patch)
treeecd47a1a95fe1467d63136644233fed96672cb74 /fortran
parent74863549c0a640909c87e72717e262f91140a2a4 (diff)
parent541bc15452f71f3eae7471fdecbe7994a7f138e2 (diff)
downloadhdf5-b9d77ec8be0aa633869b1d10510f96f756adf6f9.zip
hdf5-b9d77ec8be0aa633869b1d10510f96f756adf6f9.tar.gz
hdf5-b9d77ec8be0aa633869b1d10510f96f756adf6f9.tar.bz2
Merge branch 'hdf5_1_12' into spelling-corrections
Diffstat (limited to 'fortran')
-rw-r--r--fortran/src/H5Df.c8
-rw-r--r--fortran/src/H5Dff.F9012
-rw-r--r--fortran/src/H5Ff.c4
-rw-r--r--fortran/src/H5Pff.F904
-rw-r--r--fortran/src/H5_ff.F904
-rw-r--r--fortran/test/tH5A_1_8.F9015
-rw-r--r--fortran/test/tH5F.F9038
-rw-r--r--fortran/test/tH5P.F904
8 files changed, 56 insertions, 33 deletions
diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c
index 5c46cb3..a780683 100644
--- a/fortran/src/H5Df.c
+++ b/fortran/src/H5Df.c
@@ -495,10 +495,10 @@ h5dget_storage_size_c(hid_t_f *dset_id, hsize_t_f *size)
c_dset_id = (hid_t)*dset_id;
c_size = H5Dget_storage_size(c_dset_id);
- if (c_size == 0)
- return ret_value;
- *size = (hsize_t_f)c_size;
- ret_value = 0;
+ if (c_size != 0) {
+ ret_value = 0;
+ }
+ *size = (hsize_t_f)c_size;
return ret_value;
}
diff --git a/fortran/src/H5Dff.F90 b/fortran/src/H5Dff.F90
index 655cf1c..6b77a8c 100644
--- a/fortran/src/H5Dff.F90
+++ b/fortran/src/H5Dff.F90
@@ -1625,8 +1625,7 @@ CONTAINS
! Inputs:
! fill_value - fill value
! space_id - memory space selection identifier
-! buf - data buffer iin memory ro apply selection to
-! - of k-th dimension of the buf array
+! buf - memory buffer containing the selection to be filled
! Outputs:
! hdferr: - error code
! Success: 0
@@ -1676,8 +1675,7 @@ CONTAINS
! Inputs:
! fill_value - fill value
! space_id - memory space selection identifier
-! buf - data buffer iin memory ro apply selection to
-! - of k-th dimension of the buf array
+! buf - memory buffer containing the selection to be filled
! Outputs:
! hdferr: - error code
! Success: 0
@@ -1724,8 +1722,7 @@ CONTAINS
! Inputs:
! fill_value - fill value
! space_id - memory space selection identifier
- ! buf - data buffer iin memory ro apply selection to
- ! - of k-th dimension of the buf array
+ ! buf - memory buffer containing the selection to be filled
! Outputs:
! hdferr: - error code
! Success: 0
@@ -1799,8 +1796,7 @@ CONTAINS
! Inputs:
! fill_value - fill value
! space_id - memory space selection identifier
-! buf - data buffer iin memory ro apply selection to
-! - of k-th dimension of the buf array
+! buf - memory buffer containing the selection to be filled
! Outputs:
! hdferr: - error code
! Success: 0
diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c
index f943200..339f8b7 100644
--- a/fortran/src/H5Ff.c
+++ b/fortran/src/H5Ff.c
@@ -583,7 +583,7 @@ h5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen)
int_f ret_value = 0; /* Return value */
/*
- * Allocate buffer to hold name of an attribute
+ * Allocate buffer to hold name of file
*/
if (NULL == (c_buf = (char *)HDmalloc((size_t)*buflen + 1)))
HGOTO_DONE(FAIL);
@@ -591,7 +591,7 @@ h5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen)
/*
* Call H5Fget_name function
*/
- if ((size_c = H5Fget_name((hid_t)*obj_id, c_buf, (size_t)*buflen)) < 0)
+ if ((size_c = H5Fget_name((hid_t)*obj_id, c_buf, (size_t)*buflen + 1)) < 0)
HGOTO_DONE(FAIL);
/*
diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90
index 4831a50..c55b7d9 100644
--- a/fortran/src/H5Pff.F90
+++ b/fortran/src/H5Pff.F90
@@ -1880,7 +1880,7 @@ CONTAINS
! INPUTS
!
! prp_id - file access property list identifier
-! gc_reference - flag for string garbage collection on
+! gc_reference - flag for setting garbage collection on
! and off (1 or 0)
! OUTPUTS
!
@@ -1931,7 +1931,7 @@ CONTAINS
! prp_id - file access property list identifier
! OUTPUTS
!
-! gc_reference - flag for string garbage collection on
+! gc_reference - flag for setting garbage collection on
! and off (1 or 0)
! hdferr - error code
! Success: 0
diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90
index 39ad84f..6715314 100644
--- a/fortran/src/H5_ff.F90
+++ b/fortran/src/H5_ff.F90
@@ -700,7 +700,7 @@ CONTAINS
!
! Outputs:
! majnum - major version of the library
-! minimum - minor version of the library
+! minnum - minor version of the library
! relnum - release version of the library
! error - Returns 0 if successful and -1 if fails
!
@@ -735,7 +735,7 @@ CONTAINS
!
! Inputs:
! majnum - major version of the library
-! minimum - minor version of the library
+! minnum - minor version of the library
! relnum - release version of the library
!
! Outputs:
diff --git a/fortran/test/tH5A_1_8.F90 b/fortran/test/tH5A_1_8.F90
index eb781a5..cd8a981 100644
--- a/fortran/test/tH5A_1_8.F90
+++ b/fortran/test/tH5A_1_8.F90
@@ -776,8 +776,7 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error)
INTEGER :: Input1
INTEGER(HSIZE_T) :: hzero = 0_HSIZE_T
- INTEGER :: minusone = -1
- INTEGER(HSIZE_T) :: htmp
+ INTEGER, PARAMETER :: minusone = -1
data_dims = 0
@@ -840,10 +839,6 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error)
my_dataset = dset3
END SELECT
- ! Check for query on non-existent attribute
-
- n = 0
-
! -- CHECK PASSING AN INTEGER CONSTANT IN DIFFERENT FORMS --
! 1) call by passing an integer with the _hsize_t declaration
@@ -896,8 +891,8 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error)
! Verify information for new attribute
!EP CALL attr_info_by_idx_check(my_dataset, attrname, INT(j,HSIZE_T), use_index(i), total_error )
- htmp = j
- CALL attr_info_by_idx_check(my_dataset, attrname, htmp, use_index(i), total_error )
+ n = INT(j, HSIZE_T)
+ CALL attr_info_by_idx_check(my_dataset, attrname, n, use_index(i), total_error )
!CHECK(ret, FAIL, "attr_info_by_idx_check");
ENDDO
@@ -1427,7 +1422,7 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error)
INTEGER :: u ! Local index variable
INTEGER :: Input1
INTEGER(HSIZE_T) :: hzero = 0_HSIZE_T
- INTEGER :: minusone = -1
+ INTEGER, PARAMETER :: minusone = -1
data_dims = 0
@@ -2268,7 +2263,7 @@ SUBROUTINE test_attr_corder_create_basic( fcpl, fapl, total_error )
INTEGER :: error
INTEGER :: crt_order_flags
- INTEGER :: minusone = -1
+ INTEGER, PARAMETER :: minusone = -1
! Output message about test being performed
! WRITE(*,*) " - Testing Basic Code for Attributes with Creation Order Info"
diff --git a/fortran/test/tH5F.F90 b/fortran/test/tH5F.F90
index 3affed0..8d4845d 100644
--- a/fortran/test/tH5F.F90
+++ b/fortran/test/tH5F.F90
@@ -584,17 +584,23 @@ CONTAINS
! The following subroutine checks that h5fget_name_f produces
! correct output for a given obj_id and filename.
!
- SUBROUTINE check_get_name(obj_id, fix_filename, total_error)
+ SUBROUTINE check_get_name(obj_id, fix_filename, len_filename, total_error)
USE HDF5 ! This module contains all necessary modules
USE TH5_MISC
IMPLICIT NONE
INTEGER(HID_T) :: obj_id ! Object identifier
CHARACTER(LEN=80), INTENT(IN) :: fix_filename ! Expected filename
+ INTEGER, INTENT(IN) :: len_filename ! The length of the filename
INTEGER, INTENT(INOUT) :: total_error ! Error count
CHARACTER(LEN=80):: file_name ! Filename buffer
INTEGER:: error ! HDF5 error code
INTEGER(SIZE_T):: name_size ! Filename length
+
+ INTEGER, PARAMETER :: sm_len = 2
+ CHARACTER(LEN=len_filename) :: filename_exact
+ CHARACTER(LEN=len_filename-sm_len) :: filename_sm
+
!
!Get file name from the dataset identifier
!
@@ -637,6 +643,30 @@ CONTAINS
total_error = total_error + 1
END IF
+ ! Use a buffer which is the exact size needed to hold the filename
+ CALL h5fget_name_f(obj_id, filename_exact, name_size, error)
+ CALL check("h5fget_name_f",error,total_error)
+ IF(name_size .NE. len_filename)THEN
+ WRITE(*,*) " file name size obtained from the object id is incorrect"
+ total_error = total_error + 1
+ ENDIF
+ IF(filename_exact .NE. TRIM(fix_filename)) THEN
+ WRITE(*,*) " file name obtained from the object id is incorrect"
+ total_error = total_error + 1
+ END IF
+
+ ! Use a buffer which is smaller than needed to hold the filename
+ CALL h5fget_name_f(obj_id, filename_sm, name_size, error)
+ CALL check("h5fget_name_f",error,total_error)
+ IF(name_size .NE. len_filename)THEN
+ WRITE(*,*) " file name size obtained from the object id is incorrect"
+ total_error = total_error + 1
+ ENDIF
+ IF(filename_sm(1:len_filename-sm_len) .NE. fix_filename(1:len_filename-sm_len)) THEN
+ WRITE(*,*) " file name obtained from the object id is incorrect"
+ total_error = total_error + 1
+ END IF
+
END SUBROUTINE check_get_name
! The following subroutine tests h5fget_name_f.
@@ -653,6 +683,7 @@ CONTAINS
CHARACTER(LEN=*), PARAMETER :: filename = "filename"
CHARACTER(LEN=80) :: fix_filename
+ INTEGER :: len_filename
INTEGER(HID_T) :: file_id ! File identifier
INTEGER(HID_T) :: g_id ! Group identifier
@@ -679,8 +710,9 @@ CONTAINS
CALL h5gopen_f(file_id,"/",g_id, error)
CALL check("h5gopen_f",error,total_error)
- CALL check_get_name(file_id, fix_filename, total_error)
- CALL check_get_name(g_id, fix_filename, total_error)
+ len_filename = LEN_TRIM(fix_filename)
+ CALL check_get_name(file_id, fix_filename, len_filename, total_error)
+ CALL check_get_name(g_id, fix_filename, len_filename, total_error)
! Close the group.
!
diff --git a/fortran/test/tH5P.F90 b/fortran/test/tH5P.F90
index 75e4e72..d664dd7 100644
--- a/fortran/test/tH5P.F90
+++ b/fortran/test/tH5P.F90
@@ -541,7 +541,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error)
CALL H5Dclose_f(dsid, error)
CALL H5Oopen_f(fid, "dset", dsid, error, dapl1)
- ! Retrieve dapl from dataset, verfiy cache values are the same as on dapl1
+ ! Retrieve dapl from dataset, verify cache values are the same as on dapl1
!
! Note we rely on the knowledge that H5Pget_chunk_cache retrieves these
! values directly from the dataset structure, and not from a copy of the
@@ -563,7 +563,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error)
CALL H5Oopen_f(fid, "dset", dsid, error)
CALL check("H5Oopen_f", error, total_error)
- ! Retrieve dapl from dataset, verfiy cache values are the same as on fapl_local
+ ! Retrieve dapl from dataset, verify cache values are the same as on fapl_local
CALL H5Dget_access_plist_f(dsid, dapl2, error)
CALL check("H5Dget_access_plist_f", error, total_error)