summaryrefslogtreecommitdiffstats
path: root/fortran/examples/refobjexample.f90
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>2001-04-27 03:52:24 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>2001-04-27 03:52:24 (GMT)
commitfef182fd966c8c113a5bab02f19afca4c91f0ba5 (patch)
tree952bcd243d030ea9fc63bf6d457754abdbbea1c0 /fortran/examples/refobjexample.f90
parent9aba4e88c26d98aafaf231163e949b9a53aa9561 (diff)
downloadhdf5-fef182fd966c8c113a5bab02f19afca4c91f0ba5.zip
hdf5-fef182fd966c8c113a5bab02f19afca4c91f0ba5.tar.gz
hdf5-fef182fd966c8c113a5bab02f19afca4c91f0ba5.tar.bz2
[svn-r3862]
Purpose: Codemaintenance Description: read/write APIs have been changed. Solution: Made necessary changes to the source code. Platforms tested: Linux, Solaris 2.7, O2K, T3E
Diffstat (limited to 'fortran/examples/refobjexample.f90')
-rw-r--r--fortran/examples/refobjexample.f9010
1 files changed, 6 insertions, 4 deletions
diff --git a/fortran/examples/refobjexample.f90 b/fortran/examples/refobjexample.f90
index fdbb26d..6eda815 100644
--- a/fortran/examples/refobjexample.f90
+++ b/fortran/examples/refobjexample.f90
@@ -35,7 +35,8 @@
TYPE(hobj_ref_t_f), DIMENSION(4) :: ref
TYPE(hobj_ref_t_f), DIMENSION(4) :: ref_out
INTEGER, DIMENSION(5) :: data = (/1, 2, 3, 4, 5/)
- INTEGER :: class, ref_size
+ INTEGER :: class
+ INTEGER, DIMENSION(7) :: data_dims, ref_size
!
! Initialize FORTRAN interface.
!
@@ -91,7 +92,7 @@
CALL h5rcreate_f(file_id, "/GROUP1/GROUP2", ref(2), error)
CALL h5rcreate_f(file_id, dsetnamei, ref(3), error)
CALL h5rcreate_f(file_id, "MyType", ref(4), error)
- ref_size = size(ref)
+ ref_size(1) = size(ref)
CALL h5dwrite_f(dsetr_id, H5T_STD_REF_OBJ, ref, ref_size, error)
!
! Close the dataset
@@ -101,7 +102,7 @@
! Reopen the dataset with object references and read references to the buffer
!
CALL h5dopen_f(file_id, dsetnamer,dsetr_id,error)
- ref_size = size(ref_out)
+ ref_size(1) = size(ref_out)
CALL h5dread_f(dsetr_id, H5T_STD_REF_OBJ, ref_out, ref_size, error)
!
! Dereference the third reference. We know that it is a dataset. On practice
@@ -112,7 +113,8 @@
!
! Write data to the dataset.
!
- CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data, error)
+ data_dims(1) = size(data)
+ CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data, data_dims, error)
if (error .eq. 0) write(*,*) "Data has been successfully written to the dataset "
!
! Dereference the fourth reference. We know that it is a datatype. On practice