#!/bin/csh
#
source /home/atmos/u/gempak54/Gemenviron
#
setenv GEMMAPS /home/atmos/u/gempak54/gempak5.4/maps
setenv DISPLAY atmos.met.utah.edu:0.0
#
cd /home/atmos/q/research/west/w97
#
if ( ${1}x == x ) then
 echo YOU FORGOT YOUR INPUT COMMANDS STUPID!
 exit
endif
set day = $1
set type = $2
set yymm = ` echo $day | awk '{ print substr($0,1,4) }'`
set hr = ` echo $day | awk '{ print substr($0,7,2) }'`
set garea = "29.366;-126.316;49.150;-99.844"
set proj = "ced/40.;-115.;0."
set mm = ` echo $day | awk '{ print substr($0,3,2) }'`
set dy = ` echo $day | awk '{ print substr($0,5,2) }'`
#
if ( $mm == 01 ) set sfmon = 'jan'
if ( $mm == 02 ) set sfmon = 'feb'
if ( $mm == 03 ) set sfmon = 'mar'
if ( $mm == 04 ) set sfmon = 'apr'
if ( $type == "stp" ) then
 set sffile = "/home/atmos/q/research/ddplus/${sfmon}97.gem"
 set end = ".gif"
endif
if ( $type == "katz" ) then
 set sffile = "/home/atmos/q/research/ppt/obs/katz/${yymm}katz.gem"
 set end = "k.gif"
endif
if ( $type == "rfc" ) then
 set sffile = "/home/atmos/q/research/ppt/obs/rfc/${yymm}rfc.gem"
 set end = "r.gif"
endif
#
gpcolor<<EOF
device=gf||600;500|c
colors=101=255:255:255
run

EOF
#
sfmap<<EOF
area=us-
garea=$garea
satfil=
radfil=
sfparm=p24i=>2.0
dattim=97$mm${dy}/${hr}00
sffile=$sffile
colors=0
map=32/1/1
latlon=0
marker=28/15/14/14
title=0
clear=yes
panel=.01;.01;.99;.99/32/1/2
device=gf||600;500|c
proj=$proj
filter=no
text=1/1/1/hw
skpmis=no
lutfil=
stnplt=0
run

sfparm=p24i=>1.00=<1.99
marker=4/15/12/12
clear=no
map=0
run
 
sfparm=p24i=>.50=<.99
marker=26/15/10/10
run
 
sfparm=p24i=>.25=<.49
marker=20/15/8/8
run
 
sfparm=p24i=>.10=<.24
marker=21/15/6/6
run
 
sfparm=p24i=>.01=<.09
marker=23/15/4/4
run
 
sfparm=p24i=0.0
marker=2/15/2.5/2.5
title=32/-2/^ Observed 24 hr Precip(in.)
text=1/1/2/hw
run

EOF
gpend
mv gempak.gif OBSS${day}p24i$end
mv OBSS${day}p24i$end /home/meteor/u/jhorel/images/models/west/ppt/.
