For a 3-level map and z=0.5, compute_RGB() should select the middle level.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
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