From 3befe647ee9783b763208a581675988fbaabd321 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 26 Sep 2016 13:27:50 -0500 Subject: Added number of integer KINDs found to the header files. --- config/cmake/HDF5UseFortran.cmake | 3 +++ configure.ac | 1 + fortran/src/H5_f.c | 21 ++++++++++++-------- fortran/src/H5fort_type_defines.h.in | 1 + fortran/src/H5match_types.c | 38 ++++++++++++++++++------------------ m4/aclocal_fc.m4 | 5 ++++- 6 files changed, 41 insertions(+), 28 deletions(-) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 41efadc..2658ccf 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -159,9 +159,12 @@ set(PAC_FC_ALL_REAL_KINDS "\{${pac_validRealKinds}\}") list(GET PROG_OUTPUT 3 NUM_IKIND) list(GET PROG_OUTPUT 4 NUM_RKIND) +set(PAC_FORTRAN_NUM_INTEGER_KINDS "${NUM_IKIND}" + set(H5CONFIG_F_NUM_IKIND "INTEGER, PARAMETER :: num_ikinds = ${NUM_IKIND}") set(H5CONFIG_F_IKIND "INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/${pac_validIntKinds}/)") +message (STATUS "....NUMBER OF INTEGER KINDS FOUND ${PAC_FORTRAN_NUM_INTEGER_KINDS}") message (STATUS "....REAL KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}") message (STATUS "....INTEGER KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}") message (STATUS "....MAX DECIMAL PRECISION ${H5_PAC_FC_MAX_REAL_PRECISION}") diff --git a/configure.ac b/configure.ac index 59d1bef..afbd474 100644 --- a/configure.ac +++ b/configure.ac @@ -551,6 +551,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then AC_SUBST([PAC_FC_ALL_REAL_KINDS]) AC_SUBST([PAC_FC_MAX_REAL_PRECISION]) + AC_SUBST([PAC_FORTRAN_NUM_INTEGER_KINDS]) AC_SUBST([PAC_FC_ALL_INTEGER_KINDS]) AC_SUBST([PAC_FC_ALL_REAL_KINDS_SIZEOF]) AC_SUBST([PAC_FC_ALL_INTEGER_KINDS_SIZEOF]) diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index db05f67..f9fe927 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -34,16 +34,16 @@ int IntKinds_SizeOf[] = H5_FORTRAN_INTEGER_KINDS_SIZEOF; * Initialize predefined datatypes in Fortran * INPUTS * types - array with the predefined Native Fortran - * type, its element and length must be the - * same as the types array defined in the + * type, its element and length must be the + * same as the types array defined in the * H5f90global.F90 * floatingtypes - array with the predefined Floating Fortran - * type, its element and length must be the - * same as the floatingtypes array defined in the - * H5f90global.F90 + * type, its element and length must be the + * same as the floatingtypes array defined in the + * H5f90global.F90 * integertypes - array with the predefined Integer Fortran - * type, its element and length must be the - * same as the integertypes array defined in the + * type, its element and length must be the + * same as the integertypes array defined in the * H5f90global.F90 * RETURNS * 0 on success, -1 on failure @@ -68,8 +68,13 @@ h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes /* * Find the HDF5 type of the Fortran Integer KIND. */ + + /* Initialized INTEGER KIND types to default to native integer */ for(i=0;i<5;i++) { + if ((types[i] = (hid_t_f)H5Tcopy (H5T_NATIVE_INT)) < 0) return ret_value; + } + for(i=0;i