From 69fb44ec4bf220b8e099148d605172ee1f5c05c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20K=C3=B6lling?= Date: Thu, 3 Sep 2020 17:51:46 +0200 Subject: [PATCH] added NC_VIRTUAL storage layout --- include/netcdf.h | 1 + libhdf5/hdf5open.c | 4 ++++ libsrc4/nc4internal.c | 2 ++ ncdump/ncdump.c | 3 +++ 4 files changed, 10 insertions(+) diff --git a/include/netcdf.h b/include/netcdf.h index 630d1d21b..99bc0c219 100644 --- a/include/netcdf.h +++ b/include/netcdf.h @@ -300,6 +300,7 @@ NOTE: The NC_MAX_DIMS, NC_MAX_ATTRS, and NC_MAX_VARS limits #define NC_CONTIGUOUS 1 #define NC_COMPACT 2 #define NC_UNKNOWN_STORAGE 3 +#define NC_VIRTUAL 4 /**@}*/ /** In HDF5 files you can set check-summing for each variable. diff --git a/libhdf5/hdf5open.c b/libhdf5/hdf5open.c index a87def596..22205fc15 100644 --- a/libhdf5/hdf5open.c +++ b/libhdf5/hdf5open.c @@ -1141,6 +1141,10 @@ get_chunking_info(hid_t propid, NC_VAR_INFO_T *var) { var->storage = NC_COMPACT; } + else if (layout == H5D_VIRTUAL) + { + var->storage = NC_VIRTUAL; + } else { var->storage = NC_UNKNOWN_STORAGE; diff --git a/libsrc4/nc4internal.c b/libsrc4/nc4internal.c index bc2346cc6..968b2ab08 100644 --- a/libsrc4/nc4internal.c +++ b/libsrc4/nc4internal.c @@ -1711,6 +1711,8 @@ rec_print_metadata(NC_GRP_INFO_T *grp, int tab_count) strcat(storage_str, "compact"); else if (var->storage == NC_CHUNKED) strcat(storage_str, "chunked"); + else if (var->storage == NC_VIRTUAL) + strcat(storage_str, "virtual"); else strcat(storage_str, "unknown"); LOG((2, "%s VARIABLE - varid: %d name: %s ndims: %d " diff --git a/ncdump/ncdump.c b/ncdump/ncdump.c index b61dac26c..4b2231e3c 100644 --- a/ncdump/ncdump.c +++ b/ncdump/ncdump.c @@ -1002,6 +1002,9 @@ pr_att_specials( printf("%lu%s", (unsigned long)chunkp[i], i+1 < varp->ndims ? ", " : " ;\n"); } free(chunkp); + } else if(contig == NC_VIRTUAL) { + pr_att_name(ncid, varp->name, NC_ATT_STORAGE); + printf(" = \"virtual\" ;\n"); } else { pr_att_name(ncid, varp->name, NC_ATT_STORAGE); printf(" = \"unknown\" ;\n");