FU_Arrays Module

Functions to manipulate 1D arrays.


Uses


Contents


Interfaces

public interface is_ordered

Checks if an array is ascending ordered.

Syntax

 y = is_ordered(arr)

Where:

  • arr: Array to test if it is ascending ordered.

It returns .TRUE. if the array is ascending ordered and .FALSE. otherwise.

Example

The following program checks if an array is ascending ordered:

 PROGRAM is_orderedExample
    USE FU_Arrays, ONLY: is_ordered
    IMPLICIT NONE
    REAL,DIMENSION(6) :: X = (/1., 2., 3., 4., 5., 6./)
    WRITE(*,*) is_ordered(X)
 END PROGRAM is_orderedExample
  • private pure function is_ordered_sp(arr) result(res)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in), DIMENSION(:) :: arr

    Vector to test if it is ascending ordered

    Return Value logical

    .TRUE. if it is ascending ordered, .FALSE. otherwise

  • private pure function is_ordered_dp(arr) result(res)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in), DIMENSION(:) :: arr

    Vector to test if it is ascending ordered

    Return Value logical

    .TRUE. if it is ascending ordered, .FALSE. otherwise

  • private pure function is_ordered_qp(arr) result(res)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=qp), intent(in), DIMENSION(:) :: arr

    Vector to test if it is ascending ordered

    Return Value logical

    .TRUE. if it is ascending ordered, .FALSE. otherwise