summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5_f.c
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>2005-09-08 19:36:24 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>2005-09-08 19:36:24 (GMT)
commit244d72b6f5a62d91c4b922f45ef7217ca24f82b9 (patch)
tree806a2b9b3a65b086c874277b2c327a2b976c5a99 /fortran/src/H5_f.c
parenta0c61b514bcae172789e782c62547080da045b2a (diff)
downloadhdf5-244d72b6f5a62d91c4b922f45ef7217ca24f82b9.zip
hdf5-244d72b6f5a62d91c4b922f45ef7217ca24f82b9.tar.gz
hdf5-244d72b6f5a62d91c4b922f45ef7217ca24f82b9.tar.bz2
[svn-r11372] Purpose: Maintenance/improvement
Description: Added support for "big" REAL and DOUBLE PRECISION datatypes (i.e. sizes of Fortran real and double precision may be 8 and/or 16 bytes; usually specified by compilers flags like -r8, -r16, -d8, etc.) Solution: Added code to generate all necessary datatypes on a fly. Platforms tested: heping with g95 (-r8, -d8) mir with ifc (-r16, -r8) Note: multi file test failed when REAL is 128 bit. I will address this later. Misc. update:
Diffstat (limited to 'fortran/src/H5_f.c')
-rw-r--r--fortran/src/H5_f.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c
index 745dfe4..a993451 100644
--- a/fortran/src/H5_f.c
+++ b/fortran/src/H5_f.c
@@ -59,14 +59,24 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype
if ((types[0] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value;
} /*end else */
- /* Accomodate Crays with this check */
- if(sizeof(real_f)==sizeof(double)) {
+ /* Find appropriate size to store Fortran REAL */
+ if(sizeof(real_f)==sizeof(float)) {
+ if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value;
+ } /* end if */
+ else if(sizeof(real_f)==sizeof(double)){
if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value;
} /* end if */
- else {
- if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value;
+ else if (sizeof(real_f) == sizeof(long double)) {
+ if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value;
} /* end else */
- if ((types[2] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value;
+
+
+ if(sizeof(double_f)==sizeof(double)) {
+ if ((types[2] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value;
+ }/*end if */
+ else if(sizeof(double_f)==sizeof(long double)) {
+ if ((types[2] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value;
+ }/*end else */
/*
if ((types[3] = H5Tcopy(H5T_NATIVE_UINT8)) < 0) return ret_value;