#!/bin/csh -f
#
# This command file will create a surface map for the specified forecast hour and model 
# on X windows.
#
# Philip Schumacher	12/96
#
# Check if a data has been input.  If not print instructions.
if ($1x == x || $2x == x || $3x == x || $4x == x || $5x == x || $6x == x) then

        echo "This script creates a map of EPV and relative humidity in a layer "
	echo "and frontogenesis  at a specified level for a map centered on "
	echo " North Dakota "
	echo " "
	echo " look_epvrh "
	echo " " 
	echo "Syntax:  look_epvrh YYMMDDHH FHR MDL TOP BOTTOM FLVL " 
	echo " "
	echo "  where:                                               "
	echo "         YYMMDDHH is the year, month, day and hour of the model "
	echo "         to be examined       "
	echo " "
	echo "         FHR is the forecast hour of the map to be created " 
        echo " "
        echo "         MDL is the model to look at (in small letters)"
	echo "         ngm, ruc, avn, eta                            "
        echo " "
        echo "         TOP is the top of the layer to look at EPV and RH"
	echo " "
	echo "         BOTTOM is the bottom of the layer to look at EPV and RH"
	echo " "
        echo "         FLVL is the pressure level you want to examine frontogenesis"        echo " "
        echo " " 
	echo "   Example:  look_epvrh 96102912 F12 eta 650 750 850             "
	echo " "
	echo "   This will create a map that will examine EPV and RH in the 650 to"
	echo "   to 750 mb layer, and frontogenesis at 850 mb. "
	exit

endif

# Set up the name of the ASCII model file.

set EPVLYR = ${4}:${5}
set GEMDAT = ${2}
set GEMFIL = $METDAT/gempak/grids/${1}_${3}.gem 
#set GEMFIL = /usr2/phil/oct29/gempak/surface/${1}_sao.gem
echo ${GEMFIL}

# Now run sfmap to create quadrant 1

 gdplot << EOF
 res $GEMNTS/look_epvrh
 GDFILE   = $GEMFIL
 GDATTIM  = $GEMDAT
 GLEVEL = ${4}:${5} ! ${4}:${5} ! ${4}:${5} ! ${6}
 r
 
exit
EOF

echo `********************************`
echo `*** TYPE gpend WHEN FINISHED ***'
echo `********************************`

exit
