diff --git a/actions/actiontsc.h b/actions/actiontsc.h index 37d1ffa..0aa5c15 100644 --- a/actions/actiontsc.h +++ b/actions/actiontsc.h @@ -144,6 +144,13 @@ template MString ActionTSC::DoAction(const CLArgs& args, D& ds) if(ret != NC_NOERR) return "Can't write long_name attribute of " + vname + " variable in the netcdf file"; } + text = data.Unit(); + if(text.Exist()) + { + ret = nc_put_att_text(ncid, vid, "units", text.Len() + 1, text.Buf()); + if(ret != NC_NOERR) return "Can't write units attribute of " + vname + " variable in the netcdf file"; + } + ret = nc_put_att_float(ncid, vid, "_FillValue", NC_FLOAT, 1, &fill); if(ret != NC_NOERR) return "Can't write _FillValue attribute of " + vname + " variable in the netcdf file";