Commit 9690c6bb authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cgribexGetGrid: bug fix for yinc for odd ysize

parent 5bc50213
2012-11-05 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cgribexGetGrid: bug fix for yinc for odd ysize
2012-10-30 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* Version 1.5.8 released
......
......@@ -196,7 +196,6 @@ void cgribexGetGrid(stream_t *streamptr, int *isec2, int *isec4, grid_t *grid, i
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;
......@@ -224,7 +223,8 @@ void cgribexGetGrid(stream_t *streamptr, int *isec2, int *isec4, grid_t *grid, i
/* correct yinc if necessary */
if ( gridtype == GRID_LONLAT && abs(ISEC2_FirstLat) == abs(ISEC2_LastLat) && abs(ISEC2_LastLat) > 85000 )
{
double yinc = 180. / grid->ysize;
double range = 2.*abs(ISEC2_LastLat)/1000.;
double yinc = range / (grid->ysize-1);
if ( fabs(grid->yinc-yinc) > 0.0 )
{
......
......@@ -680,7 +680,7 @@ int varDefGrid(int vlistID, grid_t grid, int mode)
ngrids = gridSize();
if ( ngrids > 0 )
{
gridIndexList = malloc ( ngrids * sizeof ( int ));
gridIndexList = malloc(ngrids*sizeof(int));
gridGetIndexList ( ngrids, gridIndexList );
for ( i = 0; i < ngrids; i++ )
{
......
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