! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! Copyright by The HDF Group. *
! Copyright by the Board of Trustees of the University of Illinois. *
! This file is part of HDF5. The full HDF5 copyright notice, including *
! terms governing use, modification, and redistribution, is contained in *
! the files COPYING and Copyright.html. COPYING can be found at the root *
! of the source code distribution tree; Copyright.html can be found at the *
! root level of an installed copy of the electronic HDF5 document set and *
! is linked from the top-level documents page. It can also be found at *
! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
! access to either file, you may request a copy from help@hdfgroup.org. *
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! This program creates two files, copy1.h5, and copy2.h5.
! In copy1.h5, it creates a 3x4 dataset called 'Copy1',
! and write 0's to this dataset.
! In copy2.h5, it create a 3x4 dataset called 'Copy2',
! and write 1's to this dataset.
! It closes both files, reopens both files, selects two
! points in copy1.h5 and writes values to them. Then it
! uses an H5Scopy to write the same selection to copy2.h5.
! Program reopens the files, and reads and prints the contents of
USE HDF5 ! This module contains all necessary modules
CHARACTER(LEN=8), PARAMETER :: filename1 = "copy1.h5" ! File name
CHARACTER(LEN=8), PARAMETER :: filename2 = "copy2.h5" !
CHARACTER(LEN=5), PARAMETER :: dsetname1 = "Copy1" ! Dataset name
CHARACTER(LEN=5), PARAMETER :: dsetname2 = "Copy2" !
INTEGER, PARAMETER :: RANK = 2 ! Dataset rank
INTEGER(SIZE_T), PARAMETER :: NUMP = 2 ! Number of points selected
INTEGER(HID_T) :: file1_id ! File1 identifier
INTEGER(HID_T) :: file2_id ! File2 identifier
INTEGER(HID_T) :: dset1_id ! Dataset1 identifier
INTEGER(HID_T) :: dset2_id ! Dataset2 identifier
INTEGER(HID_T) :: dataspace1 ! Dataspace identifier
INTEGER(HID_T) :: dataspace2 ! Dataspace identifier
INTEGER(HID_T) :: memspace ! memspace identifier