Creates a rainbow like colormap, from dark blue to red
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(out), | dimension(:,:), allocatable | :: | map |
pure subroutine rainbow_colormap(map) integer, dimension(:,:), allocatable, intent(out) :: map integer :: levels, last, i ! The user can not choose the number of levels: levels = 256 last = levels - 1 allocate(map(0:last, 1:3)) ! We add three gaussians (red, green, blue): do concurrent (i = 0:last) map(i, 1) = nint(last * exp(-((206-i) / 70.0_wp)**2.0_wp)) map(i, 2) = nint(last * exp(-((156-i) / 70.0_wp)**2.0_wp)) map(i, 3) = nint(last * exp(-((106-i) / 70.0_wp)**2.0_wp)) end do end subroutine rainbow_colormap