Commit 3f5bb5da authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

gribapiGetGrid: if xfirst >= 180 sub 360.

parent ed903ce3
......@@ -587,7 +587,15 @@ void gribapiGetGrid(grib_handle *gh, grid_t *grid)
{
if ( editionNumber <= 1 )
{
/* correct xinc if necessary */
if ( grid->x.last < grid->x.first )
{
if ( grid->x.first >= 180 )
grid->x.first -= 360;
else
grid->x.last += 360;
}
// correct xinc if necessary
if ( IS_EQUAL(grid->x.first, 0) && grid->x.last > 354 )
{
double xinc = 360. / grid->x.size;
......
......@@ -359,8 +359,6 @@ void cdiGridTypeInit(grid_t *gridptr, int gridtype, size_t size)
// used also in CDO
void gridGenXvals(int xsize, double xfirst, double xlast, double xinc, double *restrict xvals)
{
if (xsize > 1 && xfirst >= xlast && xfirst >= 180 && xlast > 0) xfirst -= 360;
if ( (! (fabs(xinc) > 0)) && xsize > 1 )
{
if ( xfirst >= xlast )
......
Supports Markdown
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