test_051 Subroutine

subroutine test_051(id, nfail)

Uses

  • proc~~test_051~~UsesGraph proc~test_051 test_051 module~forcolormap forcolormap proc~test_051->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 a small discrete colormap and validate basic getters.

Arguments

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

Calls

proc~~test_051~~CallsGraph proc~test_051 test_051 proc~create Colormap%create proc~test_051->proc~create proc~get_levels Colormap%get_levels proc~test_051->proc~get_levels proc~get_name Colormap%get_name proc~test_051->proc~get_name proc~get_zmax Colormap%get_zmax proc~test_051->proc~get_zmax proc~get_zmin Colormap%get_zmin proc~test_051->proc~get_zmin proc~print_status Colormap%print_status proc~test_051->proc~print_status proc~report_test report_test proc~test_051->proc~report_test 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_051~~CalledByGraph proc~test_051 test_051 program~check check program~check->proc~test_051

Source Code

   subroutine test_051(id, nfail)
      use forcolormap, only: Colormap, wp
      integer, intent(inout) :: id, nfail
      character(len=*), parameter :: name = "create(discrete) getters ok"
      logical :: ok
      type(Colormap) :: cmap
      integer, dimension(0:6, 3) :: test_colormap
      real(wp), parameter :: tol = 1.0e-12_wp

      test_colormap = reshape([ &
         1, 2, 3, &
         4, 5, 6, &
         7, 8, 9, &
         0, 0, 0, &
         9, 8, 7, &
         6, 5, 4, &
         3, 2, 1 ], shape(test_colormap), order=[2,1])

      call cmap%create("discrete", 0.0_wp, 2.0_wp, test_colormap)
      call cmap%print_status()

      ok = (cmap%get_levels() == 7) .and. &
         (abs(cmap%get_zmin() - 0.0_wp) <= tol) .and. &
         (abs(cmap%get_zmax() - 2.0_wp) <= tol) .and. &
         (trim(cmap%get_name()) == "discrete")

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