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

cdfDefVarMissval: changed xtype from NC_BYTE to NC_INT for missvals > 127

parent 12fdaa16
......@@ -4,6 +4,7 @@
2013-06-06 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* cdfDefVarMissval: changed xtype from NC_BYTE to NC_INT for missvals > 127 (workaround for a netCDF bug)
* use 'number_of_grid_used' only for undefined grid types
2013-06-03 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
......
......@@ -689,6 +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;
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