Skip to content
GitLab
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
1011d94b
Commit
1011d94b
authored
Nov 07, 2012
by
Uwe Schulzweida
Browse files
cgribexGetGrid: correct xinc if necessary
parent
a7c952c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/stream_cgribex.c
View file @
1011d94b
...
...
@@ -195,8 +195,20 @@ void cgribexGetGrid(stream_t *streamptr, int *isec2, int *isec4, grid_t *grid, i
}
}
/*
correct
xinc if necessary */
/*
recompute
xinc if necessary */
if
(
recompinc
)
grid
->
xinc
=
(
ISEC2_LastLon
-
ISEC2_FirstLon
)
*
0
.
001
/
(
grid
->
xsize
-
1
);
/* correct xinc if necessary */
if
(
ISEC2_FirstLon
==
0
&&
ISEC2_LastLon
>
354000
&&
ISEC2_LastLon
<
360000
)
{
double
xinc
=
360
.
/
grid
->
xsize
;
if
(
fabs
(
grid
->
xinc
-
xinc
)
>
0
.
0
)
{
grid
->
xinc
=
xinc
;
if
(
CDI_Debug
)
Message
(
"set xinc to %g"
,
grid
->
xinc
);
}
}
}
grid
->
xfirst
=
ISEC2_FirstLon
*
0
.
001
;
grid
->
xlast
=
ISEC2_LastLon
*
0
.
001
;
...
...
@@ -218,7 +230,7 @@ void cgribexGetGrid(stream_t *streamptr, int *isec2, int *isec4, grid_t *grid, i
}
}
/*
correct
yinc if necessary */
/*
recompute
yinc if necessary */
if
(
recompinc
)
grid
->
yinc
=
(
ISEC2_LastLat
-
ISEC2_FirstLat
)
*
0
.
001
/
(
grid
->
ysize
-
1
);
}
grid
->
yfirst
=
ISEC2_FirstLat
*
0
.
001
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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