There are two intrinsics in this class:
Returns a one dimensional array containing the location of the first maximal value in an array under an optional mask. If the MASK is present the only elements considered are where the mask is .TRUE.. Note that the result is always array valued.
The source array is searched from left to right and the position of the first occurrence of the maximum value is returned,
Figure: Visualisation of MAXLOC When Applied to a 1D Array
Consider this further 2D example, if
then
Only the following elements are considered,
the maximal value is at the location indicated.
MAXLOC(Array,Array.LE.7) gives (/1,4/) so the overall result is (/2/) (array valued) corresponding to the location that holds the largest element of the array (/1,4/).
Returns a one dimensional array containing the location of the first minimal value in an array under an optional mask.
The minimal value -7 is element A(3,4).
This is effectively MINLOC((/3,2/)) so the result is (/2/) (array valued) corresponding to the second element of the array (/3,2/).
Return to corresponding overview page