#!/bin/csh 

#cd /spare11/ralazear/wrf_output

set yy = `date -u +%y`
set mm = `date -u +%m`
set dd = `date -u +%d`
set hh = `date -u +%H`
set ddm = `date +%d`

if (${hh} < 05) then
    set mdate = ${yy}${mm}${ddm}18
    echo ${mdate}
endif    
if (${hh} >= 22) then
    set mdate = ${yy}${mm}${ddm}18
    echo ${mdate} 
endif       
if (${hh} >= 05 && ${hh} < 10) then
    set mdate = ${yy}${mm}${dd}00
    echo ${mdate}
endif
if (${hh} >= 10 && ${hh} < 16) then
    set mdate = ${yy}${mm}${dd}06
    echo ${mdate}
endif
if (${hh} >= 16 && ${hh} < 22) then
    set mdate = ${yy}${mm}${dd}12
    echo ${mdate}
endif   


gdplot2 << endgdp1

GDFILE   = /spare11/ktyle/wrf/${mdate}_wrf27.gem
GDATTIM  = F$1
GLEVEL   = 0
GVCORD   = none!pres!!none
PANEL    = 0
SKIP     = !!!2
SCALE    = 0!-1!!0
GDPFUN   = ptot!sub(hght@500,hght@1000)!!pmsl
TYPE     = f!c
CONTUR   = 3/1
CINT     = !6/546!6//540!4!1//1
LINE     = !15/5/3!26/5/3!1//3/2
FINT     = 2;4;6;8;12;16;20;28;40
FLINE    = 0;23-19;17-14
HILO     = !!!!4;2/H#;L#/1016-1100;800-1008/8/2;4
HLSYM    =  
CLRBAR   = 1
WIND     =  
REFVEC   = 10
TITLE    = 1/-2/^ 3-hr Precip., 1000-500-hPa thick., PMSL!0
TEXT     = .8/2/hw!!!!2/22/hw
CLEAR    = YES
GAREA    = grid
IJSKIP   =  
PROJ     = lcc/30;-83;60
MAP      = 8//3
MSCALE   = 0
LATLON   =  
DEVICE   = psc
STNPLT   =  
SATFIL   =  
RADFIL   =  
IMCBAR   =  
LUTFIL   =  
STREAM   =  
POSN     = 0
COLORS   = 1
MARKER   = 0
GRDLBL   = 0
FILTER   = no
gdpfun   = sub(ptot^F$1,ptot^F$2)!sub(hght@500,hght@1000)!!pmsl

run


exit

endgdp1

gpend

ls -lath wrf*gif
echo 'after 27km'

#echo 'got here'

convert -density 100x100 -rotate 90 psc.plt wrf27_${mdate}F$1_pmsl_pre.gif
rm -rf psc.plt



gdplot2 << endgdp2

gdfi = /spare11/ktyle/wrf/${mdate}_wrf09.gem

run


exit

endgdp2 

gpend


ls -lath wrf*gif
echo 'after 9km'

convert -density 100x100 -rotate 90 psc.plt wrf09_${mdate}F$1_pmsl_pre.gif
rm -rf psc.plt



gdplot2 << endgdp3

gdfi = /spare11/ktyle/wrf/${mdate}_wrf03.gem
cint = !2/546!2//540!2!1//1
skip = !2

r

exit

endgdp3

gpend

ls -lath wrf*gif
echo 'after 3km'

convert -density 100x100 -rotate 90 psc.plt wrf03_${mdate}F$1_pmsl_pre.gif
rm psc.plt











