Commit 4ca964bd authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Added env. CDI_SKIP_RECORDS to skip the first GRIB records

parent 414b20b9
......@@ -602,6 +602,8 @@ void cgribexScanTimestep1(int streamID)
long unzipsize;
compvar_t compVar, compVar0;
stream_t *streamptr;
extern int cdiSkipRecords;
int nskip = cdiSkipRecords;
streamptr = stream_to_pointer(streamID);
......@@ -623,6 +625,13 @@ void cgribexScanTimestep1(int streamID)
fileID = streamInqFileID(streamID);
while ( nskip-- > 0 )
{
recsize = gribGetSize(fileID);
recpos = fileGetPos(fileID);
fileSetPos(fileID, recsize, SEEK_CUR);
}
nrecs = 0;
while ( TRUE )
{
......@@ -729,7 +738,7 @@ void cgribexScanTimestep1(int streamID)
{
if ( taxis->numavg && warn_numavg && (taxis->numavg != ISEC1_AvgNum) )
{
Message(func, "Change numavg from %d to %d not allowed!",
Warning(func, "Changing numavg from %d to %d not supported!",
taxis->numavg, ISEC1_AvgNum);
warn_numavg = FALSE;
}
......@@ -956,7 +965,7 @@ int cgribexScanTimestep2(int streamID)
(taxis->numavg != ISEC1_AvgNum) )
{
/*
Message(func, "change numavg from %d to %d not allowed!",
Warning(func, "Changing numavg from %d to %d not supported!",
taxis->numavg, ISEC1_AvgNum);
*/
warn_numavg = FALSE;
......@@ -1236,7 +1245,7 @@ int cgribexScanTimestep(int streamID)
(taxis->numavg != ISEC1_AvgNum) )
{
/*
Message(func, "Change numavg from %d to %d not allowed!",
Warning(func, "Changing numavg from %d to %d not supported!",
streamptr->tsteps[tsID].taxis.numavg, ISEC1_AvgNum);
*/
warn_numavg = FALSE;
......
......@@ -27,6 +27,7 @@ int cdiNcMissingValue = CDI_UNDEFID;
int cdiSplitLtype105 = CDI_UNDEFID;
int cdiIgnoreAttCoordinates = FALSE;
int cdiSkipRecords = 0;
int cdiInventoryMode = 1;
char *cdiPartabPath = NULL;
......@@ -151,6 +152,13 @@ void cdiInitialize(void)
envString = getenv("IGNORE_ATT_COORDINATES");
if ( envString ) cdiIgnoreAttCoordinates = atoi(envString);
envString = getenv("CDI_SKIP_RECORDS");
if ( envString )
{
cdiSkipRecords = atoi(envString);
cdiSkipRecords = cdiSkipRecords > 0 ? cdiSkipRecords : 0;
}
envString = getenv("GRIB_INVENTORY_MODE");
if ( envString )
{
......
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