diff options
author | Elena Pourmal <epourmal@hdfgroup.org> | 2000-11-03 19:45:50 (GMT) |
---|---|---|
committer | Elena Pourmal <epourmal@hdfgroup.org> | 2000-11-03 19:45:50 (GMT) |
commit | 46f49b84cf37d98fc68d582c857f98345f2e5835 (patch) | |
tree | 05496d12e49b67f871814f3c11f4f69b18d5b419 | |
parent | 0556db98e281f377b54e7e918bc296604b490993 (diff) | |
download | hdf5-46f49b84cf37d98fc68d582c857f98345f2e5835.zip hdf5-46f49b84cf37d98fc68d582c857f98345f2e5835.tar.gz hdf5-46f49b84cf37d98fc68d582c857f98345f2e5835.tar.bz2 |
[svn-r2795]
Purpose:
New feature
Description:
Now all Fortran flags such as H5F_ACC_RDONLY_F (previously defined in the
H5fortran_flags.f90 file) are generated at runtime when h5init_fortran_f
subroutine is called. All flags have now the same value as
corresponding C flags. This change affects user's programming model:
Every Fortran program that uses F90 HDF5 Library has to call
h5init_fortran_f(error) subroutine before the first call to the
F90 HDF5 Library and h5close_fortran_f(error) after the last call to the
Library. h5init(close)_types_f calls are not needed anymore since
F90 datatypes are intialized(closed) with the h5init(close)_fortran_f
calls.
Platforms tested:
O2K and Solaris2.7
-rw-r--r-- | fortran/src/Dependencies | 26 | ||||
-rw-r--r-- | fortran/src/H5Af.c | 4 | ||||
-rw-r--r-- | fortran/src/H5Aff.f90 | 3 | ||||
-rw-r--r-- | fortran/src/H5Df.c | 28 | ||||
-rw-r--r-- | fortran/src/H5Dff.f90 | 21 | ||||
-rw-r--r-- | fortran/src/H5Ff.c | 22 | ||||
-rw-r--r-- | fortran/src/H5Fff.f90 | 3 | ||||
-rw-r--r-- | fortran/src/H5Gf.c | 3 | ||||
-rw-r--r-- | fortran/src/H5Pf.c | 11 | ||||
-rw-r--r-- | fortran/src/H5Rff.f90 | 4 | ||||
-rw-r--r-- | fortran/src/H5Sf.c | 16 | ||||
-rw-r--r-- | fortran/src/H5Sff.f90 | 3 | ||||
-rw-r--r-- | fortran/src/H5Tf.c | 13 | ||||
-rw-r--r-- | fortran/src/H5f90.h | 72 | ||||
-rw-r--r-- | fortran/src/H5f90global.f90 | 330 | ||||
-rw-r--r-- | fortran/src/H5f90misc.c | 167 | ||||
-rw-r--r-- | fortran/src/H5f90miscf.f90 | 23 | ||||
-rw-r--r-- | fortran/src/H5f90proto.h | 8 | ||||
-rw-r--r-- | fortran/src/H5fortran_flags.f90 | 137 |
19 files changed, 609 insertions, 285 deletions
diff --git a/fortran/src/Dependencies b/fortran/src/Dependencies index 04df2e9..8bc0e91 100644 --- a/fortran/src/Dependencies +++ b/fortran/src/Dependencies @@ -9,7 +9,7 @@ H5Af.lo: \ H5Aff.lo: \ $(srcdir)/H5Aff.f90 \ H5fortran_types.f90 \ - $(srcdir)/H5fortran_flags.f90 + $(srcdir)/H5f90global.f90 H5Df.lo: \ $(srcdir)/H5Df.c \ $(srcdir)/H5f90.h \ @@ -18,16 +18,16 @@ H5Df.lo: \ H5Dff.lo: \ $(srcdir)/H5Dff.f90 \ H5fortran_types.f90 \ - $(srcdir)/H5fortran_flags.f90 + $(srcdir)/H5f90global.f90 H5Ef.lo: \ $(srcdir)/H5Ef.c \ $(srcdir)/H5f90.h \ $(srcdir)/H5f90i.h \ $(srcdir)/H5f90proto.h H5Eff.lo: \ - $(srcdir)/H5Eff.lo \ - H5fortran_types.f90 \ - $(srcdir)/H5fortran_flags.f90 + $(srcdir)/H5Eff.f90 \ + $(srcdir)/H5fortran_flags.f90\ + $(srcdir)/H5f90global.f90 H5Ff.lo: \ $(srcdir)/H5Ff.c \ $(srcdir)/H5f90.h \ @@ -36,7 +36,7 @@ H5Ff.lo: \ H5Fff.lo: \ $(srcdir)/H5Fff.f90 \ H5fortran_types.f90 \ - $(srcdir)/H5fortran_flags.f90 + $(srcdir)/H5f90global.f90 H5Gf.lo: \ $(srcdir)/H5Gf.c \ $(srcdir)/H5f90.h \ @@ -45,7 +45,7 @@ H5Gf.lo: \ H5Gff.lo: \ $(srcdir)/H5Gff.f90 \ H5fortran_types.f90 \ - $(srcdir)/H5fortran_flags.f90 + $(srcdir)/H5f90global.f90 H5Git.lo: \ $(srcdir)/H5Git.c \ $(srcdir)/H5Git.h @@ -57,7 +57,7 @@ H5If.lo: \ H5Iff.lo: \ $(srcdir)/H5Iff.f90 \ H5fortran_types.f90 \ - $(srcdir)/H5fortran_flags.f90 + $(srcdir)/H5f90global.f90 H5Pf.lo: \ $(srcdir)/H5Pf.c \ $(srcdir)/H5f90.h \ @@ -71,11 +71,11 @@ H5Pf_parallel.lo: \ H5Pff.lo: \ $(srcdir)/H5Pff.f90 \ H5fortran_types.f90 \ - $(srcdir)/H5fortran_flags.f90 + $(srcdir)/H5f90global.f90 H5Pff_parallel.lo: \ $(srcdir)/H5Pff_parallel.f90 \ H5fortran_types.f90 \ - $(srcdir)/H5fortran_flags.f90 + $(srcdir)/H5f90global.f90 H5Rf.lo: \ $(srcdir)/H5Rf.c \ $(srcdir)/H5f90.h \ @@ -84,7 +84,7 @@ H5Rf.lo: \ H5Rff.lo: \ $(srcdir)/H5Rff.f90 \ H5fortran_types.f90 \ - $(srcdir)/H5fortran_flags.f90 + $(srcdir)/H5f90global.f90 H5Sf.lo: \ $(srcdir)/H5Sf.c \ $(srcdir)/H5f90.h \ @@ -93,7 +93,7 @@ H5Sf.lo: \ H5Sff.lo: \ $(srcdir)/H5Sff.f90 \ H5fortran_types.f90 \ - $(srcdir)/H5fortran_flags.f90 + $(srcdir)/H5f90global.f90 H5Tf.lo: \ $(srcdir)/H5Sf.c \ $(srcdir)/H5f90.h \ @@ -102,7 +102,7 @@ H5Tf.lo: \ H5Tff.lo: \ $(srcdir)/H5Tff.f90 \ H5fortran_types.f90 \ - $(srcdir)/H5fortran_flags.f90 + $(srcdir)/H5f90global.f90 H5f90global.lo: \ $(srcdir)/H5f90global.f90 \ H5fortran_types.f90 diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c index ad13910..daa3932 100644 --- a/fortran/src/H5Af.c +++ b/fortran/src/H5Af.c @@ -29,8 +29,10 @@ nh5acreate_c (hid_t_f *obj_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_ /* * Define creation property */ - c_crt_prp = *crt_prp; + c_crt_prp = (hid_t)*crt_prp; +/* if ( H5P_DEFAULT_F == c_crt_prp ) c_crt_prp = H5P_DEFAULT; +*/ /* * Convert FORTRAN name to C name diff --git a/fortran/src/H5Aff.f90 b/fortran/src/H5Aff.f90 index 506048f..e10f445 100644 --- a/fortran/src/H5Aff.f90 +++ b/fortran/src/H5Aff.f90 @@ -3,8 +3,7 @@ ! MODULE H5A - USE H5FORTRAN_TYPES - USE H5FORTRAN_FLAGS + USE H5GLOBAL INTERFACE h5awrite_f diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index d4d70c0..76646fb 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -30,8 +30,10 @@ nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_ /* * Define creation property */ - c_crt_prp = *crt_prp; + c_crt_prp = (hid_t)*crt_prp; +/* if ( H5P_DEFAULT_F == c_crt_prp ) c_crt_prp = H5P_DEFAULT; +*/ /* * Convert FORTRAN name to C name @@ -150,8 +152,10 @@ nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_ /* * Define transfer property */ - c_xfer_prp = *xfer_prp; + c_xfer_prp = (hid_t)*xfer_prp; +/* if ( H5P_DEFAULT_F == c_xfer_prp ) c_xfer_prp = H5P_DEFAULT; +*/ /* * Call H5Dwrite function. @@ -198,8 +202,10 @@ nh5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ /* * Define transfer property */ - c_xfer_prp = *xfer_prp; + c_xfer_prp = (hid_t)*xfer_prp; +/* if ( H5P_DEFAULT_F == c_xfer_prp ) c_xfer_prp = H5P_DEFAULT; +*/ /* * Allocate temporary buffer and copy references from Fortran. @@ -258,8 +264,10 @@ nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ /* * Define transfer property */ - c_xfer_prp = *xfer_prp; + c_xfer_prp = (hid_t)*xfer_prp; +/* if ( H5P_DEFAULT_F == c_xfer_prp ) c_xfer_prp = H5P_DEFAULT; +*/ /* * Allocate temporary buffer and copy references from Fortran. @@ -344,8 +352,10 @@ nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t /* * Define transfer property */ - c_xfer_prp = *xfer_prp; + c_xfer_prp = (hid_t)*xfer_prp; +/* if ( H5P_DEFAULT_F == c_xfer_prp ) c_xfer_prp = H5P_DEFAULT; +*/ /* * Call H5Dread function. @@ -392,8 +402,10 @@ nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i /* * Define transfer property */ - c_xfer_prp = *xfer_prp; + c_xfer_prp = (hid_t)*xfer_prp; +/* if ( H5P_DEFAULT_F == c_xfer_prp ) c_xfer_prp = H5P_DEFAULT; +*/ /* * Allocate temporary buffer. @@ -452,8 +464,10 @@ nh5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i /* * Define transfer property */ - c_xfer_prp = *xfer_prp; + c_xfer_prp = (hid_t)*xfer_prp; +/* if ( H5P_DEFAULT_F == c_xfer_prp ) c_xfer_prp = H5P_DEFAULT; +*/ /* * Allocate temporary buffer. diff --git a/fortran/src/H5Dff.f90 b/fortran/src/H5Dff.f90 index ba9f9a3..f573ea7 100644 --- a/fortran/src/H5Dff.f90 +++ b/fortran/src/H5Dff.f90 @@ -2,8 +2,7 @@ ! This file contains Fortran90 interfaces for H5D functions. ! MODULE H5D - USE H5FORTRAN_TYPES -! USE H5FORTRAN_FLAGS - do not need it here since it is included in H5R already + USE H5GLOBAL USE H5R INTERFACE h5dwrite_f @@ -383,11 +382,14 @@ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default = H5P_DEFAULT_F - INTEGER(HID_T) :: mem_space_id_default = H5S_ALL_F - INTEGER(HID_T) :: file_space_id_default = H5S_ALL_F + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default INTEGER, EXTERNAL :: h5dwrite_c + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F if (present(xfer_prp)) xfer_prp_default = xfer_prp if (present(mem_space_id)) mem_space_id_default = mem_space_id if (present(file_space_id)) file_space_id_default = file_space_id @@ -783,10 +785,13 @@ ! Transfer property list identifier INTEGER, EXTERNAL :: h5dwrite_c - INTEGER(HID_T) :: xfer_prp_default = H5P_DEFAULT_F - INTEGER(HID_T) :: mem_space_id_default = H5S_ALL_F - INTEGER(HID_T) :: file_space_id_default = H5S_ALL_F + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F if (present(xfer_prp)) xfer_prp_default = xfer_prp if (present(mem_space_id)) mem_space_id_default = mem_space_id if (present(file_space_id)) file_space_id_default = file_space_id diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index 9e3d56d..df773c4 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -30,6 +30,8 @@ nh5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f* crt_prp, h /* * Define access flags */ + c_access_flags = (unsigned) *access_flags; +/* CASE = (int)*access_flags; switch (CASE) { @@ -56,19 +58,22 @@ nh5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f* crt_prp, h default: return ret_value; } - +*/ /* * Define creation property */ c_crt_prp = *crt_prp; +/* if ( H5P_DEFAULT_F == c_crt_prp ) c_crt_prp = H5P_DEFAULT; - +*/ /* * Define access property */ c_acc_prp = *acc_prp; +/* if ( H5P_DEFAULT_F == c_acc_prp ) c_acc_prp = H5P_DEFAULT; +*/ /* * Convert FORTRAN name to C name */ @@ -108,10 +113,12 @@ nh5fflush_c (hid_t_f *object_id, int_f *scope) int CASE; H5F_scope_t c_scope; htri_t status; + c_scope = (H5F_scope_t)*scope; /* * Define scope flags */ +/* CASE = (int)*scope; switch (CASE) { @@ -126,7 +133,7 @@ nh5fflush_c (hid_t_f *object_id, int_f *scope) default: return ret_value; } - +*/ /* * Call H5Fflush function. */ @@ -169,7 +176,9 @@ nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, h * Define access property */ c_acc_prp = *acc_prp; +/* if ( H5P_DEFAULT_F == c_acc_prp ) c_acc_prp = H5P_DEFAULT; +*/ c_loc_id = *loc_id; c_file_id = *file_id; @@ -257,10 +266,13 @@ nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hi hid_t c_acc_prp; int CASE; hid_t CASE_prp; + c_acc_prp = (hid_t)*acc_prp; /* * Define access flags */ + c_access_flags = (unsigned) *access_flags; +/* CASE = (int)*access_flags; switch (CASE) { @@ -287,12 +299,14 @@ nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hi default: return ret_value; } - + */ /* * Define access property */ c_acc_prp = *acc_prp; +/* if ( H5P_DEFAULT_F == c_acc_prp ) c_acc_prp = H5P_DEFAULT; +*/ /* * Convert FORTRAN name to C name diff --git a/fortran/src/H5Fff.f90 b/fortran/src/H5Fff.f90 index 817978b..077f4f6 100644 --- a/fortran/src/H5Fff.f90 +++ b/fortran/src/H5Fff.f90 @@ -2,8 +2,7 @@ ! This file contains Fortran90 interfaces for H5F functions. ! MODULE H5F - USE H5FORTRAN_TYPES - USE H5FORTRAN_FLAGS + USE H5GLOBAL CONTAINS diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index 110db73..e86d342 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -139,6 +139,8 @@ nh5gget_obj_info_idx_c HDfree(c_obj_name); return ret_value; } + *obj_type = type; +/* switch (type) { case H5G_LINK: *obj_type = H5G_LINK_F; @@ -158,6 +160,7 @@ nh5gget_obj_info_idx_c default: return ret_value; } +*/ /* * Convert C name to FORTRAN and place it in the given buffer */ diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 77cfaea..ca2e270 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -19,7 +19,9 @@ nh5pcreate_c ( int_f *classtype, hid_t_f *prp_id ) int CASE; int ret_value = 0; hid_t c_prp_id; - CASE = (int)*classtype; + /*CASE = (int)*classtype; */ + c_classtype = (H5P_class_t)*classtype; +/* switch (CASE) { @@ -47,6 +49,7 @@ nh5pcreate_c ( int_f *classtype, hid_t_f *prp_id ) ret_value = -1; return ret_value; } +*/ c_prp_id = H5Pcreate(c_classtype); if ( c_prp_id < 0 ) ret_value = -1; @@ -129,15 +132,19 @@ nh5pget_class_c ( hid_t_f *prp_id , int_f *classtype) c_prp_id = *prp_id; c_classtype = H5Pget_class(c_prp_id); if (c_classtype == H5P_NO_CLASS ) { - *classtype = H5P_NO_CLASS_F; + /* *classtype = H5P_NO_CLASS_F; */ + *classtype = H5P_NO_CLASS; ret_value = -1; return ret_value; } + *classtype = (int_f)c_classtype; +/* if (c_classtype == H5P_FILE_CREATE) *classtype = H5P_FILE_CREATE_F; if (c_classtype == H5P_FILE_ACCESS) *classtype = H5P_FILE_ACCESS_F; if (c_classtype == H5P_DATASET_CREATE) *classtype = H5P_DATASET_CREATE_F; if (c_classtype == H5P_DATASET_XFER) *classtype = H5P_DATASET_XFER_F; if (c_classtype == H5P_MOUNT_F) *classtype = H5P_MOUNT_F; +*/ return ret_value; } diff --git a/fortran/src/H5Rff.f90 b/fortran/src/H5Rff.f90 index b9d373e..860fba3 100644 --- a/fortran/src/H5Rff.f90 +++ b/fortran/src/H5Rff.f90 @@ -2,8 +2,8 @@ ! This file contains Fortran90 interfaces for H5R functions. ! MODULE H5R - USE H5FORTRAN_TYPES - USE H5FORTRAN_FLAGS + USE H5GLOBAL + ! If you change the value of these parameters, do not forget to change corresponding ! values in the H5f90.h file. INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c index af9c4a5..df51ca3 100644 --- a/fortran/src/H5Sf.c +++ b/fortran/src/H5Sf.c @@ -87,8 +87,8 @@ nh5screate_c ( int_f *classtype, hid_t_f *space_id ) int CASE; int ret_value = 0; hid_t c_space_id; - CASE = (int)*classtype; - + c_classtype = (H5S_class_t) *classtype; +/* switch (CASE) { case (H5S_SCALAR_F): @@ -103,6 +103,7 @@ nh5screate_c ( int_f *classtype, hid_t_f *space_id ) ret_value = -1; return ret_value; } +*/ c_space_id = H5Screate(c_classtype); if ( c_space_id < 0 ) ret_value = -1; @@ -531,8 +532,11 @@ nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype) c_space_id = *space_id; c_classtype = H5Sget_simple_extent_type(c_space_id); if ( c_classtype < 0 ) ret_value = -1; + *classtype = c_classtype; +/* if (c_classtype == H5S_SCALAR) *classtype = H5S_SCALAR_F; if (c_classtype == H5S_SIMPLE) *classtype = H5S_SIMPLE_F; +*/ return ret_value; } @@ -809,9 +813,11 @@ nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hssize_t_f *start, hsize c_block[i] = (hsize_t)block[t]; } + c_op = (H5S_seloper_t)*op; +/* if (*op == H5S_SELECT_SET_F) c_op = H5S_SELECT_SET; if (*op == H5S_SELECT_OR_F) c_op = H5S_SELECT_OR; - +*/ c_space_id = *space_id; status = H5Sselect_hyperslab(c_space_id, c_op, c_start, c_stride, c_count, c_block); @@ -850,8 +856,10 @@ nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hss int i, j; hssize_t *c_coord; size_t c_nelements; - +/* if (*op != H5S_SELECT_SET_F) return ret_value; +*/ + if (*op != H5S_SELECT_SET) return ret_value; c_op = H5S_SELECT_SET; c_space_id = *space_id; diff --git a/fortran/src/H5Sff.f90 b/fortran/src/H5Sff.f90 index d4b6b2f..1df0569 100644 --- a/fortran/src/H5Sff.f90 +++ b/fortran/src/H5Sff.f90 @@ -2,8 +2,7 @@ ! This file contains Fortran90 interfaces for H5S functions. ! MODULE H5S - USE H5FORTRAN_TYPES - USE H5FORTRAN_FLAGS + USE H5GLOBAL CONTAINS diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index d097936..e1757f8 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -191,10 +191,13 @@ nh5tget_class_c ( hid_t_f *type_id , int_f *classtype) c_type_id = *type_id; c_classtype = H5Tget_class(c_type_id); if (c_classtype == H5T_NO_CLASS ) { - *classtype = H5T_NO_CLASS_F; + /* *classtype = H5T_NO_CLASS_F; */ + *classtype = (int_f)H5T_NO_CLASS; ret_value = -1; return ret_value; } + *classtype = c_classtype; +/* if (c_classtype == H5T_INTEGER) *classtype = H5T_INTEGER_F; if (c_classtype == H5T_FLOAT) *classtype = H5T_FLOAT_F; if (c_classtype == H5T_TIME) *classtype = H5T_TIME_F; @@ -204,6 +207,7 @@ nh5tget_class_c ( hid_t_f *type_id , int_f *classtype) if (c_classtype == H5T_COMPOUND) *classtype = H5T_COMPOUND_F; if (c_classtype == H5T_REFERENCE) *classtype = H5T_REFERENCE_F; if (c_classtype == H5T_ENUM) *classtype = H5T_ENUM_F; +*/ return ret_value; } @@ -231,9 +235,12 @@ nh5tget_order_c ( hid_t_f *type_id , int_f *order) c_type_id = *type_id; c_order = H5Tget_order(c_type_id); if ( c_order < 0 ) return ret_value; + *order = (int_f)c_order; +/* if ( c_order == H5T_ORDER_LE) *order = H5T_ORDER_LE_F; if ( c_order == H5T_ORDER_BE) *order = H5T_ORDER_BE_F; if ( c_order == H5T_ORDER_VAX) *order = H5T_ORDER_VAX_F; +*/ return ret_value; } @@ -259,10 +266,12 @@ nh5tset_order_c ( hid_t_f *type_id , int_f *order) hid_t c_type_id; H5T_order_t c_order; herr_t status; - + c_order = (H5T_order_t)*order; +/* if ( *order == H5T_ORDER_LE_F) c_order = H5T_ORDER_LE; if ( *order == H5T_ORDER_BE_F) c_order = H5T_ORDER_BE; if ( *order == H5T_ORDER_VAX_F) c_order = H5T_ORDER_VAX; +*/ c_type_id = *type_id; status = H5Tset_order(c_type_id, c_order); if ( status < 0 ) ret_value = -1; diff --git a/fortran/src/H5f90.h b/fortran/src/H5f90.h index 14b70ac..94f61eb 100644 --- a/fortran/src/H5f90.h +++ b/fortran/src/H5f90.h @@ -5,77 +5,11 @@ #include "H5f90i.h" #include "H5f90proto.h" - -/* Constants from the H5Ff.c and H5Fff.f90 files */ - - -#define H5F_ACC_RDWR_F 1 -#define H5F_ACC_RDONLY_F 2 -#define H5F_ACC_TRUNC_F 3 -#define H5F_ACC_EXCL_F 4 -#define H5F_ACC_DEBUG_F 5 -#define H5P_DEFAULT_F 6 /* Can Fortran program use combination - of those flags? */ -#define H5F_SCOPE_LOCAL_F 0 -#define H5F_SCOPE_GLOBAL_F 1 - -/* Constants used in the H5Gf.c and H5Gff.f90 files */ - -#define OBJECT_NAMELEN_DEFAULT_F -1 -#define H5G_LINK_F 0 -#define H5G_GROUP_F 1 -#define H5G_DATASET_F 2 -#define H5G_TYPE_F 3 - - -/* Constants used in H5Df.c and H5Dff.f90 files */ - -#define H5S_ALL_F -2 - /* Constants used in H5Rff.f90 and H5Rf.c files */ - #define REF_OBJ_BUF_LEN_F 2 -#define REF_REG_BUF_LEN_F 3 +#define REF_REG_BUF_LEN_F 3 -/* Constants used in H5Sf.c and H5Sff.f90 files */ - -#define H5S_NO_CLASS_F -1 -#define H5S_SCALAR_F 0 -#define H5S_SIMPLE_F 1 -#define H5S_SELECT_SET_F 0 -#define H5S_SELECT_OR_F 1 - -/* Constants ised in H5Tf.c and H5Tff.f90 files */ - - -#define H5T_NO_CLASS_F -1 -#define H5T_INTEGER_F 0 -#define H5T_FLOAT_F 1 -#define H5T_TIME_F 2 -#define H5T_STRING_F 3 -#define H5T_BITFIELD_F 4 -#define H5T_OPAQUE_F 5 -#define H5T_COMPOUND_F 6 -#define H5T_REFERENCE_F 7 -#define H5T_ENUM_F 8 - -#define H5T_ORDER_LE_F 0 -#define H5T_ORDER_BE_F 1 -#define H5T_ORDER_VAX_F 2 - - -/* Constants used in H5Pf.c and H5Pff.f90 files */ - - -#define H5P_NO_CLASS_F -1 -#define H5P_FILE_CREATE_F 0 -#define H5P_FILE_ACCESS_F 1 -#define H5P_DATASET_CREATE_F 2 -#define H5P_DATASET_XFER_F 3 -#define H5P_MOUNT_F 4 - -/* Constants used in H5Pf_parallel.c and H5Pff_parallel.f90 files */ -#define H5FD_MPIO_INDEPENDENT_F 0 -#define H5FD_MPIO_COLLECTIVE_F 1 +/* Constants used in H5Gf.c files */ +#define OBJECT_NAMELEN_DEFAULT_F -1 #endif /* _H5f90_H */ diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90 index 078870b..55fbad1 100644 --- a/fortran/src/H5f90global.f90 +++ b/fortran/src/H5f90global.f90 @@ -72,34 +72,308 @@ EQUIVALENCE (integer_types(16), H5T_STD_U64LE) - COMMON /PREDEFINED_TYPES/ H5T_NATIVE_INTEGER, & - H5T_NATIVE_REAL, & - H5T_NATIVE_DOUBLE, & - H5T_NATIVE_CHARACTER, & - H5T_STD_REF_OBJ, & - H5T_STD_REF_DSETREG - - COMMON /FLOATING_TYPES/ H5T_IEEE_F32BE, & - H5T_IEEE_F32LE, & - H5T_IEEE_F64BE, & - H5T_IEEE_F64LE - - COMMON /INTEGER_TYPES/ H5T_STD_I8BE, & - H5T_STD_I8LE, & - H5T_STD_I16BE, & - H5T_STD_I16LE, & - H5T_STD_I32BE, & - H5T_STD_I32LE, & - H5T_STD_I64BE, & - H5T_STD_I64LE, & - H5T_STD_U8BE, & - H5T_STD_U8LE, & - H5T_STD_U16BE, & - H5T_STD_U16LE, & - H5T_STD_U32BE, & - H5T_STD_U32LE, & - H5T_STD_U64BE, & - H5T_STD_U64LE +! COMMON /PREDEFINED_TYPES/ H5T_NATIVE_INTEGER, & +! H5T_NATIVE_REAL, & +! H5T_NATIVE_DOUBLE, & +! H5T_NATIVE_CHARACTER, & +! H5T_STD_REF_OBJ, & +! H5T_STD_REF_DSETREG + COMMON /PREDEFINED_TYPES/ predef_types(PREDEF_TYPES_LEN) + +! COMMON /FLOATING_TYPES/ H5T_IEEE_F32BE, & +! H5T_IEEE_F32LE, & +! H5T_IEEE_F64BE, & +! H5T_IEEE_F64LE + COMMON /FLOATING_TYPES/ floatinig_types(FLOATING_TYPES_LEN) +! +! COMMON /INTEGER_TYPES/ H5T_STD_I8BE, & +! H5T_STD_I8LE, & +! H5T_STD_I16BE, & +! H5T_STD_I16LE, & +! H5T_STD_I32BE, & +! H5T_STD_I32LE, & +! H5T_STD_I64BE, & +! H5T_STD_I64LE, & +! H5T_STD_U8BE, & +! H5T_STD_U8LE, & +! H5T_STD_U16BE, & +! H5T_STD_U16LE, & +! H5T_STD_U32BE, & +! H5T_STD_U32LE, & +! H5T_STD_U64BE, & +! H5T_STD_U64LE + COMMON /INTEGER_TYPES/ integer_types(INTEGER_TYPES_LEN) +! +! Fortran flags +! +! +! H5F flags (DO NOT FORGET TO UPDATE WHEN NEW FLAGS ARE ADDEDD !) +! +! H5F flags declaration +! + INTEGER, PARAMETER :: H5F_FLAGS_LEN = 7 + INTEGER H5F_flags(H5F_FLAGS_LEN) + COMMON /H5F_FLAGS/ H5F_flags + + INTEGER :: H5F_ACC_RDWR_F + INTEGER :: H5F_ACC_RDONLY_F + INTEGER :: H5F_ACC_TRUNC_F + INTEGER :: H5F_ACC_EXCL_F + INTEGER :: H5F_ACC_DEBUG_F + INTEGER :: H5F_SCOPE_LOCAL_F + INTEGER :: H5F_SCOPE_GLOBAL_F + + EQUIVALENCE(H5F_flags(1), H5F_ACC_RDWR_F) + EQUIVALENCE(H5F_flags(2), H5F_ACC_RDONLY_F) + EQUIVALENCE(H5F_flags(3), H5F_ACC_TRUNC_F) + EQUIVALENCE(H5F_flags(4), H5F_ACC_EXCL_F) + EQUIVALENCE(H5F_flags(5), H5F_ACC_DEBUG_F) + EQUIVALENCE(H5F_flags(6), H5F_SCOPE_LOCAL_F) + EQUIVALENCE(H5F_flags(7), H5F_SCOPE_GLOBAL_F) +! +! H5G flags declaration +! + INTEGER, PARAMETER :: H5G_FLAGS_LEN = 5 + INTEGER H5G_flags(H5G_FLAGS_LEN) + COMMON /H5G_FLAGS/ H5G_flags + + INTEGER :: H5G_UNKNOWN_F + INTEGER :: H5G_LINK_F + INTEGER :: H5G_GROUP_F + INTEGER :: H5G_DATASET_F + INTEGER :: H5G_TYPE_F + + EQUIVALENCE(H5G_flags(1), H5G_UNKNOWN_F) + EQUIVALENCE(H5G_flags(2), H5G_LINK_F) + EQUIVALENCE(H5G_flags(3), H5G_GROUP_F) + EQUIVALENCE(H5G_flags(4), H5G_DATASET_F) + EQUIVALENCE(H5G_flags(5), H5G_TYPE_F) +! +! H5D flags declaration +! + + INTEGER, PARAMETER :: H5D_FLAGS_LEN = 3 + INTEGER H5D_flags(H5D_FLAGS_LEN) + COMMON /H5D_FLAGS/ H5D_flags + + INTEGER :: H5D_COMPACT_F + INTEGER :: H5D_CONTIGUOUS_F + INTEGER :: H5D_CHUNKED_F + + EQUIVALENCE(H5D_flags(1), H5D_COMPACT_F) + EQUIVALENCE(H5D_flags(2), H5D_CONTIGUOUS_F) + EQUIVALENCE(H5D_flags(3), H5D_CHUNKED_F) + +! +! H5FD flags declaration +! + INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 2 + INTEGER H5FD_flags(H5FD_FLAGS_LEN) + COMMON /H5FD_FLAGS/ H5FD_flags + + INTEGER :: H5FD_MPIO_INDEPENDENT_F + INTEGER :: H5FD_MPIO_COLLECTIVE_F + + EQUIVALENCE(H5FD_flags(1), H5FD_MPIO_INDEPENDENT_F) + EQUIVALENCE(H5FD_flags(2), H5FD_MPIO_COLLECTIVE_F) + +! +! H5E flags declaration +! + INTEGER, PARAMETER :: H5E_FLAGS_LEN = 23 + INTEGER H5E_flags(H5E_FLAGS_LEN) + COMMON /H5E_FLAGS/ H5E_flags + + INTEGER :: H5E_NONE_MAJOR_F + INTEGER :: H5E_ARGS_F + INTEGER :: H5E_RESOURCE_F + INTEGER :: H5E_INTERNAL_F + INTEGER :: H5E_FILE_F + INTEGER :: H5E_IO_F + INTEGER :: H5E_FUNC_F + INTEGER :: H5E_ATOM_F + INTEGER :: H5E_CACHE_F + INTEGER :: H5E_BTREE_F + INTEGER :: H5E_SYM_F + INTEGER :: H5E_HEAP_F + INTEGER :: H5E_OHDR_F + INTEGER :: H5E_DATATYPE_F + INTEGER :: H5E_DATASPACE_F + INTEGER :: H5E_DATASET_F + INTEGER :: H5E_STORAGE_F + INTEGER :: H5E_PLIST_F + INTEGER :: H5E_ATTR_F + INTEGER :: H5E_PLINE_F + INTEGER :: H5E_EFL_F + INTEGER :: H5E_RAGGED_F + INTEGER :: H5E_REFERENCE_F + + EQUIVALENCE(H5E_flags(1), H5E_NONE_MAJOR_F) + EQUIVALENCE(H5E_flags(2), H5E_ARGS_F) + EQUIVALENCE(H5E_flags(3), H5E_RESOURCE_F) + EQUIVALENCE(H5E_flags(4), H5E_INTERNAL_F) + EQUIVALENCE(H5E_flags(5), H5E_FILE_F) + EQUIVALENCE(H5E_flags(6), H5E_IO_F) + EQUIVALENCE(H5E_flags(7), H5E_FUNC_F) + EQUIVALENCE(H5E_flags(8), H5E_ATOM_F) + EQUIVALENCE(H5E_flags(9), H5E_CACHE_F) + EQUIVALENCE(H5E_flags(10), H5E_BTREE_F) + EQUIVALENCE(H5E_flags(11), H5E_SYM_F) + EQUIVALENCE(H5E_flags(12), H5E_HEAP_F) + EQUIVALENCE(H5E_flags(13), H5E_OHDR_F) + EQUIVALENCE(H5E_flags(14), H5E_DATATYPE_F) + EQUIVALENCE(H5E_flags(15), H5E_DATASPACE_F) + EQUIVALENCE(H5E_flags(16), H5E_DATASET_F) + EQUIVALENCE(H5E_flags(17), H5E_STORAGE_F) + EQUIVALENCE(H5E_flags(18), H5E_PLIST_F) + EQUIVALENCE(H5E_flags(19), H5E_ATTR_F) + EQUIVALENCE(H5E_flags(20), H5E_PLINE_F) + EQUIVALENCE(H5E_flags(21), H5E_EFL_F) + EQUIVALENCE(H5E_flags(22), H5E_RAGGED_F) + EQUIVALENCE(H5E_flags(23), H5E_REFERENCE_F) + +! +! H5E flags declaration +! + INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 + INTEGER H5I_flags(H5I_FLAGS_LEN) + COMMON /H5I_FLAGS/ H5I_flags + + INTEGER :: H5I_FILE_F + INTEGER :: H5I_GROUP_F + INTEGER :: H5I_DATATYPE_F + INTEGER :: H5I_DATASPACE_F + INTEGER :: H5I_DATASET_F + INTEGER :: H5I_ATTR_F + INTEGER :: H5I_BADID_F + + EQUIVALENCE(H5I_flags(1), H5I_FILE_F) + EQUIVALENCE(H5I_flags(2), H5I_GROUP_F) + EQUIVALENCE(H5I_flags(3), H5I_DATATYPE_F) + EQUIVALENCE(H5I_flags(4), H5I_DATASPACE_F) + EQUIVALENCE(H5I_flags(5), H5I_DATASET_F) + EQUIVALENCE(H5I_flags(6), H5I_ATTR_F) + EQUIVALENCE(H5I_flags(7), H5I_BADID_F) + +! +! H5P flags declaration +! + INTEGER, PARAMETER :: H5P_FLAGS_LEN = 6 + INTEGER H5P_flags(H5P_FLAGS_LEN) + COMMON /H5P_FLAGS/ H5P_flags + + INTEGER :: H5P_FILE_CREATE_F + INTEGER :: H5P_FILE_ACCESS_F + INTEGER :: H5P_DATASET_CREATE_F + INTEGER :: H5P_DATASET_XFER_F + INTEGER :: H5P_MOUNT_F + INTEGER :: H5P_DEFAULT_F + + EQUIVALENCE(H5P_flags(1), H5P_FILE_CREATE_F) + EQUIVALENCE(H5P_flags(2), H5P_FILE_ACCESS_F) + EQUIVALENCE(H5P_flags(3), H5P_DATASET_CREATE_F) + EQUIVALENCE(H5P_flags(4), H5P_DATASET_XFER_F) + EQUIVALENCE(H5P_flags(5), H5P_MOUNT_F) + EQUIVALENCE(H5P_flags(6), H5P_DEFAULT_F) + +! +! H5P flags declaration +! + INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 + INTEGER H5R_flags(H5R_FLAGS_LEN) + COMMON /H5R_FLAGS/ H5R_flags + + INTEGER :: H5R_OBJECT_F + INTEGER :: H5R_DATASET_REGION_F + + EQUIVALENCE(H5R_flags(1), H5R_OBJECT_F) + EQUIVALENCE(H5R_flags(2), H5R_DATASET_REGION_F) + +! +! H5S flags declaration +! + INTEGER, PARAMETER :: H5S_FLAGS_LEN = 6 + INTEGER H5S_flags(H5S_FLAGS_LEN) + COMMON /H5S_FLAGS/ H5S_flags + + INTEGER :: H5S_SCALAR_F + INTEGER :: H5S_SIMPLE_F + INTEGER :: H5S_SELECT_SET_F + INTEGER :: H5S_SELECT_OR_F + INTEGER :: H5S_UNLIMITED_F + INTEGER :: H5S_ALL_F + + EQUIVALENCE(H5S_flags(1), H5S_SCALAR_F) + EQUIVALENCE(H5S_flags(2), H5S_SIMPLE_F) + EQUIVALENCE(H5S_flags(3), H5S_SELECT_SET_F) + EQUIVALENCE(H5S_flags(4), H5S_SELECT_OR_F) + EQUIVALENCE(H5S_flags(5), H5S_UNLIMITED_F) + EQUIVALENCE(H5S_flags(6), H5S_ALL_F) + +! +! H5T flags declaration +! + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 28 + INTEGER H5T_flags(H5T_FLAGS_LEN) + COMMON /H5T_FLAGS/ H5T_flags + + INTEGER :: H5T_NO_CLASS_F + INTEGER :: H5T_INTEGER_F + INTEGER :: H5T_FLOAT_F + INTEGER :: H5T_TIME_F + INTEGER :: H5T_STRING_F + INTEGER :: H5T_BITFIELD_F + INTEGER :: H5T_OPAQUE_F + INTEGER :: H5T_COMPOUND_F + INTEGER :: H5T_REFERENCE_F + INTEGER :: H5T_ENUM_F + INTEGER :: H5T_ORDER_LE_F + INTEGER :: H5T_ORDER_BE_F + INTEGER :: H5T_ORDER_VAX_F + INTEGER :: H5T_PAD_ZERO_F + INTEGER :: H5T_PAD_ONE_F + INTEGER :: H5T_PAD_BACKGROUND_F + INTEGER :: H5T_PAD_ERROR_F + INTEGER :: H5T_SGN_NONE_F + INTEGER :: H5T_SGN_2_F + INTEGER :: H5T_SGN_ERROR_F + INTEGER :: H5T_NORM_IMPLIED_F + INTEGER :: H5T_NORM_MSBSET_F + INTEGER :: H5T_NORM_NONE_F + INTEGER :: H5T_CSET_ASCII_F + INTEGER :: H5T_STR_NULLTERM_F + INTEGER :: H5T_STR_NULLPAD_F + INTEGER :: H5T_STR_SPACEPAD_F + INTEGER :: H5T_STR_ERROR_F + + EQUIVALENCE(H5T_flags(1), H5T_NO_CLASS_F) + EQUIVALENCE(H5T_flags(2), H5T_INTEGER_F) + EQUIVALENCE(H5T_flags(3), H5T_FLOAT_F) + EQUIVALENCE(H5T_flags(4), H5T_TIME_F) + EQUIVALENCE(H5T_flags(5), H5T_STRING_F) + EQUIVALENCE(H5T_flags(6), H5T_BITFIELD_F) + EQUIVALENCE(H5T_flags(7), H5T_OPAQUE_F) + EQUIVALENCE(H5T_flags(8), H5T_COMPOUND_F) + EQUIVALENCE(H5T_flags(9), H5T_REFERENCE_F) + EQUIVALENCE(H5T_flags(10), H5T_ENUM_F) + EQUIVALENCE(H5T_flags(11), H5T_ORDER_LE_F) + EQUIVALENCE(H5T_flags(12), H5T_ORDER_BE_F) + EQUIVALENCE(H5T_flags(13), H5T_ORDER_VAX_F) + EQUIVALENCE(H5T_flags(14), H5T_PAD_ZERO_F) + EQUIVALENCE(H5T_flags(15), H5T_PAD_ONE_F) + EQUIVALENCE(H5T_flags(16), H5T_PAD_BACKGROUND_F) + EQUIVALENCE(H5T_flags(17), H5T_PAD_ERROR_F) + EQUIVALENCE(H5T_flags(18), H5T_SGN_NONE_F) + EQUIVALENCE(H5T_flags(19), H5T_SGN_2_F) + EQUIVALENCE(H5T_flags(20), H5T_SGN_ERROR_F) + EQUIVALENCE(H5T_flags(21), H5T_NORM_IMPLIED_F) + EQUIVALENCE(H5T_flags(22), H5T_NORM_MSBSET_F) + EQUIVALENCE(H5T_flags(23), H5T_NORM_NONE_F) + EQUIVALENCE(H5T_flags(24), H5T_CSET_ASCII_F) + EQUIVALENCE(H5T_flags(25), H5T_STR_NULLTERM_F) + EQUIVALENCE(H5T_flags(26), H5T_STR_NULLPAD_F) + EQUIVALENCE(H5T_flags(27), H5T_STR_SPACEPAD_F) + EQUIVALENCE(H5T_flags(28), H5T_STR_ERROR_F) END MODULE H5GLOBAL diff --git a/fortran/src/H5f90misc.c b/fortran/src/H5f90misc.c index 728b50a..04e05f1 100644 --- a/fortran/src/H5f90misc.c +++ b/fortran/src/H5f90misc.c @@ -137,3 +137,170 @@ nh5close_types_c( hid_t_f * types, int_f *lentypes, 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_RAGGED; + h5e_flags[22] = H5E_REFERENCE; + +/* + * 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; + +/* + * 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; +} diff --git a/fortran/src/H5f90miscf.f90 b/fortran/src/H5f90miscf.f90 index a345019..ac5fb0f 100644 --- a/fortran/src/H5f90miscf.f90 +++ b/fortran/src/H5f90miscf.f90 @@ -1,14 +1,27 @@ - SUBROUTINE h5init_types_f(error) + SUBROUTINE h5init_fortran_f(error) USE H5GLOBAL IMPLICIT NONE INTEGER, INTENT(OUT) :: error + INTEGER :: error_1, error_2 INTEGER, EXTERNAL :: h5init_types_c - error = h5init_types_c(predef_types, floating_types, integer_types) + INTEGER, EXTERNAL :: h5init_flags_c + error_1 = h5init_types_c(predef_types, floating_types, integer_types) + error_1 = 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_1 + error_2 - END SUBROUTINE h5init_types_f + END SUBROUTINE h5init_fortran_f - SUBROUTINE h5close_types_f(error) + SUBROUTINE h5close_fortran_f(error) USE H5GLOBAL IMPLICIT NONE @@ -18,5 +31,5 @@ floating_types, FLOATING_TYPES_LEN, & integer_types, INTEGER_TYPES_LEN ) - END SUBROUTINE h5close_types_f + END SUBROUTINE h5close_fortran_f diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 2a7ce92..6369876 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -877,15 +877,21 @@ extern int_f nh5eset_auto_c(int_f* printflag); #ifndef H5MISCf90_FNAMES # define H5MISCf90_FNAMES #ifdef DF_CAPFNAMES -# define nh5init_types_c FNAME(H5INIT_TYPES_C) +# define nh5init_type_c FNAME(H5INIT_TYPES_C) # define nh5close_types_c FNAME(H5CLOSE_TYPES_C) +# define nh5init_flags_c FNAME(H5INIT_FLAGS_C) #else # define nh5init_types_c FNAME(h5init_types_c) # define nh5close_types_c FNAME(h5close_types_c) +# define nh5init_flags_c FNAME(h5init_flags_c) #endif #endif extern int_f nh5init_types_c(hid_t_f *types, hid_t_f * floatingtypes, hid_t_f * integertypes); extern 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); +extern 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); #endif /* _H5f90proto_H */ diff --git a/fortran/src/H5fortran_flags.f90 b/fortran/src/H5fortran_flags.f90 index a104c06..f653c02 100644 --- a/fortran/src/H5fortran_flags.f90 +++ b/fortran/src/H5fortran_flags.f90 @@ -1,140 +1,11 @@ MODULE H5FORTRAN_FLAGS - -!H5F file interface related flags - INTEGER, PARAMETER :: H5F_ACC_RDWR_F = 1 , & - H5F_ACC_RDONLY_F = 2, & - H5F_ACC_TRUNC_F = 3, & - H5F_ACC_EXCL_F = 4, & - H5F_ACC_DEBUG_F = 5, & - H5F_SCOPE_LOCAL_F = 0, & - H5F_SCOPE_GLOBAL_F = 1 - -!H5G group interface related flags - INTEGER, PARAMETER :: H5G_UNKNOWN_F = -1 - INTEGER, PARAMETER :: H5G_LINK_F = 0 - INTEGER, PARAMETER :: H5G_GROUP_F =1 - INTEGER, PARAMETER :: H5G_DATASET_F =2 - INTEGER, PARAMETER :: H5G_TYPE_F =3 - -!H5P Property interface related flags - - INTEGER, PARAMETER :: H5P_FILE_CREATE_F = 0 - INTEGER, PARAMETER :: H5P_FILE_ACCESS_F = 1 - INTEGER, PARAMETER :: H5P_DATASET_CREATE_F = 2 - INTEGER, PARAMETER :: H5P_DATASET_XFER_F = 3 - INTEGER, PARAMETER :: H5P_MOUNT_F = 4 - INTEGER, PARAMETER :: H5P_DEFAULT_F = 6 - -!H5R Reference interface related flags - INTEGER, PARAMETER :: H5R_OBJECT_F = 0 - INTEGER, PARAMETER :: H5R_DATASET_REGION_F = -2 - -!H5S Dataspace interface related flags - INTEGER, PARAMETER :: H5S_SCALAR_F = 0 - INTEGER, PARAMETER :: H5S_SIMPLE_F = 1 - INTEGER, PARAMETER :: H5S_SELECT_SET_F = 0 - INTEGER, PARAMETER :: H5S_SELECT_OR_F =1 - INTEGER, PARAMETER :: H5S_UNLIMITED_F = -1 - INTEGER, PARAMETER :: H5S_ALL_F = -2 -!USED IN PROERTY INTERFACE - INTEGER, PARAMETER :: H5D_COMPACT_F = 0 - - INTEGER, PARAMETER :: H5D_CONTIGUOUS_F = 1 - INTEGER, PARAMETER :: H5D_CHUNKED_F = 2 - INTEGER, PARAMETER :: H5FD_MPIO_INDEPENDENT_F = 0 - INTEGER, PARAMETER :: H5FD_MPIO_COLLECTIVE_F = 1 - -!H5T Data type interface related flags - INTEGER, PARAMETER :: H5T_NO_CLASS_F = -1 - INTEGER, PARAMETER :: H5T_INTEGER_F = 0 - INTEGER, PARAMETER :: H5T_FLOAT_F = 1 - INTEGER, PARAMETER :: H5T_TIME_F = 2 - INTEGER, PARAMETER :: H5T_STRING_F = 3 - INTEGER, PARAMETER :: H5T_BITFIELD_F = 4 - INTEGER, PARAMETER :: H5T_OPAQUE_F = 5 - INTEGER, PARAMETER :: H5T_COMPOUND_F = 6 - INTEGER, PARAMETER :: H5T_REFERENCE_F = 7 - INTEGER, PARAMETER :: H5T_ENUM_F = 8 - INTEGER, PARAMETER :: H5T_ORDER_LE_F = 0 - INTEGER, PARAMETER :: H5T_ORDER_BE_F = 1 - INTEGER, PARAMETER :: H5T_ORDER_VAX_F = 2 - - INTEGER, PARAMETER :: H5T_PAD_ZERO_F = 0 - INTEGER, PARAMETER :: H5T_PAD_ONE_F = 1 - INTEGER, PARAMETER :: H5T_PAD_BACKGROUND_F = 2 - INTEGER, PARAMETER :: H5T_PAD_ERROR_F = -1 - INTEGER, PARAMETER :: H5T_PAD_NPAD_F = 3 - - !Unsigned integer type - INTEGER, PARAMETER :: H5T_SGN_NONE_F = 0 - !Two's complement signed integer type - INTEGER, PARAMETER :: H5T_SGN_2_F = 1 - - INTEGER, PARAMETER :: H5T_SGN_ERROR_F = -1 - !MSB of mantissa is not stored, always 1 - INTEGER, PARAMETER :: H5T_NORM_IMPLIED_F = 0 - !MSB of mantissa is always 1 - INTEGER, PARAMETER :: H5T_NORM_MSBSET_F = 1 - !Mantissa is not normalized - INTEGER, PARAMETER :: H5T_NORM_NONE_F = 2 - !Character set is US ASCII - INTEGER, PARAMETER :: H5T_CSET_ASCII_F = 0 - !Pad with zeros (as C does) - INTEGER, PARAMETER :: H5T_STR_NULL_F = 0 - !Pad with spaces (as FORTRAN does) - INTEGER, PARAMETER :: H5T_STR_SPACE_F = 1 - -!H5P interface related fortran flags: - !identifier of the low-level file driver. - INTEGER, PARAMETER :: H5F_LOW_STDIO_F = 0 - INTEGER, PARAMETER :: H5F_LOW_SEC2_F = 1 - INTEGER, PARAMETER :: H5F_LOW_MPIO_F = 2 - INTEGER, PARAMETER :: H5F_LOW_CORE_F = 3 - INTEGER, PARAMETER :: H5F_LOW_SPLIT_F = 4 - INTEGER, PARAMETER :: H5F_LOW_FAMILY_F = 5 - -!H5I interface related fortran flags: - INTEGER, PARAMETER :: H5I_FILE_F = 1 - INTEGER, PARAMETER :: H5I_GROUP_F = 12 - INTEGER, PARAMETER :: H5I_DATATYPE_F = 13 - INTEGER, PARAMETER :: H5I_DATASPACE_F = 14 - INTEGER, PARAMETER :: H5I_DATASET_F = 15 - INTEGER, PARAMETER :: H5I_ATTR_F = 16 - INTEGER, PARAMETER :: H5I_BADID_F = -1 - -!H5E interface related fortran flags: +! +! H5E interface related fortran flags: +! !Turn on automatic printing of errors INTEGER, PARAMETER :: PRINTON = 1 !Turn off automatic printing of errors INTEGER, PARAMETER :: PRINTOFF = 0 - - !Error flags same as H5E_major_t - - INTEGER, PARAMETER :: H5E_NONE_MAJOR_F = 0 !special zero, no error - INTEGER, PARAMETER :: H5E_ARGS_F = 1 !invalid arguments to routine - INTEGER, PARAMETER :: H5E_RESOURCE_F = 2 !resource unavailable - INTEGER, PARAMETER :: H5E_INTERNAL_F = 3 !Internal error (too specific to - !document in detail) - INTEGER, PARAMETER :: H5E_FILE_F = 4 !file Accessability - INTEGER, PARAMETER :: H5E_IO_F = 5 !Low-level I/O - INTEGER, PARAMETER :: H5E_FUNC_F = 6 !function Entry/Exit - INTEGER, PARAMETER :: H5E_ATOM_F = 7 !object Atom - INTEGER, PARAMETER :: H5E_CACHE_F = 8 !object Cache - INTEGER, PARAMETER :: H5E_BTREE_F = 9 !B-Tree Node - INTEGER, PARAMETER :: H5E_SYM_F = 10 !symbol Table - INTEGER, PARAMETER :: H5E_HEAP_F = 11 !Heap - INTEGER, PARAMETER :: H5E_OHDR_F = 12 !object Header - INTEGER, PARAMETER :: H5E_DATATYPE_F = 13 !Datatype - INTEGER, PARAMETER :: H5E_DATASPACE_F = 14 ! Dataspace - INTEGER, PARAMETER :: H5E_DATASET_F = 15 !Dataset - INTEGER, PARAMETER :: H5E_STORAGE_F = 16 !data storage - INTEGER, PARAMETER :: H5E_PLIST_F = 17 !Property lists - INTEGER, PARAMETER :: H5E_ATTR_F = 18 !Attribute - INTEGER, PARAMETER :: H5E_PLINE_F = 19 !Data filters - INTEGER, PARAMETER :: H5E_EFL_F = 20 !External file list - INTEGER, PARAMETER :: H5E_RAGGED_F = 21 !Ragged arrays - INTEGER, PARAMETER :: H5E_REFERENCE_F = 22 !References - - END MODULE H5FORTRAN_FLAGS + END MODULE H5FORTRAN_FLAGS |