From 6ff2e7b303b0479bba8c4709a1fcac61fbdf9f2b Mon Sep 17 00:00:00 2001 From: Elena Pourmal Date: Sat, 28 Apr 2001 20:08:16 -0500 Subject: [svn-r3872] Purpose: Windows port Description: Names of the H5f.c and H5ff.f90 files caused problems on Windows98. Compilation of H5F.c (C Library) and H5Ff.f90 (Fortran library) as compilation of H5f.c and H5ff.f90 creates the same H5F.o and H5FF.o file names and linking stage fails. Solution: Rename the files to H5_f.c and H5_ff.f90 Platforms tested: Linux (eirene) and Windows98 --- fortran/src/H5_f.c | 344 ++++++++++++++++++++++++++++++++++++++++++++++++ fortran/src/H5_ff.f90 | 161 ++++++++++++++++++++++ fortran/src/H5f.c | 344 ------------------------------------------------ fortran/src/H5ff.f90 | 149 --------------------- fortran/src/Makefile.in | 4 +- 5 files changed, 507 insertions(+), 495 deletions(-) create mode 100644 fortran/src/H5_f.c create mode 100644 fortran/src/H5_ff.f90 delete mode 100644 fortran/src/H5f.c delete mode 100644 fortran/src/H5ff.f90 diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c new file mode 100644 index 0000000..dbd5a80 --- /dev/null +++ b/fortran/src/H5_f.c @@ -0,0 +1,344 @@ +#include "H5f90.h" + +/*--------------------------------------------------------------------------- + * Name: h5init_types_c + * Purpose: 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 + * 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 + * integertypes - array with the predefined Integer Fortran + * type, its element and length must be the + * same as the integertypes array defined in the + * H5f90global.f90 + * Outputs: None + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Tuesday, August 3, 1999 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes ) +{ + + int ret_value = -1; + hid_t c_type_id; + if ((types[0] = (hid_t_f)H5Tcopy(H5T_NATIVE_INT)) < 0) return ret_value; +#if defined(_UNICOS) + if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value; +#else + if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value; +#endif + if ((types[2] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value; +/* + if ((types[3] = H5Tcopy(H5T_NATIVE_UINT8)) < 0) return ret_value; +*/ + if ((c_type_id = H5Tcopy(H5T_FORTRAN_S1)) < 0) return ret_value; + if(H5Tset_size(c_type_id, 1) < 0) return ret_value; + if(H5Tset_strpad(c_type_id, H5T_STR_SPACEPAD) < 0) return ret_value; + types[3] = (hid_t_f)c_type_id; + + + +/* + if ((types[3] = H5Tcopy(H5T_C_S1)) < 0) return ret_value; + if(H5Tset_strpad(types[3],H5T_STR_NULLTERM) < 0) return ret_value; + if(H5Tset_size(types[3],1) < 0) return ret_value; +*/ + + +/* if ((types[3] = H5Tcopy(H5T_STD_I8BE)) < 0) return ret_value; +*/ + if ((types[4] = (hid_t_f)H5Tcopy(H5T_STD_REF_OBJ)) < 0) return ret_value; + if ((types[5] = (hid_t_f)H5Tcopy(H5T_STD_REF_DSETREG)) < 0) return ret_value; + + if ((floatingtypes[0] = (hid_t_f)H5Tcopy(H5T_IEEE_F32BE)) < 0) return ret_value; + if ((floatingtypes[1] = (hid_t_f)H5Tcopy(H5T_IEEE_F32LE)) < 0) return ret_value; + if ((floatingtypes[2] = (hid_t_f)H5Tcopy(H5T_IEEE_F64BE)) < 0) return ret_value; + if ((floatingtypes[3] = (hid_t_f)H5Tcopy(H5T_IEEE_F64LE)) < 0) return ret_value; + + if ((integertypes[0] = (hid_t_f)H5Tcopy(H5T_STD_I8BE)) < 0) return ret_value; + if ((integertypes[1] = (hid_t_f)H5Tcopy(H5T_STD_I8LE)) < 0) return ret_value; + if ((integertypes[2] = (hid_t_f)H5Tcopy(H5T_STD_I16BE)) < 0) return ret_value; + if ((integertypes[3] = (hid_t_f)H5Tcopy(H5T_STD_I16LE)) < 0) return ret_value; + if ((integertypes[4] = (hid_t_f)H5Tcopy(H5T_STD_I32BE)) < 0) return ret_value; + if ((integertypes[5] = (hid_t_f)H5Tcopy(H5T_STD_I32LE)) < 0) return ret_value; + if ((integertypes[6] = (hid_t_f)H5Tcopy(H5T_STD_I64BE)) < 0) return ret_value; + if ((integertypes[7] = (hid_t_f)H5Tcopy(H5T_STD_I64LE)) < 0) return ret_value; + if ((integertypes[8] = (hid_t_f)H5Tcopy(H5T_STD_U8BE)) < 0) return ret_value; + if ((integertypes[9] = (hid_t_f)H5Tcopy(H5T_STD_U8LE)) < 0) return ret_value; + if ((integertypes[10] = (hid_t_f)H5Tcopy(H5T_STD_U16BE)) < 0) return ret_value; + if ((integertypes[11] = (hid_t_f)H5Tcopy(H5T_STD_U16LE)) < 0) return ret_value; + if ((integertypes[12] = (hid_t_f)H5Tcopy(H5T_STD_U32BE)) < 0) return ret_value; + if ((integertypes[13] = (hid_t_f)H5Tcopy(H5T_STD_U32LE)) < 0) return ret_value; + if ((integertypes[14] = (hid_t_f)H5Tcopy(H5T_STD_U64BE)) < 0) return ret_value; + if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value; + + ret_value = 0; + return ret_value; +} + +/*--------------------------------------------------------------------------- + * Name: h5close_types_c + * Purpose: Closes predefined datatype 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 + * H5f90global.f90 + * lentypes - length of the types array, which must be the + * same as the length of 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 + * floatinglen - length of the floatingtypes array, which must be the + * same as the length of 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 + * H5f90global.f90 + * integerlen - length of the floatingtypes array, which must be the + * same as the length of floatingtypes array defined + * in the H5f90global.f90 + * Outputs: None + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Tuesday, August 3, 1999 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5close_types_c( hid_t_f * types, int_f *lentypes, + hid_t_f * floatingtypes, int_f* floatinglen, + hid_t_f * integertypes, int_f * integerlen ) +{ + + int ret_value = -1; + hid_t c_type_id; + herr_t err; + int i; + for (i = 0; i < *lentypes; i++) { + c_type_id = types[i]; + if ( (err = H5Tclose(c_type_id)) < 0) return ret_value; + } + for (i = 0; i < *floatinglen; i++) { + c_type_id = floatingtypes[i]; + if ( (err = H5Tclose(c_type_id)) < 0) return ret_value; + } + for (i = 0; i < *integerlen; i++) { + c_type_id = integertypes[i]; + if ( (err = H5Tclose(c_type_id)) < 0) return ret_value; + } + ret_value = 0; + return ret_value; +} +/*--------------------------------------------------------------------------- + * Name: h5init_flags_c + * Purpose: Initialize Fortran flags + * Inputs: h5d_flags - H5D inteface flags + * h5e_flags - H5E interface flags + * h5f_flags - H5F interface flags + * h5fd_flags - H5FD interface flags + * h5g_flags - H5G interface flags + * h5i_flags - H5I interface flags + * h5p_flags - H5P interface flags + * h5r_flags - H5R interface flags + * h5s_flags - H5S interface flags + * h5t_flags - H5T interface flags + * Outputs: None + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Tuesday, August 3, 1999 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags, + int_f *h5fd_flags, int_f *h5g_flags, int_f *h5i_flags, + int_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags, + int_f *h5t_flags) +{ + int ret_value = -1; +/* + * H5D flags + */ + h5d_flags[0] = H5D_COMPACT; + h5d_flags[1] = H5D_CONTIGUOUS; + h5d_flags[2] = H5D_CHUNKED; + +/* + * H5E flags + */ + + h5e_flags[0] = H5E_NONE_MAJOR; + h5e_flags[1] = H5E_ARGS; + h5e_flags[2] = H5E_RESOURCE; + h5e_flags[3] = H5E_INTERNAL; + h5e_flags[4] = H5E_FILE; + h5e_flags[5] = H5E_IO; + h5e_flags[6] = H5E_FUNC; + h5e_flags[7] = H5E_ATOM; + h5e_flags[8] = H5E_CACHE; + h5e_flags[9] = H5E_BTREE; + h5e_flags[10] = H5E_SYM; + h5e_flags[11] = H5E_HEAP; + h5e_flags[12] = H5E_OHDR; + h5e_flags[13] = H5E_DATATYPE; + h5e_flags[14] = H5E_DATASPACE; + h5e_flags[15] = H5E_DATASET; + h5e_flags[16] = H5E_STORAGE; + h5e_flags[17] = H5E_PLIST; + h5e_flags[18] = H5E_ATTR; + h5e_flags[19] = H5E_PLINE; + h5e_flags[20] = H5E_EFL; + h5e_flags[21] = H5E_REFERENCE; + h5e_flags[22] = H5E_VFL; + h5e_flags[23] = H5E_TBBT; + +/* + * H5F flags + */ + h5f_flags[0] = (int_f)H5F_ACC_RDWR; + h5f_flags[1] = (int_f)H5F_ACC_RDONLY; + h5f_flags[2] = (int_f)H5F_ACC_TRUNC; + h5f_flags[3] = (int_f)H5F_ACC_EXCL; + h5f_flags[4] = (int_f)H5F_ACC_DEBUG; + h5f_flags[5] = (int_f)H5F_SCOPE_LOCAL; + h5f_flags[6] = (int_f)H5F_SCOPE_GLOBAL; + +/* + * H5FD flags + */ + h5fd_flags[0] = H5FD_MPIO_INDEPENDENT; + h5fd_flags[1] = H5FD_MPIO_COLLECTIVE; + +/* + * H5G flags + */ + + h5g_flags[0] = H5G_UNKNOWN; + h5g_flags[1] = H5G_LINK; + h5g_flags[2] = H5G_GROUP; + h5g_flags[3] = H5G_DATASET; + h5g_flags[4] = H5G_TYPE; + h5g_flags[5] = H5G_LINK_ERROR; + h5g_flags[6] = H5G_LINK_HARD; + h5g_flags[7] = H5G_LINK_SOFT; + +/* + * H5I flags + */ + + h5i_flags[0] = H5I_FILE; + h5i_flags[1] = H5I_GROUP; + h5i_flags[2] = H5I_DATATYPE; + h5i_flags[3] = H5I_DATASPACE; + h5i_flags[4] = H5I_DATASET; + h5i_flags[5] = H5I_ATTR; + h5i_flags[6] = H5I_BADID; + +/* + * H5P flags + */ + + h5p_flags[0] = H5P_FILE_CREATE; + h5p_flags[1] = H5P_FILE_ACCESS; + h5p_flags[2] = H5P_DATASET_CREATE; + h5p_flags[3] = H5P_DATASET_XFER; + h5p_flags[4] = H5P_MOUNT; + h5p_flags[5] = H5P_DEFAULT; + +/* + * H5R flags + */ + + h5r_flags[0] = H5R_OBJECT; + h5r_flags[1] = H5R_DATASET_REGION; + +/* + * H5S flags + */ + + + h5s_flags[0] = H5S_SCALAR; + h5s_flags[1] = H5S_SIMPLE; + h5s_flags[2] = H5S_SELECT_SET; + h5s_flags[3] = H5S_SELECT_OR; + h5s_flags[4] = H5S_UNLIMITED; + h5s_flags[5] = H5S_ALL; + +/* + * H5T flags + */ + + + h5t_flags[0] = H5T_NO_CLASS; + h5t_flags[1] = H5T_INTEGER; + h5t_flags[2] = H5T_FLOAT; + h5t_flags[3] = H5T_TIME; + h5t_flags[4] = H5T_STRING; + h5t_flags[5] = H5T_BITFIELD; + h5t_flags[6] = H5T_OPAQUE; + h5t_flags[7] = H5T_COMPOUND; + h5t_flags[8] = H5T_REFERENCE; + h5t_flags[9] = H5T_ENUM; + h5t_flags[10] = H5T_ORDER_LE; + h5t_flags[11] = H5T_ORDER_BE; + h5t_flags[12] = H5T_ORDER_VAX; + h5t_flags[13] = H5T_PAD_ZERO; + h5t_flags[14] = H5T_PAD_ONE; + h5t_flags[15] = H5T_PAD_BACKGROUND; + h5t_flags[16] = H5T_PAD_ERROR; + h5t_flags[17] = H5T_SGN_NONE; + h5t_flags[18] = H5T_SGN_2; + h5t_flags[19] = H5T_SGN_ERROR; + h5t_flags[20] = H5T_NORM_IMPLIED; + h5t_flags[21] = H5T_NORM_MSBSET; + h5t_flags[22] = H5T_NORM_NONE; + h5t_flags[23] = H5T_CSET_ASCII; + h5t_flags[24] = H5T_STR_NULLTERM; + h5t_flags[25] = H5T_STR_NULLPAD; + h5t_flags[26] = H5T_STR_SPACEPAD; + h5t_flags[27] = H5T_STR_ERROR; + + ret_value = 0; + return ret_value; +} +/*--------------------------------------------------------------------------- + * Name: h5open_c + * Purpose: Calls H5open call to initialize C HDF5 library + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Friday, November 17, 2000 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5open_c() +{ + + int ret_value = -1; + if (H5open() < 0) return ret_value; + ret_value = 0; + return ret_value; +} +/*--------------------------------------------------------------------------- + * Name: h5close_c + * Purpose: Calls H5close call to close C HDF5 library + * Returns: 0 on success, -1 on failure + * Programmer: Elena Pourmal + * Friday, November 17, 2000 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5close_c() +{ + + int ret_value = -1; + if (H5close() < 0) return ret_value; + ret_value = 0; + return ret_value; +} diff --git a/fortran/src/H5_ff.f90 b/fortran/src/H5_ff.f90 new file mode 100644 index 0000000..642bf40 --- /dev/null +++ b/fortran/src/H5_ff.f90 @@ -0,0 +1,161 @@ + +!---------------------------------------------------------------------- +! Name: h5open_f +! +! Purpose: Initializes the HDF5 library and Fortran90 interface. +! +! Inputs: +! Outputs: +! error: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! Comment: +!---------------------------------------------------------------------- + SUBROUTINE h5open_f(error) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5open_f +!DEC$endif +! + USE H5GLOBAL + + IMPLICIT NONE + INTEGER, INTENT(OUT) :: error + INTEGER :: error_0, error_1, error_2 +! INTEGER, EXTERNAL :: h5init_types_c +! INTEGER, EXTERNAL :: h5init_flags_c +! INTEGER, EXTERNAL :: h5open_c + +! +! MS FORTRAN needs explicit interfaces for C functions called here. +! + INTERFACE + INTEGER FUNCTION h5open_c() + !MS$ATTRIBUTES C,reference,alias:'_H5OPEN_C'::h5open_c + END FUNCTION h5open_c + END INTERFACE + INTERFACE + INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) + USE H5GLOBAL + INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: i_types + !MS$ATTRIBUTES C,reference,alias:'_H5INIT_TYPES_C'::h5init_types_c + END FUNCTION h5init_types_c + END INTERFACE + INTERFACE + INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & + i_H5E_flags, & + i_H5F_flags, & + i_H5FD_flags, & + i_H5G_flags, & + i_H5I_flags, & + i_H5P_flags, & + i_H5R_flags, & + i_H5S_flags, & + i_H5T_flags ) + USE H5GLOBAL + INTEGER i_H5F_flags(H5F_FLAGS_LEN) + INTEGER i_H5G_flags(H5G_FLAGS_LEN) + INTEGER i_H5D_flags(H5D_FLAGS_LEN) + INTEGER i_H5FD_flags(H5FD_FLAGS_LEN) + INTEGER i_H5E_flags(H5E_FLAGS_LEN) + INTEGER i_H5I_flags(H5I_FLAGS_LEN) + INTEGER i_H5P_flags(H5P_FLAGS_LEN) + INTEGER i_H5R_flags(H5R_FLAGS_LEN) + INTEGER i_H5S_flags(H5S_FLAGS_LEN) + INTEGER i_H5T_flags(H5T_FLAGS_LEN) + + !MS$ATTRIBUTES C,reference,alias:'_H5INIT_FLAGS_C'::h5init_flags_c + END FUNCTION h5init_flags_c + END INTERFACE + error_0 = h5open_c() + error_1 = h5init_types_c(predef_types, floating_types, integer_types) + error_2 = h5init_flags_c(H5D_flags, & + H5E_flags, & + H5F_flags, & + H5FD_flags, & + H5G_flags, & + H5I_flags, & + H5P_flags, & + H5R_flags, & + H5S_flags, & + H5T_flags ) + error = error_0 + error_1 + error_2 + + END SUBROUTINE h5open_f + +!---------------------------------------------------------------------- +! Name: h5close_f +! +! Purpose: Closes the HDF5 library and Fortran90 interface. +! +! Inputs: +! Outputs: +! error: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! NONE +! +! Programmer: Elena Pourmal +! August 12, 1999 +! +! Modifications: Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! Comment: +!---------------------------------------------------------------------- + + SUBROUTINE h5close_f(error) +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5close_f +!DEC$endif +! + USE H5GLOBAL + + IMPLICIT NONE + INTEGER :: error_1, error_2 + INTEGER, INTENT(OUT) :: error +! INTEGER, EXTERNAL :: h5close_types_c, h5close_c + INTERFACE + INTEGER FUNCTION h5close_c() + !MS$ATTRIBUTES C,reference,alias:'_H5CLOSE_C'::h5close_c + END FUNCTION h5close_c + END INTERFACE + INTERFACE + INTEGER FUNCTION h5close_types_c(p_types, P_TYPES_LEN, & + f_types, F_TYPES_LEN, & + i_types, I_TYPES_LEN ) + USE H5GLOBAL + INTEGER P_TYPES_LEN + INTEGER F_TYPES_LEN + INTEGER I_TYPES_LEN + INTEGER(HID_T), DIMENSION(P_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(F_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types + !MS$ATTRIBUTES C,reference,alias:'_H5CLOSE_TYPES_C'::h5close_types_c + END FUNCTION h5close_types_c + END INTERFACE + error_1 = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & + floating_types, FLOATING_TYPES_LEN, & + integer_types, INTEGER_TYPES_LEN ) + error_2 = h5close_c() + error = error_1 + error_2 + + END SUBROUTINE h5close_f + diff --git a/fortran/src/H5f.c b/fortran/src/H5f.c deleted file mode 100644 index dbd5a80..0000000 --- a/fortran/src/H5f.c +++ /dev/null @@ -1,344 +0,0 @@ -#include "H5f90.h" - -/*--------------------------------------------------------------------------- - * Name: h5init_types_c - * Purpose: 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 - * 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 - * integertypes - array with the predefined Integer Fortran - * type, its element and length must be the - * same as the integertypes array defined in the - * H5f90global.f90 - * Outputs: None - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Tuesday, August 3, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes ) -{ - - int ret_value = -1; - hid_t c_type_id; - if ((types[0] = (hid_t_f)H5Tcopy(H5T_NATIVE_INT)) < 0) return ret_value; -#if defined(_UNICOS) - if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value; -#else - if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value; -#endif - if ((types[2] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value; -/* - if ((types[3] = H5Tcopy(H5T_NATIVE_UINT8)) < 0) return ret_value; -*/ - if ((c_type_id = H5Tcopy(H5T_FORTRAN_S1)) < 0) return ret_value; - if(H5Tset_size(c_type_id, 1) < 0) return ret_value; - if(H5Tset_strpad(c_type_id, H5T_STR_SPACEPAD) < 0) return ret_value; - types[3] = (hid_t_f)c_type_id; - - - -/* - if ((types[3] = H5Tcopy(H5T_C_S1)) < 0) return ret_value; - if(H5Tset_strpad(types[3],H5T_STR_NULLTERM) < 0) return ret_value; - if(H5Tset_size(types[3],1) < 0) return ret_value; -*/ - - -/* if ((types[3] = H5Tcopy(H5T_STD_I8BE)) < 0) return ret_value; -*/ - if ((types[4] = (hid_t_f)H5Tcopy(H5T_STD_REF_OBJ)) < 0) return ret_value; - if ((types[5] = (hid_t_f)H5Tcopy(H5T_STD_REF_DSETREG)) < 0) return ret_value; - - if ((floatingtypes[0] = (hid_t_f)H5Tcopy(H5T_IEEE_F32BE)) < 0) return ret_value; - if ((floatingtypes[1] = (hid_t_f)H5Tcopy(H5T_IEEE_F32LE)) < 0) return ret_value; - if ((floatingtypes[2] = (hid_t_f)H5Tcopy(H5T_IEEE_F64BE)) < 0) return ret_value; - if ((floatingtypes[3] = (hid_t_f)H5Tcopy(H5T_IEEE_F64LE)) < 0) return ret_value; - - if ((integertypes[0] = (hid_t_f)H5Tcopy(H5T_STD_I8BE)) < 0) return ret_value; - if ((integertypes[1] = (hid_t_f)H5Tcopy(H5T_STD_I8LE)) < 0) return ret_value; - if ((integertypes[2] = (hid_t_f)H5Tcopy(H5T_STD_I16BE)) < 0) return ret_value; - if ((integertypes[3] = (hid_t_f)H5Tcopy(H5T_STD_I16LE)) < 0) return ret_value; - if ((integertypes[4] = (hid_t_f)H5Tcopy(H5T_STD_I32BE)) < 0) return ret_value; - if ((integertypes[5] = (hid_t_f)H5Tcopy(H5T_STD_I32LE)) < 0) return ret_value; - if ((integertypes[6] = (hid_t_f)H5Tcopy(H5T_STD_I64BE)) < 0) return ret_value; - if ((integertypes[7] = (hid_t_f)H5Tcopy(H5T_STD_I64LE)) < 0) return ret_value; - if ((integertypes[8] = (hid_t_f)H5Tcopy(H5T_STD_U8BE)) < 0) return ret_value; - if ((integertypes[9] = (hid_t_f)H5Tcopy(H5T_STD_U8LE)) < 0) return ret_value; - if ((integertypes[10] = (hid_t_f)H5Tcopy(H5T_STD_U16BE)) < 0) return ret_value; - if ((integertypes[11] = (hid_t_f)H5Tcopy(H5T_STD_U16LE)) < 0) return ret_value; - if ((integertypes[12] = (hid_t_f)H5Tcopy(H5T_STD_U32BE)) < 0) return ret_value; - if ((integertypes[13] = (hid_t_f)H5Tcopy(H5T_STD_U32LE)) < 0) return ret_value; - if ((integertypes[14] = (hid_t_f)H5Tcopy(H5T_STD_U64BE)) < 0) return ret_value; - if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value; - - ret_value = 0; - return ret_value; -} - -/*--------------------------------------------------------------------------- - * Name: h5close_types_c - * Purpose: Closes predefined datatype 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 - * H5f90global.f90 - * lentypes - length of the types array, which must be the - * same as the length of 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 - * floatinglen - length of the floatingtypes array, which must be the - * same as the length of 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 - * H5f90global.f90 - * integerlen - length of the floatingtypes array, which must be the - * same as the length of floatingtypes array defined - * in the H5f90global.f90 - * Outputs: None - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Tuesday, August 3, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5close_types_c( hid_t_f * types, int_f *lentypes, - hid_t_f * floatingtypes, int_f* floatinglen, - hid_t_f * integertypes, int_f * integerlen ) -{ - - int ret_value = -1; - hid_t c_type_id; - herr_t err; - int i; - for (i = 0; i < *lentypes; i++) { - c_type_id = types[i]; - if ( (err = H5Tclose(c_type_id)) < 0) return ret_value; - } - for (i = 0; i < *floatinglen; i++) { - c_type_id = floatingtypes[i]; - if ( (err = H5Tclose(c_type_id)) < 0) return ret_value; - } - for (i = 0; i < *integerlen; i++) { - c_type_id = integertypes[i]; - if ( (err = H5Tclose(c_type_id)) < 0) return ret_value; - } - ret_value = 0; - return ret_value; -} -/*--------------------------------------------------------------------------- - * Name: h5init_flags_c - * Purpose: Initialize Fortran flags - * Inputs: h5d_flags - H5D inteface flags - * h5e_flags - H5E interface flags - * h5f_flags - H5F interface flags - * h5fd_flags - H5FD interface flags - * h5g_flags - H5G interface flags - * h5i_flags - H5I interface flags - * h5p_flags - H5P interface flags - * h5r_flags - H5R interface flags - * h5s_flags - H5S interface flags - * h5t_flags - H5T interface flags - * Outputs: None - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Tuesday, August 3, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags, - int_f *h5fd_flags, int_f *h5g_flags, int_f *h5i_flags, - int_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags, - int_f *h5t_flags) -{ - int ret_value = -1; -/* - * H5D flags - */ - h5d_flags[0] = H5D_COMPACT; - h5d_flags[1] = H5D_CONTIGUOUS; - h5d_flags[2] = H5D_CHUNKED; - -/* - * H5E flags - */ - - h5e_flags[0] = H5E_NONE_MAJOR; - h5e_flags[1] = H5E_ARGS; - h5e_flags[2] = H5E_RESOURCE; - h5e_flags[3] = H5E_INTERNAL; - h5e_flags[4] = H5E_FILE; - h5e_flags[5] = H5E_IO; - h5e_flags[6] = H5E_FUNC; - h5e_flags[7] = H5E_ATOM; - h5e_flags[8] = H5E_CACHE; - h5e_flags[9] = H5E_BTREE; - h5e_flags[10] = H5E_SYM; - h5e_flags[11] = H5E_HEAP; - h5e_flags[12] = H5E_OHDR; - h5e_flags[13] = H5E_DATATYPE; - h5e_flags[14] = H5E_DATASPACE; - h5e_flags[15] = H5E_DATASET; - h5e_flags[16] = H5E_STORAGE; - h5e_flags[17] = H5E_PLIST; - h5e_flags[18] = H5E_ATTR; - h5e_flags[19] = H5E_PLINE; - h5e_flags[20] = H5E_EFL; - h5e_flags[21] = H5E_REFERENCE; - h5e_flags[22] = H5E_VFL; - h5e_flags[23] = H5E_TBBT; - -/* - * H5F flags - */ - h5f_flags[0] = (int_f)H5F_ACC_RDWR; - h5f_flags[1] = (int_f)H5F_ACC_RDONLY; - h5f_flags[2] = (int_f)H5F_ACC_TRUNC; - h5f_flags[3] = (int_f)H5F_ACC_EXCL; - h5f_flags[4] = (int_f)H5F_ACC_DEBUG; - h5f_flags[5] = (int_f)H5F_SCOPE_LOCAL; - h5f_flags[6] = (int_f)H5F_SCOPE_GLOBAL; - -/* - * H5FD flags - */ - h5fd_flags[0] = H5FD_MPIO_INDEPENDENT; - h5fd_flags[1] = H5FD_MPIO_COLLECTIVE; - -/* - * H5G flags - */ - - h5g_flags[0] = H5G_UNKNOWN; - h5g_flags[1] = H5G_LINK; - h5g_flags[2] = H5G_GROUP; - h5g_flags[3] = H5G_DATASET; - h5g_flags[4] = H5G_TYPE; - h5g_flags[5] = H5G_LINK_ERROR; - h5g_flags[6] = H5G_LINK_HARD; - h5g_flags[7] = H5G_LINK_SOFT; - -/* - * H5I flags - */ - - h5i_flags[0] = H5I_FILE; - h5i_flags[1] = H5I_GROUP; - h5i_flags[2] = H5I_DATATYPE; - h5i_flags[3] = H5I_DATASPACE; - h5i_flags[4] = H5I_DATASET; - h5i_flags[5] = H5I_ATTR; - h5i_flags[6] = H5I_BADID; - -/* - * H5P flags - */ - - h5p_flags[0] = H5P_FILE_CREATE; - h5p_flags[1] = H5P_FILE_ACCESS; - h5p_flags[2] = H5P_DATASET_CREATE; - h5p_flags[3] = H5P_DATASET_XFER; - h5p_flags[4] = H5P_MOUNT; - h5p_flags[5] = H5P_DEFAULT; - -/* - * H5R flags - */ - - h5r_flags[0] = H5R_OBJECT; - h5r_flags[1] = H5R_DATASET_REGION; - -/* - * H5S flags - */ - - - h5s_flags[0] = H5S_SCALAR; - h5s_flags[1] = H5S_SIMPLE; - h5s_flags[2] = H5S_SELECT_SET; - h5s_flags[3] = H5S_SELECT_OR; - h5s_flags[4] = H5S_UNLIMITED; - h5s_flags[5] = H5S_ALL; - -/* - * H5T flags - */ - - - h5t_flags[0] = H5T_NO_CLASS; - h5t_flags[1] = H5T_INTEGER; - h5t_flags[2] = H5T_FLOAT; - h5t_flags[3] = H5T_TIME; - h5t_flags[4] = H5T_STRING; - h5t_flags[5] = H5T_BITFIELD; - h5t_flags[6] = H5T_OPAQUE; - h5t_flags[7] = H5T_COMPOUND; - h5t_flags[8] = H5T_REFERENCE; - h5t_flags[9] = H5T_ENUM; - h5t_flags[10] = H5T_ORDER_LE; - h5t_flags[11] = H5T_ORDER_BE; - h5t_flags[12] = H5T_ORDER_VAX; - h5t_flags[13] = H5T_PAD_ZERO; - h5t_flags[14] = H5T_PAD_ONE; - h5t_flags[15] = H5T_PAD_BACKGROUND; - h5t_flags[16] = H5T_PAD_ERROR; - h5t_flags[17] = H5T_SGN_NONE; - h5t_flags[18] = H5T_SGN_2; - h5t_flags[19] = H5T_SGN_ERROR; - h5t_flags[20] = H5T_NORM_IMPLIED; - h5t_flags[21] = H5T_NORM_MSBSET; - h5t_flags[22] = H5T_NORM_NONE; - h5t_flags[23] = H5T_CSET_ASCII; - h5t_flags[24] = H5T_STR_NULLTERM; - h5t_flags[25] = H5T_STR_NULLPAD; - h5t_flags[26] = H5T_STR_SPACEPAD; - h5t_flags[27] = H5T_STR_ERROR; - - ret_value = 0; - return ret_value; -} -/*--------------------------------------------------------------------------- - * Name: h5open_c - * Purpose: Calls H5open call to initialize C HDF5 library - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Friday, November 17, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5open_c() -{ - - int ret_value = -1; - if (H5open() < 0) return ret_value; - ret_value = 0; - return ret_value; -} -/*--------------------------------------------------------------------------- - * Name: h5close_c - * Purpose: Calls H5close call to close C HDF5 library - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Friday, November 17, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5close_c() -{ - - int ret_value = -1; - if (H5close() < 0) return ret_value; - ret_value = 0; - return ret_value; -} diff --git a/fortran/src/H5ff.f90 b/fortran/src/H5ff.f90 deleted file mode 100644 index f9b6a22..0000000 --- a/fortran/src/H5ff.f90 +++ /dev/null @@ -1,149 +0,0 @@ - -!---------------------------------------------------------------------- -! Name: h5open_f -! -! Purpose: Initializes the HDF5 library and Fortran90 interface. -! -! Inputs: -! Outputs: -! error: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5open_f(error) - USE H5GLOBAL - - IMPLICIT NONE - INTEGER, INTENT(OUT) :: error - INTEGER :: error_0, error_1, error_2 -! INTEGER, EXTERNAL :: h5init_types_c -! INTEGER, EXTERNAL :: h5init_flags_c -! INTEGER, EXTERNAL :: h5open_c - -! -! MS FORTRAN needs explicit interfaces for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5open_c() - !MS$ATTRIBUTES C,reference,alias:'_H5OPEN_C'::h5open_c - END FUNCTION h5open_c - END INTERFACE - INTERFACE - INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) - USE H5GLOBAL - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: i_types - !MS$ATTRIBUTES C,reference,alias:'_H5INIT_TYPES_C'::h5init_types_c - END FUNCTION h5init_types_c - END INTERFACE - INTERFACE - INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & - i_H5E_flags, & - i_H5F_flags, & - i_H5FD_flags, & - i_H5G_flags, & - i_H5I_flags, & - i_H5P_flags, & - i_H5R_flags, & - i_H5S_flags, & - i_H5T_flags ) - USE H5GLOBAL - INTEGER i_H5F_flags(H5F_FLAGS_LEN) - INTEGER i_H5G_flags(H5G_FLAGS_LEN) - INTEGER i_H5D_flags(H5D_FLAGS_LEN) - INTEGER i_H5FD_flags(H5FD_FLAGS_LEN) - INTEGER i_H5E_flags(H5E_FLAGS_LEN) - INTEGER i_H5I_flags(H5I_FLAGS_LEN) - INTEGER i_H5P_flags(H5P_FLAGS_LEN) - INTEGER i_H5R_flags(H5R_FLAGS_LEN) - INTEGER i_H5S_flags(H5S_FLAGS_LEN) - INTEGER i_H5T_flags(H5T_FLAGS_LEN) - - !MS$ATTRIBUTES C,reference,alias:'_H5INIT_FLAGS_C'::h5init_flags_c - END FUNCTION h5init_flags_c - END INTERFACE - error_0 = h5open_c() - error_1 = h5init_types_c(predef_types, floating_types, integer_types) - error_2 = h5init_flags_c(H5D_flags, & - H5E_flags, & - H5F_flags, & - H5FD_flags, & - H5G_flags, & - H5I_flags, & - H5P_flags, & - H5R_flags, & - H5S_flags, & - H5T_flags ) - error = error_0 + error_1 + error_2 - - END SUBROUTINE h5open_f - -!---------------------------------------------------------------------- -! Name: h5close_f -! -! Purpose: Closes the HDF5 library and Fortran90 interface. -! -! Inputs: -! Outputs: -! error: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5close_f(error) - USE H5GLOBAL - - IMPLICIT NONE - INTEGER :: error_1, error_2 - INTEGER, INTENT(OUT) :: error -! INTEGER, EXTERNAL :: h5close_types_c, h5close_c - INTERFACE - INTEGER FUNCTION h5close_c() - !MS$ATTRIBUTES C,reference,alias:'_H5CLOSE_C'::h5close_c - END FUNCTION h5close_c - END INTERFACE - INTERFACE - INTEGER FUNCTION h5close_types_c(p_types, P_TYPES_LEN, & - f_types, F_TYPES_LEN, & - i_types, I_TYPES_LEN ) - USE H5GLOBAL - INTEGER P_TYPES_LEN - INTEGER F_TYPES_LEN - INTEGER I_TYPES_LEN - INTEGER(HID_T), DIMENSION(P_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(F_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types - !MS$ATTRIBUTES C,reference,alias:'_H5CLOSE_TYPES_C'::h5close_types_c - END FUNCTION h5close_types_c - END INTERFACE - error_1 = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & - floating_types, FLOATING_TYPES_LEN, & - integer_types, INTEGER_TYPES_LEN ) - error_2 = h5close_c() - error = error_1 + error_2 - - END SUBROUTINE h5close_f - diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index e37cd08..810c00f 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -27,11 +27,11 @@ ADD_PARALLEL_FILES=@ADD_PARALLEL_FILES@ FPAR_MOD=${ADD_PARALLEL_FILES:yes=HDF5mpio.f90} CPARALLEL=${ADD_PARALLEL_FILES:yes=H5FDmpiof.c} -CLIB_SRC=H5f90kit.c H5f.c H5Git.c H5Rf.c H5Ff.c H5Sf.c H5Df.c H5Gf.c \ +CLIB_SRC=H5f90kit.c H5_f.c H5Git.c H5Rf.c H5Ff.c H5Sf.c H5Df.c H5Gf.c \ H5Af.c H5Tf.c H5Pf.c H5If.c H5Ef.c ${CPARALLEL:no=} FPARALLEL=${ADD_PARALLEL_FILES:yes=H5FDmpioff.f90} -FLIB_SRC=H5fortran_types.f90 H5fortran_flags.f90 H5f90global.f90 H5ff.f90 \ +FLIB_SRC=H5fortran_types.f90 H5fortran_flags.f90 H5f90global.f90 H5_ff.f90 \ H5Rff.f90 H5Fff.f90 H5Sff.f90 H5Dff.f90 H5Gff.f90 H5Aff.f90 H5Tff.f90 \ H5Pff.f90 H5Iff.f90 H5Eff.f90 ${FPARALLEL:no=} ${FPAR_MOD:no=HDF5.f90} -- cgit v0.12