diff options
Diffstat (limited to 'fortran/test/tH5R.f90')
-rw-r--r-- | fortran/test/tH5R.f90 | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/fortran/test/tH5R.f90 b/fortran/test/tH5R.f90 index ef392b4..bd6264f 100644 --- a/fortran/test/tH5R.f90 +++ b/fortran/test/tH5R.f90 @@ -33,13 +33,11 @@ ! MODULE TH5R - USE HDF5 - USE TH5_MISC - USE TH5_MISC_GEN - CONTAINS SUBROUTINE refobjtest(cleanup, total_error) + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(INOUT) :: total_error @@ -127,6 +125,7 @@ SUBROUTINE refobjtest(cleanup, total_error) CALL check("h5tcopy_f",error,total_error) CALL h5tcommit_f(file_id, "MyType", type_id, error) CALL check("h5tcommit_f",error,total_error) + ! ! Close dataspaces, groups and integer dataset ! @@ -165,22 +164,22 @@ SUBROUTINE refobjtest(cleanup, total_error) CALL check("H5Rget_name_f", error, total_error) - CALL verify("H5Rget_name_f", INT(buf_size),7, total_error) - CALL verify("H5Rget_name_f", buf, "/GROUP1", total_error) + CALL VERIFY("H5Rget_name_f", INT(buf_size),7, total_error) + CALL VerifyString("H5Rget_name_f", buf, "/GROUP1", total_error) ! with buffer bigger then needed CALL H5Rget_name_f(dsetr_id, ref(1), buf_big, error, buf_size ) CALL check("H5Rget_name_f", error, total_error) - CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) - CALL verify("H5Rget_name_f", TRIM(buf_big), "/GROUP1", total_error) + CALL VERIFY("H5Rget_name_f", INT(buf_size),7,total_error) + CALL VerifyString("H5Rget_name_f", TRIM(buf_big), "/GROUP1", total_error) ! getting path to dataset in /Group1 CALL H5Rget_name_f(dsetr_id, ref(2), buf_big, error, buf_size ) CALL check("H5Rget_name_f", error, total_error) - CALL verify("H5Rget_name_f", INT(buf_size),14,total_error) - CALL verify("H5Rget_name_f", TRIM(buf_big), "/GROUP1/GROUP2", total_error) + CALL VERIFY("H5Rget_name_f", INT(buf_size),14,total_error) + CALL VerifyString("H5Rget_name_f", TRIM(buf_big), "/GROUP1/GROUP2", total_error) ! !Close the dataset @@ -234,6 +233,7 @@ SUBROUTINE refobjtest(cleanup, total_error) CALL h5fclose_f(file_id, error) CALL check("h5fclose_f",error,total_error) + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) RETURN @@ -244,6 +244,9 @@ END SUBROUTINE refobjtest ! and h5rdereference_f functionalities ! SUBROUTINE refregtest(cleanup, total_error) + USE HDF5 ! This module contains all necessary modules + USE TH5_MISC +! use iso_c_binding ! NOTE: if this is uncommented, then need to move subroutine into another file. IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup @@ -405,23 +408,23 @@ SUBROUTINE refregtest(cleanup, total_error) ! Get name of the dataset the first region reference points to using H5Rget_name_f CALL H5Rget_name_f(dsetr_id, ref_out(1), buf, error, buf_size ) CALL check("H5Rget_name_f", error, total_error) - CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) - CALL verify("H5Rget_name_f", buf, "/MATRIX", total_error) + CALL VERIFY("H5Rget_name_f", INT(buf_size),7,total_error) + CALL VerifyString("H5Rget_name_f", buf, "/MATRIX", total_error) ! Get name of the dataset the first region reference points to using H5Rget_name_f ! buffer bigger then needed CALL H5Rget_name_f(dsetr_id, ref_out(1), buf_big, error, buf_size ) CALL check("H5Rget_name_f", error, total_error) - CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) - CALL verify("H5Rget_name_f", TRIM(buf_big), "/MATRIX", total_error) + CALL VERIFY("H5Rget_name_f", INT(buf_size),7,total_error) + CALL VerifyString("H5Rget_name_f", TRIM(buf_big), "/MATRIX", total_error) ! Get name of the dataset the first region reference points to using H5Rget_name_f ! buffer smaller then needed CALL H5Rget_name_f(dsetr_id, ref_out(1), buf_small, error, buf_size ) CALL check("H5Rget_name_f", error, total_error) - CALL verify("H5Rget_name_f", INT(buf_size),7,total_error) - CALL verify("H5Rget_name_f", TRIM(buf_small), "/MAT", total_error) + CALL VERIFY("H5Rget_name_f", INT(buf_size),7,total_error) + CALL VerifyString("H5Rget_name_f", TRIM(buf_small), "/MAT", total_error) ! ! Dereference the first reference. ! @@ -433,7 +436,7 @@ SUBROUTINE refregtest(cleanup, total_error) ! Get name of the dataset the second region reference points to using H5Rget_name_f CALL H5Rget_name_f(dsetr_id, ref_out(2), buf, error) ! no optional size CALL check("H5Rget_name_f", error, total_error) - CALL verify("H5Rget_name_f", TRIM(buf), "/MATRIX", total_error) + CALL VerifyString("H5Rget_name_f", TRIM(buf), "/MATRIX", total_error) ! ! Read selected data from the dataset. ! |