Skip to content

Commit 1ca1259

Browse files
committed
write: harmonize variable names
1 parent 400c8fc commit 1ca1259

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/write/writer_template.f90

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
integer(HID_T) :: did, sid, mem_sid, dtype
1+
integer(HID_T) :: file_space_id, mem_space_id, dset_id, xfer_id, dtype
22
integer(HSIZE_T) :: dims(rank(value))
33
integer :: ier
44

5+
xfer_id = H5P_DEFAULT_F
6+
57
dims = shape(value, HSIZE_T)
68

79
select type (value)
@@ -17,31 +19,31 @@
1719
error stop "unknown variable type for " // dname
1820
end select
1921

20-
call hdf_create(self, dname, dtype, dims, sid, did, chunk_size, istart, iend, stride, compact)
22+
call hdf_create(self, dname, dtype, dims, file_space_id, dset_id, chunk_size, istart, iend, stride, compact)
2123

22-
mem_sid = H5S_ALL_F !< default
24+
mem_space_id = H5S_ALL_F !< default
2325

2426
if(present(istart) .and. present(iend)) then
2527
if(present(stride)) then
2628
!! necessary to use this present check for Intel and GCC
27-
call hdf_get_slice(self, dname, did, sid, mem_sid, istart, iend, stride)
29+
call hdf_get_slice(self, dname, dset_id, file_space_id, mem_space_id, istart, iend, stride)
2830
else
29-
call hdf_get_slice(self, dname, did, sid, mem_sid, istart, iend)
31+
call hdf_get_slice(self, dname, dset_id, file_space_id, mem_space_id, istart, iend)
3032
endif
3133
endif
3234

3335
select type (value)
3436
type is (real(real32))
35-
call h5dwrite_f(did, dtype, value, dims, ier, mem_sid, sid)
37+
call h5dwrite_f(dset_id, dtype, value, dims, ier, file_space_id=file_space_id, mem_space_id=mem_space_id, xfer_prp=xfer_id)
3638
type is (real(real64))
37-
call h5dwrite_f(did, dtype, value, dims, ier, mem_sid, sid)
39+
call h5dwrite_f(dset_id, dtype, value, dims, ier, file_space_id=file_space_id, mem_space_id=mem_space_id, xfer_prp=xfer_id)
3840
type is (integer(int32))
39-
call h5dwrite_f(did, dtype, value, dims, ier, mem_sid, sid)
41+
call h5dwrite_f(dset_id, dtype, value, dims, ier, file_space_id=file_space_id, mem_space_id=mem_space_id, xfer_prp=xfer_id)
4042
type is (integer(int64))
41-
call h5dwrite_f(did, dtype, value, dims, ier, mem_sid, sid)
43+
call h5dwrite_f(dset_id, dtype, value, dims, ier, file_space_id=file_space_id, mem_space_id=mem_space_id, xfer_prp=xfer_id)
4244
class default
4345
error stop "unknown variable type for " // dname
4446
end select
4547
if (ier/=0) error stop 'h5fortran:ERROR: could not write ' // dname // ' to ' // self%filename
4648

47-
call hdf_wrapup(did, sid)
49+
call hdf_wrapup(dset_id, file_space_id)

0 commit comments

Comments
 (0)