mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
commit
cf1a0b8bb7
@ -300,7 +300,8 @@ typedef struct NC_FILE_INFO
|
||||
nc_bool_t parallel; /**< True if file is open for parallel access */
|
||||
nc_bool_t redef; /**< True if redefining an existing file */
|
||||
nc_bool_t no_attr_create_order; /**< True if the creation order tracking of attributes is disabled (netcdf-4 only) */
|
||||
int fill_mode; /**< Fill mode for vars */
|
||||
nc_bool_t no_dimscale_attach; /**< True if attaching dimscales to variables is disabled (netcdf-4 only) */
|
||||
int fill_mode; /**< Fill mode for vars - Unused internally currently */
|
||||
nc_bool_t no_write; /**< true if nc_open has mode NC_NOWRITE. */
|
||||
NC_GRP_INFO_T *root_grp; /**< Pointer to root group. */
|
||||
short next_nc_grpid; /**< Next available group ID. */
|
||||
|
@ -164,6 +164,7 @@ Use this in mode flags for both nc_create() and nc_open(). */
|
||||
|
||||
/* Upper 16 bits */
|
||||
#define NC_NOATTCREORD 0x20000 /**< Disable the netcdf-4 (hdf5) attribute creation order tracking */
|
||||
#define NC_NODIMSCALE_ATTACH 0x40000 /**< Disable the netcdf-4 (hdf5) attaching of dimscales to variables (#2128) */
|
||||
|
||||
#define NC_MAX_MAGIC_NUMBER_LEN 8 /**< Max len of user-defined format magic number. */
|
||||
|
||||
|
@ -208,6 +208,11 @@ nc4_create_file(const char *path, int cmode, size_t initialsz,
|
||||
BAIL(NC_EHDFERR);
|
||||
#endif
|
||||
|
||||
if (cmode & NC_NODIMSCALE_ATTACH) {
|
||||
/* See https://github.com/Unidata/netcdf-c/issues/2128 */
|
||||
nc4_info->no_dimscale_attach = NC_TRUE;
|
||||
}
|
||||
|
||||
if(nc4_info->mem.inmemory) {
|
||||
retval = NC4_create_image_file(nc4_info,initialsz);
|
||||
if(retval)
|
||||
@ -337,7 +342,7 @@ nc4_H5Fcreate(const char *filename0, unsigned flags, hid_t fcpl_id, hid_t fapl_i
|
||||
|
||||
#ifdef HDF5_UTF8_PATHS
|
||||
NCpath2utf8(filename0,&filename);
|
||||
#else
|
||||
#else
|
||||
filename = strdup(filename0);
|
||||
#endif
|
||||
/* Canonicalize it since we are not opening the file ourselves */
|
||||
|
@ -1957,9 +1957,11 @@ nc4_rec_write_metadata(NC_GRP_INFO_T *grp, nc_bool_t bad_coord_order)
|
||||
}
|
||||
} /* end while */
|
||||
|
||||
/* Attach dimscales to vars in this group. */
|
||||
if ((retval = attach_dimscales(grp)))
|
||||
return retval;
|
||||
/* Attach dimscales to vars in this group. Unless directed not to. */
|
||||
if (!grp->nc4_info->no_dimscale_attach) {
|
||||
if ((retval = attach_dimscales(grp)))
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* If there are any child groups, write their metadata. */
|
||||
for (i = 0; i < ncindexsize(grp->children); i++)
|
||||
|
Loading…
Reference in New Issue
Block a user