Real scaling should map the input minimum to a and maximum to b.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
subroutine test_015(id, nfail) use forcolormap_parameters, only: wp use forcolormap_utils, only: scale integer, intent(inout) :: id, nfail character(len=*), parameter :: name = "scale(real,real): min->a, max->b" logical :: ok real(wp), parameter :: tol = 1.0e-12_wp real(wp) :: x(3), y(3) real(wp) :: a, b a = -2.0_wp b = 3.0_wp x = [ -5.0_wp, 0.0_wp, 5.0_wp ] y = scale(x, a, b) ok = abs(y(1) - a) <= tol .and. abs(y(3) - b) <= tol call report_test(name, ok, id, nfail) end subroutine test_015