test_041 Subroutine

subroutine test_041(id, nfail)

Uses

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

create() should accept a custom map and allow RGB lookup at the bounds.

Arguments

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

Calls

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

Source Code

   subroutine test_041(id, nfail)
      use forcolormap, only: Colormap, wp
      integer, intent(inout) :: id, nfail
      character(len=*), parameter :: name = "Colormap%create: endpoints via compute_RGB"
      logical :: ok
      type(Colormap) :: cm
      integer :: map(3,3)
      integer :: r, g, b

      map(1,:) = [ 10, 20, 30 ]
      map(2,:) = [ 40, 50, 60 ]
      map(3,:) = [ 70, 80, 90 ]

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

      call cm%compute_RGB(0.0_wp, r, g, b)
      ok = (r == 10) .and. (g == 20) .and. (b == 30)

      call cm%compute_RGB(2.0_wp, r, g, b)
      ok = ok .and. (r == 70) .and. (g == 80) .and. (b == 90)

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