test_015 Subroutine

subroutine test_015(id, nfail)

Uses

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

Real scaling should map the input minimum to a and maximum to b.

Arguments

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

Calls

proc~~test_015~~CallsGraph proc~test_015 test_015 proc~report_test report_test proc~test_015->proc~report_test

Called by

proc~~test_015~~CalledByGraph proc~test_015 test_015 program~check check program~check->proc~test_015

Source Code

   subroutine test_015(id, nfail)
      use forcolormap_parameters, only: wp
      use forcolormap_utils,      only: scale
      integer, intent(inout) :: id, nfail
      character(len=*), parameter :: name = "scale(real,real): 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 = -2.0_wp
      b =  3.0_wp
      x = [ -5.0_wp, 0.0_wp, 5.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_015