Project

General

Profile

Select the variable from x layer (3D to 2D)

Added by YUU YAN about 4 years ago

Hi all,

I am trying to select one variable (salinity) from a 3D nc file (so.nc). The file contains 10 levels in the vertical direction. And I want to choose only one layer (eg. 5th level). How can I do this with CDO?

Thanks,

Yu

netcdf so.nc {
dimensions:
x = 300 ;
y = 288 ;
time_counter = UNLIMITED ; // (1 currently)
depth = 10 ;
variables:
double nav_lon(y, x) ;
double nav_lat(y, x) ;
double time_counter(time_counter) ;
double depth(depth) ;
depth:valid_min = 1 ;
depth:valid_max = 90 ;
float so(time_counter, depth, y, x) ;
so:standard_name = "sea_water_practical_salinity" ;
so:long_name = "salinity" ;
so:units = "1e-3" ;
so:online_operation = "instant" ;
so:interval_operation = "1 d" ;
so:interval_write = "1 d" ;
so:cell_methods = "time: point" ;
so:coordinates = "time_counter depth nav_lat nav_lon" ;
so:actual_range = 31f, 34f ;


Replies (2)

RE: Select the variable from x layer (3D to 2D) - Added by Uwe Schulzweida about 4 years ago

The 5th level can be selected with:

cdo select,levidx=5 infile outfile

RE: Select the variable from x layer (3D to 2D) - Added by YUU YAN about 4 years ago

Hi Uwe,

Thanks so much! It works.

    (1-2/2)