Project

General

Profile

cdo ensmean and NetCDF

Added by Pau Escriba about 6 years ago

Hello,

I am trying to compute ensemble mean form a 4 member ensemble. Each member is in a netcdf format file, it is created by WRF-ARW nwp model. I have found the very useful "cdo ensmean" command to do this. It creates the ensemble mean file with correct field values and so. The problem I have is when I go to plot this netcdf file with the common netcdf viewer "ncview" I see that there has been some changes in the header of the outcome netcdf file. Basically the toplevel was 0 before and now is 1. And the bottom level was 70 and now is 71. In both files there are 71 levels but these changes may cause problems in my posterior use of ensemblemean file with WRF model.

The question is, do you know how could I change this toplevel/bottomlevel netcdf parameters to the previous correct ones with cdo?

Many thanks in advance.

Pau


Replies (5)

RE: cdo ensmean and NetCDF - Added by Ralf Mueller about 6 years ago

Hi!

for getting help, you might consider

  • uploading some input/ouput files
  • give the CDO version (output of cdo -V)
  • give the exact call you are struggeling with in order to get things reproducable

Did I mention that all of this is written in the main page of this project?

And finally: What exactly is the problem? ncview stopped working? or gives wrong results? I don't expect a big issue when going from 0...70 to 1...71 for a vertical axis since ncview can handle both, doesn't it?

cheers
ralf

RE: cdo ensmean and NetCDF - Added by Pau Escriba about 6 years ago

Thanks Ralf, good to have so fast answer!

I see that each of my netcdf file has 1.5 gb size, so it is impossible for me to upload them. Maybe if you have some ftp site I can upload them to you.
The version I am using is 1.6.1
the call I do is "cdo ensmean wrf1 wrf2 wrf3 wrf4 wrfmean", where wrfi are the ensemble members and wrfmean is the resulting netcdf mean fields file.

ncview works fine for all netcdf files. The problem is, when I do ncview wrfi, in the air parameters like T (temperature) for example I see that toplevel=0 and bottomlevel=70. But when I do ncview wrfmean toplevel=1 and bottomlevel=71. In either cases there are 71 levels in the vertical, and the field values are correct. The only problem is this change cdo makes in the toplevel/bottomlevel parameters.

The question is if I can change toplevel/bottomlevel parameters to the input ones with some cdo tool.

In any case, maybe I have no problems with this new codification. I am going to test wrfmean netcdf file as input to a wrf.exe executable (haven't done it still). Maybe all gives correct results. The question here is why cdo changes this and if this can be solved somehow.

Many thanks for your help.

Pau

RE: cdo ensmean and NetCDF - Added by Ralf Mueller about 6 years ago

Hi Pau!

IMO you should definitely consider updateing cdo to release 1.9.3. It's much less destructuve concerning dimension handling in netcd files. There is a good chance, that you problem is gone with this version of CDO.

uploading of large files can be done via our ftp server: ftp.zmaw.de:/incoming

RE: cdo ensmean and NetCDF - Added by Pau Escriba about 6 years ago

Hi Ralf,

I am uploading 3 wrf files to your ftp server right now, not sure how long it will take :-). You should do "cdo ensmean wrfarw.mem001 wrfarw.mem002 ensmean". The third file, wrfarw.mean, is the resulting ensmean in my case (with 4 files, so for sure different values than in your case in the fields). If you do ncview on them you will see the different top/bottomlevel for T variable.

I see I have up to cdo 1.8.2 version... I will try!

Let's see how it goes.

Thanks.

Pau

RE: cdo ensmean and NetCDF - Added by Pau Escriba about 6 years ago

WOW! with cdo 1.8.2 version it works! No more different parameters!

Many thanks!

I close the ftp connexion, if you want the files for debugging or so tell me please.

Very fast solution of my issue.

Pau

    (1-5/5)