test_008 Subroutine

subroutine test_008(id, nfail)

Uses

  • proc~~test_008~~UsesGraph proc~test_008 test_008 module~forcolormap_utils forcolormap_utils proc~test_008->module~forcolormap_utils module~forcolormap_parameters forcolormap_parameters module~forcolormap_utils->module~forcolormap_parameters iso_fortran_env iso_fortran_env module~forcolormap_parameters->iso_fortran_env

Ensure factorial is nondecreasing for small n (0..8).

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: id
integer, intent(inout) :: nfail

Calls

proc~~test_008~~CallsGraph proc~test_008 test_008 proc~factorial factorial proc~test_008->proc~factorial proc~report_test report_test proc~test_008->proc~report_test

Called by

proc~~test_008~~CalledByGraph proc~test_008 test_008 program~check check program~check->proc~test_008

Source Code

   subroutine test_008(id, nfail)
      use forcolormap_utils, only: factorial
      integer, intent(inout) :: id, nfail
      character(len=*), parameter :: name = "factorial: monotone for n=0..8"
      logical :: ok
      integer :: n, prev, cur

      ok = .true.
      prev = factorial(0)
      do n = 1, 8
         cur = factorial(n)
         ok = ok .and. (cur >= prev)
         prev = cur
      end do
      call report_test(name, ok, id, nfail)
   end subroutine test_008