色は渦位,実線は高度
GSM.Q.run.sh
#!/bin/sh
dataset=GSM
var=PV
exe=${dataset}.${var}.gs
if [ ! -f $exe ]; then
echo Error in $0 : No such file, $exe
exit 1
fi
yyyy=2011
mm=05
dd=23
hh=00
# Parameters
indir=/work1/am/Sato.Kodama.Manda2015/SYNOPTIC.ANALYSIS/GSM/Data.GrADS/output
input=GSM.2011052200.ctl
outdir=fig
mkdir -vp $outdir
prefix= #MandA2012Leg3
lev=300 # Vertical Level in hPa
opt="-indir $indir -input $input -outdir ${outdir}"
ci=3 #Contour Interval
it=4
nt=8
opt_grads=bcp
while [ $it -le $nt ]; do
grads -${opt_grads} "$exe $opt -t1 $it -lev $lev -var ${var} -ci $ci -q"
it=$(expr $it + 1 )
done
exit 0
GSM.PV.gs
function gsm( args )
*
* Default values
*
indir='/work1/am/Sato.Kodama.Manda2015/SYNOPTIC.ANALYSIS/GSM/Data.GrADS/output'
input='GSM.2011052200.ctl'
outdir='.'
lonw=110; lone=155
lats=15; latn=52.0
out='GSM.2011052200.eps'
quitopt='no'
lev=500
ci=5
var='PV'
scl=4
*
* Decode options
*
i = 1
while( 1 )
arg = subwrd( args, i )
i = i + 1;
if( arg = '' ); break; endif
while( 1 )
if( arg = '-indir');indir = subwrd(args,i);i=i+1; break;endif
if( arg = '-outdir');outdir = subwrd(args,i);i=i+1; break;endif
if( arg = '-input');input = subwrd(args,i);i=i+1; break;endif
if( arg = '-var' ) ;var = subwrd(args,i);i=i+1; break;endif
if( arg = '-lonw' );lonw = subwrd(args,i);i=i+1; break;endif
if( arg = '-lone' );lone = subwrd(args,i);i=i+1; break;endif
if( arg = '-lats' );lats = subwrd(args,i);i=i+1; break;endif
if( arg = '-latn' );latn = subwrd(args,i);i=i+1; break;endif
if( arg = '-lev' ); lev = subwrd(args,i) ;i=i+1; break;endif
if( arg = '-t1' ); t1 = subwrd(args,i) ;i=i+1; break;endif
if( arg = '-ci' ); ci = subwrd(args,i) ;i=i+1; break;endif
if( arg = '-q' ); quitopt=yes ;i=i+1; break;endif
say 'Syntax error : arg= 'arg
return
endwhile
endwhile
'open 'indir'/'input
#'q ctlinfo'
#say result
'set t 't1
#'q file'
#say result
'q dims'
say result
line=sublin(result,5)
datetime=subwrd(line,6)
hh=substr(datetime,1,2)
dd=substr(datetime,4,2)
mmm=substr(datetime,6,3)
yyyy=substr(datetime,9,4)
line=sublin(result,4)
pha=subwrd(line,6)
say lev ' hPa'
'set lon 'lonw' 'lone
'set lat 'lats' 'latn
# 'set mproj lambert'
'set parea 1 6 2 9'
'set xlopts 1 5 0.2'
'set ylopts 1 5 0.2'
'set xlint 10'
'set ylint 10'
'set gxout shade2'
### PV
'set z 2 16'
'coriol=2*7.29e-5*sin(lat*3.14159265/180)'
'vort=hcurl(u,v)'
'dt=t(z-1)*pow(1000/lev(z-1),0.286)-t(z+1)*pow(1000/lev(z+1),0.286)'
'dp=100*(lev(z-1)-lev(z+1))'
'dtdp=dt/dp'
'pv = -9.8*(coriol+vort)*dtdp'
'pvu=pv*1E6'
'set lev 'lev
'color -levs 0.5 1 2 3 4 5 6 7 -kind white->lightsteelblue->greenyellow->gold->navajowhite->red'
'd pvu'
'cbarn 1 1 6.5 5.5'
'set strsiz 0.18 0.2'
'set string 1 c 5 0'
'draw string 6.8 7.9 PVU' ;# 1PUV=10^(-6) m2 s-1K kg-1
### Z
'set gxout contour'
'set cint 50'
'set ccolor 0'
'set cthick 20'
'set clab off'
'set xlopts 1 0 0'
'set ylopts 1 0 0'
'd z'
'set ccolor 1'
'set cint 50'
'set clab off'
'set cthick 5'
'set xlopts 1 0 0'
'set ylopts 1 0 0'
'd z'
'set ccolor 1'
'set clopts 1 5 0.15'
'set clab on'
'set cint 100'
'set cthick 0'
'set xlopts 1 0 0'
'set ylopts 1 0 0'
'd z'
'draw title ' hh '00UTC' dd''mmm''yyyy ' 'lev' hPa'
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
out='GSM_' var '_' lev '_' yyyy '' mm '' dd '' hh '.eps'
'print ' outdir '/' out
if ( quitopt = "yes" ); quit; endif
return
GSM.2011052200.ctl
dset ^GSM%y4%m2%d2%h2Z.bin
options template
undef -999
xdef 720 LINEAR 0.0 0.5
ydef 361 LINEAR -90.0 0.5
zdef 17 LEVELS 1000 925 850 700 600 500 400 300 250 200 150 100 70 50
30 20 10
tdef 12 LINEAR 00:00Z22May2011 6hr
vars 17
slp 0 0 sea level pressure
sp 0 0 surface pressure
su 0 0 surface westerly wind
sv 0 0 surface southerly wind
st 0 0 surface temperature
srh 0 0 surface relative humidity
lca 0 0 LowCloudAmount
mca 0 0 MidCloudAmount
hca 0 0 HighCloudAmount
tca 0 0 TotalCloudAmount
z 17 0 height
u 17 0 westerly wind
v 17 0 southerly wind
t 17 0 temperature
rh 17 0 relative humidity
w 17 0 p-velocity
pre 0 0 precipitation
endvars