summaryrefslogtreecommitdiffstats
path: root/fortran/examples
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2020-04-20 23:12:00 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2020-04-20 23:12:00 (GMT)
commit9e5dbf69062d4d2cb40ba8f68edb355477fc9b67 (patch)
treeab184e76824e8b4250ad9bf38286a65227fe2407 /fortran/examples
parent7ba692badf9a1bafb9d3b2f72efbbdf773b5932a (diff)
downloadhdf5-9e5dbf69062d4d2cb40ba8f68edb355477fc9b67.zip
hdf5-9e5dbf69062d4d2cb40ba8f68edb355477fc9b67.tar.gz
hdf5-9e5dbf69062d4d2cb40ba8f68edb355477fc9b67.tar.bz2
Trim trailing whitespace
Diffstat (limited to 'fortran/examples')
-rw-r--r--fortran/examples/compound_complex_fortran2003.f906
-rw-r--r--fortran/examples/compound_fortran2003.f9012
-rw-r--r--fortran/examples/h5_cmprss.f9026
-rw-r--r--fortran/examples/h5_extend.f9054
-rw-r--r--fortran/examples/h5_subset.f9064
-rw-r--r--fortran/examples/nested_derived_type.f9014
-rw-r--r--fortran/examples/rwdset_fortran2003.f9038
-rw-r--r--fortran/examples/testh5fc.sh.in16
8 files changed, 115 insertions, 115 deletions
diff --git a/fortran/examples/compound_complex_fortran2003.f90 b/fortran/examples/compound_complex_fortran2003.f90
index 6d0f291..9f0cc9f 100644
--- a/fortran/examples/compound_complex_fortran2003.f90
+++ b/fortran/examples/compound_complex_fortran2003.f90
@@ -11,8 +11,8 @@
! help@hdfgroup.org. *
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
!
-! This example shows how to create an array of a compound datatype which
-! contains an array of type complex and how to write it to hdf5
+! This example shows how to create an array of a compound datatype which
+! contains an array of type complex and how to write it to hdf5
! and how to read it back into a compound datatype for hdf5.
!
@@ -85,7 +85,7 @@ PROGRAM compound_complex_fortran2003
! Open the file and the dataset.
!
CALL H5Fopen_f("test.h5", H5F_ACC_RDONLY_F, file_id, error)
-
+
CALL H5Dopen_f(file_id, "samples", dset_id, error)
!
! Create the memory data type.
diff --git a/fortran/examples/compound_fortran2003.f90 b/fortran/examples/compound_fortran2003.f90
index 0168177..09e1b04 100644
--- a/fortran/examples/compound_fortran2003.f90
+++ b/fortran/examples/compound_fortran2003.f90
@@ -77,10 +77,10 @@ PROGRAM main
INTEGER(SIZE_T) :: offset, sizeof_compound
INTEGER :: hdferr
TYPE(C_PTR) :: f_ptr
-
- INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype
- INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype
- INTEGER(SIZE_T) :: type_sized ! Size of the double datatype
+
+ INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype
+ INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype
+ INTEGER(SIZE_T) :: type_sized ! Size of the double datatype
INTEGER(hid_t) :: tid3 ! /* Nested Array Datatype ID */
INTEGER(HSIZE_T), DIMENSION(1) :: tdims1=(/13/)
!
@@ -133,7 +133,7 @@ PROGRAM main
!
! Write data to the dataset
!
-
+
f_ptr = C_LOC(s1(1))
CALL H5Dwrite_f(dataset, s1_tid, f_ptr, hdferr)
@@ -150,7 +150,7 @@ PROGRAM main
!
CALL H5Fopen_f(H5FILE_NAME, H5F_ACC_RDONLY_F, file, hdferr)
-
+
CALL H5Dopen_f(file, DATASETNAME, dataset,hdferr)
!
diff --git a/fortran/examples/h5_cmprss.f90 b/fortran/examples/h5_cmprss.f90
index 61dd7b0..f543024 100644
--- a/fortran/examples/h5_cmprss.f90
+++ b/fortran/examples/h5_cmprss.f90
@@ -10,17 +10,17 @@
! If you do not have access to either file, you may request a copy from *
! help@hdfgroup.org. *
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-!
+!
! This example illustrates how to create a compressed dataset.
! It is used in the HDF5 Tutorial.
-!
+!
PROGRAM h5_cmprss
- USE HDF5 ! This module contains all necessary modules
+ USE HDF5 ! This module contains all necessary modules
IMPLICIT NONE
!
- ! The dataset is stored in file "h5_cmprss.h5"
+ ! The dataset is stored in file "h5_cmprss.h5"
!
CHARACTER(LEN=12), PARAMETER :: filename = "h5_cmprss.h5"
INTEGER, PARAMETER :: rank = 2 ! Rank of the data set
@@ -33,7 +33,7 @@ PROGRAM h5_cmprss
INTEGER :: error
INTEGER(hsize_t), DIMENSION(1:rank) :: dims ! dimensions of data
INTEGER(hsize_t), DIMENSION(1:rank) :: cdims ! sizes of chunked data
-
+
INTEGER :: i,j, numfilt
INTEGER, DIMENSION(1:dim0,1:dim1) :: buf ! write buffer
INTEGER, DIMENSION(1:dim0,1:dim1) :: rbuf ! read buffer
@@ -63,15 +63,15 @@ PROGRAM h5_cmprss
CALL h5screate_simple_f(rank, dims, dataspace_id, error)
CALL h5pcreate_f(H5P_DATASET_CREATE_F, plist_id, error)
!
- ! Dataset must be chunked for compression
+ ! Dataset must be chunked for compression
cdims(1:2) = 20
CALL h5pset_chunk_f(plist_id, 2, cdims, error)
! Set ZLIB / DEFLATE Compression using compression level 6.
- ! To use SZIP Compression comment out these lines.
+ ! To use SZIP Compression comment out these lines.
CALL h5pset_deflate_f(plist_id, 6, error)
- ! Uncomment these lines to set SZIP Compression
+ ! Uncomment these lines to set SZIP Compression
!szip_options_mask = H5_SZIP_NN_OM_F
!szip_pixels_per_block = 16
!CALL H5Pset_szip_f(plist_id, szip_options_mask, szip_pixels_per_block, error)
@@ -86,7 +86,7 @@ PROGRAM h5_cmprss
ENDDO
ENDDO
- data_dims(1:2) = (/dim0,dim1/)
+ data_dims(1:2) = (/dim0,dim1/)
CALL h5dwrite_f(dataset_id, H5T_NATIVE_INTEGER, buf, data_dims, error)
! Close resources
@@ -99,12 +99,12 @@ PROGRAM h5_cmprss
CALL h5fopen_f(filename, H5F_ACC_RDONLY_F, file_id, error)
CALL h5dopen_f(file_id, "Compressed_Data", dataset_id, error)
- ! Retrieve filter information.
+ ! Retrieve filter information.
CALL h5dget_create_plist_f(dataset_id, plist_id, error)
-
+
CALL h5pget_nfilters_f(plist_id, numfilt, error)
WRITE(*,'(A, I0)') "Number of filters associated with dataset: ", numfilt
-
+
DO i = 1, numfilt
nelmts = 1
CALL h5pget_filter_f(plist_id, 0, flags, nelmts, cd_values, &
@@ -121,7 +121,7 @@ PROGRAM h5_cmprss
ENDDO
data_dims(1:2) = (/dim0,dim1/)
CALL h5dread_f(dataset_id, H5T_NATIVE_INTEGER, rbuf, data_dims, error)
-
+
CALL h5dclose_f(dataset_id, error)
CALL h5pclose_f(plist_id, error)
CALL h5fclose_f(file_id, error)
diff --git a/fortran/examples/h5_extend.f90 b/fortran/examples/h5_extend.f90
index 20b91ff..93bfea8 100644
--- a/fortran/examples/h5_extend.f90
+++ b/fortran/examples/h5_extend.f90
@@ -15,12 +15,12 @@
PROGRAM H5_EXTEND
- USE HDF5 ! This module contains all necessary modules
+ USE HDF5 ! This module contains all necessary modules
IMPLICIT NONE
!
- !the dataset is stored in file "extend.h5"
+ !the dataset is stored in file "extend.h5"
!
CHARACTER(LEN=9), PARAMETER :: filename = "extend.h5"
@@ -30,11 +30,11 @@ PROGRAM H5_EXTEND
CHARACTER(LEN=15), PARAMETER :: dsetname = "ExtendibleArray"
INTEGER :: RANK = 2
- INTEGER(HID_T) :: file_id ! File identifier
- INTEGER(HID_T) :: dset_id ! Dataset identifier
- INTEGER(HID_T) :: dataspace ! Dataspace identifier
- INTEGER(HID_T) :: memspace ! Memory dataspace identifier
- INTEGER(HID_T) :: crp_list ! Dataset creation property identifier
+ INTEGER(HID_T) :: file_id ! File identifier
+ INTEGER(HID_T) :: dset_id ! Dataset identifier
+ INTEGER(HID_T) :: dataspace ! Dataspace identifier
+ INTEGER(HID_T) :: memspace ! Memory dataspace identifier
+ INTEGER(HID_T) :: crp_list ! Dataset creation property identifier
!
!dataset dimensions at creation time
@@ -42,7 +42,7 @@ PROGRAM H5_EXTEND
INTEGER(HSIZE_T), DIMENSION(1:2) :: dims = (/3,3/)
!
- !data dimensions
+ !data dimensions
!
INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsc = (/2,5/)
INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsm = (/3,7/)
@@ -50,49 +50,49 @@ PROGRAM H5_EXTEND
!
!Maximum dimensions
!
- INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims
+ INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims
INTEGER(HSIZE_T), DIMENSION(1:2) :: offset
- INTEGER(HSIZE_T), DIMENSION(1:2) :: count
+ INTEGER(HSIZE_T), DIMENSION(1:2) :: count
!
- ! Variables for reading and writing
+ ! Variables for reading and writing
!
- INTEGER, DIMENSION(1:3,1:3) :: data1
+ INTEGER, DIMENSION(1:3,1:3) :: data1
INTEGER, DIMENSION(1:21) :: data2 = &
(/2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4/)
INTEGER(HSIZE_T), DIMENSION(1:2) :: data_dims
!
- !Size of data in the file
+ !Size of data in the file
!
INTEGER(HSIZE_T), DIMENSION(1:2) :: size
!
- !general purpose integer
+ !general purpose integer
!
INTEGER(HSIZE_T) :: i, j
!
- !flag to check operation success
+ !flag to check operation success
!
- INTEGER :: error
+ INTEGER :: error
!
!Variables used in reading data back
- !
+ !
INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsr, maxdimsr
INTEGER :: rankr
- INTEGER, DIMENSION(1:3,1:10) :: rdata
+ INTEGER, DIMENSION(1:3,1:10) :: rdata
!
!Initialize FORTRAN predifined datatypes
!
- CALL h5open_f(error)
+ CALL h5open_f(error)
!
!Create a new file using default properties.
- !
+ !
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
!
@@ -117,7 +117,7 @@ PROGRAM H5_EXTEND
CALL h5sclose_f(dataspace, error)
!
- !Fill data array with 1's
+ !Fill data array with 1's
!
DO i = 1, dims(1)
DO j = 1, dims(2)
@@ -128,7 +128,7 @@ PROGRAM H5_EXTEND
!
!Write data array to dataset
!
- data_dims(1:2) = (/3,3/)
+ data_dims(1:2) = (/3,3/)
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data1, data_dims, error)
!
@@ -144,7 +144,7 @@ PROGRAM H5_EXTEND
!
!Write to 3x7 extended part of dataset
- !
+ !
CALL h5dget_space_f(dset_id, dataspace, error)
CALL h5sselect_hyperslab_f(dataspace, H5S_SELECT_SET_F, &
offset, count, error)
@@ -185,7 +185,7 @@ PROGRAM H5_EXTEND
!
!Get dataspace's dimensions.
- !
+ !
CALL h5sget_simple_extent_dims_f(dataspace, dimsr, maxdimsr, error)
!
@@ -204,15 +204,15 @@ PROGRAM H5_EXTEND
CALL h5screate_simple_f(rankr, dimsr, memspace, error)
!
- !Read data
+ !Read data
!
data_dims(1:2) = (/3,10/)
CALL H5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, data_dims, &
error, memspace, dataspace)
- WRITE(*,'(A)') "Dataset:"
+ WRITE(*,'(A)') "Dataset:"
DO i = 1, dimsr(1)
- WRITE(*,'(100(I0,1X))') rdata(i,1:dimsr(2))
+ WRITE(*,'(100(I0,1X))') rdata(i,1:dimsr(2))
END DO
!
diff --git a/fortran/examples/h5_subset.f90 b/fortran/examples/h5_subset.f90
index ab33c86..9bebce5 100644
--- a/fortran/examples/h5_subset.f90
+++ b/fortran/examples/h5_subset.f90
@@ -11,23 +11,23 @@
! help@hdfgroup.org. *
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
!
-! This example shows how to write and read a hyperslab.
+! This example shows how to write and read a hyperslab.
! It is used in the HDF5 Tutorial.
!
-PROGRAM H5_SUBSET
+PROGRAM H5_SUBSET
- USE HDF5 ! This module contains all necessary modules
+ USE HDF5 ! This module contains all necessary modules
IMPLICIT NONE
CHARACTER(LEN=9), PARAMETER :: filename = "subset.h5" ! File name
CHARACTER(LEN=8), PARAMETER :: dsetname = "IntArray" ! Dataset name
- INTEGER(HID_T) :: file_id ! File identifier
- INTEGER(HID_T) :: dset_id ! Dataset identifier
- INTEGER(HID_T) :: dataspace ! Dataspace identifier
- INTEGER(HID_T) :: memspace ! memspace identifier
+ INTEGER(HID_T) :: file_id ! File identifier
+ INTEGER(HID_T) :: dset_id ! Dataset identifier
+ INTEGER(HID_T) :: dataspace ! Dataspace identifier
+ INTEGER(HID_T) :: memspace ! memspace identifier
!
! To change the subset size, modify size of dimsm, sdata, dim0_sub,
@@ -35,57 +35,57 @@ PROGRAM H5_SUBSET
!
INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsm = (/4,3/) ! Dataset dimensions
INTEGER, DIMENSION(1:4,1:3) :: sdata ! Subset buffer
- INTEGER :: dim0_sub = 4
- INTEGER :: dim1_sub = 3
+ INTEGER :: dim0_sub = 4
+ INTEGER :: dim1_sub = 3
INTEGER(HSIZE_T), DIMENSION(1:2) :: count = (/4,3/) ! Size of hyperslab
INTEGER(HSIZE_T), DIMENSION(1:2) :: offset = (/2,1/) ! Hyperslab offset
- INTEGER(HSIZE_T), DIMENSION(1:2) :: stride = (/1,1/) ! Hyperslab stride
- INTEGER(HSIZE_T), DIMENSION(1:2) :: block = (/1,1/) ! Hyperslab block size
+ INTEGER(HSIZE_T), DIMENSION(1:2) :: stride = (/1,1/) ! Hyperslab stride
+ INTEGER(HSIZE_T), DIMENSION(1:2) :: block = (/1,1/) ! Hyperslab block size
INTEGER(HSIZE_T), DIMENSION(1:2) :: dimsf = (/10,8/) ! Dataset dimensions
INTEGER, DIMENSION(1:10,1:8) :: data ! Data to write
- INTEGER, DIMENSION(1:10,1:8) :: rdata ! Data to read
+ INTEGER, DIMENSION(1:10,1:8) :: rdata ! Data to read
INTEGER :: rank = 2 ! Dataset rank ( in file )
INTEGER :: dim0 = 10 ! Dataset size in file
- INTEGER :: dim1 = 8
+ INTEGER :: dim1 = 8
- INTEGER :: i, j
+ INTEGER :: i, j
INTEGER :: error ! Error flag
INTEGER(HSIZE_T), DIMENSION(2) :: data_dims
!
- ! Write data to the HDF5 file.
+ ! Write data to the HDF5 file.
!
!
- ! Data initialization.
+ ! Data initialization.
!
- DO i = 1, dim0
+ DO i = 1, dim0
DO j = 1, dim1
IF (i .LE. (dim0 / 2)) THEN
- data(i,j) = 1
- ELSE
- data(i,j) = 2
+ data(i,j) = 1
+ ELSE
+ data(i,j) = 2
END IF
END DO
END DO
!
- ! Initialize FORTRAN interface.
+ ! Initialize FORTRAN interface.
!
- CALL h5open_f(error)
+ CALL h5open_f(error)
!
! Create a new file using default properties.
- !
+ !
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
!
- ! Create the data space for the dataset.
+ ! Create the data space for the dataset.
!
CALL h5screate_simple_f(rank, dimsf, dataspace, error)
@@ -98,12 +98,12 @@ PROGRAM H5_SUBSET
!
! Write the dataset.
!
- data_dims(1) = dim0
- data_dims(2) = dim1
+ data_dims(1) = dim0
+ data_dims(2) = dim1
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data, data_dims, error)
!
- ! Data Written to File
+ ! Data Written to File
!
WRITE(*,'(/,A)') "Original Data Written to File:"
DO i = 1, dim0
@@ -138,7 +138,7 @@ PROGRAM H5_SUBSET
!
CALL h5dget_space_f(dset_id, dataspace, error)
CALL h5sselect_hyperslab_f(dataspace, H5S_SELECT_SET_F, &
- offset, count, error, stride, BLOCK)
+ offset, count, error, stride, BLOCK)
!
! Create memory dataspace.
!
@@ -148,9 +148,9 @@ PROGRAM H5_SUBSET
WRITE(*,'(A,/)') " offset=2x1 stride=1x1 count=4x3 block=1x1"
!
- ! Write subset to dataset
+ ! Write subset to dataset
!
- data_dims(1:2) = (/dim0_sub, dim1_sub/)
+ data_dims(1:2) = (/dim0_sub, dim1_sub/)
CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, sdata, data_dims, error, &
memspace, dataspace)
@@ -158,10 +158,10 @@ PROGRAM H5_SUBSET
CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, data_dims, error)
!
- ! Read entire dataset back
+ ! Read entire dataset back
!
WRITE(*,'(A)') "Data in File after Subset Written:"
- DO i = 1, dim0
+ DO i = 1, dim0
WRITE(*,'(100(1X,I0,1X))') rdata(i,1:dim1)
END DO
PRINT *, " "
diff --git a/fortran/examples/nested_derived_type.f90 b/fortran/examples/nested_derived_type.f90
index 68354ac..651830c 100644
--- a/fortran/examples/nested_derived_type.f90
+++ b/fortran/examples/nested_derived_type.f90
@@ -1,4 +1,4 @@
-!
+!
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! Copyright by the Board of Trustees of the University of Illinois. *
! All rights reserved. *
@@ -82,10 +82,10 @@ PROGRAM main
INTEGER(SIZE_T) :: offset, sizeof_compound
INTEGER :: hdferr
TYPE(C_PTR) :: f_ptr
-
- INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype
- INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype
- INTEGER(SIZE_T) :: type_sized ! Size of the double datatype
+
+ INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype
+ INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype
+ INTEGER(SIZE_T) :: type_sized ! Size of the double datatype
INTEGER(hid_t) :: tid3 ! /* Nested Array Datatype ID */
INTEGER(HSIZE_T), DIMENSION(1) :: tdims1=(/7/)
INTEGER(HSIZE_T), DIMENSION(1) :: tdims1a=(/4/)
@@ -136,7 +136,7 @@ PROGRAM main
!
! Write data to the dataset
!
-
+
f_ptr = C_LOC(s1(1))
CALL H5Dwrite_f(dataset, s1_tid, f_ptr, hdferr)
@@ -153,7 +153,7 @@ PROGRAM main
!
CALL H5Fopen_f(H5FILE_NAME, H5F_ACC_RDONLY_F, file, hdferr)
-
+
CALL H5Dopen_f(file, DATASETNAME, dataset,hdferr)
!
! Create a data type for s2
diff --git a/fortran/examples/rwdset_fortran2003.f90 b/fortran/examples/rwdset_fortran2003.f90
index 36ebf0d..f79c8fe 100644
--- a/fortran/examples/rwdset_fortran2003.f90
+++ b/fortran/examples/rwdset_fortran2003.f90
@@ -1,4 +1,4 @@
-! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! Copyright by The HDF Group. *
! Copyright by the Board of Trustees of the University of Illinois. *
! All rights reserved. *
@@ -9,12 +9,12 @@
! 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. *
-! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
!
!
-! The following example shows how to write and read to/from an existing dataset.
-! It opens the file created in the previous example, obtains the dataset
-! identifier, writes the data to the dataset in the file,
+! The following example shows how to write and read to/from an existing dataset.
+! It opens the file created in the previous example, obtains the dataset
+! identifier, writes the data to the dataset in the file,
! then reads the dataset to memory. Uses updated Fortran 2003 interface
! with different KINDs of integers and reals.
!
@@ -22,8 +22,8 @@ PROGRAM RWDSET_FORTRAN2003
USE ISO_C_BINDING
- USE HDF5 ! This module contains all necessary modules
-
+ USE HDF5 ! This module contains all necessary modules
+
IMPLICIT NONE
INTEGER, PARAMETER :: int_kind_1 = SELECTED_INT_KIND(2) !should map to INTEGER*1 on most modern processors
@@ -42,13 +42,13 @@ PROGRAM RWDSET_FORTRAN2003
CHARACTER(LEN=6), PARAMETER :: dsetnamer4 = "dsetr4" ! Dataset name
CHARACTER(LEN=6), PARAMETER :: dsetnamer8 = "dsetr8" ! Dataset name
- INTEGER(HID_T) :: file_id ! File identifier
- INTEGER(HID_T) :: dset_id1 ! Dataset identifier
- INTEGER(HID_T) :: dset_id4 ! Dataset identifier
- INTEGER(HID_T) :: dset_id8 ! Dataset identifier
- INTEGER(HID_T) :: dset_id16 ! Dataset identifier
- INTEGER(HID_T) :: dset_idr4 ! Dataset identifier
- INTEGER(HID_T) :: dset_idr8 ! Dataset identifier
+ INTEGER(HID_T) :: file_id ! File identifier
+ INTEGER(HID_T) :: dset_id1 ! Dataset identifier
+ INTEGER(HID_T) :: dset_id4 ! Dataset identifier
+ INTEGER(HID_T) :: dset_id8 ! Dataset identifier
+ INTEGER(HID_T) :: dset_id16 ! Dataset identifier
+ INTEGER(HID_T) :: dset_idr4 ! Dataset identifier
+ INTEGER(HID_T) :: dset_idr8 ! Dataset identifier
INTEGER :: error ! Error flag
INTEGER :: i
@@ -65,15 +65,15 @@ PROGRAM RWDSET_FORTRAN2003
REAL(real_kind_7), DIMENSION(1:4), TARGET :: dset_data_r7, data_out_r7
REAL(real_kind_15), DIMENSION(1:4), TARGET :: dset_data_r15, data_out_r15
- INTEGER(HSIZE_T), DIMENSION(1:1) :: data_dims = (/4/)
+ INTEGER(HSIZE_T), DIMENSION(1:1) :: data_dims = (/4/)
INTEGER(HID_T) :: dspace_id ! Dataspace identifier
-
+
TYPE(C_PTR) :: f_ptr
!
! Initialize FORTRAN interface.
!
- CALL h5open_f(error)
+ CALL h5open_f(error)
!
! Initialize the dset_data array.
!
@@ -130,7 +130,7 @@ PROGRAM RWDSET_FORTRAN2003
!
! Read the dataset.
!
- ! Read data back into an integer size that is larger then the original size used for
+ ! Read data back into an integer size that is larger then the original size used for
! writing the data
f_ptr = C_LOC(data_out_i8a(1))
CALL h5dread_f(dset_id1, h5kind_to_type(int_kind_8,H5_INTEGER_KIND), f_ptr, error)
@@ -172,5 +172,5 @@ PROGRAM RWDSET_FORTRAN2003
END PROGRAM RWDSET_FORTRAN2003
-
+
diff --git a/fortran/examples/testh5fc.sh.in b/fortran/examples/testh5fc.sh.in
index f384909..200f311 100644
--- a/fortran/examples/testh5fc.sh.in
+++ b/fortran/examples/testh5fc.sh.in
@@ -71,13 +71,13 @@ temp_FILES="a.out $applib"
# An application Main that calls hdf5 and application's own functions.
cat > $appmain <<EOF
PROGRAM FILEEXAMPLE
- USE HDF5 ! This module contains all necessary modules
-
+ USE HDF5 ! This module contains all necessary modules
+
IMPLICIT NONE
CHARACTER(LEN=8), PARAMETER :: filename = "apptmp.h5" ! File name
INTEGER(HID_T) :: file_id ! File identifier
-
+
INTEGER :: error ! Error flag
CALL sub1
@@ -86,7 +86,7 @@ cat > $appmain <<EOF
CALL h5fclose_f(file_id, error)
CALL h5close_f(error)
CALL sub2
- END PROGRAM FILEEXAMPLE
+ END PROGRAM FILEEXAMPLE
EOF
# generate prog1
@@ -107,20 +107,20 @@ EOF
# An HDF5 sample program that calls hdf5 functions.
cat > $hdf5main <<EOF
PROGRAM FILEEXAMPLE
- USE HDF5 ! This module contains all necessary modules
-
+ USE HDF5 ! This module contains all necessary modules
+
IMPLICIT NONE
CHARACTER(LEN=8), PARAMETER :: filename = "apptmp.h5" ! File name
INTEGER(HID_T) :: file_id ! File identifier
-
+
INTEGER :: error ! Error flag
CALL h5open_f (error)
CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
CALL h5fclose_f(file_id, error)
CALL h5close_f(error)
- END PROGRAM FILEEXAMPLE
+ END PROGRAM FILEEXAMPLE
EOF