mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
Merge pull request #1787 from Unidata/NOAA-GSD-ejh_fix_redef
Noaa gsd ejh fix redef
This commit is contained in:
commit
675db5fa13
@ -8,6 +8,7 @@ This file contains a high-level description of this package's evolution. Release
|
||||
## 4.8.0 - TBD
|
||||
|
||||
* [Enhancement] Added new test for using compression with parallel I/O: nc_test4/tst_h_par_compress.c. See [https://github.com/Unidata/netcdf-c/pull/1784].
|
||||
* [Bug Fix] Don't return error for extra calls to nc_redef() for netCDF/HDF5 files, unless classic model is in use. See [https://github.com/Unidata/netcdf-c/issues/1779].
|
||||
* [Bug Fix] Now allow szip to be used on variables with unlimited dimension [https://github.com/Unidata/netcdf-c/issues/1774].
|
||||
* [Enhancement] Add support for cloud storage using a variant of the Zarr storage format. Warning: this feature is highly experimental and is subject to rapid evolution [https://www.unidata.ucar.edu/blogs/developer/en/entry/overview-of-zarr-support-in].
|
||||
* [Bug Fix] Fix nccopy to properly set default chunking parameters when not otherwise specified. This can significantly improve performance in selected cases. Note that if seeing slow performance with nccopy, then, as a work-around, specifically set the chunking parameters. [https://github.com/Unidata/netcdf-c/issues/1763].
|
||||
|
@ -425,9 +425,10 @@ NC4_redef(int ncid)
|
||||
return retval;
|
||||
assert(nc4_info);
|
||||
|
||||
/* If we're already in define mode, return an error. */
|
||||
/* If we're already in define mode, return an error for classic
|
||||
* files, or netCDF/HDF5 files when classic mode is in use. */
|
||||
if (nc4_info->flags & NC_INDEF)
|
||||
return NC_EINDEFINE;
|
||||
return (nc4_info->cmode & NC_CLASSIC_MODEL) ? NC_EINDEFINE : NC_NOERR;
|
||||
|
||||
/* If the file is read-only, return an error. */
|
||||
if (nc4_info->no_write)
|
||||
|
@ -497,6 +497,20 @@ test_redef(int format)
|
||||
if (strcmp(var_name, REDEF_VAR2_NAME) || xtype_in != NC_BYTE || ndims != REDEF_NDIMS ||
|
||||
dimids_in[0] != dimids[0] || dimids_in[1] != dimids[1]) ERR;
|
||||
|
||||
/* Try enddef/redef. */
|
||||
if (nc_enddef(ncid)) ERR;
|
||||
if (nc_redef(ncid)) ERR;
|
||||
|
||||
/* NetCDF/HDF5 files ignore the repeated redef(). */
|
||||
if (format != NC_FORMAT_NETCDF4)
|
||||
{
|
||||
if (nc_redef(ncid) != NC_EINDEFINE) ERR;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nc_redef(ncid)) ERR;
|
||||
}
|
||||
|
||||
/* Close it up. */
|
||||
if (format != NC_FORMAT_NETCDF4)
|
||||
if (nc_enddef(ncid)) ERR;
|
||||
|
Loading…
Reference in New Issue
Block a user