#!/bin/sh
##############################################################
# Add the NCDC GIF processing to the end of the gempak_gif job
# There is no timing issue with the NCDC GIF, so it is
# okay to just add it here. If timing becomes a problem
# in the future, we should move it above somewhere else.
##############################################################
export PS4='exgempakgif_ncdc:$SECONDS + '
set -xa

cd $DATA
msg="The NCDC GIF processing has begun"
postmsg "$jlogfile" "$msg"

export NTS=$USHgempak/restore

if [ $MODEL = GDAS -o $MODEL = GFS ]
then
    case $MODEL in
      GDAS) fcsthrs="00";;
      GFS)  fcsthrs="00 12 24 36 48";;
    esac

    export fhr
    for fhr in $fcsthrs
    do
       cp ${COMIN}/${RUN}_${PDY}${cyc}f0${fhr} gem_grids${fhr}.gem
     
       if [ $cyc -eq 00 -o $cyc -eq 12 ]
       then
          $USHgempak/gempak_${RUN}_f${fhr}_gif.sh
       fi

    done
fi

exit

