0

I am confused why cdo and ncdump display different variables. I have found that WRF data does not have a coordinate variable of time, like typical ncfiles (http://www.ncl.ucar.edu/Applications/wrfnetcdf.shtml) . So I have added a time variable to all of my nc files, and maybe the way I have added this time variable is a reason it is not appearing in cdo showname? (This is the same question as before, just hopefully clearer wording)

time variable is displayed here with ncdump:

$ ncdump -h rotated_UVwinds.nc 
netcdf rotated_UVwinds {
dimensions:
time = UNLIMITED ; // (4 currently)
x = 83 ;
y = 94 ;
variables:
    double time(time) ;
    float latitude(y) ;
    float longitude(x) ;
    float Vearth(time, y, x) ;
    float Uearth(time, y, x) ;
}

There is no time variable shown here with cdo:

$ cdo showname rotated_UVwinds.nc 
latitude longitude Vearth Uearth
cdo showname: Processed 4 variables ( 0.00s )
ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
pwprnt
  • 521
  • 3
  • 9
  • 27
  • 1
    `time` is a dimension, and not a variable. `cdo showname ...` just shows variables, i.e., `x` and `y` also do not show up. – makra Sep 06 '16 at 09:32

1 Answers1

1

You can do this in two or three steps: rename 't' dimension to 'time'. make it unlimited. add attributes.

ncrename -d t,time in.nc
ncks --mk_rec_dmn time in.nc out.nc
ncatted -a standard_name,time,c,o,'time' -a long_name ... out.nc

The NCO options are all described in the online manual here.

Charlie Zender
  • 5,929
  • 14
  • 19
  • thanks for this comment, this was useful but I think I needed to reword the question to make it clearer what I was asking – pwprnt Aug 10 '16 at 01:42