@@ -90,7 +90,7 @@ module h5mpi
90
90
module subroutine hdf_create (self , dname , dtype , mem_dims , dset_dims , filespace , memspace , dset_id , &
91
91
istart , iend , chunk_size , compact )
92
92
93
- class(hdf5_file), intent (inout ) :: self
93
+ class(hdf5_file), intent (in ) :: self
94
94
character (* ), intent (in ) :: dname
95
95
integer (HID_T), intent (in ) :: dtype
96
96
integer (HSIZE_T), dimension (:), intent (in ) :: mem_dims, dset_dims
@@ -111,14 +111,14 @@ end subroutine get_hdf5_config
111
111
interface ! < writer.f90
112
112
113
113
module subroutine h5write_scalar (self , dname , value , compact )
114
- class(hdf5_file), intent (inout ) :: self
114
+ class(hdf5_file), intent (in ) :: self
115
115
character (* ), intent (in ) :: dname
116
116
class(* ), intent (in ) :: value
117
117
logical , intent (in ), optional :: compact
118
118
end subroutine h5write_scalar
119
119
120
120
module subroutine ph5write_1d (self , dname , value , dset_dims , istart , iend , chunk_size , compact )
121
- class(hdf5_file), intent (inout ) :: self
121
+ class(hdf5_file), intent (in ) :: self
122
122
character (* ), intent (in ) :: dname
123
123
class(* ), intent (in ) :: value(:)
124
124
class(* ), intent (in ), dimension (1 ), optional :: dset_dims ! < integer or integer(HSIZE_T) full disk shape (not just per worker)
@@ -128,7 +128,7 @@ module subroutine ph5write_1d(self, dname, value, dset_dims, istart, iend, chunk
128
128
end subroutine ph5write_1d
129
129
130
130
module subroutine ph5write_2d (self , dname , value , dset_dims , istart , iend , chunk_size , compact )
131
- class(hdf5_file), intent (inout ) :: self
131
+ class(hdf5_file), intent (in ) :: self
132
132
character (* ), intent (in ) :: dname
133
133
class(* ), intent (in ) :: value(:,:)
134
134
class(* ), intent (in ), dimension (2 ), optional :: dset_dims
@@ -138,7 +138,7 @@ module subroutine ph5write_2d(self, dname, value, dset_dims, istart, iend, chunk
138
138
end subroutine ph5write_2d
139
139
140
140
module subroutine ph5write_3d (self , dname , value , dset_dims , istart , iend , chunk_size , compact )
141
- class(hdf5_file), intent (inout ) :: self
141
+ class(hdf5_file), intent (in ) :: self
142
142
character (* ), intent (in ) :: dname
143
143
class(* ), intent (in ) :: value(:,:,:)
144
144
class(* ), intent (in ), dimension (3 ), optional :: dset_dims
@@ -148,7 +148,7 @@ module subroutine ph5write_3d(self, dname, value, dset_dims, istart, iend, chunk
148
148
end subroutine ph5write_3d
149
149
150
150
module subroutine ph5write_4d (self , dname , value , dset_dims , istart , iend , chunk_size , compact )
151
- class(hdf5_file), intent (inout ) :: self
151
+ class(hdf5_file), intent (in ) :: self
152
152
character (* ), intent (in ) :: dname
153
153
class(* ), intent (in ) :: value(:,:,:,:)
154
154
class(* ), intent (in ), dimension (4 ), optional :: dset_dims
@@ -158,7 +158,7 @@ module subroutine ph5write_4d(self, dname, value, dset_dims, istart, iend, chunk
158
158
end subroutine ph5write_4d
159
159
160
160
module subroutine ph5write_5d (self , dname , value , dset_dims , istart , iend , chunk_size , compact )
161
- class(hdf5_file), intent (inout ) :: self
161
+ class(hdf5_file), intent (in ) :: self
162
162
character (* ), intent (in ) :: dname
163
163
class(* ), intent (in ) :: value(:,:,:,:,:)
164
164
class(* ), intent (in ), dimension (5 ), optional :: dset_dims
@@ -168,7 +168,7 @@ module subroutine ph5write_5d(self, dname, value, dset_dims, istart, iend, chunk
168
168
end subroutine ph5write_5d
169
169
170
170
module subroutine ph5write_6d (self , dname , value , dset_dims , istart , iend , chunk_size , compact )
171
- class(hdf5_file), intent (inout ) :: self
171
+ class(hdf5_file), intent (in ) :: self
172
172
character (* ), intent (in ) :: dname
173
173
class(* ), intent (in ) :: value(:,:,:,:,:,:)
174
174
class(* ), intent (in ), dimension (6 ), optional :: dset_dims
@@ -178,7 +178,7 @@ module subroutine ph5write_6d(self, dname, value, dset_dims, istart, iend, chunk
178
178
end subroutine ph5write_6d
179
179
180
180
module subroutine ph5write_7d (self , dname , value , dset_dims , istart , iend , chunk_size , compact )
181
- class(hdf5_file), intent (inout ) :: self
181
+ class(hdf5_file), intent (in ) :: self
182
182
character (* ), intent (in ) :: dname
183
183
class(* ), intent (in ) :: value(:,:,:,:,:,:,:)
184
184
class(* ), intent (in ), dimension (7 ), optional :: dset_dims
@@ -423,7 +423,7 @@ subroutine ph5close(self, close_hdf5_interface)
423
423
! ! close_hdf5_interface is when you know you have exactly one HDF5 file in your
424
424
! ! application, if true it closes ALL files, even those invoked directly from HDF5.
425
425
426
- class(hdf5_file), intent (inout ) :: self
426
+ class(hdf5_file), intent (in ) :: self
427
427
logical , intent (in ), optional :: close_hdf5_interface
428
428
429
429
integer :: ierr, i
@@ -515,7 +515,7 @@ end function has_parallel_compression
515
515
subroutine destructor (self )
516
516
! ! Close file and handle if user forgets to do so
517
517
518
- type (hdf5_file), intent (inout ) :: self
518
+ type (hdf5_file), intent (in ) :: self
519
519
520
520
if (.not. self% is_open()) return
521
521
@@ -798,21 +798,15 @@ end subroutine hdf_shape_check
798
798
799
799
integer (HSIZE_T) function hdf_filesize(self)
800
800
! ! returns the size of the HDF5 file in bytes
801
- class(hdf5_file), intent (inout ) :: self
801
+ class(hdf5_file), intent (in ) :: self
802
802
803
803
integer :: ierr
804
804
805
- logical :: close_self
806
-
807
- close_self = .not. self% is_open()
808
-
809
- if (close_self) call self% open (self% filename, action= " r" , mpi= .false. )
805
+ if (.not. self% is_open()) error stop ' h5fortran:filesize: file handle is not open: ' // self% filename
810
806
811
807
call h5fget_filesize_f(self% file_id, hdf_filesize, ierr)
812
808
if (ierr/= 0 ) error stop " ERROR:h5fortran: could not get file size " // self% filename
813
809
814
- if (close_self) call self% close ()
815
-
816
810
end function hdf_filesize
817
811
818
812
0 commit comments