Browse Source

Added unit attribute in the netcdf output file.

interpolate
Michael Uleysky 1 year ago
parent
commit
20824cdaab
  1. 7
      actions/actiontsc.h

7
actions/actiontsc.h

@ -144,6 +144,13 @@ template<class D> 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";

Loading…
Cancel
Save