Skip to content

Commit 681c134

Browse files
committed
don't use rank() in argument to avoid oneapi 2025.x ICE
1 parent 2280d3e commit 681c134

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/attr_read.inc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
integer :: ier, attr_class
2+
integer, parameter :: rA = rank(A)
23
integer(HID_T) :: attr_id, space_id
3-
integer(HSIZE_T) :: attr_dims(rank(A))
4+
integer(HSIZE_T) :: attr_dims(rA)
45
logical :: is_scalar
56

67
attr_dims = shape(A, HSIZE_T)
@@ -11,8 +12,8 @@ call estop(ier, "attr_read:H5Aopen_by_name", self%filename, obj_name, attr_name)
1112
call H5Aget_space_f(attr_id, space_id, ier)
1213
call estop(ier, "attr_read:H5Aget_space", self%filename, obj_name, attr_name)
1314

14-
if(rank(A) == 0) then
15-
call hdf_rank_check(self, obj_name // ":" // attr_name, space_id, rank(A), is_scalar)
15+
if(rA == 0) then
16+
call hdf_rank_check(self, obj_name // ":" // attr_name, space_id, rA, is_scalar)
1617
else
1718
call hdf_shape_check(self, obj_name // ":" // attr_name, space_id, attr_dims)
1819
endif

src/read_scalar.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
call H5Dget_space_f(dset_id, file_space_id, ier)
2323
call estop(ier, "read_scalar:H5Dget_space", self%filename, dname)
2424

25-
call hdf_rank_check(self, dname, file_space_id, rank(A), is_scalar)
25+
call hdf_rank_check(self, dname, file_space_id, 0, is_scalar)
2626

2727
if (is_scalar) then
2828
call hdf_get_slice(dims, dset_id, file_space_id, mem_space_id, [1], [1])

test/test_minimal.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ program test_minimal
2424
if (i/=0) error stop 'minimal: could not create file'
2525
print *, 'minimal: created '//filename
2626

27-
call h5ltmake_dataset_f(lid, "A", rank(p), shape(p, kind=HSIZE_T), h5kind_to_type(kind(p),H5_INTEGER_KIND), p, i)
27+
call h5ltmake_dataset_f(lid, "A", 0, shape(p, kind=HSIZE_T), h5kind_to_type(kind(p),H5_INTEGER_KIND), p, i)
2828
if (i/=0) error stop 'minimal: could not create dataset A'
2929
print *, 'minimal: created variable'
3030

0 commit comments

Comments
 (0)