#/usr/bin/ksh
#

# bufr2ropp

banner BUFR2ROPP


BFILE=GRAS_1B_M02_20140101000329Z_20140101000436Z_R_O_20140709200600Z_G23_NN.bufr

TFILE=$(echo $BFILE |sed -es/'bufr'/'decbufr'/)

$ROPP_ROOT/ifort/bin/decbufr -d $BFILE > $TFILE


NFILE=$(echo $BFILE |sed -es/'bufr'/'nc'/)

TFILE=$(echo $BFILE |sed -es/'bufr'/'bufr2ropp'/)

$ROPP_ROOT/ifort/bin/bufr2ropp $BFILE -o $NFILE -d > $TFILE


TFILE=$(echo $BFILE |sed -es/'bufr'/'ncks'/)

ncks -H -vpcd $NFILE > $TFILE




# ropp2bufr

banner ROPP2BUFR


BFILE2=$(echo $BFILE |sed -es/'bufr'/'bufr2'/)

TFILE=$(echo $BFILE |sed -es/'bufr'/'ropp2bufr'/)

$ROPP_ROOT/ifort/bin/ropp2bufr $NFILE -o $BFILE2 -d > $TFILE


TFILE=$(echo $BFILE |sed -es/'bufr'/'decbufr2'/)

$ROPP_ROOT/ifort/bin/decbufr -d $BFILE2 > $TFILE



# bufr2ropp again

banner BUFR2ROPP2

NFILE=$(echo $BFILE |sed -es/'bufr'/'nc2'/)

TFILE=$(echo $BFILE |sed -es/'bufr'/'bufr2ropp2'/)

$ROPP_ROOT/ifort/bin/bufr2ropp $BFILE2 -o $NFILE -d > $TFILE


TFILE=$(echo $BFILE |sed -es/'bufr'/'ncks2'/)

ncks -H -vpcd $NFILE > $TFILE


