#!/bin/sh
export ECCODES_BUFR_SET_TO_MISSING_IF_OUT_OF_RANGE=1

# 1. run ropp2bufr -gi on test data
old_dir=/data/users/fwarrick/ROPP/ropp_src/branches/dev/Share/ROPP10_prototype/ropp_io/tools
$old_dir/ropp2bufr -gi ./input_data.nc -o old_result.bufr 

# 1. run ropp2bufr -g on test data
old_dir=/data/users/fwarrick/ROPP/ropp_src/branches/dev/Share/ROPP10_prototype/ropp_io/tools
$old_dir/ropp2bufr -g ./input_data.nc -o old_result_without_iph.bufr 

# 2a. run ropp2bufr_eccodes on test data
new_dir=/data/users/fwarrick/ROPP/ropp_src/branches/dev/Share/ROPP10_ecCodes/ropp_io/tools
$new_dir/ropp2bufr_eccodes ./input_data.nc -o new_result.bufr

# 2b. run gtsheaders_bufr.pl on result of 2a
perl ./gtsheaders_bufr.pl new_result.bufr new_result_plus_perl.bufr IUTB14 EKMI 
#190117

# 3 compare octal dumps of each BUFR file
od -c old_result.bufr > old_result_od.txt
od -c old_result_without_iph.bufr > old_result_without_iph_od.txt
od -c new_result_plus_perl.bufr > new_result_plus_perl_od.txt
