Commit cd133867 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

print_xyvals2D: set compare eps for yinc to 0.005.

parent 5fc928bb
......@@ -111,7 +111,7 @@ static void
print_xvals(int gridID, int dig)
{
const size_t xsize = gridInqXsize(gridID);
if (xsize > 0 && gridInqXvals(gridID, NULL))
if (xsize && gridInqXvals(gridID, NULL))
{
char xname[CDI_MAX_NAME], xunits[CDI_MAX_NAME];
gridInqXname(gridID, xname);
......@@ -136,7 +136,7 @@ static void
print_yvals(int gridID, int dig)
{
const size_t ysize = gridInqYsize(gridID);
if (ysize > 0 && gridInqYvals(gridID, NULL))
if (ysize && gridInqYvals(gridID, NULL))
{
char yname[CDI_MAX_NAME], yunits[CDI_MAX_NAME];
gridInqYname(gridID, yname);
......@@ -201,7 +201,7 @@ print_xyvals2D(int gridID, int dig)
for (size_t i = 0; i < xsize; ++i) xvals[i] = xvals2D[i];
xinc = fabs(xvals[xsize - 1] - xvals[0]) / (xsize - 1);
for (size_t i = 1; i < xsize; i++)
if (fabs(fabs(xvals[i - 1] - xvals[i]) - xinc) > 0.01 * xinc)
if (fabs(fabs(xvals[i - 1] - xvals[i]) - xinc) > 0.005 * xinc)
{
xinc = 0;
break;
......@@ -223,7 +223,7 @@ print_xyvals2D(int gridID, int dig)
for (size_t i = 0; i < ysize; ++i) yvals[i] = yvals2D[i * xsize];
yinc = fabs(yvals[ysize - 1] - yvals[0]) / (ysize - 1);
for (size_t i = 1; i < ysize; i++)
if (fabs(fabs(yvals[i - 1] - yvals[i]) - yinc) > 0.01 * yinc)
if (fabs(fabs(yvals[i - 1] - yvals[i]) - yinc) > 0.005 * yinc)
{
yinc = 0;
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment