@@ -3629,7 +3629,7 @@ pure function subscript_i1(x, ind) result(subscript)
36293629 integer (i1), dimension (:), allocatable :: subscript
36303630 integer (i1), dimension (:), allocatable :: indices
36313631 integer :: i
3632- indices = pack (ind, ind > 0 .and. ind < size (x))
3632+ indices = pack (ind, ind > 0 .and. ind <= size (x))
36333633 allocate (subscript(size (indices)))
36343634 do concurrent(i = 1 :size (indices))
36353635 subscript(i) = x(indices(i))
@@ -3646,7 +3646,7 @@ pure function subscript_i2(x, ind) result(subscript)
36463646 integer (i2), dimension (:), allocatable :: subscript
36473647 integer (i2), dimension (:), allocatable :: indices
36483648 integer :: i
3649- indices = pack (ind, ind > 0 .and. ind < size (x))
3649+ indices = pack (ind, ind > 0 .and. ind <= size (x))
36503650 allocate (subscript(size (indices)))
36513651 do concurrent(i = 1 :size (indices))
36523652 subscript(i) = x(indices(i))
@@ -3663,7 +3663,7 @@ pure function subscript_i4(x, ind) result(subscript)
36633663 integer (i4), dimension (:), allocatable :: subscript
36643664 integer (i4), dimension (:), allocatable :: indices
36653665 integer :: i
3666- indices = pack (ind, ind > 0 .and. ind < size (x))
3666+ indices = pack (ind, ind > 0 .and. ind <= size (x))
36673667 allocate (subscript(size (indices)))
36683668 do concurrent(i = 1 :size (indices))
36693669 subscript(i) = x(indices(i))
@@ -3680,7 +3680,7 @@ pure function subscript_i8(x, ind) result(subscript)
36803680 integer (i8), dimension (:), allocatable :: subscript
36813681 integer (i8), dimension (:), allocatable :: indices
36823682 integer :: i
3683- indices = pack (ind, ind > 0 .and. ind < size (x))
3683+ indices = pack (ind, ind > 0 .and. ind <= size (x))
36843684 allocate (subscript(size (indices)))
36853685 do concurrent(i = 1 :size (indices))
36863686 subscript(i) = x(indices(i))
@@ -3697,7 +3697,7 @@ pure function subscript_r4(x, ind) result(subscript)
36973697 real (r4 ), dimension (:), allocatable :: subscript
36983698 integer (i4), dimension (:), allocatable :: indices
36993699 integer :: i
3700- indices = pack (ind, ind > 0 .and. ind < size (x))
3700+ indices = pack (ind, ind > 0 .and. ind <= size (x))
37013701 allocate (subscript(size (indices)))
37023702 do concurrent(i = 1 :size (indices))
37033703 subscript(i) = x(indices(i))
@@ -3714,7 +3714,7 @@ pure function subscript_r8(x, ind) result(subscript)
37143714 real (r8 ), dimension (:), allocatable :: subscript
37153715 integer (i4), dimension (:), allocatable :: indices
37163716 integer :: i
3717- indices = pack (ind, ind > 0 .and. ind < size (x))
3717+ indices = pack (ind, ind > 0 .and. ind <= size (x))
37183718 allocate (subscript(size (indices)))
37193719 do concurrent(i = 1 :size (indices))
37203720 subscript(i) = x(indices(i))
@@ -3731,7 +3731,7 @@ pure function subscript_r16(x, ind) result(subscript)
37313731 real (r16), dimension (:), allocatable :: subscript
37323732 integer (i4), dimension (:), allocatable :: indices
37333733 integer :: i
3734- indices = pack (ind, ind > 0 .and. ind < size (x))
3734+ indices = pack (ind, ind > 0 .and. ind <= size (x))
37353735 allocate (subscript(size (indices)))
37363736 do concurrent(i = 1 :size (indices))
37373737 subscript(i) = x(indices(i))
@@ -3748,7 +3748,7 @@ pure function subscript_c4(x, ind) result(subscript)
37483748 complex (r4 ), dimension (:), allocatable :: subscript
37493749 integer (i4), dimension (:), allocatable :: indices
37503750 integer :: i
3751- indices = pack (ind, ind > 0 .and. ind < size (x))
3751+ indices = pack (ind, ind > 0 .and. ind <= size (x))
37523752 allocate (subscript(size (indices)))
37533753 do concurrent(i = 1 :size (indices))
37543754 subscript(i) = x(indices(i))
@@ -3765,7 +3765,7 @@ pure function subscript_c8(x, ind) result(subscript)
37653765 complex (r8 ), dimension (:), allocatable :: subscript
37663766 integer (i4), dimension (:), allocatable :: indices
37673767 integer :: i
3768- indices = pack (ind, ind > 0 .and. ind < size (x))
3768+ indices = pack (ind, ind > 0 .and. ind <= size (x))
37693769 allocate (subscript(size (indices)))
37703770 do concurrent(i = 1 :size (indices))
37713771 subscript(i) = x(indices(i))
@@ -3782,7 +3782,7 @@ pure function subscript_c16(x, ind) result(subscript)
37823782 complex (r16), dimension (:), allocatable :: subscript
37833783 integer (i4), dimension (:), allocatable :: indices
37843784 integer :: i
3785- indices = pack (ind, ind > 0 .and. ind < size (x))
3785+ indices = pack (ind, ind > 0 .and. ind <= size (x))
37863786 allocate (subscript(size (indices)))
37873787 do concurrent(i = 1 :size (indices))
37883788 subscript(i) = x(indices(i))
0 commit comments