Re: Index of array from mask
- From: dpb <none@xxxxxxx>
- Date: Wed, 30 Apr 2008 13:15:28 -0500
Thomas Koenig wrote:
On 2008-04-30, hiphop <ratel.gilles@xxxxxxx> wrote:
Suppose V = (/103,102,103,104,105/)
a = 102
b = 105
I am interested get index for (V > a ) .AND. (V < b) ==> answer:
1,3, 4
program main
implicit none
integer, dimension(5) :: v
integer :: a, b, i
v = (/103,102,103,104,105/)
a = 102
b = 105
do i = 1, size(v)
if (v(i) > a .and. v(i) < b) write (*,'(1X,I0)',advance='no') i
end do
write (*,*)
end program main
Or am I missing something here?
I think he was looking for an intrinsic on the order of COUNT() or MAXLOC() but that would return the locations of array elements meeting the mask conditions...
That isn't available directly...
--
.
- Follow-Ups:
- Re: Index of array from mask
- From: Michael Metcalf
- Re: Index of array from mask
- References:
- Index of array from mask
- From: hiphop
- Re: Index of array from mask
- From: Thomas Koenig
- Index of array from mask
- Prev by Date: Re: variable length of integer
- Next by Date: Re: Index of array from mask
- Previous by thread: Re: Index of array from mask
- Next by thread: Re: Index of array from mask
- Index(es):
Relevant Pages
|