Creates a colormap with fire tones, similar to the black_body colormap
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | levels | |||
| integer, | intent(out), | dimension(:,:), allocatable | :: | map |
pure subroutine fire_colormap(levels, map) integer, intent(in) :: levels integer, dimension(:,:), allocatable, intent(out) :: map integer :: last, i ! Best with 256 levels but you can try other numbers: last = levels - 1 allocate(map(0:last, 1:3)) do concurrent (i = 0:last) map(i, 1) = nint(last * exp(-((last-i) / 200.0_wp)**7.0_wp)) map(i, 2) = nint(last * exp(-((last-i) / 120.0_wp)**1.8_wp)) map(i, 3) = nint(last * exp(-((last-i) / 40.0_wp)**0.7_wp)) end do end subroutine fire_colormap