Commit 89d326f7 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cgribexlib update

parent 295be48d
......@@ -2459,12 +2459,12 @@ gribExDP(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
{
int yfunc = *hoper;
if ( yfunc == 'D' || yfunc == 'J' || yfunc == 'R' )
gribDecode(isec0, isec1, isec2, fsec2, isec3,
if ( yfunc == 'C' )
gribEncode(isec0, isec1, isec2, fsec2, isec3,
fsec3, isec4, fsec4, klenp, kgrib,
kleng, kword, yfunc, kret);
else if ( yfunc == 'C' )
gribEncode(isec0, isec1, isec2, fsec2, isec3,
else if ( yfunc == 'D' || yfunc == 'J' || yfunc == 'R' )
gribDecode(isec0, isec1, isec2, fsec2, isec3,
fsec3, isec4, fsec4, klenp, kgrib,
kleng, kword, yfunc, kret);
else if ( yfunc == 'V' )
......@@ -10188,7 +10188,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
return (gribLen);
}
static const char grb_libvers[] = "1.6.0" " of ""Jan 14 2013"" ""11:39:57";
static const char grb_libvers[] = "1.6.0" " of ""Jan 14 2013"" ""13:42:16";
const char *
cgribexLibraryVersion(void)
{
......
......@@ -1685,8 +1685,7 @@ void stream_write_var(int streamID, int varID, int memtype, const void *data, in
case FILETYPE_GRB:
case FILETYPE_GRB2:
{
if ( memtype == MEMTYPE_FLOAT ) Error("grbWriteVar not implemented for memtype float!");
grbWriteVarDP(streamptr, varID, data, nmiss);
grb_write_var(streamptr, varID, memtype, data, nmiss);
break;
}
#endif
......@@ -1884,8 +1883,7 @@ void stream_write_var_slice(int streamID, int varID, int levelID, int memtype, c
case FILETYPE_GRB:
case FILETYPE_GRB2:
{
if ( memtype == MEMTYPE_FLOAT ) Error("grbWriteVarSlice not implemented for memtype float!");
grbWriteVarSliceDP(streamptr, varID, levelID, data, nmiss);
grb_write_var_slice(streamptr, varID, levelID, memtype, data, nmiss);
break;
}
#endif
......
......@@ -501,7 +501,7 @@ size_t grbSzip(int filetype, unsigned char *gribbuffer, size_t gribbuffersize)
}
int grbWriteVarSliceDP(stream_t *streamptr, int varID, int levelID, const double *data, int nmiss)
int grb_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, int nmiss)
{
size_t nwrite;
int fileID;
......@@ -520,8 +520,9 @@ int grbWriteVarSliceDP(stream_t *streamptr, int varID, int levelID, const double
int ljpeg_warn = 1;
void *gc = NULL;
filetype = streamptr->filetype;
if ( memtype == MEMTYPE_FLOAT ) Error("cdf_write_var_slice not implemented for memtype float!");
filetype = streamptr->filetype;
fileID = streamptr->fileID;
vlistID = streamptr->vlistID;
gridID = vlistInqVarGrid(vlistID, varID);
......@@ -594,7 +595,7 @@ int grbWriteVarSliceDP(stream_t *streamptr, int varID, int levelID, const double
}
void grbWriteVarDP(stream_t *streamptr, int varID, const double *data, int nmiss)
void grb_write_var(stream_t *streamptr, int varID, int memtype, const void *data, int nmiss)
{
int vlistID, gridID, zaxisID, levelID, nlevs;
int gridsize;
......@@ -607,7 +608,7 @@ void grbWriteVarDP(stream_t *streamptr, int varID, const double *data, int nmiss
for ( levelID = 0; levelID < nlevs; levelID++ )
{
grbWriteVarSliceDP(streamptr, varID, levelID, data+levelID*gridsize, nmiss);
grb_write_var_slice(streamptr, varID, levelID, memtype, data+levelID*gridsize, nmiss);
}
}
......@@ -672,7 +673,7 @@ int grbCopyRecord(int streamID2, int streamID1)
}
int grbWriteRecord(int streamID, const double *data, int nmiss)
int grb_write_record(int streamID, int memtype, const void *data, int nmiss)
{
int status = 0;
int varID, levelID;
......@@ -685,7 +686,7 @@ int grbWriteRecord(int streamID, const double *data, int nmiss)
varID = streamptr->record->varID;
levelID = streamptr->record->levelID;
status = grbWriteVarSliceDP(streamptr, varID, levelID, data, nmiss);
status = grb_write_var_slice(streamptr, varID, levelID, memtype, data, nmiss);
return (status);
}
......
......@@ -8,15 +8,15 @@ int grbInqTimestep(int streamID, int tsID);
int grbInqRecord(int streamID, int *varID, int *levelID);
int grbDefRecord(int streamID);
int grbWriteRecord(int streamID, const double *data, int nmiss);
int grb_write_record(int streamID, int memtype, const void *data, int nmiss);
int grbReadRecord(int streamID, double *data, int *nmiss);
int grbCopyRecord(int streamIDdest, int streamIDsrc);
void grbReadVarDP(int streamID, int varID, double *data, int *nmiss);
void grbWriteVarDP(stream_t *streamptr, int varID, const double *data, int nmiss);
void grb_write_Var(stream_t *streamptr, int varID, int memtype, const void *data, int nmiss);
void grbReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *nmiss);
int grbWriteVarSliceDP(stream_t *streamptr, int varID, int levelID, const double *data, int nmiss);
int grb_write_var_slice(stream_t *streamptr, int varID, int levelID, int memtype, const void *data, int nmiss);
int grib1ltypeToZaxisType(int grib_ltype);
int grib2ltypeToZaxisType(int grib_ltype);
......
......@@ -373,8 +373,7 @@ void stream_write_record(int streamID, int memtype, const void *data, int nmiss)
case FILETYPE_GRB:
case FILETYPE_GRB2:
{
if ( memtype == MEMTYPE_FLOAT ) Error("grbWriteRecord not implemented for memtype float!");
status = grbWriteRecord(streamID, data, nmiss);
status = grbWriteRecord(streamID, 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