Project

General

Profile

Converting ugrd10m, vgrd10m into ws10m for ensemble grib

Added by Ran Glattstein over 1 year ago

Hi guys,
I'm working on the ECMWF ensemble gribs (can be retrieved using "wget https://ai4edataeuwest.blob.core.windows.net/ecmwf/20220830/0z/0p4-beta/oper/20220830000000-150h-oper-fc.grib2").

I'm intereted in efficiently extracting the forecasted wind speed on 2m level for each member and then averaging it.
The classic cdo commands I use are taking average on all members for the URGD10m, VGRD10m but then it means nothing and WS10m can not be calculated.
I was wondering whether there is a command to create "WS10m" for each member and then continue to normal averaging as usual.

Thank you so much,
Ran.


Replies (14)

RE: Converting ugrd10m, vgrd10m into ws10m for ensemble grib - Added by Karin Meier-Fleischer over 1 year ago

Hi Ran,

I am not able to download the file:

404 The specified blob does not exist

RE: Converting ugrd10m, vgrd10m into ws10m for ensemble grib - Added by Karin Meier-Fleischer over 1 year ago

The problem are the ensembles within the GRIB2 file, but I think I have a solution.

cdo -f grb2 -t ecmwf -sqrt -add \
                           -sqr -selname,10u 20220829000000-48h-enfo-ef.grib2 \
                           -sqr -selname,10v 20220829000000-48h-enfo-ef.grib2 \
                           tmp.grb2

The wind speed variable name can be set to 10si (ECMWF).

grib_set -s shortName=10si tmp.grb2 20220829000000-48h-enfo-ef_10si.grib2

The PNG shows the computed wind speed of the first ensemble member:

RE: Converting ugrd10m, vgrd10m into ws10m for ensemble grib - Added by Ran Glattstein over 1 year ago

But I think we might have a problem here...

ws10m = square_root (ugrd^2 + vgrd^2)
it seems what you are doing is sum(square_root(ugrd)+square_root(vgrd))
Am I right?

RE: Converting ugrd10m, vgrd10m into ws10m for ensemble grib - Added by Ran Glattstein over 1 year ago

Oops,
didn't notice the sqrt at the beginning.
All is good, world is saved :))))
sorry for the mistake

RE: Converting ugrd10m, vgrd10m into ws10m for ensemble grib - Added by Ran Glattstein over 1 year ago

Hi again...

So I've been trying to run the commands, but sadly I'm getting an Error.
It seems like mycdo doesn't find 10u and 10v fields.
When I run

cdo -selname,10u original.grb2 dest_10u.grb2 

I get the following Error:
cdo selname (Warning): Variable name 10u not found!
cdo selname (Abort): No variables selected!

