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
3f5bb5da
Commit
3f5bb5da
authored
Aug 10, 2018
by
Uwe Schulzweida
Browse files
gribapiGetGrid: if xfirst >= 180 sub 360.
parent
ed903ce3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/gribapi_utilities.c
View file @
3f5bb5da
...
...
@@ -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
;
...
...
src/grid.c
View file @
3f5bb5da
...
...
@@ -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
)
...
...
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