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

netCDF: added env IGNORE_VALID_RANGE to ignore the attribute valid_range

parent 02f20818
......@@ -3,6 +3,10 @@
* Version 1.6.0 released
* using CGRIBEX library version 1.6.0
2013-02-04 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* netCDF: added env IGNORE_VALID_RANGE to ignore the attribute valid_range
2013-01-31 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* stream_cgribex::cgribexGetGrid: add 360 to lastLon, if lastlon <firstLon [Bug #3189]
......
......@@ -4722,11 +4722,15 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
{
if ( ncvars[ncvarid].lvalidrange == FALSE )
{
cdfGetAttDouble(ncid, ncvarid, attname, 2, ncvars[ncvarid].validrange);
ncvars[ncvarid].lvalidrange = TRUE;
if ( ((int)ncvars[ncvarid].validrange[0]) == 0 && ((int)ncvars[ncvarid].validrange[1]) == 255 )
ncvars[ncvarid].lunsigned = TRUE;
/* cdfSetVar(ncvars, ncvarid, TRUE); */
extern int cdiIgnoreValidRange;
if ( cdiIgnoreValidRange == FALSE )
{
cdfGetAttDouble(ncid, ncvarid, attname, 2, ncvars[ncvarid].validrange);
ncvars[ncvarid].lvalidrange = TRUE;
if ( ((int)ncvars[ncvarid].validrange[0]) == 0 && ((int)ncvars[ncvarid].validrange[1]) == 255 )
ncvars[ncvarid].lunsigned = TRUE;
/* cdfSetVar(ncvars, ncvarid, TRUE); */
}
}
}
else if ( strcmp(attname, "valid_min") == 0 && attlen == 1 )
......
......@@ -33,6 +33,7 @@ int cdiChunkType = CHUNK_GRID;
int cdiSplitLtype105 = CDI_UNDEFID;
int cdiIgnoreAttCoordinates = FALSE;
int cdiIgnoreValidRange = FALSE;
int cdiSkipRecords = 0;
int cdiInventoryMode = 1;
......@@ -207,6 +208,9 @@ void cdiInitialize(void)
envString = getenv("IGNORE_ATT_COORDINATES");
if ( envString ) cdiIgnoreAttCoordinates = atoi(envString);
envString = getenv("IGNORE_VALID_RANGE");
if ( envString ) cdiIgnoreValidRange = atoi(envString);
envString = getenv("CDI_SKIP_RECORDS");
if ( envString )
{
......@@ -268,7 +272,7 @@ char *strfiletype(int filetype)
if ( filetype > 0 && filetype < size )
name = Filetypes[filetype];
else
name = Filetypes[0];
name = Filetypes[0];
return (name);
}
......
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