We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents eeeadbf + e9814be commit c016c6dCopy full SHA for c016c6d
1 file changed
src/math/stdlib_math_diff.fypp
@@ -91,7 +91,14 @@ contains
91
size_work = size_x + size_prepend + size_append
92
93
if (size_work <= n_) then
94
- allocate(y(0, 0))
+ select case (dim_)
95
+ case (1)
96
+ allocate(y(0, size(x, 2)))
97
+ case (2)
98
+ allocate(y(size(x, 1), 0))
99
+ case default
100
+ error stop "diff_2: internal error: invalid dimension (dim_ must be 1 or 2)"
101
+ end select
102
return
103
end if
104
0 commit comments