Commit c985f7c6 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cgribexGetGrid: correct last lon when last lon < first lon

parent 41320a58
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
* using EXSE library version 1.3.2 * using EXSE library version 1.3.2
* using CGRIBEX library version 1.6.4 * using CGRIBEX library version 1.6.4
2014-05-15 Uwe Schulzweida
* cgribexGetGrid: correct last lon when last lon < first lon
2014-05-14 Uwe Schulzweida 2014-05-14 Uwe Schulzweida
* netCDF: skip unsupported dimension (no xyzt) * netCDF: skip unsupported dimension (no xyzt)
......
...@@ -187,9 +187,10 @@ void cgribexGetGrid(stream_t *streamptr, int *isec2, int *isec4, grid_t *grid, i ...@@ -187,9 +187,10 @@ void cgribexGetGrid(stream_t *streamptr, int *isec2, int *isec4, grid_t *grid, i
{ {
int recompinc = TRUE; int recompinc = TRUE;
if ( ISEC2_LastLon < ISEC2_FirstLon && ISEC2_LastLon < 0 ) ISEC2_LastLon += 360000;
if ( ISEC2_ResFlag && ISEC2_LonIncr > 0 ) if ( ISEC2_ResFlag && ISEC2_LonIncr > 0 )
{ {
if ( ISEC2_LastLon < ISEC2_FirstLon && ISEC2_LastLon < 0 ) ISEC2_LastLon += 360000;
if ( abs(ISEC2_LastLon - (ISEC2_FirstLon+ISEC2_LonIncr*(grid->xsize-1))) <= 2 ) if ( abs(ISEC2_LastLon - (ISEC2_FirstLon+ISEC2_LonIncr*(grid->xsize-1))) <= 2 )
{ {
recompinc = FALSE; recompinc = FALSE;
...@@ -254,6 +255,8 @@ void cgribexGetGrid(stream_t *streamptr, int *isec2, int *isec4, grid_t *grid, i ...@@ -254,6 +255,8 @@ void cgribexGetGrid(stream_t *streamptr, int *isec2, int *isec4, grid_t *grid, i
{ {
if ( grid->xsize > 1 ) if ( grid->xsize > 1 )
{ {
if ( ISEC2_LastLon < ISEC2_FirstLon && ISEC2_LastLon < 0 ) ISEC2_LastLon += 360000;
if ( ISEC2_ResFlag && ISEC2_LonIncr > 0 ) if ( ISEC2_ResFlag && ISEC2_LonIncr > 0 )
grid->xinc = ISEC2_LonIncr * 0.001; grid->xinc = ISEC2_LonIncr * 0.001;
else else
......
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