使用法
$ grads -bcp "contour.exercise.gs"
ソースコード
[2017年 8月 8日 火曜日 19:06:54 JST]
[~/TEACHING/Typhoon.Kids/Typhoon.Contour]
[am@aofd165]
$ srcdump.sh contour.exercise.gs
------------------------------
List of the following files:
------------------------------
contour.exercise.gs
------------------------------
Machine info
------------------------------
aofd165.bio.mie-u.ac.jp
/work2/am/TEACHING/Typhoon.Kids/Typhoon.Contour
Tue Aug 8 19:22:01 JST 2017
======================
contour.exercise.gs
======================
#
# Exercise of drawing contour plot
#
#
dir='/misc/raid112MANDA/KakenA.H28/MSM/2017/MSM-S/'
'sdfopen 'dir'0807.nc'
'q ctlinfo'
say result
'set grads off'
i=1
while (i<=24)
'cc'
'set t 'i
'set lon 131 141'
'set lat 27 37'
xmin=1
xmax=8 ;#7
ymin=1
ymax=11 ;#9
'set parea 'xmin' 'xmax' 'ymin' 'ymax
'set xlint 1'
'set ylint 1'
'set xlopts 1 8 0.2'
'set ylopts 1 8 0.2'
'set mpdset hires'
'set poli on'
'set map 1 1 6'
'set gxout contour'
'set clab forced'
'set cthick 10'
'set ccolor 15'
'set cstyle 2'
'set clab forced'
'set clopts 1 5 0.09'
p1=980
p2=985
p3=990
p4=995
p5=1000
p6=1005
p7=1010
p8=1015
'set clevs 'p1' 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8
'd psea/100'
'set gxout vector'
'set arrscl 0.5 40'
'set cthick 10'
'set ccolor 0'
'd skip(maskout(u,mag(u,v)-5),10,10);skip(maskout(v,mag(u,v)-5),10,10)'
'set arrscl 0.5 40'
'set cthick 3'
'set ccolor 1'
'd skip(maskout(u,mag(u,v)-5),10,10);skip(maskout(v,mag(u,v)-5),10,10)'
'set line 1 1 6'
'draw rec 1.0 0.6 1.5 1.1'
'draw rec 1.5 0.6 2.0 1.1'
'draw rec 2.0 0.6 2.5 1.1'
'draw rec 2.5 0.6 3.0 1.1'
'draw rec 3.0 0.6 3.5 1.1'
'draw rec 3.5 0.6 4.0 1.1'
'draw rec 4.0 0.6 4.5 1.1'
'set string 1 c 5 0'
'set strsiz 0.12 0.14'
'draw string 1.0 0.5 'p1
'draw string 1.5 0.5 'p2
'draw string 2.0 0.5 'p3
'draw string 2.5 0.5 'p4
'draw string 3.0 0.5 'p5
'draw string 3.5 0.5 'p6
'draw string 4.0 0.5 'p7
'draw string 4.5 0.5 'p8
'draw string 5.1 0.85 [hPa]'
lonP=136.49393
latP=34.745816
'markplot 'lonP' 'latP' -c 2 -m 3 -s 0.25'
'q dims'
say result
line=sublin(result,5)
datetime_utc=subwrd(line,6)
yyyy_utc=substr(datetime_utc,9,4)
mmm_utc=substr(datetime_utc,6,3)
dd_utc=substr(datetime_utc,4,2)
hh_utc=substr(datetime_utc,1,2)
yyyy=yyyy_utc
mmm=mmm_utc
dd=dd_utc
hh=hh_utc+9
if (hh >= 24)
hh=hh - 24
dd=dd_utc + 1
dd='0'dd
endif
if (mmm = 'JAN')
mm=01
endif
if (mmm = 'FEB')
mm=02
endif
if (mmm = 'MAR')
mm=03
endif
if (mmm = 'APR')
mm=04
endif
if (mmm = 'MAY')
mm=05
endif
if (mmm = 'JUN')
mm=06
endif
if (mmm = 'JUL')
mm=07
endif
if (mmm = 'AUG')
mm=08
endif
if (mmm = 'SEP')
mm=09
endif
if (mmm = 'OCT')
mm=10
endif
if (mmm = 'NOV')
mm=11
endif
if (mmm = 'DEC')
mm=12
endif
hh=math_format('%02.2g', hh)
datetime_h=yyyy'/'mm'/'dd' 'hh':00'
datetime_f=yyyy''mm''dd'_'hh
'set string 1 tc 8 0'
'set strsiz 0.2 0.25'
'draw string 4.5 10.55 'datetime_h
'set string 1 tc 8 0'
'set strsiz 0.2 0.25'
'draw string 4.5 10.95 Sea Level Pressure [hPa]'
'set strsiz 0.1 0.12'
'draw string 6.68 1.22 m/s'
'gxprint psea_'datetime_f'.eps'
i=i+1
endwhile
quit
----------------------
End of contour.exercise.gs
----------------------