diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2009-03-23 20:04:55 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2009-03-23 20:04:55 (GMT) |
commit | 9c9e2c6d7daae12fe44ffb1e66f2caaea65bc619 (patch) | |
tree | 66d7718485ced779ef0341e25d91e02dd6eeafa5 /hl/fortran/src/H5LTfc.c | |
parent | 1598893d1403ff264bff1df49f647f3054b6f3f8 (diff) | |
download | hdf5-9c9e2c6d7daae12fe44ffb1e66f2caaea65bc619.zip hdf5-9c9e2c6d7daae12fe44ffb1e66f2caaea65bc619.tar.gz hdf5-9c9e2c6d7daae12fe44ffb1e66f2caaea65bc619.tar.bz2 |
[svn-r16598] merge 16597 from trunk
#1047 (B1) The h5lt info routines are returning data in transposed form. ISSUE : the dimension array of the function h5ltget_dataset_info_f was not transposed (because of C-FORTRAN storage order, the FORTRAN function calls the C function with the same name). SOLUTION: transpose the array. ACTION: add a test case.
added the note
Fortran High-Level APIs:
------
- Lite: The h5ltget_dataset_info_f function (gets information about a dataset)
was not correctly returning the dimension array (PVN - 2009/3/23)
tested: linux
Diffstat (limited to 'hl/fortran/src/H5LTfc.c')
-rwxr-xr-x | hl/fortran/src/H5LTfc.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index 93d65ef..61c7547 100755 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -1247,6 +1247,7 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id, size_t c_type_size; hsize_t c_dims[32]; int i; + int c_rank; /* * Convert FORTRAN name to C name @@ -1261,15 +1262,23 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5LTget_dataset_info(c_loc_id, c_name, c_dims, &c_classtype, &c_type_size); + if (ret < 0) return ret_value; *type_class = c_classtype; *type_size = (size_t_f)c_type_size; - for (i = 0; i < 32 ; i++) { - dims[i] = (hsize_t_f) c_dims[i]; - } + /* + * Transpose dimension arrays because of C-FORTRAN storage order + */ + ret = H5LTget_dataset_ndims(c_loc_id, c_name, &c_rank); if (ret < 0) return ret_value; + + for (i = 0; i < c_rank ; i++) { + dims[i] = (hsize_t_f) c_dims[c_rank - i - 1]; + } + + ret_value = 0; return ret_value; } @@ -1375,6 +1384,7 @@ nh5ltget_attribute_info_c(hid_t_f *loc_id, size_t c_type_size; hsize_t c_dims[32]; int i; + int c_rank; /* * Convert FORTRAN name to C name @@ -1388,20 +1398,27 @@ nh5ltget_attribute_info_c(hid_t_f *loc_id, if (c_attrname == NULL) return ret_value; /* - * Call H5LTget_dataset_ndims function. + * Call H5LTget_attribute_info function. */ c_loc_id = (hid_t)*loc_id; ret = H5LTget_attribute_info(c_loc_id,c_name,c_attrname,c_dims,&c_classtype,&c_type_size); + if (ret < 0) return ret_value; *type_class = c_classtype; *type_size = (size_t_f)c_type_size; - for (i = 0; i < 32 ; i++) { - dims[i] = (hsize_t_f) c_dims[i]; - } +/* + * Transpose dimension arrays because of C-FORTRAN storage order + */ + ret = H5LTget_attribute_ndims(c_loc_id,c_name,c_attrname,&c_rank); if (ret < 0) return ret_value; + + for (i = 0; i < c_rank ; i++) { + dims[i] = (hsize_t_f) c_dims[c_rank - i - 1]; + } + ret_value = 0; return ret_value; } |