Skip to content

Commit a33cfc3

Browse files
committed
use %ndims instead of %rank to avoid possible confusion
1 parent 9784fac commit a33cfc3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ exists = h5exist("my.h5", "/foo")
113113

114114
## check variable shape, rank/ndims
115115

116-
`h5f%rank == h5f%ndims` for convenience, both methods are equivalent.
116+
`h5f%ndims` we didn't use `%rank` to avoid confusion with intrinsic "rank()"
117117

118118
```fortran
119119
call h5f%initialize('test.h5', status='old',action='r')
120120
121121
integer :: drank
122122
integer(hsize_t), allocatable :: dims(:)
123123
124-
drank = h5f%rank('/foo')
124+
drank = h5f%ndims('/foo')
125125
call h5f%shape('/foo',dims)
126126
127127
if (drank /= size(dims)) error stop

src/interface.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module h5fortran
2424

2525
!> Workaround for Intel 19.1 / 2020 bug with /stand:f18
2626
!> error #6410: This name has not been declared as an array or a function. [RANK]
27+
!> GCC 10.2.0 generates spurious Wsurprising from having this here.
2728
intrinsic :: rank
2829

2930
!> main type
@@ -48,7 +49,7 @@ module h5fortran
4849
procedure, public :: initialize => hdf_initialize, finalize => hdf_finalize, &
4950
write_group, writeattr, &
5051
open => hdf_open_group, close => hdf_close_group, flush => hdf_flush, &
51-
rank => hdf_get_ndims, ndims => hdf_get_ndims, &
52+
ndims => hdf_get_ndims, &
5253
shape => hdf_get_shape, layout => hdf_get_layout, chunks => hdf_get_chunk, &
5354
exist => hdf_check_exist, exists => hdf_check_exist, &
5455
is_contig => hdf_is_contig, is_chunked => hdf_is_chunked

0 commit comments

Comments
 (0)