Project

General

Profile

Verticul sum of a subset of levels to replace one of the levels

Added by Noam Chomsky about 4 years ago

I have a netcdf with 10 levels. I would like to sun it's a set of those levels say level 2, 3, and 8 and store the result of the vertical some on level 2, so effectively overwriting level 2.

so far I have used this:

myexpr is
sellevel(myvar,2)+sellevel(myvar,3)+sellevel(myvar,8)

cdo exprf,myexpr file1.nc levelsum.nc

Than imagine I have to delete levels two, three, and eight from the original file and then combine with levelsum.nc.

But how do I replace level 2 with the result in levelsum.nc?


Replies (2)

RE: Verticul sum of a subset of levels to replace one of the levels - Added by Noam Chomsky about 4 years ago

Is there a way to do this in one sweep? It seems that nco allows to overwrite specific levels with the result of algebra operations.

RE: Verticul sum of a subset of levels to replace one of the levels - Added by Ralf Mueller about 4 years ago

hi Noam!

I don't think it's directly possible with the -expr operator. NCO's ncap might be able to do it.

hth
ralf

    (1-2/2)