#! /bin/sh
set -xa

# Dump POES data for MADIS
#
# This script's Variables
#   CDY  (imported)  Current day (like PDY but not based on com/date)
#   HHMM (imported)  Current time
#   RUNDIR     the MADIS Run directory
#   ATIME      the 9-character current time (YYDDDHHMM)
#   RAWFILES   the output directory for the POES bufr data
#   RAWFILES   the output directory for the second source of POES bufr data

RUNDIR=${DATA}

RAWFILES=${COMOUT}/poes/bufr
RAWFILES2=${COMOUT}/poes2/bufr
mkdir -p $RAWFILES $RAWFILES2


HH=${HHMM:0:2}
MIN=${HHMM:2:2}
ATIME=`date -d "$CDY $HH:$MIN UTC" +%y%j%H%M`

${USHmadis}/FSL_poes.run $RUNDIR $RAWFILES $ATIME $RAWFILES2
export err=$?;err_chk
