within_limits Function

private pure function within_limits(row, column, limits)

Checks whether a point is within bounds \return whether the point is within the bounds

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: row

point to check point to check

integer, intent(in) :: column

point to check point to check

integer, intent(in), DIMENSION(4) :: limits

limits (low_row, high_row, low_col, high_col)

Return Value logical


Source Code

   PURE FUNCTION within_limits(row, column, limits)
      !! Checks whether a point is within bounds
      !! \return whether the point is within the bounds

      INTEGER, INTENT(IN)                                :: row, column
         !! point to check
         !! point to check
      INTEGER, DIMENSION(4), INTENT(IN)                  :: limits
         !! limits (low_row, high_row, low_col, high_col)
      LOGICAL                                            :: within_limits

      within_limits = row .GE. limits(1) .AND. row .LE. limits(2) .AND. &
                      column .GE. limits(3) .AND. column .LE. limits(4)
   END FUNCTION within_limits