aofd165.bio.mie-u.ac.jp
/work1/am/2016.PolarLow/Sonde.Profile.03.Height
Tue Nov 1 14:58:48 JST 2016
$ proc.sonde.pl1101.run.sh
$ grads.bin.pl1101.run.sh
$ plot.profile.run.sh
======================
proc.sonde.pl1101.run.sh
======================
#!/bin/bash
exe=$(basename $0 .run.sh).sh
if [ ! -f $exe ]; then
echo Error in $0: No such file, $exe
exit 1
fi
indir=/work4/data/Sonde/PL1101
outdir=output
inlist="\
011800.prn \
011806.prn \
011812.prn \
011818.prn \
011900.prn \
011906.prn \
011912.prn \
011918.prn \
012000.prn \
012006.prn \
012012.prn \
012018.prn \
012100.prn \
012106.prn \
012112.prn \
012118.prn \
012200.prn \
012206.prn \
012212.prn \
012218.prn \
012300.prn \
012306.prn \
012312.prn \
012318.prn \
012400.prn \
012406.prn \
012412.prn \
012418.prn \
"
nh=39 # Number of header lines in input file
mkdir -vp ${outdir}
for in in $inlist; do
out=${outdir}/$(basename $in .prn).txt
$exe ${indir}/$in $out $nh
done
exit 0
----------------------
End of proc.sonde.pl1101.run.sh
----------------------
======================
grads.bin.pl1101.run.sh
======================
#!/bin/sh
exe=$(basename $0 .run.sh).sh
indir=output
outdir=$indir
inlist="\
011800.txt \
011806.txt \
011812.txt \
011818.txt \
011900.txt \
011906.txt \
011912.txt \
011918.txt \
012000.txt \
012006.txt \
012012.txt \
012018.txt \
012100.txt \
012106.txt \
012112.txt \
012118.txt \
012200.txt \
012206.txt \
012212.txt \
012218.txt \
012300.txt \
012306.txt \
012312.txt \
012318.txt \
012400.txt \
012406.txt \
012412.txt \
012418.txt \
"
for in in $inlist; do
yy=11
out=${yy}$(basename $in .txt).grd
$exe ${indir}/$in ${outdir}/$out
done
exit 0
----------------------
End of grads.bin.pl1101.run.sh
----------------------
======================
plot.profile.run.sh
======================
#!/bin/bash
exe=$(basename $0 .run.sh).gs
datelist="\
00Z18JAN2011 \
06Z18JAN2011 \
12Z18JAN2011 \
18Z18JAN2011 \
00Z19JAN2011 \
06Z19JAN2011 \
12Z19JAN2011 \
18Z19JAN2011 \
00Z20JAN2011 \
06Z20JAN2011 \
12Z20JAN2011 \
18Z20JAN2011 \
00Z21JAN2011 \
06Z21JAN2011 \
12Z21JAN2011 \
18Z21JAN2011 \
00Z22JAN2011 \
06Z22JAN2011 \
12Z22JAN2011 \
18Z22JAN2011 \
00Z23JAN2011 \
06Z23JAN2011 \
12Z23JAN2011 \
18Z23JAN2011 \
"
for datetime in $datelist; do
grads -bcp "$exe -dtime $datetime -q"
done
exit 0
----------------------
End of plot.profile.run.sh
----------------------
======================
plot.profile.gs
======================
function profile( args )
*
* Default values
*
yymmddhh='11011800'
datetime='00Z18JAN2011'
outdir='Fig'
*
* Decode options
*
i = 1
while( 1 )
arg = subwrd( args, i )
i = i + 1;
if( arg = '' ); break; endif
while( 1 )
if( arg = '-dtime' ); datetime= 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
'!mkdir -vp 'outdir
'open sonde.ctl'
'cc'
'set grads off'
'set timelab off'
'set parea 1.5 8 1 10.3'
'set time 'datetime
'set z 1 100'
'set xlopts 1 7 0.3'
'set ylopts 1 7 0.3'
'set vrange -70 10'
'set ccolor 1'
'set digsiz 0.01'
'set cthick 20'
'd t' ;*-273.15'
'set strsiz 0.3 0.3'
#'set string 1 c 10 0'
#'draw string 5.5 9.5 Obs.'
#'set string 2 c 10 0'
#'draw string 5.37 9 CTL'
'set string 1 c 10 90'
'draw string 0.2 6 [m]'
'set strsiz 0.25 0.25'
'set string 1 c 10 0'
'draw string 4.5 0.22 Temperature [degC]'
'draw title 'datetime
'q dims'
line=sublin(result,5)
time=subwrd(line,6)
yy=substr(time,11,4)
mmm=substr(time,6,3)
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
dd=substr(time,4,2)
hh=substr(time,1,2)
say hh
yymmddhh=yy''mm''dd''hh
out=outdir'/Profile.' yymmddhh '.eps'
'gxprint 'out
say
say 'Output: 'out
say
'q dims' ;*ctlinfo'
say result
if (quitopt="yes")then
quit
endif
----------------------
End of plot.profile.gs
----------------------