Project

General

Profile

changing unit with setattribute

Added by Sondre Bekken over 4 years ago

Hi,

Is it possible to change the units of a netCDF4 file from [kg m^(-2) s^(-1)] to [ton/year/gridcell] ?
If it is how do I do it in cdo? What command do I have to use?

Kind regards,
Sondre


Replies (3)

RE: changing unit with setattribute - Added by Sondre Bekken over 4 years ago

I have tried using
´´´cdo setattribute, emi_so2@units=tons/year/gridcell
v432_SO2_2012_IPCC_1A1b_1A1c_1A5b1_1B1b_1B2a5_1B2a6_1B2b5_2C1b.0.1x0.1_time.nc
v432_SO2_2012_IPCC_1A1b_1A1c_1A5b1_1B1b_1B2a5_1B2a6_1B2b5_2C1b.0.1x0.1_time_tons.nc´´´

This only gave me this message: cdo (Abort): Unprocessed Input, could not process all Operators/Files

RE: changing unit with setattribute - Added by Robert Wilson over 4 years ago

Hi Sondre,

You have a space after setattribute,
cdo setattribute,emi_so2@units=tons/year/gridcell infile outfile

will work

Regards

Robert

RE: changing unit with setattribute - Added by Sondre Bekken over 4 years ago

Hi Robert,

It worked! Thank you very much :)

Regards,
Sondre

    (1-3/3)