test_075 Subroutine

subroutine test_075(id, nfail)

Uses

  • proc~~test_075~~UsesGraph proc~test_075 test_075 module~forcolormap forcolormap proc~test_075->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

For a 3-level map and z=0.5, compute_RGB() should select the middle level.

Arguments

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

Calls

proc~~test_075~~CallsGraph proc~test_075 test_075 proc~compute_rgb Colormap%compute_RGB proc~test_075->proc~compute_rgb proc~create Colormap%create proc~test_075->proc~create proc~report_test report_test proc~test_075->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_075~~CalledByGraph proc~test_075 test_075 program~check check program~check->proc~test_075

Source Code

   subroutine test_075(id, nfail)
      use forcolormap, only: Colormap, wp
      integer, intent(inout) :: id, nfail
      character(len=*), parameter :: name = "compute_RGB picks interior level for 3-level custom map"
      logical :: ok
      type(Colormap) :: cm
      integer :: map(3,3)
      integer :: r, g, b

      map(1,:) = [  1,  2,  3 ]   ! level 0
      map(2,:) = [ 11, 12, 13 ]   ! level 1 (middle)
      map(3,:) = [ 21, 22, 23 ]   ! level 2

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

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

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