#!/bin/ksh

byteswap=/data/smcd/nprovs/source/byteswap
dailyfiles=/data/data065/nprovs/data/matchup/DailyFiles_incoming
cd $dailyfiles

rm -f rrodf1000.a11.unix

# Process the Oper NOAA-19 ATOVS RRODF first for daily NPROVS matchups

ftp satepsanone.nesdis.noaa.gov <<EOD
cd atovsdev/rrodf
get rrodf1000.oa11 rrodf1000.a11.unix
bye
EOD

# Byte-swap the words in the UNIX files so they can be read properly
# in a Linux environment.

if test -e $dailyfiles/rrodf1000.a11.unix
then
   rm -f $dailyfiles/rrodf1000.a11
   rm -f $dailyfiles/fort.*

   ln -s $dailyfiles/rrodf1000.a11.unix    fort.20
   ln -s $dailyfiles/rrodf1000.a11         fort.21

   $byteswap/swaprrodf1000.x

   rm -f fort.*
   chmod 664 $dailyfiles/rrodf1000.a11
   rm -f $dailyfiles/rrodf1000.a11.unix
fi

