Re: Index of array from mask




"dpb" <none@xxxxxxx> wrote in message news:fvad2l$tmh$3@xxxxxxxxxxx
Thomas Koenig wrote:

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...

Maybe:

program main
implicit none
integer, dimension(5) :: v
integer :: a, b, i
v = (/103,102,103,104,105/)
a = 102
b = 105
write (*,*) pack(v, mask = v > 102 .and. v <105)
end program main



Regards,



Mike Metcalf



.



Relevant Pages

  • Re: Index of array from mask
    ... MAXLOC() but that would return the locations of array elements meeting the ... mask conditions... ... implicit none ...
    (comp.lang.fortran)
  • Re: Index of array from mask
    ... Thomas Koenig wrote: ... implicit none ... I think he was looking for an intrinsic on the order of COUNTor MAXLOCbut that would return the locations of array elements meeting the mask conditions... ...
    (comp.lang.fortran)
  • Re: idmax, idmin in blas extension
    ... according to the mannual of blas, they belong to the extension of ... except using a mask. ... Maxloc is a little ... In my reference, it's given as: ...
    (comp.lang.fortran)
  • Re: Index of array from mask
    ... Paul van Delst wrote: ... MAXLOC() but that would return the locations of array elements meeting the ... I tend to forget pack() far too often...sharp! ...
    (comp.lang.fortran)
  • Re: Intrinsic functions in f90
    ... No specific intrinsic exists for the intrinsic call "MAXLOC". ... "Michel OLAGNON" wrote in message ... > Since the standard order of arguments to maxloc is Array, Dim, Mask, I ... > suspect that you should either write ...
    (comp.lang.fortran)