Skip to content

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

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

Merged
merged 4 commits into from
Feb 25, 2025
Merged
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
19 changes: 15 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,18 @@ verbose=${5:-${VERBOSE:-"N"}}
$verbose == [Tt][Rr][Uu][Ee] ]] && set -x

rc="-1"

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 +47,9 @@ case $file_type in
rc="-2"
;;
esac
# If any comparison fails, exit with an error
if [[ $rc -ne 0 ]]; then
exit $rc
fi
Copy link
Collaborator

@xincjin-NOAA xincjin-NOAA Feb 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little confused here. is an error message missing or do you want to print out an error message?


exit $rc