mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-21 03:13:42 +08:00
include storage in rec_print_metadata() output
This commit is contained in:
parent
6241a6e7a0
commit
3241aca93a
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user