diff options
author | Elena Pourmal <epourmal@hdfgroup.org> | 2001-06-21 14:53:42 (GMT) |
---|---|---|
committer | Elena Pourmal <epourmal@hdfgroup.org> | 2001-06-21 14:53:42 (GMT) |
commit | ef31e2929dc496a32515a8c11cef8ecce6c746e2 (patch) | |
tree | 25d8a46040f85f54948db95a3cf3e493c51d9a5d /fortran/test/tH5R.f90 | |
parent | aa08bf12452437589712812d5a8c21fe8a0ed401 (diff) | |
download | hdf5-ef31e2929dc496a32515a8c11cef8ecce6c746e2.zip hdf5-ef31e2929dc496a32515a8c11cef8ecce6c746e2.tar.gz hdf5-ef31e2929dc496a32515a8c11cef8ecce6c746e2.tar.bz2 |
[svn-r4026]
Purpose:
Windows port
Description:
Modified code to reflect the changes in the read/write APIs.
Platforms tested:
Windows 98, Linux, DEC UNIX
Diffstat (limited to 'fortran/test/tH5R.f90')
-rw-r--r-- | fortran/test/tH5R.f90 | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/fortran/test/tH5R.f90 b/fortran/test/tH5R.f90 index 3975357..345345b 100644 --- a/fortran/test/tH5R.f90 +++ b/fortran/test/tH5R.f90 @@ -38,8 +38,9 @@ INTEGER :: rankr = 1 TYPE(hobj_ref_t_f), DIMENSION(4) :: ref TYPE(hobj_ref_t_f), DIMENSION(4) :: ref_out - INTEGER :: ref_dim + INTEGER, DIMENSION(7) :: ref_dim INTEGER, DIMENSION(5) :: data = (/1, 2, 3, 4, 5/) + INTEGER, DIMENSION(7) :: data_dims ! ! Initialize FORTRAN predefined datatypes @@ -124,7 +125,7 @@ CALL check("h5rcreate_f",error,total_error) CALL h5rcreate_f(file_id, "MyType", ref(4), error) CALL check("h5rcreate_f",error,total_error) - ref_dim = size(ref) + ref_dim(1) = size(ref) CALL h5dwrite_f(dsetr_id, H5T_STD_REF_OBJ, ref, ref_dim, error) CALL check("h5dwrite_f",error,total_error) @@ -138,7 +139,7 @@ ! CALL h5dopen_f(file_id, dsetnamer,dsetr_id,error) CALL check("h5dopen_f",error,total_error) - ref_dim = size(ref_out) + ref_dim(1) = size(ref_out) CALL h5dread_f(dsetr_id, H5T_STD_REF_OBJ, ref_out, ref_dim, error) CALL check("h5dread_f",error,total_error) @@ -151,7 +152,8 @@ CALL h5rdereference_f(dsetr_id, ref(3), dset1_id, error) CALL check("h5rdereference_f",error,total_error) - CALL h5dwrite_f(dset1_id, H5T_NATIVE_INTEGER, data, error) + data_dims(1) = 5 + CALL h5dwrite_f(dset1_id, H5T_NATIVE_INTEGER, data, data_dims, error) CALL check("h5dwrite_f",error,total_error) end if @@ -206,7 +208,8 @@ INTEGER :: error TYPE(hdset_reg_ref_t_f) , DIMENSION(2) :: ref ! Buffers to store references TYPE(hdset_reg_ref_t_f) , DIMENSION(2) :: ref_out ! - INTEGER :: ref_dim + INTEGER, DIMENSION(7) :: ref_dim + INTEGER, DIMENSION(7) :: data_dims INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/2,9/) ! Datasets dimensions INTEGER(HSIZE_T), DIMENSION(1) :: dimsr = (/2/) ! INTEGER(HSSIZE_T), DIMENSION(2) :: start @@ -253,7 +256,9 @@ CALL h5dcreate_f(file_id, dsetnamev, H5T_NATIVE_INTEGER, space_id, & dsetv_id, error) CALL check("h5dcreate_f", error, total_error) - CALL h5dwrite_f(dsetv_id, H5T_NATIVE_INTEGER, data, error) + data_dims(1) = 2 + data_dims(2) = 9 + CALL h5dwrite_f(dsetv_id, H5T_NATIVE_INTEGER, data, data_dims, error) CALL check("h5dwrite_f", error, total_error) CALL h5dclose_f(dsetv_id, error) @@ -289,7 +294,7 @@ ! ! Write dataset with the references. ! - ref_dim = size(ref) + ref_dim(1) = size(ref) CALL h5dwrite_f(dsetr_id, H5T_STD_REF_DSETREG, ref, ref_dim, error) CALL check("h5dwrite_f", error, total_error) ! @@ -313,7 +318,7 @@ ! ! Read references to the dataset regions. ! - ref_dim = size(ref_out) + ref_dim(1) = size(ref_out) CALL h5dread_f(dsetr_id, H5T_STD_REF_DSETREG, ref_out, ref_dim, error) CALL check("h5dread_f", error, total_error) ! @@ -326,7 +331,9 @@ ! ! Read selected data from the dataset. ! - CALL h5dread_f(dsetv_id, H5T_NATIVE_INTEGER, data_out, error, & + data_dims(1) = 2 + data_dims(2) = 9 + CALL h5dread_f(dsetv_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, & mem_space_id = space_id, file_space_id = space_id) CALL check("h5dread_f", error, total_error) CALL h5sclose_f(space_id, error) @@ -345,7 +352,7 @@ ! ! Read selected data from the dataset. ! - CALL h5dread_f(dsetv_id, H5T_NATIVE_INTEGER, data_out, error, & + CALL h5dread_f(dsetv_id, H5T_NATIVE_INTEGER, data_out, data_dims, error, & mem_space_id = space_id, file_space_id = space_id) CALL check("h5dread_f", error, total_error) ! |