色は渦位で実線は高度
GSM.PV.lat-p.run.sh
#!/bin/sh
dataset=GSM
var=PV
exe=${dataset}.${var}.lat-p.gs
if [ ! -f $exe ]; then
echo Error in $0 : No such file, $exe
exit 1
fi
yyyy=2011
mm=05
dd=23
hh=00
lon=128
# Parameters
indir=/work1/am/Sato.Kodama.Manda2015/SYNOPTIC.ANALYSIS/GSM/Data.GrADS/output
input=GSM.2011052200.ctl
outdir=fig
mkdir -vp $outdir
opt="-indir $indir -input $input -outdir ${outdir}"
it=4
nt=8
opt_grads=bcp
while [ $it -le $nt ]; do
grads -${opt_grads} "$exe $opt -t1 $it -lon $lon -var ${var} -q"
it=$(expr $it + 1 )
done
exit 0
GSM.PV.lat-p.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
lon=123
out='GSM.2011052200.eps'
quitopt='no'
lon=123
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 = '-lon' ); lon = 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 lon ' E'
'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 100'
'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 lon 'lon
'set lev 925 100'
'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 1000'
'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 1000'
'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 1000'
'set cthick 0'
'set xlopts 1 0 0'
'set ylopts 1 0 0'
'd z'
'draw title ' hh '00UTC' dd''mmm''yyyy ' ' lon 'E'
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 '_lat-p_' lon '_' yyyy '' mm '' dd '' hh '.eps'
'print ' outdir '/' out
if ( quitopt = "yes" ); quit; endif
return