summaryrefslogtreecommitdiffstats
path: root/hl/fortran/src/H5LTfc.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-03-24 19:23:11 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-03-24 19:23:11 (GMT)
commit53e4b5b90b3f5cb9dc7fbe47e6787a5280b2fa04 (patch)
tree825d37444aa8c0f3bab4442c3f1b0068c7ac2924 /hl/fortran/src/H5LTfc.c
parent65dc3358db37b04cc64b65b88065cbaf48e63a8b (diff)
downloadhdf5-53e4b5b90b3f5cb9dc7fbe47e6787a5280b2fa04.zip
hdf5-53e4b5b90b3f5cb9dc7fbe47e6787a5280b2fa04.tar.gz
hdf5-53e4b5b90b3f5cb9dc7fbe47e6787a5280b2fa04.tar.bz2
[svn-r16601] Description:
Bring r16536:16600 from trunk back into revise_chunks branch Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.6 (amazon) in debug mode Mac OS X/32 10.5.6 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'hl/fortran/src/H5LTfc.c')
-rwxr-xr-xhl/fortran/src/H5LTfc.c31
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;
}