Commit 7068fcc5 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

vlistChangeVarGrid: bug fix

parent 9101e12b
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* using GRIB library version 1.0.2 * using GRIB library version 1.0.2
* grbCopyRecord: add SZIP support * grbCopyRecord: add SZIP support
* vlistChangeVarGrid: bug fix
* cdfDefVar: set default datatype for addoffset and scalefactor to double * cdfDefVar: set default datatype for addoffset and scalefactor to double
* cdfWriteVar*: round integer fields with NINT [report: Etienne Tourigny] * cdfWriteVar*: round integer fields with NINT [report: Etienne Tourigny]
* Version 1.0.2 released * Version 1.0.2 released
......
...@@ -1205,7 +1205,7 @@ void vlistChangeVarZaxis(int vlistID, int varID, int zaxisID) ...@@ -1205,7 +1205,7 @@ void vlistChangeVarZaxis(int vlistID, int varID, int zaxisID)
for ( index = 0; index < vlistptr->nzaxis; index++ ) for ( index = 0; index < vlistptr->nzaxis; index++ )
if ( vlistptr->zaxisIDs[index] == zaxisID ) break; if ( vlistptr->zaxisIDs[index] == zaxisID ) break;
if ( index == nvars ) if ( index == vlistptr->nzaxis )
{ {
if ( vlistptr->nzaxis + 1 >= MAX_ZAXIS ) if ( vlistptr->nzaxis + 1 >= MAX_ZAXIS )
Error(func, "Maximum of %d zaxis reached", MAX_ZAXIS); Error(func, "Maximum of %d zaxis reached", MAX_ZAXIS);
...@@ -1245,7 +1245,7 @@ void vlistChangeVarGrid(int vlistID, int varID, int gridID) ...@@ -1245,7 +1245,7 @@ void vlistChangeVarGrid(int vlistID, int varID, int gridID)
for ( index = 0; index < vlistptr->ngrids; index++ ) for ( index = 0; index < vlistptr->ngrids; index++ )
if ( vlistptr->gridIDs[index] == gridID ) break; if ( vlistptr->gridIDs[index] == gridID ) break;
if ( index == nvars ) if ( index == vlistptr->ngrids )
{ {
if ( vlistptr->ngrids + 1 >= MAX_GRIDS ) if ( vlistptr->ngrids + 1 >= MAX_GRIDS )
Error(func, "Maximum of %d grids reached", MAX_GRIDS); Error(func, "Maximum of %d grids reached", MAX_GRIDS);
......
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