test_021 Subroutine

subroutine test_021(id, nfail)

Uses

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

Reversed integer bounds [20,10] should still map endpoints and keep values inside the range.

Arguments

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

Calls

proc~~test_021~~CallsGraph proc~test_021 test_021 proc~report_test report_test proc~test_021->proc~report_test

Called by

proc~~test_021~~CalledByGraph proc~test_021 test_021 program~check check program~check->proc~test_021

Source Code

   subroutine test_021(id, nfail)
      use forcolormap_parameters, only: wp
      use forcolormap_utils,      only: scale
      integer, intent(inout) :: id, nfail
      character(len=*), parameter :: name = "scale(real,int): reversed integer range [20,10] endpoints"
      logical :: ok
      real(wp) :: x(3)
      integer  :: y(3)

      x = [ -2.0_wp, 0.0_wp, 2.0_wp ]
      y = scale(x, 20, 10)

      ok = (y(1) == 20) .and. (y(3) == 10) .and. (y(2) <= 20) .and. (y(2) >= 10)
      call report_test(name, ok, id, nfail)
   end subroutine test_021