Commit 2d2c8fcf authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

streamWriteRecordF: bug fix

parent 8477be05
...@@ -389,10 +389,7 @@ void streamWriteRecordF(int streamID, const float *data, int nmiss) ...@@ -389,10 +389,7 @@ void streamWriteRecordF(int streamID, const float *data, int nmiss)
// In case the file format does not support single precision reading, // In case the file format does not support single precision reading,
// we fall back to double precision writing, converting the data on the fly. // we fall back to double precision writing, converting the data on the fly.
stream_t *streamptr = stream_to_pointer(streamID); stream_t *streamptr = stream_to_pointer(streamID);
int tsID = streamptr->curTsID; int varID = streamptr->record->varID;
int vrecID = streamptr->tsteps[tsID].curRecID;
int recID = streamptr->tsteps[tsID].recIDs[vrecID];
int varID = streamptr->tsteps[tsID].records[recID].varID;
size_t elementCount = (size_t) gridInqSize(vlistInqVarGrid(streamInqVlist(streamID), varID)); size_t elementCount = (size_t) gridInqSize(vlistInqVarGrid(streamInqVlist(streamID), varID));
double *conversionBuffer = (double *) Malloc(elementCount*sizeof(*conversionBuffer)); double *conversionBuffer = (double *) Malloc(elementCount*sizeof(*conversionBuffer));
for ( size_t i = elementCount; i--; ) conversionBuffer[i] = (double) data[i]; for ( size_t i = elementCount; i--; ) conversionBuffer[i] = (double) data[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