Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
fa624e1b
Commit
fa624e1b
authored
Apr 04, 2016
by
Uwe Schulzweida
Browse files
gribapiGetGrid: get increment only if number of values > 1
parent
ed87c33c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/gribapi_utilities.c
View file @
fa624e1b
...
...
@@ -499,8 +499,9 @@ void gribapiGetGrid(grib_handle *gh, grid_t *grid)
FAIL_ON_GRIB_ERROR
(
grib_get_double
,
gh
,
"longitudeOfLastGridPointInDegrees"
,
&
grid
->
xlast
);
FAIL_ON_GRIB_ERROR
(
grib_get_double
,
gh
,
"latitudeOfFirstGridPointInDegrees"
,
&
grid
->
yfirst
);
FAIL_ON_GRIB_ERROR
(
grib_get_double
,
gh
,
"latitudeOfLastGridPointInDegrees"
,
&
grid
->
ylast
);
FAIL_ON_GRIB_ERROR
(
grib_get_double
,
gh
,
"iDirectionIncrementInDegrees"
,
&
grid
->
xinc
);
if
(
gridtype
==
GRID_LONLAT
)
if
(
nlon
>
1
)
FAIL_ON_GRIB_ERROR
(
grib_get_double
,
gh
,
"iDirectionIncrementInDegrees"
,
&
grid
->
xinc
);
if
(
gridtype
==
GRID_LONLAT
&&
nlat
>
1
)
FAIL_ON_GRIB_ERROR
(
grib_get_double
,
gh
,
"jDirectionIncrementInDegrees"
,
&
grid
->
yinc
);
if
(
grid
->
xinc
<
-
999
||
grid
->
xinc
>
999
)
grid
->
xinc
=
0
;
...
...
@@ -575,9 +576,9 @@ void gribapiGetGrid(grib_handle *gh, grid_t *grid)
FAIL_ON_GRIB_ERROR
(
grib_get_double
,
gh
,
"longitudeOfLastGridPointInDegrees"
,
&
grid
->
xlast
);
FAIL_ON_GRIB_ERROR
(
grib_get_double
,
gh
,
"latitudeOfFirstGridPointInDegrees"
,
&
grid
->
yfirst
);
FAIL_ON_GRIB_ERROR
(
grib_get_double
,
gh
,
"latitudeOfLastGridPointInDegrees"
,
&
grid
->
ylast
);
FAIL_ON_GRIB_ERROR
(
grib_get_double
,
gh
,
"iDirectionIncrementInDegrees"
,
&
grid
->
xinc
);
if
(
IS_EQUAL
(
grid
->
xinc
,
GRIB_MISSING_DOUBLE
)
)
grid
->
xinc
=
0
;
// FAIL_ON_GRIB_ERROR(grib_get_double, gh, "iDirectionIncrementInDegrees", &grid->xinc);
// if ( IS_EQUAL(grid->xinc, GRIB_MISSING_DOUBLE) ) grid->xinc = 0;
/* if ( IS_NOT_EQUAL(grid->xfirst, 0) || IS_NOT_EQUAL(grid->xlast, 0) ) */
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment