Commit 927e3a04 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

check status of grbScanTimestep1

parent 164cae77
......@@ -573,7 +573,7 @@ void cgribexDecodeHeader(int *isec0, int *isec1, int *isec2, double *fsec2,
}
void cgribexScanTimestep1(int streamID)
int cgribexScanTimestep1(int streamID)
{
int *isec0, *isec1, *isec2, *isec3, *isec4;
double fsec2[512], fsec3[2], *fsec4 = NULL;
......@@ -765,6 +765,8 @@ void cgribexScanTimestep1(int streamID)
streamptr->rtsteps = 1;
if ( nrecs == 0 ) return (CDI_EUFSTRUCT);
cdiGenVars(streamID);
if ( fcast )
......@@ -825,6 +827,8 @@ void cgribexScanTimestep1(int streamID)
}
}
}
return (0);
}
......
#ifndef _STREAM_CGRIBEX_H
#define _STREAM_CGRIBEX_H
void cgribexScanTimestep1(int streamID);
int cgribexScanTimestep1(int streamID);
int cgribexScanTimestep2(int streamID);
int cgribexScanTimestep(int streamID);
......
......@@ -129,8 +129,9 @@ int grbReadRecord(int streamID, double *data, int *nmiss)
}
static
void grbScanTimestep1(int streamID)
int grbScanTimestep1(int streamID)
{
int status;
int filetype;
stream_t *streamptr;
......@@ -139,12 +140,14 @@ void grbScanTimestep1(int streamID)
if ( filetype == FILETYPE_GRB )
{
cgribexScanTimestep1(streamID);
status = cgribexScanTimestep1(streamID);
}
else
{
gribapiScanTimestep1(streamID);
status = gribapiScanTimestep1(streamID);
}
return (status);
}
static
......@@ -206,9 +209,9 @@ int grbInqContents(int streamID)
streamptr->curTsID = 0;
grbScanTimestep1(streamID);
status = grbScanTimestep1(streamID);
if ( streamptr->ntsteps == -1 ) status = grbScanTimestep2(streamID);
if ( status == 0 && streamptr->ntsteps == -1 ) status = grbScanTimestep2(streamID);
fileSetPos(fileID, 0, SEEK_SET);
......
......@@ -690,7 +690,7 @@ void gribapiAddRecord(int streamID, int param, grib_handle *gh,
}
#endif
void gribapiScanTimestep1(int streamID)
int gribapiScanTimestep1(int streamID)
{
#if defined (HAVE_LIBGRIB_API)
off_t recpos = 0;
......@@ -944,6 +944,8 @@ void gribapiScanTimestep1(int streamID)
streamptr->rtsteps = 1;
if ( nrecs == 0 ) return (CDI_EUFSTRUCT);
cdiGenVars(streamID);
if ( fcast )
......@@ -1006,6 +1008,8 @@ void gribapiScanTimestep1(int streamID)
#else
Error("GRIB_API support not compiled in!");
#endif
return (0);
}
......
#ifndef _STREAM_GRIBAPI_H
#define _STREAM_GRIBAPI_H
void gribapiScanTimestep1(int streamID);
int gribapiScanTimestep1(int streamID);
int gribapiScanTimestep2(int streamID);
int gribapiScanTimestep(int streamID);
......
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