#!/usr/bin/ksh

set +x
#####################################################################
echo "-------------------------------------------------------"
echo "exgfdl_post_swath.sh.sms - Script to create GFDL swath"
echo "               graphics as part of the post-processing."
echo "-------------------------------------------------------"
echo "History: MAY 2005 - First implementation of this new script."
#####################################################################
set -x

PS4=' + exgfdl_post_swath.sh.sms line $LINENO: '

label="cat $COMOUT/$stormlabel.$cycle"

if test -f "$label" = "No $stormlabel"
then
   ##############################################
   # Condition if no storms are to be run
   ##############################################
   msg="No hurricane to run."
   postmsg "$jlogfile" "$msg"

   exit
fi

if test -f ${COMIN}/${stormlabel}.holdvars.txt
then
   . ${COMIN}/${stormlabel}.holdvars.txt
else
   msg="Hurricane to Run But No ${stormlabel}.holdvars.txt file found."
   postmsg "$jlogfile" "$msg"
   export pgm=exgfdl_post.sh.sms
   export err=911;err_chk
fi

cd $DATA

######################################################################
# Invoke POE to run the 2 scripts that create the 2 different 
# swath files.
######################################################################

>post_swath.cmdfile

echo "$EXhur/gfdl_post_swath_wind.sh"    >>post_swath.cmdfile
echo "$EXhur/gfdl_post_swath_precip.sh"  >>post_swath.cmdfile

export MP_PGMMODEL=mpmd
export MP_CMDFILE=post_swath.cmdfile
export MP_LABELIO=YES
export MP_INFOLEVEL=3
export MP_STDOUTMODE=ordered

poe

#####################################################################
# GOOD RUN
set +x
echo "**************JOB GFDL_POST_SWATH COMPLETED NORMALLY on the IBM-SP"
echo "**************JOB GFDL_POST_SWATH COMPLETED NORMALLY on the IBM-SP"
echo "**************JOB GFDL_POST_SWATH COMPLETED NORMALLY on the IBM-SP"
set -x
#####################################################################

echo EXITING $0
exit

