Commit 58a9e951 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

vlistCopyFlag: copy ensdata (bug fix)

parent 0d58e1bf
......@@ -3,6 +3,10 @@
* Version 1.5.8 released
* using CGRIBEX library version 1.5.5
2012-10-18 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* vlistCopyFlag: copy ensdata (bug fix) [report: Jaison Ambadan]
2012-10-16 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* grib2: change packingType from grid_jpeg to grid_simple if nmiss > 0 (bug fix)
......
......@@ -225,7 +225,7 @@ void vlistDestroy(int vlistID)
vlistDelAtts(vlistID, varID);
}
if ( vlistptr->vars ) free(vlistptr->vars);
vlist_delete_entry(vlistptr);
......@@ -282,11 +282,6 @@ void vlistCopy(int vlistID2, int vlistID1)
if ( vlistptr1->vars[varID].units )
vlistptr2->vars[varID].units = strdupx(vlistptr1->vars[varID].units);
nlevs = vlistptr1->vars[varID].nlevs;
vlistptr2->vars[varID].levinfo = (levinfo_t *) malloc(nlevs*sizeof(levinfo_t));
memcpy(vlistptr2->vars[varID].levinfo,
vlistptr1->vars[varID].levinfo, nlevs*sizeof(levinfo_t));
if ( vlistptr1->vars[varID].ensdata )
{
vlistptr2->vars[varID].ensdata = (ensinfo_t *) malloc(sizeof(ensinfo_t));
......@@ -296,6 +291,11 @@ void vlistCopy(int vlistID2, int vlistID1)
vlistptr2->vars[varID].atts.nelems = 0;
vlistCopyVarAtts(vlistID1, varID, vlistID2, varID);
nlevs = vlistptr1->vars[varID].nlevs;
vlistptr2->vars[varID].levinfo = (levinfo_t *) malloc(nlevs*sizeof(levinfo_t));
memcpy(vlistptr2->vars[varID].levinfo,
vlistptr1->vars[varID].levinfo, nlevs*sizeof(levinfo_t));
}
}
}
......@@ -508,6 +508,16 @@ void vlistCopyFlag(int vlistID2, int vlistID1)
if ( vlistptr1->vars[varID].units )
vlistptr2->vars[varID2].units = strdupx(vlistptr1->vars[varID].units);
if ( vlistptr1->vars[varID].ensdata )
{
vlistptr2->vars[varID].ensdata = (ensinfo_t *) malloc(sizeof(ensinfo_t));
memcpy(vlistptr2->vars[varID].ensdata,
vlistptr1->vars[varID].ensdata, sizeof(ensinfo_t));
}
vlistptr2->vars[varID2].atts.nelems = 0;
vlistCopyVarAtts(vlistID1, varID, vlistID2, varID2);
nlevs = vlistptr1->vars[varID].nlevs;
nlevs2 = 0;
for ( levID = 0; levID < nlevs; levID++ )
......@@ -515,9 +525,6 @@ void vlistCopyFlag(int vlistID2, int vlistID1)
vlistptr2->vars[varID2].levinfo = (levinfo_t *) malloc(nlevs2*sizeof(levinfo_t));
vlistptr2->vars[varID2].atts.nelems = 0;
vlistCopyVarAtts(vlistID1, varID, vlistID2, varID2);
if ( nlevs != nlevs2 )
{
int zaxisType;
......
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