Project

General

Profile

Remapnn erases some of the existing variables

Added by Nikolaos Frouzakis almost 8 years ago

Hello all,

I have some netcdf files that I have converted from grid format. First I want to keep only specific variables with selvar command. So far, so good. I check the new files and the variables that I want have been properly extracted. But then I want to keep only one point from the whole grid, so I use the remapnn command but the output files have only 2 of the variables left. It is like remapnn command conflicts with something and erases the rest of the variables. I have used remapnn in the past and it worked fine so I am bit confused about what am I doing wrong.

Thanks in advance for the help.

Nikos


Replies (4)

RE: Remapnn erases some of the existing variables - Added by Ralf Mueller almost 8 years ago

Hi Nikos!

Without some sample data, it's really (and I mean really) hard to tell, what's going wrong ;-)

RE: Remapnn erases some of the existing variables - Added by Nikolaos Frouzakis almost 8 years ago

Hello Ralf,

of course you are right, I have now attached one of the files I am working with. To guide you through the procedure:

1. First I use cdo -sellonlatbox to choose the area of interest
2. I use cdo -f nc copy to convert the "cropped" grid files into netcdf format.
3. I use cdo -s setday, -setyear, -setmon, -selvar to edit and obtain the variables I am interested in.

So far, so good. I check the output files and the area coordinates as well as the contained variables are correct.
From this point on I need to perform 2 steps: first keep only one level for the variables and secondly take those values only at specific coordinates. For the first operation I am using sellevel command but I get some kind of conflict because some variables have levels and some don't. So if I try to perform sellevel to all variables I get no variables as output, while if I try to perform it only to the ones that have levels, the output file contains only them. More specifically in the file I have attached I am interested in variables 131,132,151,165,166 and 167 but only 131 and 132 have different levels.

Then I use remapnn to obtain the values in specific coordinates but I guess the error is getting carried from before so I get an empty file.

Excuse me for the misleading title I just realized that the problem is probably in the sellevel command instead of the remapnn. I hope the explanation was not even more confusing.

Thanks for all the help.

Nikos.

RE: Remapnn erases some of the existing variables - Added by Nikolaos Frouzakis almost 8 years ago

Hello again,

just to ansewr my own question in case anyone else has also encountered the same problem the sellevel variable is not working, or at least I could not make it work, in files that also include variables without levels (e.g. u10m). What I had to do was to split the variables into different files with splitname command, then use sellevel command to the variables I wanted to obtain at a certain level and finally use merge command to have all the variables together.

Hope this helps.

Nikos

RE: Remapnn erases some of the existing variables - Added by Ralf Mueller almost 8 years ago

Hi Nikos!
sorry for the late reply.

You could use the operator splitzaxis instead of splitname and only select levels on those files with number of levels larger than 1.

this number can be read from the files with the nlevel operator.

BUT I just talked to Uwe and he suggested to add the 0 to the sellevel call. With this, all surface variables are kept!!

    (1-4/4)