#!/bin/sh
######################################################################
#  UTILITY SCRIPT NAME :  sref_awips.sh
#         DATE WRITTEN :  06/07/2006
#
#  Abstract:  This utility script produces the  (mean, spread and
#             probability) of selected variables for grids 212, 216
#             and 243 in GRIB2 format for AWIPSfrom the SREF model.
#
#
#####################################################################
echo "------------------------------------------------"
echo "JSREF_AWIPS ( 09Z AND 21Z) SREF postprocessing"
echo "------------------------------------------------"
echo "History: JUNE 2006 - First implementation of this new script."
echo " "
#####################################################################

set -x 

for grid in 212 216 243; do
  for type in mean spread prob ; do
    input_grib=$COMIN/sref.t${cyc}z.pgrb${grid}.${type}
    $utilexec/cnvgrib -g12 -p40 -nv $input_grib sref.t${cyc}z.pgrb${grid}.${type}.grib2
    export GRID=$grid
    export type
    $utilscript/mkawpgrb.sh "00"
  done
done

exit
