Project

General

Profile

Vertical problem renaming after cdo merge

Added by Ashwin D over 7 years ago

This is the original definition of each of my 17 netCDF files -

netcdf shum_1000_2014_12_5_00Z {
dimensions:
    dimy_Q = 24 ;
    dimx_Q = 29 ;
    dimz_Q = 1 ;
    time = UNLIMITED ; // (1 currently)
variables:
    float dimy_Q(dimy_Q) ;
        dimy_Q:units = "degrees_north" ;
    float dimx_Q(dimx_Q) ;
        dimx_Q:units = "degrees_east" ;
    float time(time) ;
        time:units = "hours since 1800-1-1 00:00:0.0" ;
    float shum(time, dimz_Q, dimy_Q, dimx_Q) ;
        shum:missing_data = -999.99f ;
        shum:zstag = -0.5f ;
        shum:ystag = 0.f ;
        shum:xstag = 0.f ;
        shum:xmin = -180.f ;
        shum:ymin = -90.f ;
        shum:xmax = -180.f ;
        shum:ymax = -90.f ;
        shum:zmin = 0.f ;
        shum:zmax = 105.f ;
        shum:_FillValue = -999.99f ;

After merging using cdo merge the definition of the netCDF file seems to be changing

As you can see the variable dimz_Q now is renamed sfc ! Not only that it has been renamed to "sfc". Also the data type of time has changed from float to double.

How do I avoid all of these issues ?

netcdf shumFile {
dimensions:
    dimx_Q = 29 ;
    dimy_Q = 24 ;
    sfc = 17 ;
    time = UNLIMITED ; // (1 currently)
variables:
    float dimx_Q(dimx_Q) ;
        dimx_Q:standard_name = "longitude" ;
        dimx_Q:long_name = "longitude" ;
        dimx_Q:units = "degrees_east" ;
        dimx_Q:axis = "X" ;
    float dimy_Q(dimy_Q) ;
        dimy_Q:standard_name = "latitude" ;
        dimy_Q:long_name = "latitude" ;
        dimy_Q:units = "degrees_north" ;
        dimy_Q:axis = "Y" ;
    double sfc(sfc) ;
        sfc:long_name = "surface" ;
        sfc:axis = "Z" ;
    double time(time) ;
        time:standard_name = "time" ;
        time:units = "hours since 1800-1-1 00:00:00" ;
        time:calendar = "standard" ;
        time:axis = "T" ;
    float shum(time, sfc, dimy_Q, dimx_Q) ;
        shum:_FillValue = -999.99f ;
        shum:missing_value = -999.99f ;
        shum:missing_data = -999.99f ;
        shum:zstag = -0.5f ;
        shum:ystag = 0.f ;
        shum:xstag = 0.f ;
        shum:xmin = -180.f ;
        shum:ymin = -90.f ;
        shum:xmax = -180.f ;
        shum:ymax = -90.f ;
        shum:zmin = 0.f ;
        shum:zmax = 105.f ;

Replies (4)

RE: Vertical problem renaming after cdo merge - Added by Uwe Schulzweida over 7 years ago

There bugs will be fixed in the next CDO release!

Cheers,
Uwe

RE: Vertical problem renaming after cdo merge - Added by Ashwin D over 7 years ago

Thanks for that response Uwe.

There is another bug I want to report(or a problem at least if not a bug).

You see in order to get this to work I had to define the vertical coordinate as a variable.

But I do not want that the vertical coordinate be named as a variable. I want it to non coordinate dimension.

But cdo merge deliberately adds the vertical coordinate as a variable after merge. Is it possible to fix that as well ?

RE: Vertical problem renaming after cdo merge - Added by Uwe Schulzweida over 7 years ago

The result in the next CDO release will look like:

netcdf shumFile {
dimensions:
    dimx_Q = 29 ;
    dimy_Q = 24 ;
    dimz_Q = 17 ;
    time = UNLIMITED ; // (1 currently)
variables:
    float dimx_Q(dimx_Q) ;
        dimx_Q:standard_name = "longitude" ;
        dimx_Q:long_name = "longitude" ;
        dimx_Q:units = "degrees_east" ;
        dimx_Q:axis = "X" ;
    float dimy_Q(dimy_Q) ;
        dimy_Q:standard_name = "latitude" ;
        dimy_Q:long_name = "latitude" ;
        dimy_Q:units = "degrees_north" ;
        dimy_Q:axis = "Y" ;
    float time(time) ;
        time:standard_name = "time" ;
        time:units = "hours since 1800-1-1 00:00:00" ;
        time:calendar = "standard" ;
        time:axis = "T" ;
    float shum(time, dimz_Q, dimy_Q, dimx_Q) ;
        shum:_FillValue = -999.99f ;
        shum:missing_value = -999.99f ;
        shum:missing_data = -999.99f ;
        shum:zstag = -0.5f ;
        shum:ystag = 0.f ;
        shum:xstag = 0.f ;
        shum:xmin = -180.f ;
        shum:ymin = -90.f ;
        shum:xmax = -180.f ;
        shum:ymax = -90.f ;
        shum:zmin = 0.f ;
        shum:zmax = 105.f ;

RE: Vertical problem renaming after cdo merge - Added by Ashwin D over 7 years ago

Exactly. You understood my request completely ! I do not want the dimz_Q defined as a variable after the cdo merge. It is a non coordinate dimension.

    (1-4/4)