Skip to content

Commit

Permalink
fcompare (AMReX-Codes#1281)
Browse files Browse the repository at this point in the history
## Summary

Remove unimplemented option from help message.  Print more information on
which files have NaNs if there are.

## Checklist

The proposed changes:
- [ ] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX users
- [ ] are described in the proposed changes to the AMReX documentation, if appropriate
  • Loading branch information
WeiqunZhang authored Aug 19, 2020
1 parent 33fdf6b commit 192f638
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Tools/Plotfile/fcompare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ int main_main()
<< " variable.\n"
<< "\n"
<< " usage:\n"
<< " fcompare [-g|--ghost] [-n|--norm num] [-d|--diffvar var] [-z|--zone_info var] [-a|--allow_diff_grids] [-r|rel_tol] file1 file2\n"
<< " fcompare [-n|--norm num] [-d|--diffvar var] [-z|--zone_info var] [-a|--allow_diff_grids] [-r|rel_tol] file1 file2\n"
<< "\n"
<< " optional arguments:\n"
<< " -g|--ghost : compare the ghost cells too (if stored)\n"
<< " -n|--norm num : what norm to use (default is 0 for inf norm)\n"
<< " -d|--diffvar var : output a plotfile showing the differences for\n"
<< " variable var\n"
Expand Down Expand Up @@ -268,10 +267,18 @@ int main_main()
amrex::Print() << " " << std::setw(24) << std::left << names_a[icomp_a]
<< " " << std::setw(50)
<< "< variable not present in both files > \n";
} else if (has_nan_a[icomp_a] or has_nan_b[icomp_a]) {
} else if (has_nan_a[icomp_a] and has_nan_b[icomp_a]) {
amrex::Print() << " " << std::setw(24) << std::left << names_a[icomp_a]
<< " " << std::setw(50)
<< "< NaN present > \n";
<< "< NaN present in both A and B > \n";
} else if (has_nan_a[icomp_a]) {
amrex::Print() << " " << std::setw(24) << std::left << names_a[icomp_a]
<< " " << std::setw(50)
<< "< NaN present in A > \n";
} else if (has_nan_b[icomp_a]) {
amrex::Print() << " " << std::setw(24) << std::left << names_b[icomp_a]
<< " " << std::setw(50)
<< "< NaN present in B > \n";
} else {
Real aerr = 0., rerr = 0.;
if (aerror[icomp_a] > 0.) {
Expand Down

0 comments on commit 192f638

Please sign in to comment.