summaryrefslogtreecommitdiffstats
path: root/fortran/test/tH5T.f90
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2014-04-08 19:34:42 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2014-04-08 19:34:42 (GMT)
commit9cd1a1bb60c66650208033d61ff377df5ac1a72e (patch)
tree1983e8fbd82c084d515a6dd1554b094a44123811 /fortran/test/tH5T.f90
parentd1f2b1a682213d98db080e91c09d3f95b4f2b3b0 (diff)
downloadhdf5-9cd1a1bb60c66650208033d61ff377df5ac1a72e.zip
hdf5-9cd1a1bb60c66650208033d61ff377df5ac1a72e.tar.gz
hdf5-9cd1a1bb60c66650208033d61ff377df5ac1a72e.tar.bz2
[svn-r24986] Comparing REALs now converts all REALs to double precision and then compares if the two numbers are equivalent.
Tested: jam (gnu, intel)
Diffstat (limited to 'fortran/test/tH5T.f90')
-rw-r--r--fortran/test/tH5T.f9021
1 files changed, 7 insertions, 14 deletions
diff --git a/fortran/test/tH5T.f90 b/fortran/test/tH5T.f90
index aac5f33..8ac91d2 100644
--- a/fortran/test/tH5T.f90
+++ b/fortran/test/tH5T.f90
@@ -528,13 +528,7 @@ CONTAINS
CALL h5dread_f(dset_id, dt3_id, double_member_out, data_dims, error)
CALL check("h5dread_f", error, total_error)
do i = 1, dimsize
- differ = .FALSE.
- if (abs(double_member_out(i) - double_member(i)) .ge. 1.D-08) THEN
- differ = .TRUE.
- endif
- ! This is temorary fix until we figure out how to compare floats
- !CALL compare_floats(double_member_out(i), double_member(i), differ)
- if (differ) then
+ IF( .NOT.dreal_eq( REAL(double_member_out(i),dp), REAL( double_member(i), dp)) ) THEN
write(*,*) " Wrong double precision data is read back "
total_error = total_error + 1
endif
@@ -551,13 +545,12 @@ CONTAINS
!
CALL h5dread_f(dset_id, dt4_id, real_member_out, data_dims, error)
CALL check("h5dread_f", error, total_error)
- do i = 1, dimsize
- CALL compare_floats(real_member_out(i), real_member(i), differ)
- if (differ) then
- write(*,*) " Wrong real precision data is read back "
- total_error = total_error + 1
- endif
- enddo
+ DO i = 1, dimsize
+ IF( .NOT.dreal_eq( REAL(real_member_out(i),dp), REAL( real_member(i), dp)) ) THEN
+ WRITE(*,*) " Wrong real precision data is read back "
+ total_error = total_error + 1
+ ENDIF
+ ENDDO
!
! *-----------------------------------------------------------------------
! * Test encoding and decoding compound datatypes