Problem with GMT6 and grd2cpt or makecpt

Hi,
As training to the modern mode of GMT6, I try to convert some GMT5 scripts into GMT6 ones. But some gmt command which worked well with GMT5 doesn’t with GMT6. In particular grd2cpt or makecpt : it seems that GMT6 doesn’t write anything into the output cpt file. So the output script says : output.cpt has no z-slices.

With GMT5 scripts, I used

grid=$rasterpath/etopo1/ETOPO1_Ice_g_gmt4.grd
region=-R0/166/-15/70
projection=-JM83/27.5/18c

gmt makecpt -Cgeo -T-8000/8000/50 -Z -N > ./topo-Eurasie.cpt
colormap=./topo-Eurasie.cpt

gmt grdgradient $grid $region -A30/60 -V -G$temp_shade_filename -Nt
gmt grdimage $grid $region $projection -C$colormap \
	-I$temp_shade_filename -n+c -V -K -Yc > $carte
gmt psscale -C$colormap -Dx7c/1.5c+w5c/0.2c+e+h+jCT -Bxaf+l"Topographie" -By+l"m" -I$temp_shade_filename -V -O -K  >> $carte
gmt pscoast -Wdefault,black $region $projection -Di -N1/default,sienna -A100 -I1/default,steelblue -O -K -V >> $carte

With GMT6 modern syntax, it should become

 gmt begin map
grid=$rasterpath/etopo1/ETOPO1_Ice_g_gmt4.grd
region=-R0/166/-15/70
projection=-JM83/27.5/18c

gmt makecpt -Cgeo -T-8000/8000/50 -Z -N > ./topo-Eurasie.cpt
colormap=./topo-Eurasie.cpt
gmt grdgradient $grid $region -A30/60 -V -G$temp_shade_filename -Nt
gmt grdimage $grid $region $projection -C$colormap -I$temp_shade_filename -n+c -Yc -V
gmt colorbar -C$colormap -Dx7.5c/1.5c+w5c/0.2c+e+h+jCT -Bxaf+l"Topographie" -By+l"m" -I$temp_shade_filename -V
gmt coast -Wdefault,black $region $projection -Di -N1/default,sienna -A100 -I1/default,steelblue -V

gmt end show

The map is done, but without any color. The same is true with grd2cpt.
Conversely, using build-in color scales like
gmt grdimage $grid $region $projection -Cetopo1 -I$temp_shade_filename -n+c -Yc -V
give me the expected map with the ETOPO1 color scale. But it seems I can’t use a personal color scale.
Could you say me why the output color scales are not set with GMT6 ?

Thanks,
Cyril

See https://docs.generic-mapping-tools.org/latest/grd2cpt.html#note-on-cpts-in-modern-mode.

In modern mode you rarely have to specify CPT file names. There are a few cases where you do, such as in making animations via movie. Otherwise, if you must create an explicit CPT file in modern mode you need to use -H.