test_018 Subroutine

subroutine test_018(id, nfail)

Uses

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

Reversed bounds (a>b) should still map min->a and max->b.

Arguments

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

Calls

proc~~test_018~~CallsGraph proc~test_018 test_018 proc~report_test report_test proc~test_018->proc~report_test

Called by

proc~~test_018~~CalledByGraph proc~test_018 test_018 program~check check program~check->proc~test_018

Source Code

   subroutine test_018(id, nfail)
      use forcolormap_parameters, only: wp
      use forcolormap_utils,      only: scale
      integer, intent(inout) :: id, nfail
      character(len=*), parameter :: name = "scale(real,real): reversed range a>b maps min->a, max->b"
      logical :: ok
      real(wp), parameter :: tol = 1.0e-12_wp
      real(wp) :: x(3), y(3)
      real(wp) :: a, b

      a = 5.0_wp
      b = -1.0_wp
      x = [ -2.0_wp, 0.0_wp, 2.0_wp ]

      y = scale(x, a, b)
      ok = abs(y(1) - a) <= tol .and. abs(y(3) - b) <= tol
      call report_test(name, ok, id, nfail)
   end subroutine test_018