test_017 Subroutine

subroutine test_017(id, nfail)

Uses

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

Monotone input should remain monotone after affine rescaling.

Arguments

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

Calls

proc~~test_017~~CallsGraph proc~test_017 test_017 proc~report_test report_test proc~test_017->proc~report_test

Called by

proc~~test_017~~CalledByGraph proc~test_017 test_017 program~check check program~check->proc~test_017

Source Code

   subroutine test_017(id, nfail)
      use forcolormap_parameters, only: wp
      use forcolormap_utils,      only: scale
      integer, intent(inout) :: id, nfail
      character(len=*), parameter :: name = "scale(real,real): monotone input stays monotone"
      logical :: ok
      real(wp), parameter :: tol = 1.0e-12_wp
      real(wp) :: x(5), y(5)
      integer :: i

      x = [ -2.0_wp, -1.0_wp, 0.0_wp, 1.0_wp, 2.0_wp ]
      y = scale(x, 10.0_wp, 20.0_wp)

      ok = .true.
      do i = 1, 4
         ok = ok .and. (y(i+1) + tol >= y(i))
      end do
      call report_test(name, ok, id, nfail)
   end subroutine test_017