Project

General

Profile

Convert time steps to vertical levels

Added by Noam Chomsky almost 4 years ago

Because of some constraint in R when creating the netCDF file, my file has 10 time step instead of 10 vertical levels. Is it possible to convert the time steps into vertical levels? I also do not need to have the time component so what am looking for is a three dimension file.

Here are the details

File format : NetCDF
-1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter ID
1 : unknown unknown v instant 1 1 16200 1 F32 : -1
Grid coordinates :
1 : projection : points=16200 (180x90)
mapping : undefined
longitude : -179 to 179 by 2 degrees_east
latitude : 89 to -89 by -2 degrees_north
Vertical coordinates :
1 : surface : levels=1
Time coordinate : 10 steps
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00
0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00
0000-00-00 00:00:00 0000-00-00 00:00:00

I would like to get

File format : NetCDF
-1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter ID
1 : unknown unknown c instant 10 1 16200 1 F32 : -1
Grid coordinates :
1 : lonlat : points=16200 (180x90)
longitude : -179 to 179 by 2 degrees_east circular
latitude : 89 to -89 by -2 degrees_north
Vertical coordinates :
1 : generic : levels=10
sfc : 1 to 10 by 1

Thanks


Replies (4)

RE: Convert time steps to vertical levels - Added by Ralf Mueller almost 4 years ago

hi Noam!

I think a renaming of variable/dimension from time to level should do it. NCOs ncrename is the right tool for it, I guess. In case you upload the file, I possibly can say more.

cheers
ralf

RE: Convert time steps to vertical levels - Added by Noam Chomsky almost 4 years ago

Thanks Ralf, it's easier for me to post the ncdump. I have tried ncrename but I can't figure out what the name of the time is, it seems "z"

dimensions:
        longitude = 180 ;
        latitude = 90 ;
        z = UNLIMITED ; // (10 currently)
variables:
        int crs ;
                crs:proj4 = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0" ;
        double longitude(longitude) ;
                longitude:units = "degrees_east" ;
                longitude:long_name = "longitude" ;
        double latitude(latitude) ;
                latitude:units = "degrees_north" ;
                latitude:long_name = "latitude" ;
        int z(z) ;
                z:units = "unknown" ;
                z:long_name = "z" ;
        float wbm(z, latitude, longitude) ;
                wbm:units = "kg" ;
                wbm:_FillValue = -3.4e+38f ;
                wbm:grid_mapping = "crs" ;
                wbm:proj4 = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0" ;
                wbm:min = 14., 11., 10., 10., 8., 1., 11., 1., 1., 6. ;
                wbm:max = 1600., 2800., 1991., 1282., 620., 46., 38., 80., 24.5, 13. ;

RE: Convert time steps to vertical levels - Added by Noam Chomsky almost 4 years ago

It seems the dimension time is not present.

RE: Convert time steps to vertical levels - Added by Ralf Mueller almost 4 years ago

try to rename 'z' to 'time' (dim and var) and check with CDO again - that is my best guess

    (1-4/4)