test_042 Subroutine

subroutine test_042(id, nfail)

Uses

  • proc~~test_042~~UsesGraph proc~test_042 test_042 module~forcolormap forcolormap proc~test_042->module~forcolormap module~forcolormap_cm_matplotlib forcolormap_cm_matplotlib module~forcolormap->module~forcolormap_cm_matplotlib module~forcolormap_cm_miscellaneous forcolormap_cm_miscellaneous module~forcolormap->module~forcolormap_cm_miscellaneous module~forcolormap_cm_scientific forcolormap_cm_scientific module~forcolormap->module~forcolormap_cm_scientific module~forcolormap_info forcolormap_info module~forcolormap->module~forcolormap_info module~forcolormap_parameters forcolormap_parameters module~forcolormap->module~forcolormap_parameters module~forcolormap_utils forcolormap_utils module~forcolormap->module~forcolormap_utils module~forcolormap_cm_matplotlib->module~forcolormap_parameters module~forcolormap_cm_miscellaneous->module~forcolormap_parameters module~forcolormap_cm_scientific->module~forcolormap_parameters module~forcolormap_info->module~forcolormap_cm_matplotlib module~forcolormap_info->module~forcolormap_cm_miscellaneous module~forcolormap_info->module~forcolormap_cm_scientific module~forcolormap_info->module~forcolormap_parameters iso_fortran_env iso_fortran_env module~forcolormap_parameters->iso_fortran_env module~forcolormap_utils->module~forcolormap_parameters

compute_RGB() should clamp z below/above the bounds to the first/last color.

Arguments

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

Calls

proc~~test_042~~CallsGraph proc~test_042 test_042 proc~compute_rgb Colormap%compute_RGB proc~test_042->proc~compute_rgb proc~create Colormap%create proc~test_042->proc~create proc~report_test report_test proc~test_042->proc~report_test proc~get_rgb Colormap%get_RGB proc~compute_rgb->proc~get_rgb proc~assign_map Colormap%assign_map proc~create->proc~assign_map proc~check Colormap%check proc~create->proc~check proc~reverse Colormap%reverse proc~create->proc~reverse proc~find_index Colormaps_info%find_index proc~check->proc~find_index proc~get_levels~2 Colormaps_info%get_levels proc~check->proc~get_levels~2

Called by

proc~~test_042~~CalledByGraph proc~test_042 test_042 program~check check program~check->proc~test_042

Source Code

   subroutine test_042(id, nfail)
      use forcolormap, only: Colormap, wp
      integer, intent(inout) :: id, nfail
      character(len=*), parameter :: name = "Colormap%compute_RGB: clamps z outside bounds"
      logical :: ok
      type(Colormap) :: cm
      integer :: map(2,3)
      integer :: r, g, b

      map(1,:) = [  1,  2,  3 ]
      map(2,:) = [ 11, 12, 13 ]

      call cm%create("custom", 0.0_wp, 1.0_wp, map)

      call cm%compute_RGB(-10.0_wp, r, g, b)
      ok = (r == 1) .and. (g == 2) .and. (b == 3)

      call cm%compute_RGB( 10.0_wp, r, g, b)
      ok = ok .and. (r == 11) .and. (g == 12) .and. (b == 13)

      call report_test(name, ok, id, nfail)
   end subroutine test_042