@@ -3629,7 +3629,7 @@ pure function subscript_i1(x, ind) result(subscript)
3629
3629
integer (i1), dimension (:), allocatable :: subscript
3630
3630
integer (i1), dimension (:), allocatable :: indices
3631
3631
integer :: i
3632
- indices = pack (ind, ind > 0 .and. ind < size (x))
3632
+ indices = pack (ind, ind > 0 .and. ind <= size (x))
3633
3633
allocate (subscript(size (indices)))
3634
3634
do concurrent(i = 1 :size (indices))
3635
3635
subscript(i) = x(indices(i))
@@ -3646,7 +3646,7 @@ pure function subscript_i2(x, ind) result(subscript)
3646
3646
integer (i2), dimension (:), allocatable :: subscript
3647
3647
integer (i2), dimension (:), allocatable :: indices
3648
3648
integer :: i
3649
- indices = pack (ind, ind > 0 .and. ind < size (x))
3649
+ indices = pack (ind, ind > 0 .and. ind <= size (x))
3650
3650
allocate (subscript(size (indices)))
3651
3651
do concurrent(i = 1 :size (indices))
3652
3652
subscript(i) = x(indices(i))
@@ -3663,7 +3663,7 @@ pure function subscript_i4(x, ind) result(subscript)
3663
3663
integer (i4), dimension (:), allocatable :: subscript
3664
3664
integer (i4), dimension (:), allocatable :: indices
3665
3665
integer :: i
3666
- indices = pack (ind, ind > 0 .and. ind < size (x))
3666
+ indices = pack (ind, ind > 0 .and. ind <= size (x))
3667
3667
allocate (subscript(size (indices)))
3668
3668
do concurrent(i = 1 :size (indices))
3669
3669
subscript(i) = x(indices(i))
@@ -3680,7 +3680,7 @@ pure function subscript_i8(x, ind) result(subscript)
3680
3680
integer (i8), dimension (:), allocatable :: subscript
3681
3681
integer (i8), dimension (:), allocatable :: indices
3682
3682
integer :: i
3683
- indices = pack (ind, ind > 0 .and. ind < size (x))
3683
+ indices = pack (ind, ind > 0 .and. ind <= size (x))
3684
3684
allocate (subscript(size (indices)))
3685
3685
do concurrent(i = 1 :size (indices))
3686
3686
subscript(i) = x(indices(i))
@@ -3697,7 +3697,7 @@ pure function subscript_r4(x, ind) result(subscript)
3697
3697
real (r4 ), dimension (:), allocatable :: subscript
3698
3698
integer (i4), dimension (:), allocatable :: indices
3699
3699
integer :: i
3700
- indices = pack (ind, ind > 0 .and. ind < size (x))
3700
+ indices = pack (ind, ind > 0 .and. ind <= size (x))
3701
3701
allocate (subscript(size (indices)))
3702
3702
do concurrent(i = 1 :size (indices))
3703
3703
subscript(i) = x(indices(i))
@@ -3714,7 +3714,7 @@ pure function subscript_r8(x, ind) result(subscript)
3714
3714
real (r8 ), dimension (:), allocatable :: subscript
3715
3715
integer (i4), dimension (:), allocatable :: indices
3716
3716
integer :: i
3717
- indices = pack (ind, ind > 0 .and. ind < size (x))
3717
+ indices = pack (ind, ind > 0 .and. ind <= size (x))
3718
3718
allocate (subscript(size (indices)))
3719
3719
do concurrent(i = 1 :size (indices))
3720
3720
subscript(i) = x(indices(i))
@@ -3731,7 +3731,7 @@ pure function subscript_r16(x, ind) result(subscript)
3731
3731
real (r16), dimension (:), allocatable :: subscript
3732
3732
integer (i4), dimension (:), allocatable :: indices
3733
3733
integer :: i
3734
- indices = pack (ind, ind > 0 .and. ind < size (x))
3734
+ indices = pack (ind, ind > 0 .and. ind <= size (x))
3735
3735
allocate (subscript(size (indices)))
3736
3736
do concurrent(i = 1 :size (indices))
3737
3737
subscript(i) = x(indices(i))
@@ -3748,7 +3748,7 @@ pure function subscript_c4(x, ind) result(subscript)
3748
3748
complex (r4 ), dimension (:), allocatable :: subscript
3749
3749
integer (i4), dimension (:), allocatable :: indices
3750
3750
integer :: i
3751
- indices = pack (ind, ind > 0 .and. ind < size (x))
3751
+ indices = pack (ind, ind > 0 .and. ind <= size (x))
3752
3752
allocate (subscript(size (indices)))
3753
3753
do concurrent(i = 1 :size (indices))
3754
3754
subscript(i) = x(indices(i))
@@ -3765,7 +3765,7 @@ pure function subscript_c8(x, ind) result(subscript)
3765
3765
complex (r8 ), dimension (:), allocatable :: subscript
3766
3766
integer (i4), dimension (:), allocatable :: indices
3767
3767
integer :: i
3768
- indices = pack (ind, ind > 0 .and. ind < size (x))
3768
+ indices = pack (ind, ind > 0 .and. ind <= size (x))
3769
3769
allocate (subscript(size (indices)))
3770
3770
do concurrent(i = 1 :size (indices))
3771
3771
subscript(i) = x(indices(i))
@@ -3782,7 +3782,7 @@ pure function subscript_c16(x, ind) result(subscript)
3782
3782
complex (r16), dimension (:), allocatable :: subscript
3783
3783
integer (i4), dimension (:), allocatable :: indices
3784
3784
integer :: i
3785
- indices = pack (ind, ind > 0 .and. ind < size (x))
3785
+ indices = pack (ind, ind > 0 .and. ind <= size (x))
3786
3786
allocate (subscript(size (indices)))
3787
3787
do concurrent(i = 1 :size (indices))
3788
3788
subscript(i) = x(indices(i))
0 commit comments