! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! Copyright by The HDF Group. *
! Copyright by the Board of Trustees of the University of Illinois. *
! All rights reserved. *
! *
! This file is part of HDF5. The full HDF5 copyright notice, including *
! terms governing use, modification, and redistribution, is contained in *
! the COPYING file, which can be found at the root of the source code *
! distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
! 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
! the two datasets.
!
PROGRAM SELECTEXAMPLE
USE HDF5 ! This module contains all necessary modules
IMPLICIT NONE
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
INTEGER(HSIZE_T), DIMENSION(1) :: dimsm = (/2/)
! Memory dataspace dimensions