Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -s -B flags and the capability of compare multiple output files for the same obs type #53

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions tools/build_scripts/bufr_comp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
set -eu

file_type=$1
cmd=$2
file_name=$3
cmd=$2
file_name=($3) # convert space-separated strings into an array
tol=${4:-"0.0"}
verbose=${5:-${VERBOSE:-"N"}}

Expand All @@ -19,11 +19,19 @@ verbose=${5:-${VERBOSE:-"N"}}
$verbose == [Tt][Rr][Uu][Ee] ]] && set -x

rc="-1"
echo "emily checking: U are using new bufr_comp.sh ....."

case $file_type in
netcdf)
$cmd && \
nccmp testrun/$file_name testoutput/$file_name -d -m -g -f -S -T ${tol}
rc=${?}
for i in "${!file_name[@]}"; do
file_name=${file_name[$i]}
nccmp testrun/$file_name testoutput/$file_name -d -m -g -f -s -S -B -T ${tol}
rc=${?}
if [[ $rc -ne 0 ]]; then
echo "Files testrun/$file_name and testoutput/$file_name are not identical."
fi
done
;;
odb)
$cmd && \
Expand All @@ -40,5 +48,9 @@ case $file_type in
rc="-2"
;;
esac
# If any comparison fails, exit with an error
if [[ $rc -ne 0 ]]; then
exit $rc
fi

exit $rc