Project

General

Profile

Expr(f) and Z-axis

Added by Thomas Lechauve over 7 years ago

Hi,

I did not found any expr command to select a specific z-axis of a variable.

For example, i have isobaric and surface vertical coordinates and inside isobaric i have 31 levels. i would like to select isobaric(29), but how ?

Cheers,


Replies (4)

RE: Expr(f) and Z-axis - Added by Uwe Schulzweida over 7 years ago

You can select the vertical coordinate of a variable with clev(x). The value of one vertical layer can be selected with sellevidx(x,29). Here is an example:

vcoord=clev(varname);
vcoord29=sellevidx(vcoord,29);
Or in one line:
vcoord29=sellevidx(clev(varname),29);
Unfortunately all expr command with a comma (like sellevidx(x,k)) can't be processed from the CDO command line. That means they can be used only with the CDO operator exprf or aexprf, which read the expr commands from a file.

Cheers,
Uwe

RE: Expr(f) and Z-axis - Added by Thomas Lechauve over 7 years ago

Hi,

Thanks for you answer, but i think i did not ask the proper question. Put the levels aside

Here the sinfon output of my dataset:

   File format : GRIB2
    -1 : Institut Source   Steptype Levels Num    Points Num Dtype : Parameter name
     1 : NCEP     unknown  avg           1   1    259920   1  P9   : tcc
     2 : NCEP     unknown  avg           1   2    259920   1  P9   : tcc
     3 : NCEP     unknown  avg           1   3    259920   1  P9   : tcc
   Grid coordinates :
     1 : lonlat                   : points=259920 (720x361)
                              lon : 0 to 359.5 by 0.5 degrees_east  circular
                              lat : 90 to -90 by -0.5 degrees_north
   Vertical coordinates :
     1 : generic      (ltype=214) : : levels=1
                              lev : 0
     2 : generic      (ltype=224) : : levels=1
                              lev : 0
     3 : generic      (ltype=234) : : levels=1
                              lev : 0
   Time coordinate :  2 steps
     RefTime =  2016-09-23 12:00:00  Units = hours  Calendar = proleptic_gregorian
  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss
  2016-09-23 15:00:00  2016-09-23 18:00:00

Here an example of what i want:

tcc214 = ?
tcc224 = ?
tcc234 = ?

As all variables have the same name, i can not use clev(tcc).

Thank you in advance

Cheers,

RE: Expr(f) and Z-axis - Added by Uwe Schulzweida over 7 years ago

Duplicate variable names can't be handled by the CDO operator expr. The last occurrence of the variable name will be used.
Variables with different level type (ltype) can only be selected with the CDO operator selltype:

cdo selltype,214  file  ofile214

RE: Expr(f) and Z-axis - Added by Thomas Lechauve over 7 years ago

Thank you, then i'll use temp files.

    (1-4/4)