Project

General

Profile

Adding one level to a variable with time series

Added by Sara Minoli almost 3 years ago

Hi,

I'm navigating through the manual, but could not find the right function so far.

I have a ncdf file that look like this:

> cdo sinfon <myfile>

   File format : NetCDF
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter name
     1 : unknown  bin/clm2cdf v instant      32   1    201600   1  F32  : cftfrac
   Grid coordinates :
     1 : lonlat                   : points=201600 (720x280)
                        longitude : -179.75 to 179.75 by 0.5 degrees_east  circular
                         latitude : -55.75 to 83.75 by 0.5 degrees_north
   Vertical coordinates :
     1 : generic                  : levels=32
   Time coordinate :  1166 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
  0850-01-01 00:00:00  0851-01-01 00:00:00  0852-01-01 00:00:00  0853-01-01 00:00:00
  0854-01-01 00:00:00  0855-01-01 00:00:00  0856-01-01 00:00:00  0857-01-01 00:00:00
  0858-01-01 00:00:00  0859-01-01 00:00:00  0860-01-01 00:00:00  0861-01-01 00:00:00
  0862-01-01 00:00:00  0863-01-01 00:00:00  0864-01-01 00:00:00  0865-01-01 00:00:00
...

What I want to do is to add two levels to the variable <cftfrac>, so to have 34 levels.

Moreover, I need to:
- add one level in position 17 and the other level in position 34.
- the level should contain all zeros.

The closest I could get so far was to find these two operators: <setzaxis> and <genlevelbounds>, but I don't think they are exactly what I need.
Can you please help me find a solution to my question?

Thanks!
Cheers
Sara


Replies (2)

RE: Adding one level to a variable with time series - Added by Kalpesh Patil over 2 years ago

Hello Sara,
You can use following cdo command
intlevel,levels infile outfile

This generates extra levels as specified in levels.
E.g.
Old levels - 5, 15, 20, 25, 50, 80, 115
New required levels - 5, 10, 15, 20, 25, 30, 35, 40, 50, 75, 85, 100, 115

So the command would look like this
cdo intlevel,5, 10, 15, 20, 25, 30, 35, 40, 50, 75, 85, 100, 115 infile outfile
Note: no space in intlevel and values start

    (1-2/2)