#!/bin/ksh
################################################################################
####  UNIX Script Documentation Block
#                      .                                             .
# Script name:         exhiresw_post.sh
# Script description:  Run NAM post jobs
#
# Author:        Eric Rogers       Org: NP22         Date: 1999-06-23
#
# Abstract: This script runs the Nam post jobs for the hiresw forecast
#
# Script history log:
# 1999-06-23  Eric Rogers
# 1999-08-17  Brent Gordon  -- Modified for production.
# 2001-04-23  Eric Rogers modified Nam script for hiresw runs
# 2002-03-15  Eric Rogers modified 8km/4km hires window model
# 2006-05-17  Eric Rogers modified script to just run PRDGEN using ops NAM input
#

set -x
cd $DATA 

msg="$job HAS BEGUN FOR NEST=$NEST"
postmsg "$jlogfile" "$msg"

postmsg "$jlogfile" "Starting post for NEST=$NEST at F${fhr}"
#
# Run the prdgen code for the hiresw here, since both post and prdgen
# run quickly for these smaller domains.
#
postmsg "$jlogfile" "Starting prdgen for NEST=$NEST at F${fhr}"

rm -rf poescript
for fhr in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18
do
  mkdir -p $DATA/$fhr
  echo "$USHhiresw/hiresw_prdgen_hls.sh $fhr" >>poescript
done

chmod 775 poescript
export MP_PGMMODEL=mpmd
export MP_CMDFILE=poescript
#
# Execute the script.
poe
export err=$?; err_chk

echo done > $FCST_DIR/postdone${fhr}.${tmmark}

postmsg "$jlogfile" "HIRESW POST done for F${fhr}"

echo EXITING $0
set +x
echo " ***** $RUN PROCESSING COMPLETED NORMALLY *****"
echo " ***** $RUN PROCESSING COMPLETED NORMALLY *****"
echo " ***** $RUN PROCESSING COMPLETED NORMALLY *****"
set -x

exit
#
