Create a small discrete colormap and validate basic getters.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
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