Project

General

Profile

CDO remap renames time dimension

Added by Nicolau Manubens almost 9 years ago

Hello,

I'm using CDO 1.6.3 to interpolate a NetCDF file into a different
grid. The command looks like
cdo remapcons,t106grid -selname,tas file_in.nc file_out.nc

After the interpolation, the dimension 'time' disappears and appears
instead a dimension named 'leadtime' or 'reftime', depending on the
order of the variables 'leadtime' and 'reftime' in file_in.nc.
If the file contains the variable 'time' instead of 'leadtime' and
'reftime' the dimension name is kept properly as 'time'.

Is this a known CDO bug? Or is it normal? Do you know if the way around to get the same dimensions after interpolation?

Thanks very much for your attention,
Nicolau

These are the dimensions and variables in file_in.nc:
dimensions:

time = UNLIMITED ; // (360 currently)
latitude = 128 ;
longitude = 256 ;
ensemble = 13 ;
bnds = 2 ;
variables:
int reftime(time) ;
    reftime:long_name = "forecast reference time" ;
    reftime:units = "days since 1950-01-01 00:00:00" ;
float tas(time, ensemble, latitude, longitude) ;
double leadtime(time) ;
    leadtime:bounds = "time_bnds" ;
    leadtime:units = "days since 1991-1-1" ;
    leadtime:calendar = "gregorian" ;
    leadtime:axis = "T" ;
    leadtime:long_name = "time" ;
    leadtime:standard_name = "time" ;
double time_bnds(time, bnds) ;
double latitude(latitude) ;
    latitude:bounds = "lat_bnds" ;
    latitude:units = "degrees_north" ;
    latitude:axis = "Y" ;
    latitude:long_name = "latitude" ;
    latitude:standard_name = "latitude" ;
double lat_bnds(latitude, bnds) ;
double longitude(longitude) ;
    longitude:bounds = "lon_bnds" ;
    longitude:units = "degrees_east" ;
    longitude:axis = "X" ;
    longitude:long_name = "longitude" ;
    longitude:standard_name = "longitude" ;
double lon_bnds(longitude, bnds) ;
double height ;
    height:units = "m" ;
    height:axis = "Z" ;
    height:positive = "up" ;
    height:long_name = "height" ;
    height:standard_name = "height" ;
int realization(ensemble) ;
    realization:long_name = "Number of the simulation in the ensemble" ;
    realization:standard_name = "realization" ;

And these the file_out.nc headers:

dimensions:
    lon = 320 ;
    lat = 160 ;
    lev = 13 ;
    leadtime = UNLIMITED ; // (360 currently)
    nb2 = 2 ;
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 lev(lev) ;
        lev:long_name = "generic" ;
        lev:units = "level" ;
        lev:axis = "Z" ;
    double leadtime(leadtime) ;
        leadtime:standard_name = "time" ;
        leadtime:long_name = "time" ;
        leadtime:bounds = "leadtime_bnds" ;
        leadtime:units = "days since 1991-01-01 00:00:00" ;
        leadtime:calendar = "standard" ;
    double leadtime_bnds(leadtime, nb2) ;
        leadtime_bnds:units = "days since 1991-01-01 00:00:00" ;
        leadtime_bnds:calendar = "standard" ;
    double tas(leadtime, lev, lat, lon) ;
        tas:grid_type = "gaussian" ;


Replies (2)

RE: CDO remap renames time dimension - Added by Sylvain Marchi about 2 years ago

I have a problem similar to Nicolau. The remapbil operator renames the 'z' dimension (z to lev) and removes the 'nav_lev' variable. It also creates the variable 'lev(lev)' which contains the vertical indices (1 to 75). Is it a known feature of CDO? How can I get around this problem? Thanks for your help. Sylvain

cdo -P 10 remapbil,tn_ano_oras4_fc00_11-1984_tmask_no-lev.nc tn_ano_oras4_fc00_11-1984_tmask_no-lev.nc tn_ano_oras4_fc00_11-1984_tmask_no-lev_remapbil.nc

input file:

