17 #include "sll_errors.h"
18 #include "sll_working_precision.h"
42 character(len=maxlen) :: filename =
""
43 logical :: is_open = .false.
60 generic :: write_array => write_dble_array_1d, &
61 write_dble_array_2d, &
62 write_dble_array_3d, &
74 character(len=*),
intent(in) :: filename
76 self%filename = filename
84 character(len=*),
parameter :: this_sub_name =
"t_hdf5_serial__create"
90 sll_error(this_sub_name,
"Cannot create HDF5 file "//trim(self%filename))
101 character(len=*),
parameter :: this_sub_name =
"t_hdf5_serial__open"
104 if (self%is_open)
then
105 sll_error(this_sub_name,
"File is already open")
111 sll_error(this_sub_name,
"Cannot open HDF5 file "//trim(self%filename))
114 self%is_open = .true.
122 character(len=*),
parameter :: this_sub_name =
"t_hdf5_serial__close"
126 if (.not. self%is_open)
then
127 sll_error(this_sub_name,
"File is already closed")
133 sll_error(this_sub_name,
"Cannot close HDF5 file "//trim(self%filename))
136 self%is_open = .false.
144 if (self%is_open)
call self%close()
147 self%is_open = .false.
154 sll_real64,
intent(in) :: array(:)
155 character(len=*),
intent(in) :: dsetname
157 character(len=*),
parameter :: this_sub_name =
"t_hdf5_serial__write_dble_array_1d"
161 if (.not. self%is_open)
then
162 sll_error(this_sub_name,
"File is closed")
168 sll_error(this_sub_name,
"Cannot write to file "//trim(self%filename))
176 sll_real64,
intent(in) :: array(:, :)
177 character(len=*),
intent(in) :: dsetname
179 character(len=*),
parameter :: this_sub_name =
"t_hdf5_serial__write_dble_array_2d"
182 if (.not. self%is_open)
then
183 sll_error(this_sub_name,
"File is closed")
189 sll_error(this_sub_name,
"Cannot write to file "//trim(self%filename))
197 sll_real64,
intent(in) :: array(:, :, :)
198 character(len=*),
intent(in) :: dsetname
200 character(len=*),
parameter :: this_sub_name =
"t_hdf5_serial__write_dble_array_3d"
204 if (.not. self%is_open)
then
205 sll_error(this_sub_name,
"File is closed")
211 sll_error(this_sub_name,
"Cannot write to file "//trim(self%filename))
219 sll_int32,
intent(in) :: array(:)
220 character(len=*),
intent(in) :: dsetname
222 character(len=*),
parameter :: this_sub_name =
"t_hdf5_serial__write_int_array_1d"
226 if (.not. self%is_open)
then
227 sll_error(this_sub_name,
"File is closed")
233 sll_error(this_sub_name,
"Cannot write to file "//trim(self%filename))
241 sll_int32,
intent(in) :: array(:, :)
242 character(len=*),
intent(in) :: dsetname
244 character(len=*),
parameter :: this_sub_name =
"t_hdf5_serial__write_int_array_2d"
248 if (.not. self%is_open)
then
249 sll_error(this_sub_name,
"File is closed")
255 sll_error(this_sub_name,
"Cannot write to file "//trim(self%filename))
263 sll_int32,
intent(in) :: array(:, :, :)
264 character(len=*),
intent(in) :: dsetname
266 character(len=*),
parameter :: this_sub_name =
"t_hdf5_serial__write_int_array_3d"
270 if (.not. self%is_open)
then
271 sll_error(this_sub_name,
"File is closed")
277 sll_error(this_sub_name,
"Cannot write to file "//trim(self%filename))
Write nD array of double precision floats or integers into HDF5 file.
Implements the functions to write hdf5 file to store heavy data.
subroutine, public sll_s_hdf5_ser_file_create(filename, handle, error)
Create new HDF5 file.
subroutine, public sll_s_hdf5_ser_file_close(handle, error)
Close existing HDF5 file.
subroutine, public sll_s_hdf5_ser_file_open(filename, handle, error)
Open existing HDF5 file.
Simple object-oriented wrapper to Pierre's "sll_m_hdf5_io_serial".
subroutine t_hdf5_serial__create(self)
subroutine t_hdf5_serial__close(self)
subroutine t_hdf5_serial__write_int_array_1d(self, array, dsetname)
subroutine t_hdf5_serial__write_int_array_2d(self, array, dsetname)
subroutine t_hdf5_serial__open(self)
subroutine t_hdf5_serial__delete(self)
subroutine t_hdf5_serial__init(self, filename)
subroutine t_hdf5_serial__write_dble_array_3d(self, array, dsetname)
subroutine t_hdf5_serial__write_int_array_3d(self, array, dsetname)
integer, parameter maxlen
Maximum length of non-allocatable strings in module.
subroutine t_hdf5_serial__write_dble_array_1d(self, array, dsetname)
subroutine t_hdf5_serial__write_dble_array_2d(self, array, dsetname)
Opaque object around HDF5 file id.