include storage in rec_print_metadata() output

This commit is contained in:
Edward Hartnett 2020-02-25 16:12:50 -07:00
parent 6241a6e7a0
commit 3241aca93a
2 changed files with 14 additions and 5 deletions

View File

@ -1643,7 +1643,6 @@ rec_print_metadata(NC_GRP_INFO_T *grp, int tab_count)
NC_TYPE_INFO_T *type;
NC_FIELD_INFO_T *field;
char tabs[MAX_NESTS+1] = "";
char *dims_string = NULL;
char temp_string[10];
int t, retval, d, i;
@ -1674,6 +1673,9 @@ rec_print_metadata(NC_GRP_INFO_T *grp, int tab_count)
for (i = 0; i < ncindexsize(grp->vars); i++)
{
int j;
char storage_str[NC_MAX_NAME] = "";
char *dims_string = NULL;
var = (NC_VAR_INFO_T*)ncindexith(grp->vars,i);
assert(var);
if (var->ndims > 0)
@ -1687,9 +1689,16 @@ rec_print_metadata(NC_GRP_INFO_T *grp, int tab_count)
strcat(dims_string, temp_string);
}
}
LOG((2, "%s VARIABLE - varid: %d name: %s ndims: %d dimscale: %d dimids:%s",
tabs, var->hdr.id, var->hdr.name, var->ndims, (int)var->dimscale,
(dims_string ? dims_string : " -")));
if (var->contiguous)
strcat(storage_str, "contiguous");
else if (var->compact)
strcat(storage_str, "compact");
else
strcat(storage_str, "chunked");
LOG((2, "%s VARIABLE - varid: %d name: %s ndims: %d dimscale: %d "
"dimids:%s storage: %s", tabs, var->hdr.id, var->hdr.name,
var->ndims, (int)var->dimscale,
(dims_string ? dims_string : " -"), storage_str));
for (j = 0; j < ncindexsize(var->att); j++)
{
att = (NC_ATT_INFO_T *)ncindexith(var->att, j);

View File

@ -270,7 +270,7 @@ main(int argc, char **argv)
{
int ndims, nvars;
int storage_in;
nc_set_log_level(3);
if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
if (nc_inq(ncid, &ndims, &nvars, NULL, NULL)) ERR;
if (ndims != 2 || nvars != 3) ERR;