Skip to content

Commit ac1a2a2

Browse files
committed
median: add check on shapes between mask and x
1 parent 2bc1a8b commit ac1a2a2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/stdlib_stats_median.fypp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ contains
123123
integer(kind = int64) :: c, n
124124
${t1}$, allocatable :: x_tmp(:)
125125

126+
if (any(shape(x) .ne. shape(mask))) then
127+
call error_stop("ERROR (median): shapes of x and mask are different")
128+
error stop
129+
end if
130+
126131
x_tmp = pack(x, mask)
127132

128133
call sort(x_tmp)
@@ -163,6 +168,11 @@ contains
163168
#:endif
164169
${t1}$, allocatable :: x_tmp(:)
165170

171+
if (any(shape(x) .ne. shape(mask))) then
172+
call error_stop("ERROR (median): shapes of x and mask are different")
173+
error stop
174+
end if
175+
166176
select case(dim)
167177
#:for fi in range(1, rank+1)
168178
case(${fi}$)

0 commit comments

Comments
 (0)