The fortran routine minloc(array) returns the indices at which the minimum value in array occurs. However the return must be a vector quantity of the same size as the array has dimensions. This can be slightly clunky if array is of dimension 1 - ie, a 1-dimensional vector. The function minLoc1d allows one to obtain the index of the minimum value of the 1-D argument in a scalar return value. This can save some lines of code.
interface minLoc1d function minLoc1dSingle(vector, mask) real(single), intent(in) :: vector(:) logical(bool), intent(in), optional :: mask(:) integer :: minLoc1dSingle end function function minLoc1dDouble(vector, mask) real(double), intent(in) :: vector(:) logical(bool), intent(in), optional :: mask(:) integer :: minLoc1dSingle end function end interface