Project

General

Profile

Merge levels

Added by Waheed Iqbal almost 11 years ago

Hello

Cdo version is :
cdo -V
Climate Data Operators version 1.6.2rc3 (http://code.zmaw.de/projects/cdo)

and OS is Fedora 19:

I am unable to merge four files of uwind into a single file that will have four pressure levels.

Here are the details:
Input files:
file1_925.nc (has variable ua925 0 t,y,x Eastward Wind)
file2_850.nc (has variable ua825 0 t,y,x Eastward Wind)
file3_500.nc (has variable ua500 0 t,y,x Eastward Wind)
file4_200.nc (has variable ua200 0 t,y,x Eastward Wind)

Desired Output file:

I want a file file_final.nc (variable ua 4 t,z,y,x Eastward Wind)

I have tried merge, cat etc but they do not serve the purpose.

Please help me to solve this problem?

Thanks in advance.

Waheed


Replies (2)

RE: Merge levels - Added by Matt Thompson almost 11 years ago

Waheed,

"cdo merge" worked for me. I took a file with around 48 levels of U and split them apart with "splitlevel". I then took 6 of these:

$ ls Ulev00000*
Ulev000001.nc4  Ulev000002.nc4  Ulev000003.nc4  Ulev000004.nc4  Ulev000005.nc4  Ulev000007.nc4
$ cdo infon Ulev000001.nc4
    -1 :       Date     Time   Level Gridsize    Miss :     Minimum        Mean     Maximum : Parameter name
     1 : 2000-04-15 00:00:00       1    16380       0 :     -11.440      25.533      83.944 : U             
cdo infon: Processed 16380 values from 1 variable over 1 timestep ( 0.00s )
$ cdo merge Ulev00000* comboU.nc4
cdo merge: Processed 98280 values from 6 variables over 6 timesteps ( 0.01s )
$ cdo info comboU.nc4
    -1 :       Date     Time   Level Gridsize    Miss :     Minimum        Mean     Maximum : Parameter ID
     1 : 2000-04-15 00:00:00       1    16380       0 :     -11.440      25.533      83.944 : -1            
     2 : 2000-04-15 00:00:00       2    16380       0 :     -18.550      19.201      65.850 : -1            
     3 : 2000-04-15 00:00:00       3    16380       0 :     -24.682      13.400      60.121 : -1            
     4 : 2000-04-15 00:00:00       4    16380       0 :     -31.325      8.5258      54.017 : -1            
     5 : 2000-04-15 00:00:00       5    16380       0 :     -39.248      6.0766      50.995 : -1            
     6 : 2000-04-15 00:00:00       7    16380       0 :     -43.078      3.6568      47.119 : -1            
cdo info: Processed 98280 values from 1 variable over 1 timestep ( 0.00s )

Is your cdo returning an odd error?

Matt

RE: Merge levels - Added by Waheed Iqbal almost 11 years ago

Hi Matt

I tried "cdo merge", no error is returned. The detail of the procedure that I adopted is as following:
I used

 cdo merge file1_925.nc file2_850.nc file3_500.nc file4_200.nc out1.nc
cdo merge: Processed 2609360 values from 4 variables over 104 timesteps ( 0.16s)

this out1.nc has four variables (as each file had different name of variable) and only one z level (level=0).

To overcome the problem of different names in each file, I changed the variable of each file to "u" by using the
cdo command "cdo chname" and then executed the command:

$ cdo merge file_925.nc file_850.nc file_500.nc file_200.nc out3.nc
cdo merge (Warning): Duplicate entry of parameter u in file_850.nc!
cdo merge: Processed 2609360 values from 4 variables over 104 timesteps ( 0.14s )

This out2.nc file has one variable at 4 levels (but when i set set z lev 1 (or 2,3,4) grads returns "LEV set to 0 0 ").
also I am unable to display the variable, here is the error message from Grads:

ga-> d u
Data Request Error: Invalid grid coordinates
  World coordinates convert to non-integer  grid coordinates
    Variable = u  Dimension = 2 
  Error ocurred at column 1
DISPLAY error:  Invalid expression 
  Expression = u

I guess the problem is that my input files do not have the z co-ordinates (as you can see the variable: ua850 0 ,t,y,x) and in your case z coordinate will be present: you have splitted the levels from a file which had the z coordinate and hence the "cdo merge" command worked for you!

If I ncdump or cdo sinfo any input file the level is "0" (surface) but in actual that is not the case!

May be it will be required to first add the z coordinate to each file and then merge?

Any help/suggestions will be greatly appreciated.

Waheed

    (1-2/2)