Commit 6c9c2aed authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

gridInqXinc: bug fix

parent 81a3a524
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* add support for GRID type LCC2 (LCC PROJ.4 version) * add support for GRID type LCC2 (LCC PROJ.4 version)
* grbDefTime: define tunit also for absolute time [report: Pruek Pongprueksa] * grbDefTime: define tunit also for absolute time [report: Pruek Pongprueksa]
* change default calendar to CALENDAR_PROLEPTIC * change default calendar to CALENDAR_PROLEPTIC
* gridInqXinc: bug fix
* grid_check_cyclic: support for curvilinear grids without bounds * grid_check_cyclic: support for curvilinear grids without bounds
* streamOpenAppen: set ncmode to 2 (bug fix) * streamOpenAppen: set ncmode to 2 (bug fix)
* Version 1.3.0 released * Version 1.3.0 released
......
...@@ -1769,9 +1769,9 @@ double gridInqXinc(int gridID) ...@@ -1769,9 +1769,9 @@ double gridInqXinc(int gridID)
if ( xsize > 1 ) if ( xsize > 1 )
{ {
int i; int i;
xinc = fabs(xvals[0] - xvals[1]); xinc = fabs(xvals[xsize-1] - xvals[0])/(xsize-1);
for ( i = 2; i < xsize; i++ ) for ( i = 2; i < xsize; i++ )
if ( fabs(fabs(xvals[i-1] - xvals[i]) - xinc) > (xinc/1000) ) break; if ( fabs(fabs(xvals[i-1] - xvals[i]) - xinc) > 0.01*xinc ) break;
if ( i < xsize ) xinc = 0; if ( i < xsize ) xinc = 0;
} }
......
...@@ -3070,11 +3070,11 @@ int cdfReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *n ...@@ -3070,11 +3070,11 @@ int cdfReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *n
{ {
char name[256]; char name[256];
vlistInqVarName(vlistID, varID, name); vlistInqVarName(vlistID, varID, name);
Error(func, "Unsupported array structure for %s\n", name); Error(func, "Unsupported array structure for: %s", name);
} }
} }
if ( yid != UNDEFID && xid != UNDEFID ) if ( swapyz == FALSE && yid != UNDEFID && xid != UNDEFID )
{ {
if ( xid == dimids[ndimsp-1] && yid == dimids[ndimsp-2] ) if ( xid == dimids[ndimsp-1] && yid == dimids[ndimsp-2] )
swapxy = FALSE; swapxy = FALSE;
...@@ -3084,7 +3084,7 @@ int cdfReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *n ...@@ -3084,7 +3084,7 @@ int cdfReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *n
{ {
char name[256]; char name[256];
vlistInqVarName(vlistID, varID, name); vlistInqVarName(vlistID, varID, name);
Error(func, "Unsupported array structure for %s\n", name); Error(func, "Unsupported array structure for: %s", name);
} }
} }
......
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