#!/bin/ksh
################################################################################
####  UNIX Script Documentation Block
#                      .                                             .
# Script name:         exnam_smartinit_hi.sh.sms
# Script description:  Run nam DNG code over Hawaii 
#
# Author:        Bradley Mabe       Org: NP11         Date: 2007-11-26
#
# 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
# 2011-07-04  Geoff Manikin - revised script to use the Hawaii nest for
#             the first 60 hours and then the parent NAM for the rest.
#             The nest is only used to F54 for the 06/18z cycles to
#             prevent splitting the 12-hour precip accumulations between
#             nest and parent grids.
# 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_smartinithinest_on.sh
    else
        $USHnam/nam_smartinithi_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_smartinithinest_off.sh
    else
        $USHnam/nam_smartinithi_off.sh
    fi
  fi

#export err=$?; err_chk

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

echo EXITING $0
exit
#