I'm wondering could it be due to the fact that I'm using CDO 1.9.3 ? tried to run apt-get --upgrade but it deosn't find newer versions.
If so I willy try to install manually from downloading the tar file (if you have a script that's installing the tar it would be great).

Thanks again,
Ran.

RE: Converting ugrd10m, vgrd10m into ws10m for ensemble grib - Added by Karin Meier-Fleischer over 1 year ago

No, it is because the variable 10u is not in original.grb2 or you use a wrong parameter table.

You can list the variables in your file with

cdo showvar original.grb2

or get a short info about the content with

cdo sinfon original.grb2

If it is an ECMWF GRIB2 file you can use the '-t ecmwf' option

cdo -t ecmwf -selname,10u original.grb2 dest_10u.grb2

But I can only guess without the file.

RE: Converting ugrd10m, vgrd10m into ws10m for ensemble grib - Added by Ran Glattstein over 1 year ago

Hi, attaching the file. Sorry for that.

It seems like "cdo showvar" only identifies "2t" field, although the file contains many fields (that can be seen when running grib_ls on it)

Do you manage to perform the transformation on the attached file ? maybe my CDO version is the problem?

Thanks

RE: Converting ugrd10m, vgrd10m into ws10m for ensemble grib - Added by Ran Glattstein over 1 year ago

OK I think I see the problem.
It seems like cdo showvar (or selname) can't identify the fields correctly when working on the grib that contains all of the Perturbation Members.
When running the same commands on a specific perturbation grib file (see attached) it does seem to work!

RE: Converting ugrd10m, vgrd10m into ws10m for ensemble grib - Added by Karin Meier-Fleischer over 1 year ago

I guess you have to update CDO because I'm not able to reproduce the problem.

cdo showvar eps_op_0p50_20220830_0000_240.US.minigrib 
 2t 2t 2t 2t 2t 2t 2t 2t 2t 10u
 10v 10u 10v 10u 10v 10u 10v 10u 10v 10u
 10v 10u 10v 10u 10v 2t 2t 10u 10v 2t
 2t 10u 10v 2t 2t 2t 10u 10v 10u 10v
 tp 2t 10u 10v 2t 10u 10v 2t 10u 10v
 10u 10v 2t 10u 10v 10u 10v 10u 10v 10u
 10v 2t 10u 10v 2t 10u 10v 2t tp tp
 10u 10v 10u 10v 2t tp 10u 10v 2t 2t
 2t 2t 2t 10u 10v 2t 2t 2t 2t 2t
 10u 10v 2t 2t 2t 2t 10u 10v 2t 2t
 2t 2t tp 2t 2t 2t 2t 10u 10v 2t
 10u 10v 2t 2t 2t 10u 10v tp 10u 10v
 10u 10v 10u 10v 10u 10v tp 10u 10v tp
 10u 10v 10u 10v 10u 10v 10u 10v 10u 10v
 10u 10v 10u 10v 10u 10v 10u 10v 10u 10v
 10u 10v 10u 10v tp 10u 10v tp 10u 10v
 2t tp 10u 10v tp tp tp tp tp tp
 tp tp tp tp tp tp tp tp tp tp
 tp tp tp tp tp tp tp tp tp tp
 tp tp tp tp tp tp tp tp tp tp
 tp tp tp tp t gh gh t gh t
 gh gh gh gh gh gh gh gh gh gh
 gh gh gh gh gh gh gh gh gh gh
 t gh gh gh gh t gh t t gh
 gh gh gh t t t t gh gh gh
 gh gh gh gh gh gh t t t t
 gh t t t gh t t t t t
 t gh t t t t t t gh t
 t t t gh t gh t t t t
 t gh gh t t t t t gh t
 t gh t t t t sp sp sp sp
 sp sp sp sp sp sp sp sp sp sp
 sp sp sp sp sp sp sp sp sp sp
 sp sp sp sp sp sp sp sp sp sp
 sp sp sp sp sp sp sp sp sp sp
 sp sp sp sp sp sp sp st st st
 st st st st st st st st st st
 st st st st st st st st st st
 st st st st st st st st st st
 st st st st st st st st st st
 st st st st st st st st ro ro
 ro ro ro ro ro ro ro ro ro ro
 ro ro ro ro ro ro ro ro ro ro
 ro ro ro ro ro ro ro ro ro ro
 ro ro ro ro ro ro ro ro ro ro
 ro ro ro ro ro ro ro ro ro

Doing the calculation of the wind speed as explained above:

cdo -f grb2 -t ecmwf -sqrt -add -sqr -selname,10u eps_op_0p50_20220830_0000_240.US.minigrib -sqr -selname,10v eps_op_0p50_20220830_0000_240.US.minigrib outfile.grb2
cdo(1) add: Process started
cdo(2) sqr: Process started
cdo(3) selname: Process started
cdo(4) sqr: Process started
cdo(5) selname: Process started
cdo(1) add (Warning): Input streams have different parameter names!
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
gribapiEncode     : *** GRIB2 shortName does not correspond to chosen variable name: "unknown" ("10u").
cdo(5) selname: Processed 385560 values from 459 variables over 1 timestep.
cdo(4) sqr: Processed 385560 values from 51 variables over 1 timestep.
cdo(3) selname: Processed 385560 values from 459 variables over 1 timestep.
cdo(2) sqr: Processed 385560 values from 51 variables over 1 timestep.
cdo(1) add: Processed 771120 values from 102 variables over 2 timesteps.
cdo    sqrt: Processed 385560 values from 51 variables over 1 timestep [1.46s 98MB].
grib_set -s shortName=10si outfile.grb2 10si.grb2
cdo sinfon 10si.grb2 
   File format : GRIB2
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter name
     1 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
     2 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
     3 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
     4 : ECMWF    unknown  v instant       1   1      7560   1  P10  : 10si          
     5 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
     6 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
     7 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
     8 : ECMWF    unknown  v instant       1   1      7560   1  P12  : 10si          
     9 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    10 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    11 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    12 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    13 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    14 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    15 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    16 : ECMWF    unknown  v instant       1   1      7560   1  P12  : 10si          
    17 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    18 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    19 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    20 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    21 : ECMWF    unknown  v instant       1   1      7560   1  P13  : 10si          
    22 : ECMWF    unknown  v instant       1   1      7560   1  P12  : 10si          
    23 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    24 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    25 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    26 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    27 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    28 : ECMWF    unknown  v instant       1   1      7560   1  P10  : 10si          
    29 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    30 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    31 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    32 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    33 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    34 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    35 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    36 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    37 : ECMWF    unknown  v instant       1   1      7560   1  P12  : 10si          
    38 : ECMWF    unknown  v instant       1   1      7560   1  P10  : 10si          
    39 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    40 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    41 : ECMWF    unknown  v instant       1   1      7560   1  P10  : 10si          
    42 : ECMWF    unknown  v instant       1   1      7560   1  P12  : 10si          
    43 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    44 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    45 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    46 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    47 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    48 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    49 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    50 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
    51 : ECMWF    unknown  v instant       1   1      7560   1  P11  : 10si          
   Grid coordinates :
     1 : lonlat                   : points=7560 (126x60)
                              lon : 233 to 295.5 by 0.5 degrees_east
                              lat : 22 to 51.5 by 0.5 degrees_north
   Vertical coordinates :
     1 : height                   : levels=1
                           height : 10 m
   Time coordinate :
                             time : 1 step
     RefTime =  2022-08-30 00: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
  2022-09-09 00:00:00
cdo    sinfon: Processed 51 variables over 1 timestep [0.26s 49MB].

RE: Converting ugrd10m, vgrd10m into ws10m for ensemble grib - Added by Ran Glattstein over 1 year ago

Ok, so it's probably really a version issue.
thanks

RE: Converting ugrd10m, vgrd10m into ws10m for ensemble grib - Added by Ran Glattstein over 1 year ago

Are versions > 1.9.3 available for ubuntu 18.04 ?
Can't find it on apt-get.

    (1-14/14)