set mm2=$mm
if($mm < 10) set mm2=0$mm
if ($mm == 1) set mon=jan ; if ($mm == 2) set mon=feb ;
if ($mm == 3) set mon=mar; if ($mm == 4) set mon=apr ;
if ($mm == 5) set mon=may ; if ($mm == 6) set mon=jun
if ($mm == 7) set mon=jul ; if ($mm == 8) set mon=aug ;
if ($mm == 9) set mon=sep ; if ($mm == 10) set mon=oct ;
if ($mm == 11) set mon=nov ; if ($mm == 12) set mon=dec
set ofl=$odir/$yr-$mm2-$num.4params.ps
set ofl2=$odir/$yr-$mm2-$num.4params.jpg
set ofl3=$odir/$yr-$mm2-$num.4params.png
コントロールファイルの作成
cat << EOF >! $pdir/slp.ctl
DSET $sdir/$yr-$mm2.slp.rev.145x73.flat
TITLE NCEP Sea Level Pressure
OPTIONS yrev
UNDEF -9.99E33
XDEF 145 LINEAR 180 2.5
YDEF 73 LINEAR -90 2.5
ZDEF 1 LEVELS 0
TDEF 1 LINEAR 0Z01$mon$yr 24hr
VARS 1
slp 0 -99 sea level pressure
ENDVARS
EOF
cat << EOF >! $pdir/uwnd.ctl
DSET $udir/$yr-$mm2.uwnd.rev.193x94.flat
TITLE NCEP Wind vector at 10m
OPTIONS yrev
UNDEF 9.96921E36
XDEF 193 LINEAR 180 1.8653
YDEF 94 LINEAR -88.54 1.90418
ZDEF 1 LEVELS 0
TDEF 1 LINEAR 0Z01$mon$yr 24hr
VARS 1
uwnd 0 -99 Uwind
ENDVARS
EOF
cat << EOF >! $pdir/vwnd.ctl
DSET $udir/$yr-$mm2.vwnd.rev.193x94.flat
TITLE NCEP Wind vector at 10m
OPTIONS yrev
UNDEF 9.96921E36
XDEF 193 LINEAR 180 1.8653
YDEF 94 LINEAR -88.54 1.90418
ZDEF 1 LEVELS 0
TDEF 1 LINEAR 0Z01$mon$yr 24hr
VARS 1
vwnd 0 -99 Vwind
ENDVARS
EOF
cat << EOF >! $pdir/ic.ctl
DSET $icdir/$yr/$yr-$mm2-sic.mon.721x721.bil
TITLE NSIDC SSMI-derived Ice concentration
OPTIONS yrev
UNDEF 1100
XDEF 721 LINEAR 180 0.5
YDEF 721 LINEAR -88.54 0.2478
ZDEF 1 LEVELS 0
TDEF 1 LINEAR 0Z01$mon$yr 24hr
VARS 1
ic 0 -99 Ice concentration
ENDVARS
EOF
cat << EOF >! $pdir/ui.ctl
DSET $ivdir/$yr/$yr-$mm2.uice.mon.721x721.bil
TITLE NSIDC SSMI-derived Ice motion U
OPTIONS yrev
UNDEF 9.96921E36
XDEF 721 LINEAR 180 0.5
YDEF 721 LINEAR -88.54 0.2478
ZDEF 1 LEVELS 0
TDEF 1 LINEAR 0Z01$mon$yr 24hr
VARS 1
ui 0 -99 Uvec-ice
ENDVARS
EOF
cat << EOF >! $pdir/vi.ctl
DSET $ivdir/$yr/$yr-$mm2.vice.mon.721x721.bil
TITLE NSIDC SSMI-derived Ice motion V
OPTIONS yrev
UNDEF 9.96921E36
XDEF 721 LINEAR 180 0.5
YDEF 721 LINEAR -88.54 0.2478
ZDEF 1 LEVELS 0
TDEF 1 LINEAR 0Z01$mon$yr 24hr
VARS 1
vi 0 -99 Vvec-ice
ENDVARS
EOF
ここからデータを読みこみ、描画させる
cat << EOF >! $pdir/code
enable print tmp
open $pdir/ic.ctl
open $pdir/slp.ctl
open $pdir/ui.ctl
open $pdir/vi.ctl
open $pdir/uwnd.ctl
open $pdir/vwnd.ctl
カラーパレットの作成
set display color white
set mproj nps
set mpvals 0 360 65 90
set rgb 16 0 0 9
set rgb 17 0 0 28
set rgb 18 0 0 47
set rgb 19 0 0 67
set rgb 20 0 0 86
set rgb 21 0 0 105
set rgb 22 0 0 124
set rgb 23 0 17 143
set rgb 24 0 40 163
set rgb 25 0 61 181
set rgb 26 0 84 200
set rgb 27 0 107 220
set rgb 28 0 130 239
set rgb 29 0 152 255
set rgb 30 53 175 255
set rgb 31 110 198 255
set rgb 32 167 220 255
set rgb 33 225 243 255
set rgb 34 255 255 255
set clevs 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100
set ccols 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
set grads off
set xlint 20
set ylint 10
set grid on 2 1
set map 1 1 2
set frame on
set mpdset hires
set gxout grfill
set strsiz 0.2
set string 0 c 1 0
define ic2=maskout(ic.1,1200)*0.1 マスクの作成
d ic2 海氷密接度
cbarn
set gxout contour
set cmin 970
set cmax 1009
set cint 2
set cstyle 4
set cthick 2
set ccolor 6
d slp.2 海面気圧
set cmin 1010
set cmax 1034
set cint 4
set cstyle 1
set cthick 2
set ccolor 6
d slp.2 海面気圧
draw title Ice motion(cm/s) + UV10m(m/s) (Arctic region) $yr-$mm2
set arrowhead 0.08
set arrscl 1 10
set ccolor 14
set cthick 6
d skip(ui.3,20,10)*0.1;vi.4*0.1 海氷ベクトル
set arrowhead 0.1
set arrscl 1 10
set ccolor 6
set cthick 5
#set gxout barb
d skip(uwnd.5,6,2);vwnd.6 海上風ベクトル
print
disable print
EOF
grads < code
#rm -fr code $pdir/*.ctl
gxps -i tmp -o $ofl -c カラーで出力(-cオプション)
rm -fr tmp
convert -density 150 -rotate 90 $ofl $ofl2 変換
rm -fr $ofl
@ mm++
@ num++
end
exit
|