module colormaps
contains

function red_jet(ic,nc)
implicit none
integer ic,nc
double precision a,red_jet
a=4.d0/dble(nc)
if (ic<=3*nc/8) then
   red_jet=0.d0
elseif (ic<=5*nc/8) then
   red_jet=ic*a -1.5
elseif (ic<=7*nc/8) then
   red_jet=1.d0
else
   red_jet=-a*ic+4.5
end if
return
end function

function green_jet(ic,nc)
implicit none
integer ic,nc
double precision a,green_jet
a=4.d0/dble(nc)
if (ic<=nc/8) then
   green_jet= 0.d0
elseif (ic<=3*nc/8) then
   green_jet= ic*a -0.5
elseif (ic<=5*nc/8) then
   green_jet= 1.d0
elseif (ic<=7*nc/8) then
   green_jet=-a*ic+3.5
else
   green_jet=0.d0
end if
return
end function

function blue_jet(ic,nc)
implicit none
integer ic,nc
double precision a,blue_jet
a=4.d0/dble(nc)
if (ic<=nc/8) then
   blue_jet=a*ic+0.5
elseif (ic<=3*nc/8) then
   blue_jet=1.d0
elseif (ic<=5*nc/8) then
   blue_jet= -a*ic+2.5
else
   blue_jet=0.d0
end if
return
end function





!===========================
!====hot===================
!===========================

function red_hot(ic,nc)
implicit none
integer ic,nc
double precision a,red_hot
a=8.d0/dble(nc)/3.d0

if (ic<=3*nc/8) then
   red_hot=ic*a
else
   red_hot=1.d0
end if
return
end function

function green_hot(ic,nc)
implicit none
integer ic,nc
double precision a,green_hot
a=8.d0/dble(nc)/3.d0
if (ic<=3*nc/8) then
   green_hot= 0.d0
elseif (ic<=3*nc/4) then
   green_hot=ic*a-1.
else
   green_hot= 1.
end if
return
end function

function blue_hot(ic,nc)
implicit none
integer ic,nc
double precision a,blue_hot
a=4.d0/dble(nc)
if (ic<=3*nc/4) then
   blue_hot= 0.
else
   blue_hot= ic*a-3.
end if
return
end function





end module
