Commit 0bb80cc0 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdfCopyRecord: use MEMTYPE_FLOAT for DATATYPE_FLT32

parent 7281ee93
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
* Version 1.7.1 released * Version 1.7.1 released
* using CGRIBEX library version 1.7.4 * using CGRIBEX library version 1.7.4
2015-11-17 Uwe Schulzweida
* cdfCopyRecord: use MEMTYPE_FLOAT for DATATYPE_FLT32
2015-11-04 Uwe Schulzweida 2015-11-04 Uwe Schulzweida
* tableRead: name is not interpreted correctly (bug introduced in 1.7.0 #3933) * tableRead: name is not interpreted correctly (bug introduced in 1.7.0 #3933)
......
...@@ -533,8 +533,15 @@ void cdfCopyRecord(stream_t *streamptr2, stream_t *streamptr1) ...@@ -533,8 +533,15 @@ void cdfCopyRecord(stream_t *streamptr2, stream_t *streamptr1)
int ivarID = streamptr1->tsteps[tsID].records[recID].varID; int ivarID = streamptr1->tsteps[tsID].records[recID].varID;
int gridID = vlistInqVarGrid(vlistID1, ivarID); int gridID = vlistInqVarGrid(vlistID1, ivarID);
int datasize = gridInqSize(gridID); int datasize = gridInqSize(gridID);
int datatype = vlistInqVarDatatype(vlistID1, ivarID);
double *data = (double *) Malloc((size_t)datasize * sizeof (double)); if ( datatype == DATATYPE_FLT32 ) memtype = MEMTYPE_FLOAT;
void *data = NULL;
if ( memtype == MEMTYPE_DOUBLE )
data = Malloc((size_t)datasize*sizeof(double));
else
data = Malloc((size_t)datasize*sizeof(float));
int nmiss; int nmiss;
cdf_read_record(streamptr1, memtype, data, &nmiss); cdf_read_record(streamptr1, memtype, data, &nmiss);
......
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