#!/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 << endgdp

GDFILE   = /spare11/ktyle/wrf/${mdate}_wrf27.gem
GDATTIM  = $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
LINE     = !15/5/2!26/5/2!31//2/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/3/hw
CLEAR    = YES
GAREA    = grid
IJSKIP   =  
PROJ     = lcc/30;-83;60
MAP      = 8//2
MSCALE   = 0
LATLON   =  
DEVICE   = psc
STNPLT   =  
SATFIL   =  
RADFIL   =  
IMCBAR   =  
LUTFIL   =  
STREAM   =  
POSN     = 0
COLORS   = 1
MARKER   = 0
GRDLBL   = 0
FILTER   = no

r

gdatt = F006
gdpfun=sub(ptot^F006,ptot^F003)!sub(hght@500,hght@1000)!!pmsl

r

gdatt = F009
gdpfun=sub(ptot^F009,ptot^F006)!sub(hght@500,hght@1000)!!pmsl

r

gdatt = F012
gdpfun=sub(ptot^F012,ptot^F009)!sub(hght@500,hght@1000)!!pmsl

r

gdatt = F015
gdpfun=sub(ptot^F015,ptot^F012)!sub(hght@500,hght@1000)!!pmsl

r

gdatt = F018
gdpfun=sub(ptot^F018,ptot^F015)!sub(hght@500,hght@1000)!!pmsl

r

gdatt = F021
gdpfun=sub(ptot^F021,ptot^F018)!sub(hght@500,hght@1000)!!pmsl

r

gdatt = F024
gdpfun=sub(ptot^F024,ptot^F021)!sub(hght@500,hght@1000)!!pmsl

r

gdatt = F027
gdpfun=sub(ptot^F027,ptot^F024)!sub(hght@500,hght@1000)!!pmsl

r

gdatt = F030
gdpfun=sub(ptot^F030,ptot^F027)!sub(hght@500,hght@1000)!!pmsl

r

gdatt = F033
gdpfun=sub(ptot^F033,ptot^F030)!sub(hght@500,hght@1000)!!pmsl

r

gdatt = F036
gdpfun=sub(ptot^F036,ptot^F033)!sub(hght@500,hght@1000)!!pmsl

r

gdatt = F039
gdpfun=sub(ptot^F039,ptot^F036)!sub(hght@500,hght@1000)!!pmsl

r

gdatt = F042
gdpfun=sub(ptot^F042,ptot^F039)!sub(hght@500,hght@1000)!!pmsl

r

gdatt = F045
gdpfun=sub(ptot^F045,ptot^F042)!sub(hght@500,hght@1000)!!pmsl

r

gdatt = F048
gdpfun=sub(ptot^F048,ptot^F045)!sub(hght@500,hght@1000)!!pmsl

r


