summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2015-06-08 21:13:15 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2015-06-08 21:13:15 (GMT)
commit32703c9fc5a315a005abf26965d5545043fd3605 (patch)
tree342146825782a26babcd939201f7d657520c84dc /fortran
parent8641814c4e5b4211e0980df783c3d2d25f484226 (diff)
downloadhdf5-32703c9fc5a315a005abf26965d5545043fd3605.zip
hdf5-32703c9fc5a315a005abf26965d5545043fd3605.tar.gz
hdf5-32703c9fc5a315a005abf26965d5545043fd3605.tar.bz2
[svn-r27164] various bug fixes for DT
Diffstat (limited to 'fortran')
-rw-r--r--fortran/Makefile.in1
-rw-r--r--fortran/examples/Makefile.in1
-rw-r--r--fortran/examples/rwdset_fortran2003.f9012
-rw-r--r--fortran/src/H5_ff.F902
-rw-r--r--fortran/src/H5config_f.inc.in3
-rw-r--r--fortran/src/H5match_types.c4
-rw-r--r--fortran/src/Makefile.in1
-rw-r--r--fortran/test/Makefile.in1
-rw-r--r--fortran/test/tH5T.f902
-rw-r--r--fortran/test/tH5T_F03.F9017
-rw-r--r--fortran/testpar/Makefile.in1
11 files changed, 36 insertions, 9 deletions
diff --git a/fortran/Makefile.in b/fortran/Makefile.in
index d3b941d..6427d4c 100644
--- a/fortran/Makefile.in
+++ b/fortran/Makefile.in
@@ -517,6 +517,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
+PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@
PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@
PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@
PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@
diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in
index c517d7a..d0400c0 100644
--- a/fortran/examples/Makefile.in
+++ b/fortran/examples/Makefile.in
@@ -461,6 +461,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
+PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@
PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@
PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@
PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@
diff --git a/fortran/examples/rwdset_fortran2003.f90 b/fortran/examples/rwdset_fortran2003.f90
index d65db9e..cd932bd 100644
--- a/fortran/examples/rwdset_fortran2003.f90
+++ b/fortran/examples/rwdset_fortran2003.f90
@@ -28,13 +28,13 @@ PROGRAM RWDSET_FORTRAN2003
IMPLICIT NONE
- INTEGER, PARAMETER :: int_kind_1 = SELECTED_INT_KIND(Fortran_INTEGER_1) !should map to INTEGER*1 on most modern processors
- INTEGER, PARAMETER :: int_kind_4 = SELECTED_INT_KIND(Fortran_INTEGER_2) !should map to INTEGER*2 on most modern processors
- INTEGER, PARAMETER :: int_kind_8 = SELECTED_INT_KIND(Fortran_INTEGER_4) !should map to INTEGER*4 on most modern processors
- INTEGER, PARAMETER :: int_kind_16 = SELECTED_INT_KIND(Fortran_INTEGER_8) !should map to INTEGER*8 on most modern processors
+ INTEGER, PARAMETER :: int_kind_1 = SELECTED_INT_KIND(2) !should map to INTEGER*1 on most modern processors
+ INTEGER, PARAMETER :: int_kind_4 = SELECTED_INT_KIND(4) !should map to INTEGER*2 on most modern processors
+ INTEGER, PARAMETER :: int_kind_8 = SELECTED_INT_KIND(9) !should map to INTEGER*4 on most modern processors
+ INTEGER, PARAMETER :: int_kind_16 = SELECTED_INT_KIND(18) !should map to INTEGER*8 on most modern processors
- INTEGER, PARAMETER :: real_kind_7 = SELECTED_REAL_KIND(Fortran_REAL_4) !should map to REAL*4 on most modern processors
- INTEGER, PARAMETER :: real_kind_15 = SELECTED_REAL_KIND(Fortran_REAL_8) !should map to REAL*8 on most modern processors
+ INTEGER, PARAMETER :: real_kind_7 = SELECTED_REAL_KIND(6,37) !should map to REAL*4 on most modern processors
+ INTEGER, PARAMETER :: real_kind_15 = SELECTED_REAL_KIND(15,307) !should map to REAL*8 on most modern processors
CHARACTER(LEN=8), PARAMETER :: filename = "dsetf.h5" ! File name
CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name
diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90
index 74838cf..7939644 100644
--- a/fortran/src/H5_ff.F90
+++ b/fortran/src/H5_ff.F90
@@ -397,6 +397,8 @@ CONTAINS
h5_type = H5T_NATIVE_FLOAT_128
#endif
#endif
+ ELSE
+ h5_type = -1
ENDIF
ENDIF
diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in
index c8fcf31..dbbf43b 100644
--- a/fortran/src/H5config_f.inc.in
+++ b/fortran/src/H5config_f.inc.in
@@ -33,3 +33,6 @@
! Define if INTEGER*16 is available
#undef HAVE_Fortran_INTEGER_SIZEOF_16
+! Maximum decimal precision for C
+#undef PAC_C_MAX_REAL_PRECISION
+
diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c
index 366e3da..c22f423 100644
--- a/fortran/src/H5match_types.c
+++ b/fortran/src/H5match_types.c
@@ -163,6 +163,7 @@ int main(void)
int H5_FORTRAN_NUM_INTEGER_KINDS;
int H5_FORTRAN_NUM_REAL_KINDS;
+ int found_long_double = 0;
/* Open target files */
c_header = fopen(CFILE, "w");
@@ -206,7 +207,6 @@ int main(void)
/* (b) Define c_float_x */
- int found_long_double = 0;
for(i=0;i< H5_FORTRAN_NUM_REAL_KINDS;i++) {
if (sizeof(float) == RealKinds_SizeOf[i]) {
@@ -551,12 +551,12 @@ int main(void)
fprintf(fort_header, " INTEGER, PARAMETER :: H5R_DSET_REG_REF_BUF_SIZE_F = %u\n", H5_SIZEOF_HADDR_T + 4 );
-
/* Close files */
endCfile();
endFfile();
fclose(c_header);
fclose(fort_header);
+
return 0;
}
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index 54f2065..0abfb53 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -562,6 +562,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
+PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@
PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@
PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@
PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@
diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in
index 431c42a..6478b50 100644
--- a/fortran/test/Makefile.in
+++ b/fortran/test/Makefile.in
@@ -573,6 +573,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
+PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@
PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@
PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@
PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@
diff --git a/fortran/test/tH5T.f90 b/fortran/test/tH5T.f90
index 9aaaa73..d845f73 100644
--- a/fortran/test/tH5T.f90
+++ b/fortran/test/tH5T.f90
@@ -213,8 +213,10 @@ CONTAINS
CALL check("h5tget_size_f", error, total_error)
CALL h5tget_size_f(H5T_NATIVE_INTEGER, type_sizei, error)
CALL check("h5tget_size_f", error, total_error)
+ PRINT*,H5T_NATIVE_DOUBLE
CALL h5tget_size_f(H5T_NATIVE_DOUBLE, type_sized, error)
CALL check("h5tget_size_f", error, total_error)
+ stop
CALL h5tget_size_f(H5T_NATIVE_REAL, type_sizer, error)
CALL check("h5tget_size_f", error, total_error)
!write(*,*) "get sizes", type_sizec, type_sizei, type_sizer, type_sized
diff --git a/fortran/test/tH5T_F03.F90 b/fortran/test/tH5T_F03.F90
index ee9f2f2..995243f 100644
--- a/fortran/test/tH5T_F03.F90
+++ b/fortran/test/tH5T_F03.F90
@@ -994,10 +994,25 @@ END SUBROUTINE test_array_compound_atomic
INTEGER, PARAMETER :: real_kind_7 = C_FLOAT !should map to REAL*4 on most modern processors
INTEGER, PARAMETER :: real_kind_15 = C_DOUBLE !should map to REAL*8 on most modern processors
+! Check if C has quad precision extension
#if H5_HAVE_FLOAT128!=0
+! Check if Fortran supports quad precision
+# if H5_PAC_FC_MAX_REAL_PRECISION > 26
INTEGER, PARAMETER :: real_kind_31 = SELECTED_REAL_KIND(31)
+# else
+ INTEGER, PARAMETER :: real_kind_31 = SELECTED_REAL_KIND(15,307)
+# endif
#else
- INTEGER, PARAMETER :: real_kind_31 = SELECTED_REAL_KIND(17)
+! Check if the default of long double is quad precision
+# if H5_PAC_C_MAX_REAL_PRECISION > 26
+# if H5_PAC_FC_MAX_REAL_PRECISION > 26
+ INTEGER, PARAMETER :: real_kind_31 = SELECTED_REAL_KIND(31)
+# else
+ INTEGER, PARAMETER :: real_kind_31 = SELECTED_REAL_KIND(15,307)
+# endif
+# else
+ INTEGER, PARAMETER :: real_kind_31 = SELECTED_REAL_KIND(15,307)
+# endif
#endif
REAL(real_kind_31), DIMENSION(1:4), TARGET :: dset_data_r31, data_out_r31
INTEGER(HID_T) :: dset_idr16 ! Dataset identifier
diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in
index 6c81b76..79db2dc 100644
--- a/fortran/testpar/Makefile.in
+++ b/fortran/testpar/Makefile.in
@@ -513,6 +513,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
+PAC_C_MAX_REAL_PRECISION = @PAC_C_MAX_REAL_PRECISION@
PAC_FC_ALL_INTEGER_KINDS = @PAC_FC_ALL_INTEGER_KINDS@
PAC_FC_ALL_INTEGER_KINDS_SIZEOF = @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@
PAC_FC_ALL_REAL_KINDS = @PAC_FC_ALL_REAL_KINDS@