diff options
Diffstat (limited to 'fortran/test/tH5T_F03.f90')
-rw-r--r-- | fortran/test/tH5T_F03.f90 | 226 |
1 files changed, 122 insertions, 104 deletions
diff --git a/fortran/test/tH5T_F03.f90 b/fortran/test/tH5T_F03.f90 index a9a6487..bd6a701 100644 --- a/fortran/test/tH5T_F03.f90 +++ b/fortran/test/tH5T_F03.f90 @@ -41,15 +41,23 @@ !** !****************************************************************/ ! + +MODULE TH5T_F03 + + USE HDF5 + USE ISO_C_BINDING + +CONTAINS + SUBROUTINE test_array_compound_atomic(total_error) USE HDF5 + USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE INTEGER, INTENT(INOUT) :: total_error ! 1-D dataset WITH fixed dimensions - CHARACTER(LEN=6), PARAMETER :: SPACE1_NAME = "Space1" INTEGER, PARAMETER :: SPACE1_RANK = 1 INTEGER, PARAMETER :: SPACE1_DIM1 = 4 ! 1-D array datatype @@ -63,11 +71,11 @@ SUBROUTINE test_array_compound_atomic(total_error) END TYPE s1_t TYPE(s1_t), DIMENSION(:,:), ALLOCATABLE, TARGET :: wdata ! Information to write TYPE(s1_t), DIMENSION(:,:), ALLOCATABLE, TARGET :: rdata ! Information read in - INTEGER(hid_t) :: fid1 ! HDF5 File IDs - INTEGER(hid_t) :: dataset ! Dataset ID - INTEGER(hid_t) :: sid1 ! Dataspace ID - INTEGER(hid_t) :: tid1 ! Array Datatype ID - INTEGER(hid_t) :: tid2 ! Compound Datatype ID + INTEGER(hid_t) :: fid1 ! HDF5 File IDs + INTEGER(hid_t) :: dataset ! Dataset ID + INTEGER(hid_t) :: sid1 ! Dataspace ID + INTEGER(hid_t) :: tid1 ! Array Datatype ID + INTEGER(hid_t) :: tid2 ! Compound Datatype ID INTEGER(HSIZE_T), DIMENSION(1) :: sdims1 = (/SPACE1_DIM1/) INTEGER(HSIZE_T), DIMENSION(1) :: tdims1=(/ARRAY1_DIM1/) @@ -79,14 +87,10 @@ SUBROUTINE test_array_compound_atomic(total_error) INTEGER(size_t) :: off ! Offset of compound field INTEGER(hid_t) :: mtid ! Datatype ID for field INTEGER :: i,j ! counting variables - INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype - INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype - INTEGER(SIZE_T) :: sizeof_compound ! total size of compound INTEGER :: error ! Generic RETURN value - INTEGER(SIZE_T) :: offset ! Member's offset INTEGER :: namelen - LOGICAL :: flag + LOGICAL :: flag, differ TYPE(C_PTR) :: f_ptr ! Needed to pass the pointer, for g95 compiler to work @@ -254,7 +258,8 @@ SUBROUTINE test_array_compound_atomic(total_error) PRINT*, 'ERROR: Wrong integer data is read back by H5Dread_f ' total_error = total_error + 1 ENDIF - IF(wdata(i,j)%f.NE.rdata(i,j)%f)THEN + CALL compare_floats(wdata(i,j)%f, rdata(i,j)%f, differ) + IF(differ)THEN PRINT*, 'ERROR: Wrong real data is read back by H5Dread_f ' total_error = total_error + 1 ENDIF @@ -285,6 +290,7 @@ END SUBROUTINE test_array_compound_atomic SUBROUTINE test_array_compound_array(total_error) USE HDF5 + USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE @@ -310,14 +316,13 @@ END SUBROUTINE test_array_compound_atomic TYPE(st_t_struct), DIMENSION(1:SPACE1_DIM1,1:ARRAY1_DIM1), TARGET :: rdata - INTEGER(hid_t) :: fid1 ! HDF5 File IDs - INTEGER(hid_t) :: dataset ! Dataset ID + INTEGER(hid_t) :: fid1 ! HDF5 File IDs + INTEGER(hid_t) :: dataset ! Dataset ID integer(hid_t) :: sid1 ! Dataspace ID integer(hid_t) :: tid1 ! Array Datatype ID integer(hid_t) :: tid2 ! Compound Datatype ID integer(hid_t) :: tid3 ! Nested Array Datatype ID integer(hid_t) :: tid4 ! Nested Array Datatype ID - INTEGER(HID_T) :: dt5_id ! Memory datatype identifier INTEGER(HSIZE_T), DIMENSION(1) :: sdims1 = (/SPACE1_DIM1/) INTEGER(HSIZE_T), DIMENSION(1) :: tdims1=(/ARRAY1_DIM1/) @@ -326,31 +331,25 @@ END SUBROUTINE test_array_compound_atomic INTEGER ndims ! Array rank for reading INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: rdims1 ! Array dimensions for reading - INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: rdims ! Array dimensions for reading INTEGER :: nmemb ! Number of compound members CHARACTER(LEN=20) :: mname ! Name of compound field INTEGER(size_t) :: off ! Offset of compound field - INTEGER(size_t) :: offset ! Offset of compound field INTEGER(hid_t) :: mtid ! Datatype ID for field INTEGER(hid_t) :: mtid2 ! Datatype ID for field - INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype - INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype - INTEGER(SIZE_T) :: type_sizec ! Size of the character datatype - INTEGER(SIZE_T) :: sizeof_compound ! total size of compound INTEGER :: mclass ! Datatype class for field INTEGER :: i,j,k ! counting variables INTEGER :: error CHARACTER(LEN=2) :: ichr2 - INTEGER(SIZE_T) :: sizechar INTEGER :: namelen LOGICAL :: flag INTEGER(HID_T) :: atype_id !String Attribute Datatype identifier INTEGER(SIZE_T) :: attrlen ! Length of the attribute string TYPE(c_ptr) :: f_ptr + LOGICAL :: differ ! Initialize array data to write DO i = 1, SPACE1_DIM1 @@ -623,7 +622,8 @@ END SUBROUTINE test_array_compound_atomic total_error = total_error + 1 ENDIF DO k = 1, ARRAY2_DIM1 - IF(wdata(i,j)%f(k).NE.rdata(i,j)%f(k))THEN + CALL compare_floats(wdata(i,j)%f(k), rdata(i,j)%f(k), differ) + IF(differ)THEN PRINT*, 'ERROR: Wrong real array data is read back by H5Dread_f ' total_error = total_error + 1 ENDIF @@ -659,6 +659,7 @@ END SUBROUTINE test_array_compound_atomic SUBROUTINE test_array_bkg(total_error) USE HDF5 + USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE @@ -721,9 +722,8 @@ END SUBROUTINE test_array_compound_atomic INTEGER :: error TYPE(c_ptr) :: f_ptr + LOGICAL :: differ - TYPE(c_funptr) :: func - ! Initialize the data ! ------------------- @@ -834,11 +834,13 @@ END SUBROUTINE test_array_compound_atomic PRINT*, 'ERROR: Wrong integer data is read back by H5Dread_f ' total_error = total_error + 1 ENDIF - IF( cf(i)%b(j) .NE. cfr(i)%b(j) )THEN + CALL compare_floats(cf(i)%b(j), cfr(i)%b(j), differ) + IF(differ)THEN PRINT*, 'ERROR: Wrong real data is read back by H5Dread_f ' total_error = total_error + 1 ENDIF - IF( cf(i)%c(j) .NE. cfr(i)%c(j) )THEN + CALL compare_floats(cf(i)%c(j), cfr(i)%c(j), differ) + IF(differ)THEN PRINT*, 'ERROR: Wrong double data is read back by H5Dread_f ' total_error = total_error + 1 ENDIF @@ -901,7 +903,8 @@ END SUBROUTINE test_array_compound_atomic DO i = 1, LENGTH DO j = 1, ALEN - IF( fld(i)%b(j) .NE. fldr(i)%b(j) )THEN + CALL compare_floats(fld(i)%b(j), fldr(i)%b(j), differ) + IF(differ)THEN PRINT*, 'ERROR: Wrong real data is read back by H5Dread_f ' total_error = total_error + 1 ENDIF @@ -932,11 +935,13 @@ END SUBROUTINE test_array_compound_atomic PRINT*, 'ERROR: Wrong integer data is read back by H5Dread_f ' total_error = total_error + 1 ENDIF - IF( cf(i)%b(j) .NE. cfr(i)%b(j) )THEN + CALL compare_floats(cf(i)%b(j), cfr(i)%b(j), differ) + IF(differ)THEN PRINT*, 'ERROR: Wrong real data is read back by H5Dread_f ' total_error = total_error + 1 ENDIF - IF( cf(i)%c(j) .NE. cfr(i)%c(j) )THEN + CALL compare_floats(cf(i)%c(j), cfr(i)%c(j), differ) + IF(differ)THEN PRINT*, 'ERROR: Wrong double data is read back by H5Dread_f ' total_error = total_error + 1 ENDIF @@ -990,11 +995,13 @@ END SUBROUTINE test_array_compound_atomic PRINT*, 'ERROR: Wrong integer data is read back by H5Dread_f ' total_error = total_error + 1 ENDIF - IF( cf(i)%b(j) .NE. cfr(i)%b(j) )THEN + CALL compare_floats(cf(i)%b(j),cfr(i)%b(j), differ) + IF(differ)THEN PRINT*, 'ERROR: Wrong real data is read back by H5Dread_f ' total_error = total_error + 1 ENDIF - IF( cf(i)%c(j) .NE. cfr(i)%c(j) )THEN + CALL compare_floats(cf(i)%c(j), cfr(i)%c(j), differ) + IF(differ)THEN PRINT*, 'ERROR: Wrong double data is read back by H5Dread_f ' total_error = total_error + 1 ENDIF @@ -1018,6 +1025,7 @@ END SUBROUTINE test_array_compound_atomic USE ISO_C_BINDING USE HDF5 ! This module contains all necessary modules + USE TH5_MISC IMPLICIT NONE @@ -1050,12 +1058,10 @@ END SUBROUTINE test_array_compound_atomic INTEGER(HID_T) :: dset_idr8 ! Dataset identifier INTEGER :: error ! Error flag - INTEGER :: i, j + INTEGER :: i ! Data buffers: - INTEGER, DIMENSION(1:4) :: dset_data - INTEGER(int_kind_1), DIMENSION(1:4), TARGET :: dset_data_i1, data_out_i1 INTEGER(int_kind_4), DIMENSION(1:4), TARGET :: dset_data_i4, data_out_i4 INTEGER(int_kind_8), DIMENSION(1:4), TARGET :: dset_data_i8, data_out_i8 @@ -1069,7 +1075,6 @@ END SUBROUTINE test_array_compound_atomic INTEGER(HID_T) :: dspace_id ! Dataspace identifier TYPE(C_PTR) :: f_ptr - INTEGER(hid_t) :: datatype ! Common datatype ID ! ! Initialize the dset_data array. @@ -1220,8 +1225,9 @@ END SUBROUTINE test_h5kind_to_type !************************************************************ SUBROUTINE t_array(total_error) - USE HDF5 USE ISO_C_BINDING + USE HDF5 + USE TH5_MISC IMPLICIT NONE @@ -1233,10 +1239,8 @@ SUBROUTINE t_array(total_error) INTEGER , PARAMETER :: adim0 = 3 INTEGER , PARAMETER :: adim1 = 5 INTEGER(HID_T) :: file, filetype, memtype, space, dset ! Handles - INTEGER :: hdferr INTEGER(HSIZE_T), DIMENSION(1:1) :: dims = (/dim0/) INTEGER(HSIZE_T), DIMENSION(1:2) :: adims = (/adim0, adim1/) - INTEGER(HSIZE_T), DIMENSION(1:3) :: bdims = (/dim0, adim0, adim1/) INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims INTEGER, DIMENSION(1:dim0, 1:adim0, 1:adim1), TARGET :: wdata ! Write buffer INTEGER, DIMENSION(:,:,:), ALLOCATABLE, TARGET :: rdata ! Read buffer @@ -1337,9 +1341,9 @@ SUBROUTINE t_array(total_error) ! ! Output the data to the screen. ! - i_loop: DO i = 1, dims(1) - DO j=1, adim0 - DO k = 1, adim1 + i_loop: DO i = 1, INT(dims(1)) + DO j=1, INT(adim0) + DO k = 1, INT(adim1) CALL VERIFY("H5Sget_simple_extent_dims_f", rdata(i,j,k), wdata(i,j,k), total_error) IF(total_error.NE.0) EXIT i_loop ENDDO @@ -1365,6 +1369,7 @@ END SUBROUTINE t_array SUBROUTINE t_enum(total_error) USE HDF5 + USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE @@ -1497,8 +1502,8 @@ SUBROUTINE t_enum(total_error) ! ! Output the data to the screen. ! - i_loop: DO i = 1, dims(1) - DO j = 1, dims(2) + i_loop: DO i = 1, INT(dims(1)) + DO j = 1, INT(dims(2)) ! ! Get the name of the enumeration member. ! @@ -1527,6 +1532,7 @@ END SUBROUTINE t_enum SUBROUTINE t_bit(total_error) USE HDF5 + USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE @@ -1617,8 +1623,8 @@ SUBROUTINE t_bit(total_error) ! ! Output the data to the screen. ! - i_loop: DO i = 1, dims(1) - DO j = 1, dims(2) + i_loop: DO i = 1, INT(dims(1)) + DO j = 1, INT(dims(2)) A = IAND(rdata(i,j), INT(hex,C_SIGNED_CHAR)) ! Retrieve field "A" B = IAND(ISHFT(rdata(i,j),-2), INT(hex,C_SIGNED_CHAR)) ! Retrieve field "B" C = IAND(ISHFT(rdata(i,j),-4), INT(hex,C_SIGNED_CHAR)) ! Retrieve field "C" @@ -1652,6 +1658,7 @@ END SUBROUTINE t_bit SUBROUTINE t_opaque(total_error) USE HDF5 + USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE @@ -1675,7 +1682,7 @@ SUBROUTINE t_opaque(total_error) INTEGER :: taglen INTEGER(HSIZE_T), DIMENSION(1:1) :: maxdims - INTEGER :: i + INTEGER(hsize_t) :: i CHARACTER(LEN=1) :: ichr TYPE(C_PTR) :: f_ptr INTEGER :: error @@ -1799,6 +1806,7 @@ END SUBROUTINE t_opaque SUBROUTINE t_objref(total_error) USE HDF5 + USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE @@ -1905,7 +1913,7 @@ SUBROUTINE t_objref(total_error) ! ! Output the data to the screen. ! - DO i = 1, maxdims(1) + DO i = 1, INT(maxdims(1)) ! ! Open the referenced object, get its name and type. ! @@ -1951,6 +1959,7 @@ END SUBROUTINE t_objref SUBROUTINE t_regref(total_error) USE HDF5 + USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE @@ -1984,7 +1993,7 @@ SUBROUTINE t_regref(total_error) CHARACTER(LEN=80),DIMENSION(1:1), TARGET :: rdata2 CHARACTER(LEN=80) :: name - INTEGER :: i + INTEGER(hsize_t) :: i TYPE(C_PTR) :: f_ptr CHARACTER(LEN=ds2dim0) :: chrvar CHARACTER(LEN=20), DIMENSION(1:2) :: chrref_correct @@ -2150,6 +2159,7 @@ END SUBROUTINE t_regref SUBROUTINE t_vlen(total_error) USE HDF5 + USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE @@ -2159,7 +2169,7 @@ SUBROUTINE t_vlen(total_error) CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" INTEGER, PARAMETER :: LEN0 = 3 INTEGER, PARAMETER :: LEN1 = 12 - INTEGER :: dim0 + INTEGER(hsize_t) :: dim0 INTEGER(HID_T) :: file, filetype, memtype, space, dset ! Handles INTEGER :: error @@ -2266,7 +2276,7 @@ SUBROUTINE t_vlen(total_error) dim0 = dims(1) CALL H5Sget_simple_extent_dims_f(space, dims, maxdims, error) CALL check("H5Sget_simple_extent_dims_f",error, total_error) - CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(1)), dim0, total_error) + CALL VERIFY("H5Sget_simple_extent_dims_f", INT(dims(1)), INT(dim0), total_error) ! ! Create the memory datatype. @@ -2281,7 +2291,7 @@ SUBROUTINE t_vlen(total_error) CALL H5Dread_f(dset, memtype, f_ptr, error) CALL check("H5Dread_f",error, total_error) - DO i = 1, dims(1) + DO i = 1, INT(dims(1)) CALL c_f_pointer(rdata(i)%p, ptr_r, [rdata(i)%len] ) DO j = 1, rdata(i)%len CALL VERIFY("t_vlen", ptr_r(j), ptr(i)%data(j), total_error) @@ -2307,6 +2317,7 @@ END SUBROUTINE t_vlen SUBROUTINE t_vlstring(total_error) USE HDF5 + USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE @@ -2328,7 +2339,7 @@ SUBROUTINE t_vlstring(total_error) CHARACTER(LEN=sdim), DIMENSION(:), ALLOCATABLE :: rdata ! Read buffer INTEGER(HSIZE_T), DIMENSION(2) :: data_dims = (/sdim,dim0/) INTEGER(SIZE_T), DIMENSION(4) :: str_len = (/7,7,5,7/) - INTEGER :: i + INTEGER(hsize_t) :: i ! ! Create a new file using the default properties. @@ -2427,6 +2438,7 @@ SUBROUTINE t_vlstring_readwrite(total_error) ! test writing and reading vl string using h5dread_f and h5dwrite_f, C_LOC and C_F_POINTER USE HDF5 + USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE @@ -2439,7 +2451,6 @@ SUBROUTINE t_vlstring_readwrite(total_error) INTEGER(HSIZE_T) , PARAMETER :: dim0 = 4 INTEGER(HSIZE_T) , PARAMETER :: dim1 = 2 - INTEGER(SIZE_T) , PARAMETER :: sdim = 7 INTEGER(HID_T) :: file, filetype, space, dset ! Handles INTEGER(HSIZE_T), DIMENSION(1:1) :: dims = (/dim0/) INTEGER(HSIZE_T), DIMENSION(1:2) :: dims2D = (/dim1,dim0/) @@ -2468,7 +2479,8 @@ SUBROUTINE t_vlstring_readwrite(total_error) CHARACTER(len=8, kind=c_char), DIMENSION(1:4) :: data_w ! A pointer to a Fortran string CHARACTER(len=8, kind=c_char), DIMENSION(1:dim1,1:dim0) :: data2D_w ! A pointer to a Fortran string TYPE(C_PTR) :: f_ptr - INTEGER :: i, j, len + INTEGER(hsize_t) :: i, j + INTEGER :: len INTEGER :: error ! Initialize array of C pointers @@ -2677,6 +2689,7 @@ END SUBROUTINE t_vlstring_readwrite SUBROUTINE t_string(total_error) USE HDF5 + USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE @@ -2697,7 +2710,7 @@ SUBROUTINE t_string(total_error) CHARACTER(LEN=sdim), DIMENSION(1:dim0), TARGET :: & wdata = (/"Parting", "is such", "sweet ", "sorrow."/) CHARACTER(LEN=sdim), DIMENSION(:), ALLOCATABLE, TARGET :: rdata - INTEGER :: i + INTEGER(hsize_t) :: i INTEGER(SIZE_T) :: size TYPE(C_PTR) :: f_ptr ! @@ -2800,23 +2813,23 @@ SUBROUTINE t_string(total_error) END SUBROUTINE t_string -SUBROUTINE vl_test_special_char(cleanup, total_error) +SUBROUTINE vl_test_special_char(total_error) - USE hdf5 + USE HDF5 + USE TH5_MISC IMPLICIT NONE - INTERFACE - SUBROUTINE setup_buffer(data_in, line_lengths, char_type) - USE hdf5 - USE ISO_C_BINDING - IMPLICIT NONE - CHARACTER(len=*), DIMENSION(:) :: data_in - INTEGER(size_t), DIMENSION(:) :: line_lengths - CHARACTER(KIND=C_CHAR,LEN=*) :: char_type - END SUBROUTINE setup_buffer - END INTERFACE +! INTERFACE +! SUBROUTINE setup_buffer(data_in, line_lengths, char_type) +! USE HDF5 +! USE ISO_C_BINDING +! IMPLICIT NONE +! CHARACTER(len=*), DIMENSION(:) :: data_in +! INTEGER(size_t), DIMENSION(:) :: line_lengths +! CHARACTER(KIND=C_CHAR,LEN=*) :: char_type +! END SUBROUTINE setup_buffer +! END INTERFACE - LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(OUT) :: total_error CHARACTER(LEN=16), PARAMETER :: filename = "t_controlchar.h5" @@ -2967,14 +2980,14 @@ END SUBROUTINE setup_buffer !------------------------------------------------------------------------- ! -SUBROUTINE test_nbit(cleanup, total_error ) +SUBROUTINE test_nbit(total_error ) USE HDF5 + USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE INTEGER, PARAMETER :: wp = SELECTED_REAL_KIND(Fortran_REAL_4) !should map to REAL*4 on most modern processors - LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(INOUT) :: total_error INTEGER(hid_t) :: file @@ -2991,8 +3004,9 @@ SUBROUTINE test_nbit(cleanup, total_error ) INTEGER(size_t) :: PRECISION, offset INTEGER :: error LOGICAL :: status - INTEGER(size_t) :: i, j + INTEGER(hsize_t) :: i, j TYPE(C_PTR) :: f_ptr + LOGICAL :: differ ! check to see if filter is available CALL H5Zfilter_avail_f(H5Z_FILTER_NBIT_F, status, error) @@ -3065,7 +3079,8 @@ SUBROUTINE test_nbit(cleanup, total_error ) i_loop: DO i = 1, dims(1) j_loop: DO j = 1, dims(2) IF(.NOT.(orig_data(i,j).EQ.orig_data(i,j))) CYCLE ! skip IF value is NaN - IF(new_data(i,j) .NE. orig_data(i,j))THEN + CALL compare_floats(new_data(i,j), orig_data(i,j), differ) + IF(differ)THEN total_error = total_error + 1 WRITE(*,'(" Read different values than written.")') WRITE(*,'(" At index ", 2(1X,I0))') i, j @@ -3114,6 +3129,7 @@ SUBROUTINE t_enum_conv(total_error) !------------------------------------------------------------------------- ! USE HDF5 + USE TH5_MISC USE ISO_C_BINDING IMPLICIT NONE @@ -3125,7 +3141,7 @@ SUBROUTINE t_enum_conv(total_error) INTEGER, PARAMETER :: real_kind_7 = SELECTED_REAL_KIND(Fortran_REAL_4) !should map to REAL*4 on most modern processors - INTEGER(hid_t) :: cwg=-1, dtype=-1, space=-1, dset=-1, memtype ! Handles + INTEGER(hid_t) :: cwg=-1, dtype=-1, space=-1, dset=-1 ! Handles INTEGER(hid_t) :: file ! Handles ! Enumerated type @@ -3161,6 +3177,7 @@ SUBROUTINE t_enum_conv(total_error) INTEGER(hsize_t), DIMENSION(1:1) :: ds_size = (/20/) INTEGER(size_t) :: i + INTEGER(hsize_t) :: ih INTEGER :: error TYPE(C_PTR) :: f_ptr INTEGER(HID_T) :: m_baset ! Memory base type @@ -3223,10 +3240,10 @@ SUBROUTINE t_enum_conv(total_error) CALL check(" h5dread_f", error, total_error) ! Check values - DO i = 1, ds_size(1) - IF(data1(i) .NE. data2(i))THEN + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. data2(ih))THEN total_error = total_error + 1 - WRITE(*,'(" 1. data1(",I0,")=",I0," .NE. data2(",I0,")=",I0)') i, data1(i),i,data2(i) + WRITE(*,'(" 1. data1(",I0,")=",I0," .NE. data2(",I0,")=",I0)') ih, data1(ih),i,data2(ih) EXIT ENDIF ENDDO @@ -3237,10 +3254,10 @@ SUBROUTINE t_enum_conv(total_error) CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) CALL check("h5dread_f", error, total_error) ! Check values - DO i = 1, ds_size(1) - IF(data1(i) .NE. data_short(i))THEN + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. data_short(ih))THEN total_error = total_error + 1 - WRITE(*,'(" 2. data1(",I0,")=",I0," .NE. data_short(",I0,")=",I0)') i, data1(i),i,data_short(i) + WRITE(*,'(" 2. data1(",I0,")=",I0," .NE. data_short(",I0,")=",I0)') ih, data1(ih),i,data_short(ih) EXIT ENDIF ENDDO @@ -3253,11 +3270,11 @@ SUBROUTINE t_enum_conv(total_error) CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) CALL check("h5dread_f", error, total_error) ! Check values - DO i = 1, ds_size(1) - IF(data1(i) .NE. INT(data_double(i)))THEN + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. INT(data_double(ih)))THEN total_error = total_error + 1 WRITE(*,'(" 3. data_double(",I0,")=",I0," .NE. data_double(",I0,")=",I0)') & - i, INT(data1(i)), i, INT(data_double(i)) + ih, INT(data1(ih)), ih, INT(data_double(ih)) EXIT ENDIF ENDDO @@ -3270,11 +3287,11 @@ SUBROUTINE t_enum_conv(total_error) CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) CALL check("h5dread_f", error, total_error) ! Check values - DO i = 1, ds_size(1) - IF(data1(i) .NE. INT(data_i8(i)))THEN + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. INT(data_i8(ih)))THEN total_error = total_error + 1 WRITE(*,'(" 4. data_i8(",I0,")=",I0," .NE. data_i8(",I0,")=",I0)') & - i, INT(data1(i)), i, INT(data_i8(i)) + ih, INT(data1(ih)), i, INT(data_i8(ih)) EXIT ENDIF ENDDO @@ -3287,11 +3304,11 @@ SUBROUTINE t_enum_conv(total_error) CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) CALL check("h5dread_f", error, total_error) ! Check values - DO i = 1, ds_size(1) - IF(data1(i) .NE. INT(data_i16(i)))THEN + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. INT(data_i16(ih)))THEN total_error = total_error + 1 WRITE(*,'(" 5. data_i16(",I0,")=",I0," .NE. data_i16(",I0,")=",I0)') & - i, INT(data1(i)), i, INT(data_i16(i)) + ih, INT(data1(ih)), i, INT(data_i16(ih)) EXIT ENDIF ENDDO @@ -3304,11 +3321,11 @@ SUBROUTINE t_enum_conv(total_error) CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) CALL check("h5dread_f", error, total_error) ! Check values - DO i = 1, ds_size(1) - IF(data1(i) .NE. INT(data_r7(i)))THEN + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. INT(data_r7(ih)))THEN total_error = total_error + 1 WRITE(*,'(" 6. data_r7(",I0,")=",I0," .NE. data_r7(",I0,")=",I0)') & - i, INT(data1(i)), i, INT(data_r7(i)) + ih, INT(data1(ih)), i, INT(data_r7(ih)) EXIT ENDIF ENDDO @@ -3335,10 +3352,10 @@ SUBROUTINE t_enum_conv(total_error) CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) CALL check("h5dread_f", error, total_error) - DO i = 1, ds_size(1) - IF(data1(i) .NE. data_int(i))THEN + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. data_int(ih))THEN total_error = total_error + 1 - WRITE(*,'(" 7. data1(",I0,")=",I0," .NE. data_int(",I0,")=",I0)') i, data1(i),i,data_int(i) + WRITE(*,'(" 7. data1(",I0,")=",I0," .NE. data_int(",I0,")=",I0)') ih, data1(ih),i,data_int(ih) EXIT ENDIF ENDDO @@ -3363,10 +3380,10 @@ SUBROUTINE t_enum_conv(total_error) CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) CALL check("h5dread_f", error, total_error) - DO i = 1, ds_size(1) - IF(data1(i) .NE. INT(data_double(i)))THEN + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. INT(data_double(ih)))THEN total_error = total_error + 1 - WRITE(*,'(" 8. data1(",I0,")=",I0," .NE. data_double(",I0,")=",I0)') i, data1(i),i,INT(data_double(i)) + WRITE(*,'(" 8. data1(",I0,")=",I0," .NE. data_double(",I0,")=",I0)') ih, data1(ih),ih,INT(data_double(ih)) EXIT ENDIF ENDDO @@ -3391,10 +3408,10 @@ SUBROUTINE t_enum_conv(total_error) CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) CALL check("h5dread_f", error, total_error) - DO i = 1, ds_size(1) - IF(data1(i) .NE. INT(data_r7(i)))THEN + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. INT(data_r7(ih)))THEN total_error = total_error + 1 - WRITE(*,'(" 9. data1(",I0,")=",I0," .NE. data_r7(",I0,")=",I0)') i, data1(i),i,INT(data_r7(i)) + WRITE(*,'(" 9. data1(",I0,")=",I0," .NE. data_r7(",I0,")=",I0)') ih, data1(ih),ih,INT(data_r7(ih)) EXIT ENDIF ENDDO @@ -3420,10 +3437,10 @@ SUBROUTINE t_enum_conv(total_error) CALL h5dread_f(dset, m_baset, f_ptr, error, space, space) CALL check("h5dread_f", error, total_error) - DO i = 1, ds_size(1) - IF(data1(i) .NE. data_i16(i))THEN + DO ih = 1, ds_size(1) + IF(data1(ih) .NE. data_i16(ih))THEN total_error = total_error + 1 - WRITE(*,'(" 10. data1(",I0,")=",I0," .NE. data_i16(",I0,")=",I0)') i, data1(i),i,data_i16(i) + WRITE(*,'(" 10. data1(",I0,")=",I0," .NE. data_i16(",I0,")=",I0)') ih, data1(ih),ih,data_i16(ih) EXIT ENDIF ENDDO @@ -3444,3 +3461,4 @@ SUBROUTINE t_enum_conv(total_error) END SUBROUTINE t_enum_conv +END MODULE TH5T_F03 |