Project

General

Profile

Create 1 TM from 3 TM

Added by Romain LE LAMER almost 4 years ago

Hi all,
I need to create a TM003, I cannot use the NOAA TM003.

I read and reread the online help and find some interesting stuff but it doesn't work.

Calculation from TM009 TZ-1, TM012 TZ-1 and TM006 = TM003

What I'm looking to do:
• Rename the variables of these 3 TMs:
TM009 TZ-1 (= 10v & 10u) in 10v009 & 10u009
TM012 TZ-1 (= 10v & 10u) in 10v012 & 10u012
TM006 TZ (= 10v & 10u) in 10u006 and 10v006
For 1 TZ, I use this :

cdo setpartabn,10uv006 gfs.t12z.pgrb2.1p00.f006 test_v006

10uv006

&parameter
  name = 10u
  out_name = 10u006
/
&parameter
  name = 10v
  out_name = 10v006
/

• Merge these 3 new gribs into 1

cdo mergetime test_v009 test_v012 test_v006 test_all

• As all 10uXXX & 10vXXX values are in the same grib I can set up my calculation, which is:

cdo exprf,mk003_14_1 test_all test_003

mk003_14_1

10u = (10u009 + (10u012 - 10u009) * (4/18)) * (14/15) + (10u009 + (10u006 - 10u009) * (4/18)) * (1/15);
10v = (10v009 + (10v012 - 10v009) * (4/18)) * (14/15) + (10v009 + (10v006 - 10v009) * (4/18)) * (1/15);

The method seems "coherent" to me (there may be another way to do it)

But I get an error message while renaming the variables ...

$ cdo setpartabn,10uv006 gfs.t12z.pgrb2.1p00.f006 test_v006
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "10u" ("10u006").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "10v" ("10v006").
cdo    setpartabn: Processed 2 variables over 1 timestep [0.17s 27MB].

I don't understand what I'm not doing correctly ... could someone show it to me ?
Thanks


Replies (4)

RE: Create 1 TM from 3 TM - Added by Uwe Schulzweida almost 4 years ago

Use NetCDF to store the renamed variables

cdo -f nc setpartabn,10uv006 gfs.t12z.pgrb2.1p00.f006 test_v006
and if you really need GRIB use it at the final step
cdo -f grb2 exprf,mk003_14_1 test_all test_003

RE: Create 1 TM from 3 TM - Added by Romain LE LAMER almost 4 years ago

Thanks for the tip (-f nc) it works as expected.

On the other hand,
• Merge these 3 new gribs into 1, does not work as I expected

$ cdo mergetime test_v009 test_v012 test_v006 test_all
Warning: Input streams have different parameter names!
Warning: Input streams have different parameter names!
cdo    mergetime: Processed 6 variables over 3 timesteps [0.05s 8392KB].
$ cdo copy test_v009 test_v012 test_v006 test_all
cdo    copy:  66% Warning: Input streams have different parameter names!
cdo    copy: Processed 6 variables over 3 timesteps [0.04s 9012KB].

something escapes me

$ cdo sinfon test_all
 File format : NetCDF2
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter name
     1 : ECMWF    unknown  v instant       1   1     65160   1  F32  : 10u009        
     2 : ECMWF    unknown  v instant       1   1     65160   1  F32  : 10v009        
   Grid coordinates :
     1 : lonlat                   : points=65160 (360x181)
                              lon : 0 to 359 by 1 degrees_east  circular
                              lat : 90 to -90 by -1 degrees_north
   Vertical coordinates :
     1 : height                   : levels=1
                           height : 10 m
   Time coordinate :  3 steps
     RefTime =  2020-07-25 06:00:00  Units = hours  Calendar = proleptic_gregorian
  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss
  2020-07-25 15:00:00  2020-07-25 18:00:00  2020-07-25 18:00:00
cdo    sinfon: Processed 2 variables over 3 timesteps [0.02s 7580KB].

I'm still doing something wrong ... I don't see 10u/v012 and 10u/v006 so I can't apply the formula

RE: Create 1 TM from 3 TM - Added by Uwe Schulzweida almost 4 years ago

merge is the correct operator for this task.

RE: Create 1 TM from 3 TM - Added by Romain LE LAMER almost 4 years ago

Thanks Uwe Schulzweida.
I have tried them all except this one ...
Why make it simple when you can make it complicated ... (French expression)

    (1-4/4)