Commit 13f9fff6 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

gridPrint: print xfirst and xinc if xinc is constant

parent 701bf9c1
2006-05-?? Uwe Schulzweida <schulzweida@dkrz.de>
* using GRIB library version 0.6.6
* gridPrint: print xfirst and xinc if xinc is constant
* Version 0.9.7 released
2006-03-08 Uwe Schulzweida <schulzweida@dkrz.de>
......
......@@ -2442,10 +2442,19 @@ void gridCompress(int gridID)
gridptr->xsize = gridsize;
gridptr->ysize = gridsize;
if ( gridptr->xvals )
gridptr->xvals = (double *) realloc(gridptr->xvals, gridsize*sizeof(double));
if ( gridptr->yvals )
gridptr->yvals = (double *) realloc(gridptr->yvals, gridsize*sizeof(double));
if ( gridptr->area )
gridptr->area = (double *) realloc(gridptr->area, gridsize*sizeof(double));
if ( gridptr->xbounds )
gridptr->xbounds = (double *) realloc(gridptr->xbounds, nv*gridsize*sizeof(double));
if ( gridptr->ybounds )
gridptr->ybounds = (double *) realloc(gridptr->ybounds, nv*gridsize*sizeof(double));
free(gridptr->mask);
......@@ -2827,6 +2836,21 @@ void gridPrint(int gridID)
}
if ( xvals )
{
double xfirst = 0.0, xinc = 0.0;
if ( type == GRID_LONLAT || type == GRID_GAUSSIAN )
{
xfirst = gridInqXval(gridID, 0);
xinc = gridInqXinc(gridID);
}
if ( !DBL_IS_EQUAL(xinc, 0) )
{
fprintf(fp, "xfirst : %g\n", xfirst);
fprintf(fp, "xinc : %g\n", xinc);
}
else
{
nbyte0 = fprintf(fp, "xvals : ");
nbyte = nbyte0;
......@@ -2842,6 +2866,7 @@ void gridPrint(int gridID)
}
fprintf(fp, "\n");
}
}
if ( xbounds )
{
......@@ -2857,6 +2882,21 @@ void gridPrint(int gridID)
}
if ( yvals )
{
double yfirst = 0.0, yinc = 0.0;
if ( type == GRID_LONLAT )
{
yfirst = gridInqYval(gridID, 0);
yinc = gridInqYinc(gridID);
}
if ( !DBL_IS_EQUAL(yinc, 0) )
{
fprintf(fp, "yfirst : %g\n", yfirst);
fprintf(fp, "yinc : %g\n", yinc);
}
else
{
nbyte0 = fprintf(fp, "yvals : ");
nbyte = nbyte0;
......@@ -2872,6 +2912,7 @@ void gridPrint(int gridID)
}
fprintf(fp, "\n");
}
}
if ( ybounds )
{
......
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