#! /bin/sh
set -xa

# Dump raob 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 DB time (YYDDDHHMM)
#   MIN        the current minute (MM)
#

RUNDIR=$DATA

RAOBRAW=$DATA/raob/bufr
mkdir -p $RAOBRAW

###############################################################################
# Determine the time
###############################################################################


#  By the default below the minutes were rounded back
#  to the nearest hour.

HH=${HHMM:0:2}
MIN=${HHMM:2:2}

ATIME=`date -d "$CDY $HH:00" +%y%j%H00`

$USHmadis/FSL_raob.run $RUNDIR $ATIME $MIN $RAOBRAW
export err=$?;err_chk
