[2018-04-02_14:48]
[/work2/am/2017.KYUSHU-HOKUBU.HEAVY.RAIN/FNL0.25.FLUX]
[am@localhost]
$ fnl0.25.flux.sh
[2018-04-02_14:48]
[/work2/am/2017.KYUSHU-HOKUBU.HEAVY.RAIN/FNL0.25.FLUX]
[am@localhost]
$ srcdump.sh fnl0.25.flux.sh
------------------------------
List of the following files:
------------------------------
fnl0.25.flux.sh
------------------------------
Machine info
------------------------------
localhost
/work2/am/2017.KYUSHU-HOKUBU.HEAVY.RAIN/FNL0.25.FLUX
Mon Apr 2 15:03:02 JST 2018
======================
fnl0.25.flux.sh
======================
#!/bin/bash
gs=$(basename $0 .sh).gs
figdir=Fig_$(basename $0 .sh)
mkdir -vp $figdir
dataset_name='NCEP_fnl0.25'
ctl=fnl0.25.ctl
export LANG=C
host=$(hostname)
cwd=$(pwd)
timestamp=$(date)
lonw=118
lone=132.5
lats=24
latn=34.5
datetimes=00Z15JUN2017
datetimee=18Z09JUL2017
cat <<EOF>$gs
'open ${ctl}'
'set time ${datetimes}'
'q dims'
line=sublin(result,5)
is=subwrd(line,9)
say 'START 'line' 'is
'set time ${datetimee}'
'q dims'
line=sublin(result,5)
ie=subwrd(line,9)
say 'END 'line' 'ie
'set lon '${lonw}' '${lone}
'set lat '${lats}' '${latn}
'set mpdset 'hires
'set gxout shade2'
xmax = 4
ymax = 2
xwid = 9.0/xmax
ywid = 5.5/ymax
i=is
while (i <= ie) ;*TIME LOOP
'cc'
'set t 'i
'q dims'
line=sublin(result,5)
say line
nmap = 1
ymap = 1
while (ymap <= ymax) ;*ROW
xmap = 1
while (xmap <= xmax) ;*COLUMN
xs = 0.8 + (xwid+0.10)*(xmap-1)
xe = xs + xwid
ye = 7.5 - (ywid+0.10)*(ymap-1)
ys = ye - ywid
if (ymap = ymax)
'set xlopts 1 2 0.14'
else
'set xlopts 1 2 0.0'
'set xlopts 1 2 0.14'
endif
if (xmap = 1)
'set ylopts 1 2 0.14'
else
'set ylopts 1 2 0.0'
endif
'set vpage 0.0 11.0 0.0 8.5'
'set parea 'xs ' 'xe' 'ys' 'ye
'set grads off'
'set grid off'
'set font 4'
xlevs='116 120 124 128'
'set xlevs 'xlevs
#'set xlint 4'
'set ylint 4'
if(nmap = 1)
title=CWP
cwp='vint(lev(z=1),CLWMRprs,100)'
'set gxout shade2'
clevs2='0 0.1 0.2 0.3 0.4 0.5 0.6'
kind2='darkgray->white' ;*->white'
'color -levs 'clevs2' -kind 'kind2 ' -xcbar 0.8 3.1 4.7 4.8 -ft 2 -fwidth 0.08 -fheight 0.10 -edge circle -fstep 1 -line on'
'd 'cwp
'set gxout contour'
'set clevs 'clevs2
'set cstyle 1'
'set cthick 1'
'set ccolor 0'
'set clab off'
'd 'cwp
endif
if(nmap = 2)
title=SWR
'set gxout shade2'
clevs='-500 -400 -300 -200 -100 -20 20 200 400 600 800 1000'
kind='blue->white->orange'
'color -levs 'clevs' -kind 'kind ' -xcbar 2.0 9.0 1.7 1.8 -ft 2 -fwidth 0.12 -fheight 0.14 -edge circle -fstep 1 -line on'
'd DSWRFsfc-USWRFsfc'
#'d USWRFsfc' ;*-USWRFsfc'
'set gxout contour'
'set clevs 'clevs
'set cstyle 1'
'set cthick 1'
'set ccolor 0'
'set clab off'
'd DSWRFsfc-USWRFsfc'
#'d USWRFsfc' ;*-USWRFsfc'
endif
if(nmap = 3)
title=LWR
'set gxout shade2'
'color -levs 'clevs' -kind 'kind
'd DLWRFsfc-ULWRFsfc'
'set gxout contour'
'set clevs 'clevs
'set cstyle 1'
'set cthick 1'
'set ccolor 0'
'set clab off'
'd DLWRFsfc-ULWRFsfc'
endif
if(nmap = 4)
title=SHF
'set gxout shade2'
'color -levs 'clevs' -kind 'kind
'd -SHTFLsfc'
'set gxout contour'
'set clevs 'clevs
'set cthick 1'
'set cstyle 1'
'set ccolor 0'
'set clab off'
'd -SHTFLsfc'
endif
if(nmap = 5)
title=LHF
'set gxout shade2'
'color -levs 'clevs' -kind 'kind
'd -LHTFLsfc'
'set gxout contour'
'set clevs 'clevs
'set cstyle 1'
'set cthick 1'
'set ccolor 0'
'set clab off'
'd -LHTFLsfc'
endif
if(nmap = 6)
title=SUM
'sum=DSWRFsfc-USWRFsfc+DLWRFsfc-ULWRFsfc-SHTFLsfc-LHTFLsfc'
'set gxout shade2'
'color -levs 'clevs' -kind 'kind
'd 'sum
'set gxout contour'
'set clevs 'clevs
'set cstyle 1'
'set cthick 1'
'set ccolor 0'
'set clab off'
'd 'sum
endif
'q gxinfo'
line=sublin(result,3)
xl=subwrd(line,4)
xr=subwrd(line,6)
line=sublin(result,4)
yb=subwrd(line,4)
yt=subwrd(line,6)
*
xx = xl+0.0
yy = yt+0.15
'set string 1 l 2 0'
'set strsiz 0.12 0.15'
'draw string 'xx' 'yy' 'title
'set parea off'
'set vpage off'
*
if (nmap = 22); break; endif
nmap = nmap + 1
xmap = xmap + 1
endwhile ;* xmap COLUMN
ymap = ymap + 1
endwhile :* ymap ROW
# Datetime & dataset name
'set strsiz 0.12 0.16'
'set string 1 c 2'
'draw string 5.5 7.75 ${dataset_name}'
'q dims'
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)
timeutc=hh'00UTC' dd mmm yyyy
say
say timeutc
say
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
'draw string 5.5 7.45 'timeutc
# Header
'set strsiz 0.08 0.1'
'set string 1 l 2'
'draw string 0.5 8.35 ${timestamp}'
'draw string 0.5 8.23 ${host}'
'draw string 0.5 8.11 ${cwd}'
'draw string 0.5 7.99 ${gs} ${ctl}'
figfile='${figdir}/${dataset_name}.'yyyy''mm''dd'_'hh'.eps'
'gxprint 'figfile
say 'Fig file: 'figfile
i=i+1
endwhile ;* i TIME LOOP
quit
EOF
grads -bcl "${gs}"
exit 0
----------------------
End of fnl0.25.flux.sh
----------------------