#!/bin/ksh

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

rm -f rrodf1000.m1.unix

# Process the Oper Metop-B ATOVS RRODF first for daily NPROVS matchups

ftp satepsanone.espc.nesdis.noaa.gov <<EOD
cd /pub/atovsdev/rrodf
get rrodf1000.m1 rrodf1000.m1.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.m1.unix
then
   rm -f $dailyfiles/rrodf1000.m1
   rm -f $dailyfiles/fort.*

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

   $byteswap/swaprrodf1000.x

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

