Commit 10509918 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

renamed grbReadVarDP to grb_read_var

parent 1c98fdc1
......@@ -17,7 +17,7 @@
static
int grbDecode(int filetype, int memtype, void *gribbuffer, int gribsize, double *data, size_t datasize,
int grbDecode(int filetype, int memtype, void *gribbuffer, int gribsize, void *data, size_t datasize,
int unreduced, int *nmiss, double missval, int vlistID, int varID)
{
int status = 0;
......@@ -145,7 +145,7 @@ void grbReadRecord(stream_t * streamptr, double *data, int *nmiss)
}
void grbReadVarDP(stream_t * streamptr, int varID, double *data, int *nmiss)
void grb_read_var(stream_t * streamptr, int varID, int memtype, void *data, int *nmiss)
{
int filetype = streamptr->filetype;
......@@ -181,7 +181,13 @@ void grbReadVarDP(stream_t * streamptr, int varID, double *data, int *nmiss)
streamptr->tsteps[tsID].records[recID].zip = grbUnzipRecord(gribbuffer, &recsize);
grbDecode(filetype, MEMTYPE_DOUBLE, gribbuffer, (int)recsize, &data[levelID*gridsize], gridsize,
void *datap = NULL;
if ( memtype == MEMTYPE_FLOAT )
datap = (float*)data + levelID*gridsize;
else
datap = (double*)data + levelID*gridsize;
grbDecode(filetype, memtype, gribbuffer, (int)recsize, datap, gridsize,
streamptr->unreduced, &imiss, missval, vlistID, varID);
*nmiss += imiss;
......
......@@ -3,17 +3,17 @@
int grbBitsPerValue(int datatype);
int grbInqContents(stream_t * streamptr);
int grbInqTimestep(stream_t * streamptr, int tsID);
int grbInqContents(stream_t *streamptr);
int grbInqTimestep(stream_t *streamptr, int tsID);
int grbInqRecord(stream_t * streamptr, int *varID, int *levelID);
void grbDefRecord(stream_t * streamptr);
void grbReadRecord(stream_t * streamptr, double *data, int *nmiss);
void grb_write_record(stream_t * streamptr, int memtype, const void *data, int nmiss);
void grbCopyRecord(stream_t * streamptr2, stream_t * streamptr1);
int grbInqRecord(stream_t *streamptr, int *varID, int *levelID);
void grbDefRecord(stream_t *streamptr);
void grbReadRecord(stream_t *streamptr, double *data, int *nmiss);
void grb_write_record(stream_t *streamptr, int memtype, const void *data, int nmiss);
void grbCopyRecord(stream_t *streamptr2, stream_t *streamptr1);
void grbReadVarDP(stream_t * streamptr, int varID, double *data, int *nmiss);
void grb_write_var(stream_t * streamptr, int varID, int memtype, const void *data, int nmiss);
void grb_read_var(stream_t *streamptr, int varID, int memtype, void *data, int *nmiss);
void grb_write_var(stream_t *streamptr, int varID, int memtype, const void *data, int nmiss);
void grb_read_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, void *data, int *nmiss);
void grb_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, int nmiss);
......
......@@ -33,8 +33,7 @@ void cdiStreamReadVar(int streamID, int varID, int memtype, void *data, int *nmi
case FILETYPE_GRB:
case FILETYPE_GRB2:
{
if ( memtype == MEMTYPE_FLOAT ) Error("grbReadVar not implemented for memtype float!");
grbReadVarDP(streamptr, varID, (double *)data, nmiss);
grb_read_var(streamptr, varID, memtype, data, nmiss);
break;
}
#endif
......
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