| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=sp), | intent(in) | :: | V(:) | |||
| logical, | intent(in), | optional | :: | ascending |
pure function is_sorted_real_sp (V, ascending) result(res) real (sp), intent(in) :: V(:) logical, intent(in), optional :: ascending logical :: ascending_ logical :: res integer :: i if(present(ascending)) then ascending_ = ascending else ascending_ = .true. endif res = .true. if (ascending_) then do i = 1, size(V) - 1 if (V(i) > V(i + 1)) then res = .false. return end if end do else do i = 1, size(V) - 1 if (V(i) < V(i + 1)) then res = .false. return end if end do end if end function is_sorted_real_sp