summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2015-06-09 17:05:09 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2015-06-09 17:05:09 (GMT)
commit62401ac7c61dc71ea5980e44e895ab757df15a01 (patch)
tree48eb78e17c07ad2485642d555c47733dff1cfd80 /fortran
parent32703c9fc5a315a005abf26965d5545043fd3605 (diff)
downloadhdf5-62401ac7c61dc71ea5980e44e895ab757df15a01.zip
hdf5-62401ac7c61dc71ea5980e44e895ab757df15a01.tar.gz
hdf5-62401ac7c61dc71ea5980e44e895ab757df15a01.tar.bz2
[svn-r27167] more DT fixes
Diffstat (limited to 'fortran')
-rw-r--r--fortran/Makefile.in1
-rw-r--r--fortran/examples/Makefile.in1
-rw-r--r--fortran/src/H5_f.c10
-rw-r--r--fortran/src/H5_ff.F902
-rw-r--r--fortran/src/H5config_f.inc.in3
-rw-r--r--fortran/src/H5fort_type_defines.h.in3
-rw-r--r--fortran/src/H5match_types.c30
-rw-r--r--fortran/src/Makefile.in1
-rw-r--r--fortran/test/Makefile.in1
-rw-r--r--fortran/testpar/Makefile.in1
10 files changed, 35 insertions, 18 deletions
diff --git a/fortran/Makefile.in b/fortran/Makefile.in
index 6427d4c..c8a309d 100644
--- a/fortran/Makefile.in
+++ b/fortran/Makefile.in
@@ -458,6 +458,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@
FCLIBS = @FCLIBS@
FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
+FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
GREP = @GREP@
diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in
index d0400c0..15e98ac 100644
--- a/fortran/examples/Makefile.in
+++ b/fortran/examples/Makefile.in
@@ -402,6 +402,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@
FCLIBS = @FCLIBS@
FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
+FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
GREP = @GREP@
diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c
index 241af79..cca36fb 100644
--- a/fortran/src/H5_f.c
+++ b/fortran/src/H5_f.c
@@ -221,21 +221,27 @@ h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes
/*
* FIND H5T_NATIVE_REAL_C_LONG_DOUBLE
*/
+#if H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE
if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(float)) {
if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value;
} /*end if */
else if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(double)) {
if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value;
} /*end if */
-#if FORTRAN_HAVE_C_LONG_DOUBLE!=0
+# if FORTRAN_HAVE_C_LONG_DOUBLE!=0
else if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(long double)) {
if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value;
} /*end else */
-#else
+# else
else if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(long double)) {
if ((types[12] = H5Tcopy (H5T_NATIVE_FLOAT)) < 0) return ret_value;
if ( H5Tset_precision (types[12], 128) < 0) return ret_value;
} /*end else */
+# endif
+
+#else
+ if ((types[12] = H5Tcopy (H5T_NATIVE_FLOAT)) < 0) return ret_value;
+ if ( H5Tset_precision (types[12], 64) < 0) return ret_value;
#endif
/*
* FIND H5T_NATIVE_B_8
diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90
index 7939644..3ef6331 100644
--- a/fortran/src/H5_ff.F90
+++ b/fortran/src/H5_ff.F90
@@ -389,8 +389,10 @@ CONTAINS
h5_type = H5T_NATIVE_REAL_C_FLOAT
ELSE IF(kind.EQ.Fortran_REAL_C_DOUBLE)THEN
h5_type = H5T_NATIVE_REAL_C_DOUBLE
+#if H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE!=0
ELSE IF(kind.EQ.Fortran_REAL_C_LONG_DOUBLE)THEN
h5_type = H5T_NATIVE_REAL_C_LONG_DOUBLE
+#endif
#if H5_PAC_FC_MAX_REAL_PRECISION > 28
#ifdef H5_HAVE_FLOAT128
ELSE IF(kind.EQ.Fortran_REAL_C_FLOAT128)THEN
diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in
index dbbf43b..d6909ed 100644
--- a/fortran/src/H5config_f.inc.in
+++ b/fortran/src/H5config_f.inc.in
@@ -18,6 +18,9 @@
! Define if the intrinsic function C_LONG_DOUBLE exists
#undef FORTRAN_HAVE_C_LONG_DOUBLE
+! Define if Fortran C_LONG_DOUBLE is different from C_DOUBLE
+#undef FORTRAN_C_LONG_DOUBLE_IS_UNIQUE
+
! Define if the intrinsic module ISO_FORTRAN_ENV exists
#undef HAVE_ISO_FORTRAN_ENV
diff --git a/fortran/src/H5fort_type_defines.h.in b/fortran/src/H5fort_type_defines.h.in
index 279deb9..5511742 100644
--- a/fortran/src/H5fort_type_defines.h.in
+++ b/fortran/src/H5fort_type_defines.h.in
@@ -13,4 +13,5 @@
#define H5_FORTRAN_REAL_KINDS_SIZEOF @PAC_FC_ALL_REAL_KINDS_SIZEOF@
#define H5_PAC_FC_MAX_REAL_PRECISION @PAC_FC_MAX_REAL_PRECISION@
#define H5_HAVE_Fortran_INTEGER_SIZEOF_16 @HAVE_Fortran_INTEGER_SIZEOF_16@
-#define H5_HAVE_Fortran_INTRINSIC_C_LONG_DOUBLE @FORTRAN_HAVE_C_LONG_DOUBLE@
+#define H5_FORTRAN_HAVE_C_LONG_DOUBLE @FORTRAN_HAVE_C_LONG_DOUBLE@
+#define H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c
index c22f423..27d314e 100644
--- a/fortran/src/H5match_types.c
+++ b/fortran/src/H5match_types.c
@@ -211,16 +211,16 @@ int main(void)
if (sizeof(float) == RealKinds_SizeOf[i]) {
writeTypedef("float", "float", RealKinds[i]);
- strcpy(Real_C_TYPES[i], "C_FLOAT");
- } else if(sizeof(double) == RealKinds_SizeOf[i]) {
+ strcpy(Real_C_TYPES[i], "C_FLOAT"); }
+ else if(sizeof(double) == RealKinds_SizeOf[i]) {
writeTypedef("float", "double", RealKinds[i]);
- strcpy(Real_C_TYPES[i], "C_DOUBLE");
-/* may not have long double in fortran need check */
- } else if(sizeof(long double) == RealKinds_SizeOf[i] && found_long_double == 0) {
+ strcpy(Real_C_TYPES[i], "C_DOUBLE"); }
+#if H5_FORTRAN_HAVE_C_LONG_DOUBLE!=0
+ else if(sizeof(long double) == RealKinds_SizeOf[i] && found_long_double == 0) {
writeTypedef("float", "long double", RealKinds[i]);
strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE");
- found_long_double = 1;
- }
+ found_long_double = 1; }
+#endif
#ifdef H5_HAVE_FLOAT128
/* Don't select a higher precision than Fortran can support */
else if(sizeof(__float128) == RealKinds_SizeOf[i] && found_long_double == 1 && H5_PAC_FC_MAX_REAL_PRECISION > 28) {
@@ -240,15 +240,15 @@ int main(void)
/* } else if(sizeof(long double) > RealKinds_SizeOf[H5_FORTRAN_NUM_REAL_KINDS-2]) { */
/* writeTypedef("float", "long double", RealKinds[i]); */
/* strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE"); } */
- else {
- printf(" **** HDF5 WARNING ****\n");
- printf("Fortran REAL is %d bytes, but no corresponding C floating type exists\n",RealKinds_SizeOf[i]);
- printf("Fortran Interface will create a custom datatype to store Fortran Real\n",RealKinds_SizeOf[i]);
+ else {
+ printf(" **** HDF5 WARNING ****\n");
+ printf("Fortran REAL is %d bytes, but no corresponding C floating type exists\n",RealKinds_SizeOf[i]);
+ printf("Fortran Interface will create a custom datatype to store Fortran Real\n",RealKinds_SizeOf[i]);
- writeTypedef("float", "long double", RealKinds[i]);
- strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE"); }
- }
-/* } */
+/* writeTypedef("float", "long double", RealKinds[i]); */
+/* strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE"); } */
+ }
+ }
/* Now begin defining fortran types. */
fprintf(c_header, "\n");
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index 0abfb53..5c9de7c 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -503,6 +503,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@
FCLIBS = @FCLIBS@
FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
+FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
GREP = @GREP@
diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in
index 6478b50..bef4842 100644
--- a/fortran/test/Makefile.in
+++ b/fortran/test/Makefile.in
@@ -514,6 +514,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@
FCLIBS = @FCLIBS@
FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
+FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
GREP = @GREP@
diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in
index 79db2dc..e40dda7 100644
--- a/fortran/testpar/Makefile.in
+++ b/fortran/testpar/Makefile.in
@@ -454,6 +454,7 @@ FCFLAGS_f90 = @FCFLAGS_f90@
FCLIBS = @FCLIBS@
FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
+FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
GREP = @GREP@