Skip to content
Snippets Groups Projects
Commit e0d3d6a5 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel: Committed by Sergey Kosukhin
Browse files

Prevent unnecessary fill value writing.

parent dea96288
No related branches found
No related tags found
2 merge requests!34Version 2.2.0,!13Consolidation with CDI-PIO (develop)
......@@ -202,10 +202,15 @@ cdf_def_var(int ncid, const char *name, nc_type xtype, int ndims, const int dimi
void
cdf_def_var_serial(int ncid, const char *name, nc_type xtype, int ndims, const int dimids[], int *varidp)
{
const int status = nc_def_var(ncid, name, xtype, ndims, dimids, varidp);
int status = nc_def_var(ncid, name, xtype, ndims, dimids, varidp);
if (CDF_Debug || status != NC_NOERR) Message("ncid=%d name=%s xtype=%d ndims=%d varid=%d", ncid, name, xtype, ndims, *varidp);
if (status == NC_NOERR)
{
int fileFormat;
status = nc_inq_format(ncid, &fileFormat);
if (status == NC_NOERR && (fileFormat == NC_FORMAT_NETCDF4 || fileFormat == NC_FORMAT_NETCDF4_CLASSIC))
status = nc_def_var_fill(ncid, *varidp, 1, NULL);
}
if (status != NC_NOERR) Error("%s", nc_strerror(status));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment