Project

General

Profile

setting long_name for time

Added by Jenny Fisher over 11 years ago

Hi,

I'm a new CDO (and netcdf) user - I've explored the forums but can't find an answer to my question, so apologies if this is very basic.

I'm converting an ascii file to a netcdf file for input to a model using:
cdo -f nc input,grid_file nc_file.nc < ascii_file.txt

This works fine, and I have no trouble subsequently changing the time value, variable name, etc.
BUT it doesn't set a long_name for the time axis; ncdump gives the following in the header:

dimensions:
lon = 980 ;
lat = 670 ;
time = UNLIMITED ; // (1 currently)
variables:
double lon(lon) ;
lon:standard_name = "longitude" ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
lon:axis = "X" ;
double lat(lat) ;
lat:standard_name = "latitude" ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
lat:axis = "Y" ;
double time(time) ;
time:standard_name = "time" ;
time:units = "hours since 0-00-00 00:00:00" ;
time:calendar = "proleptic_gregorian" ;

Unfortunately, the model requires the netcdf time dimension to have long_name="time".
Is there a way to change standard_name to long_name, or to add long_name for time?

Thanks,
Jenny


Replies (1)

RE: setting long_name for time - Added by Uwe Schulzweida over 11 years ago

Hi Jenny,

Unfortunately this is not possible with CDO. Try it with the NCO operator ncatted:

ncatted -a long_name,time,c,c,"time" nc_file.nc
Best wishes,
Uwe

    (1-1/1)