#!/bin/ksh
################################################################################
####  UNIX Script Documentation Block
#                      .                                             .
# Script name:         exnam_prdgen.sh
# Script description:  Run nam product generator jobs
#
# Author:        Bradley Mabe       Org: NP11         Date: 2007-08-23
#
# Abstract: This script runs the Nam  Smart Init jobs
#
# Script history log:
# 2007-08-23  Bradley Mabe  - Created script (copied actually) to call nam_smartinit on & off
#                          initially of Alaskan precip & snowfall
# 2007-09-17  Geoff Manikin - This version for CONUS runs
# 2011-07-06  Geoff Manikin - Adapted to use nested output
# 2011-07-22  Geoff Manikin - Can't use nest output for F00 
#

set -xa
msg="JOB $job HAS BEGUN"
postmsg "$jlogfile" "$msg"

cd $DATA

  if [ cyc -eq 00 -o cyc -eq 12 ] ; then
    if [ ffhr -le 60 -a ffhr -ne 0 ] ; then
        $USHnam/nam_smartinitconusnest_on.sh
    else
        $USHnam/nam_smartinitconus_on.sh
    fi
  else
# must stop nest at 54 hours, so that 12-hr totals at
#  f66 aren't split between nest and parent
    if [ ffhr -le 54 -a ffhr -ne 0 ] ; then
        $USHnam/nam_smartinitconusnest_off.sh
    else
        $USHnam/nam_smartinitconus_off.sh
    fi
  fi

set -x
#####################################################################

echo EXITING $0
exit
#
