Commit 34c9155e authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

streamReadRecordF: wrong elementCount for complex numbers (bug fix).

parent 56085ffe
......@@ -338,7 +338,8 @@ void streamReadRecordF(int streamID, float *data, size_t *nmiss)
int vrecID = streamptr->tsteps[tsID].curRecID;
int recID = streamptr->tsteps[tsID].recIDs[vrecID];
int varID = streamptr->tsteps[tsID].records[recID].varID;
size_t elementCount = gridInqSize(vlistInqVarGrid(streamInqVlist(streamID), varID));
int nwpv = vlistInqVarNumber(streamInqVlist(streamID), varID);
size_t elementCount = nwpv*gridInqSize(vlistInqVarGrid(streamInqVlist(streamID), varID));
double *conversionBuffer = (double *) Malloc(elementCount*sizeof(*conversionBuffer));
streamReadRecord(streamID, conversionBuffer, nmiss);
for ( size_t i = elementCount; i--; ) data[i] = (float) conversionBuffer[i];
Supports Markdown
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