netcdf tn_ano_oras4_fc00_11-1984_tmask {
dimensions:
        y = 292 ;
        x = 362 ;
        z = 75 ;
        time = UNLIMITED ; // (1 currently)
variables:
        double nav_lat(y, x) ;
                nav_lat:standard_name = "latitude" ;
                nav_lat:long_name = "latitude" ;
                nav_lat:units = "degrees_north" ;
                nav_lat:_CoordinateAxisType = "Lat" ;
        float nav_lev(z) ;
                nav_lev:long_name = "Vertical T levels" ;
                nav_lev:units = "m" ;
                nav_lev:axis = "Z" ;
                nav_lev:positive = "down" ;
        double nav_lon(y, x) ;
                nav_lon:standard_name = "longitude" ;
                nav_lon:long_name = "longitude" ;
                nav_lon:units = "degrees_east" ;
                nav_lon:_CoordinateAxisType = "Lon" ;
        double time(time) ;
                time:calendar = "proleptic_gregorian" ;
                time:standard_name = "time" ;
                time:units = "second" ;
        float tn(time, z, y, x) ;
                tn:_FillValue = 1.e+20f ;
                tn:coordinates = "time nav_lev nav_lon nav_lat" ;
                tn:long_name = "Temperature" ;
                tn:units = "C" ;

output file
netcdf tn_ano_oras4_fc00_11-1984_tmask_remapbil {
dimensions:
        x = 1442 ;
        y = 559 ;
        bnds = 4 ;
        lev = 75 ;
        time = UNLIMITED ; // (1 currently)
variables:
        double nav_lon(y, x) ;
                nav_lon:standard_name = "longitude" ;
                nav_lon:long_name = "longitude" ;
                nav_lon:units = "degrees_east" ;
                nav_lon:_CoordinateAxisType = "Lon" ;
                nav_lon:bounds = "nav_lon_bnds" ;
        double nav_lon_bnds(y, x, bnds) ;
        double nav_lat(y, x) ;
                nav_lat:standard_name = "latitude" ;
                nav_lat:long_name = "latitude" ;
                nav_lat:units = "degrees_north" ;
                nav_lat:_CoordinateAxisType = "Lat" ;
                nav_lat:bounds = "nav_lat_bnds" ;
        double nav_lat_bnds(y, x, bnds) ;
        double lev(lev) ;
                lev:long_name = "generic" ;
                lev:units = "level" ;
                lev:axis = "Z" ;
        double time(time) ;
                time:standard_name = "time" ;
                time:units = "day as %Y%m%d.%f" ;
                time:calendar = "proleptic_gregorian" ;
                time:axis = "T" ;
        float tn(time, lev, y, x) ;
                tn:long_name = "Temperature" ;
                tn:units = "C" ;
                tn:coordinates = "nav_lat nav_lon" ;
                tn:_FillValue = 1.e+20f ;
                tn:missing_value = 1.e+20f ;

Output grid description
netcdf eORCA025-SO_corners_new_variable-names {
dimensions:
        y = 559 ;
        x = 1442 ;
        bnds = 4 ;
        z = 75 ;
variables:
        byte mask(y, x) ;
                mask:coordinates = "nav_lat nav_lon" ;
        double nav_lon(y, x) ;
                nav_lon:standard_name = "longitude" ;
                nav_lon:units = "degrees East" ;
                nav_lon:overlap = 2b ;
                nav_lon:bounds = "nav_lon_bnds" ;
        double nav_lat(y, x) ;
                nav_lat:standard_name = "latitude" ;
                nav_lat:units = "degrees North" ;
                nav_lat:overleap = 2b ;
                nav_lat:bounds = "nav_lat_bnds" ;
        double nav_lon_bnds(y, x, bnds) ;
        double nav_lat_bnds(y, x, bnds) ;
        float nav_lev(z) ;
                nav_lev:long_name = "Vertical T levels" ;
                nav_lev:units = "m" ;
                nav_lev:positive = "up" ;
                nav_lev:axis = "Z" ;
                nav_lev:bounds = "nav_lev_bnds" ;
        float nav_lev_bnds(z, bnds) ;

RE: CDO remap renames time dimension - Added by Ralf Mueller about 2 years ago

hi!

CDO does not support temporal or vertical dimensions in the coordinates attributes. that's why CDI ignores nav_lev. Since it is only 1-dimensional, you can rename z to lev and nav_lev to lev and CDO should work fine with it. Same for time just remote it from the coordinates attribute.

The CDO should work for your input. ncrename and ncatted are the tools I would use for editing the input.

hth
ralf

    (1-2/2)