Commit 46d6fc5d authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdfScanVarAttributes: reduced number of warnings

parent dfa0bb98
......@@ -4971,20 +4971,23 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
int timedimid, int modelID, int format)
{
int ncid;
int ncvarid;
int ncdimid;
int nvdims, nvatts;
int *dimidsp;
int iatt;
int i;
int tablenum;
nc_type xtype, atttype;
size_t attlen;
char name[CDI_MAX_NAME];
char attname[CDI_MAX_NAME];
const int attstringlen = 8192; char attstring[8192];
int iatt;
int i;
int tablenum;
for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
int nchecked_vars = 0;
char *checked_vars[9];
for ( i = 0; i < 9; ++i ) checked_vars[i] = NULL;
for ( int ncvarid = 0; ncvarid < nvars; ncvarid++ )
{
ncid = ncvars[ncvarid].ncid;
dimidsp = ncvars[ncvarid].dimids;
......@@ -5352,7 +5355,17 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
}
}
else
Warning("%s - %s", nc_strerror(status), varname);
{
int k;
for ( k = 0; k < nchecked_vars; ++k )
if ( strcmp(checked_vars[k], varname) == 0 ) break;
if ( k == nchecked_vars )
{
if ( nchecked_vars < 9 ) checked_vars[nchecked_vars++] = strdup(varname);
Warning("%s - %s", nc_strerror(status), varname);
}
}
if ( lstop ) break;
}
......@@ -5650,6 +5663,8 @@ void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
}
}
}
for ( i = 0; i < 9; ++i ) if ( checked_vars[i] ) free(checked_vars[i]);
}
static
......
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