Commit abde3228 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdf_create: print file name on error

parent da12db61
......@@ -71,7 +71,7 @@ void cdf_create(const char *path, int cmode, int *ncidp)
status = nc_set_fill(*ncidp, NC_NOFILL, &oldfill);
if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
if ( status != NC_NOERR ) Error("%s: %s", path, nc_strerror(status));
}
......
......@@ -689,8 +689,8 @@ void cdfDefVarMissval(stream_t *streamptr, int varID, int dtype, int lcheck)
if ( lcheck && streamptr->ncmode == 2 ) cdf_redef(fileID);
xtype = cdfDefDatatype(dtype, streamptr->filetype);
/* workaround for a netCDF bug? */
if ( xtype == NC_BYTE && missval > 127 ) xtype = NC_INT;
if ( xtype == NC_BYTE && missval > 127 && missval < 256 ) xtype = NC_INT;
cdf_put_att_double(fileID, ncvarid, "_FillValue", (nc_type) xtype, 1, &missval);
cdf_put_att_double(fileID, ncvarid, "missing_value", (nc_type) xtype, 1, &missval);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment