#!/bin/sh
####################################################################
echo "---------------------------------------------------------"
echo "Script exhrly_dailyver.sh.sms"
echo "This Script generates Daily Stats for Verification Report"
echo "---------------------------------------------------------"
echo "History: JUN 2009 - First implementation of this new script."
#####################################################################

#########################################################################
# START FLOW OF CONTROL
# 1)    QCMON - GENERATES DAILY STATS FOR AIRCRAFT, SATWINDS, SHIPREPORTS
# 2)   ANLVER - GENERATES S1 SCORES FOR THE VARIOUS MODELS (00Z)(12Z)
# 3)   SUMAC4 - GENERATES DAILY STATS FOR DAILY SUMAC FILES
#########################################################################

set -x

cd $DATA 

export YYYY=`echo $PDYm1 | cut -c1-4`
export yy=`echo $PDYm1 | cut -c3-4`
export mm=`echo $PDYm1 | cut -c5-6`
export dd=`echo $PDYm1 | cut -c7-8`

if [ -d $COMOUT/sumac4 ]
then
  rm -fr $COMOUT/sumac4
fi

export COMOUT_SUMAC41=$COMOUT/sumac4
mkdir -p $COMOUT_SUMAC41

if [ -d $COMOUT/qcmon ]
then
  rm -fr $COMOUT/qcmon
fi

export COMOUT_QCMON1=$COMOUT/qcmon
mkdir -p $COMOUT_QCMON1

if [ -d $COMOUT/anlver ]
then
  rm -fr $COMOUT/anlver
fi

export COMOUT_ANLVER_DATA1=$COMOUT/anlver/daily_obs
mkdir -p $COMOUT_ANLVER_DATA1
 
export COMOUT_ANLVER_FCST1=$COMOUT/anlver/daily_forecast
mkdir -p $COMOUT_ANLVER_FCST1

if [ -d $COMOUT/cqcht ]
then
  rm -fr $COMOUT/cqcht
fi

export DATABASEcqcht=$COMOUT/cqcht
mkdir -p $DATABASEcqcht

$USHhrly/verf_daily_stats.sh
export err=$?; err_chk

#####################################################################
# GOOD RUN
set +x
echo "**************JOB $job COMPLETED NORMALLY ON THE IBM"
echo "**************JOB $job COMPLETED NORMALLY ON THE IBM"
echo "**************JOB $job COMPLETED NORMALLY ON THE IBM"
set -x
#####################################################################

############## END OF SCRIPT #######################
