aofd165.bio.mie-u.ac.jp
/work1/am/2016.Atmospheric.Data.Ornithology
Tue Jun 14 14:17:08 JST 2016
======================
ERA-I_T.snapshot.gs
======================
function ncep1( args )
*
* Default values
*
indir='/work4/data/ERA-Interim'
input='ERA-I_20150101_sfc.nc'
lonw=122.0 ; lone=134 ;*lone=150
lats=24.5 ; latn=35 ;* latn=47.5
out='ncep.snapshot.test.eps'
quitopt='no'
#lev=1000
ci=20
'set rgb 100 153 76 0'
*
* Decode options
*
i = 1
while( 1 )
arg = subwrd( args, i )
i = i + 1;
if( arg = '' ); break; endif
while( 1 )
# if( arg = '-ifu');ifu = subwrd(args,i);i=i+1; break;endif
# if( arg = '-ifv');ifv = subwrd(args,i);i=i+1; break;endif
# if( arg = '-ift');ift = subwrd(args,i);i=i+1; break;endif
if( arg = '-indir');indir = subwrd(args,i);i=i+1; break;endif
if( arg = '-input');input = 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 = '-time' ); time = subwrd(args,i) ;i=i+1; break;endif
if( arg = '-ci' ); ci = subwrd(args,i) ;i=i+1; break;endif
if( arg = '-outdir' ); outdir = subwrd(args,i) ;i=i+1;break;endif
if( arg = '-out' ); out = 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
#say 'Open 'ifu; 'open 'ifu
#say 'Open 'ifv; 'open 'ifv
#say 'Open 'ift; 'open 'ift
say 'Open 'input; 'sdfopen 'indir'/'input
say
'q ctlinfo'
say result
'set time 'time
'q dims'
say result
line=sublin(result,5)
datetime=subwrd(line,6)
#line=sublin(result,4)
#pdb=subwrd(line,6)
pha=lev
say pha
say
say 'lon 'lonw' 'lone
say 'lat 'lats' 'latn
say
'set lon 'lonw' 'lone
'set lat 'lats' 'latn
'cc'
xmin=1; xmax=7
ymin=2; ymax=9
'set parea ' xmin ' ' xmax ' ' ymin ' ' ymax
'set lon 'lonw' 'lone
'set lat 'lats' 'latn
'set mpdset hires'
'set map 1 1 2'
'set xlopts 1 5 0.2'
'set ylopts 1 5 0.2'
'set grid off'
### Color shade
'set gxout shade2'
#'w=-w/11.769' ;# 11.769=rho*g
wmin=-20 ;#-0.05
wmax=20 ;#0.05
wint=5;#0.01
'color ' wmin ' ' wmax ' ' wint ' -kind blue->white->red'
'tc=' t2m '-273'
'set xlab off'
'set ylab off'
'd 'tc ;#w
'xcbar 7.6 7.7 3 8'
### contour
'set gxout contour'
'set ccolor 0'
'set cthick 2'
'set cint 'ci
'set clab off'
'set xlab off'
'set ylab off'
'd 'tc
### vector
'set gxout vector'
'set ccolor 0'
'set cthick 10'
'set xlab off'
'set ylab off'
'set arrscl .5 50'
'd skip(u10,1,1);skip(v10,1,1)'
'set ccolor 1'
'set cthick 1'
'set xlab on'
'set ylab on'
'set xlint 5'
'set ylint 5'
'set arrscl .5 50'
'd skip(u10,1,1);skip(v10,1,1)'
# Text
'set strsiz 0.10 0.12'
'set string 1 c 5 0'
'draw string 5.6 1.85 m/s'
'draw title 'datetime' SFC'
'gxprint 'outdir '/' out
if ( quitopt = "yes" ); quit; endif
return
----------------------
End of ERA-I_T.snapshot.gs
----------------------
======================
ERA-I_T.snapshot.run.sh
======================
#!/bin/sh
exe=ERA-I_T.snapshot.gs
if [ ! -f $exe ]; then
echo Error in $0 : No such file, $exe
exit 1
fi
# Parameters
indir=/work4/data/ERA-Interim
input=ERA-I_20150101_sfc.nc #ERA-I_201501_p1000_UVW.nc
prefix=ERA-I_T
outdir="Fig"
#lev=1000 #950 # Vertical Level
lonw=120
lone=150
lats=22.4
latn=47.6
ci=5 #Contour Interval
opt="-lonw $lonw -lone $lone -lats $lats -latn $latn -ci $ci"
time='00Z01JAN2015'
out=${prefix}_${time}_SFC.eps
grads -bcp "$exe -indir $indir -input $input \
$opt -time $time \
-outdir $outdir -out $out -q"
echo
echo Output: $out
echo
exit 0
----------------------
End of ERA-I_T.snapshot.run.sh
----------------------