Skip to content
Snippets Groups Projects
Commit 11520af9 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdf_scan_var_attr: valid_min bug fix.

parent 4514393a
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,10 @@
* Version 1.9.4 released
2018-05-03 Uwe Schulzweida
* cdf_scan_var_attr: valid_min bug fix
2018-04-25 Uwe Schulzweida
* gribapiDefDateTimeRel: check range of endStep (bug fix)
......
......@@ -1458,34 +1458,28 @@ void cdf_scan_var_attr(int nvars, ncvar_t *ncvars, ncdim_t *ncdims, int timedimi
}
else if ( isNumber && strcmp(attname, "valid_min") == 0 && attlen == 1 )
{
if ( ncvars[ncvarid].lvalidrange == false )
bool lignore = xtypeIsFloat(atttype) != xtypeIsFloat(xtype);
if ( !cdiIgnoreValidRange && lignore == false )
{
bool lignore = xtypeIsFloat(atttype) != xtypeIsFloat(xtype);
if ( !cdiIgnoreValidRange && lignore == false )
{
cdfGetAttDouble(ncid, ncvarid, attname, 1, &(ncvars[ncvarid].validrange)[0]);
ncvars[ncvarid].lvalidrange = true;
}
else if ( lignore )
{
Warning("Inconsistent data type for attribute %s:valid_min, ignored!", name);
}
cdfGetAttDouble(ncid, ncvarid, attname, 1, &(ncvars[ncvarid].validrange)[0]);
ncvars[ncvarid].lvalidrange = true;
}
else if ( lignore )
{
Warning("Inconsistent data type for attribute %s:valid_min, ignored!", name);
}
}
else if ( isNumber && strcmp(attname, "valid_max") == 0 && attlen == 1 )
{
if ( ncvars[ncvarid].lvalidrange == false )
bool lignore = xtypeIsFloat(atttype) != xtypeIsFloat(xtype);
if ( !cdiIgnoreValidRange && lignore == false )
{
bool lignore = xtypeIsFloat(atttype) != xtypeIsFloat(xtype);
if ( !cdiIgnoreValidRange && lignore == false )
{
cdfGetAttDouble(ncid, ncvarid, attname, 1, &(ncvars[ncvarid].validrange)[1]);
ncvars[ncvarid].lvalidrange = true;
}
else if ( lignore )
{
Warning("Inconsistent data type for attribute %s:valid_max, ignored!", name);
}
cdfGetAttDouble(ncid, ncvarid, attname, 1, &(ncvars[ncvarid].validrange)[1]);
ncvars[ncvarid].lvalidrange = true;
}
else if ( lignore )
{
Warning("Inconsistent data type for attribute %s:valid_max, ignored!", name);
}
}
else if ( isText && strcmp(attname, "_Unsigned") == 0 )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment