Hi,
Here an update with more explanation on what I posted before:
- download
- change soil variables with -set_var and
-set_level (I noticed when running wgrib2 -s on the data downloaded that the soil depths appear in meters instead of cm! no idea why it's doing that but obviously ungrib cannot find the data with the wrong depth! set_level allows to change it.
wgrib2 test.grb2 -set_var TMP -grib temp1.grb2
wgrib2 temp1.grb2 -if ":0-7 m below ground" -set_lev "0-0.07 m below ground" -elseif ":7-28 m below ground" -set_lev "0.07-0.28 m below ground" -elseif ":28-100 m below ground" -set_lev "0.28-1 m below ground" -elseif ":100-" -set_lev "1-2.89 m below ground" -endif -grib res.grb2
wgrib2 test2.grb2 -set_var SOILW -grib temp1.grb2
wgrib2 temp1.grb2 -if ":0-7 m below ground" -set_lev "0-0.07 m below ground" -elseif ":7-28 m below ground" -set_lev "0.07-0.28 m below ground" -elseif ":28-100 m below ground" -set_lev "0.28-1 m below ground" -elseif ":100-" -set_lev "1-2.89 m below ground" -endif -grib res2.grb2
-change the compression format:
wgrib2 ifs_file.grb2 -set_grib_type c3 -grib_out newfilename
- run ungrib with Vtable (sightly different from previous post after reading more carefully the documentation I had some depths wrong):
GRIB1| Level| From | To | metgrid | metgrid | metgrid |GRIB2|GRIB2|GRIB2|GRIB2|
Param| Type |Level1|Level2| Name | Units | Description |Discp|Catgy|Param|Level|
-----+------+------+------+----------+---------+-----------------------------------------+-----------------------+
129 | 100 | * | | HGT | K | Height | 0 | 3 | 5 | 100 |
130 | 100 | * | | TT | K | Temperature | 0 | 0 | 0 | 100 |
157 | 100 | * | | RH | % | Relative Humidity | 0 | 1 | 1 | 100 |
131 | 100 | * | | UU | m s-1 | U | 0 | 2 | 2 | 100 |
132 | 100 | * | | VV | m s-1 | V | 0 | 2 | 3 | 100 |
167 | 105 | 2 | | TT | K | Temperature at 2 m | 0 | 0 | 0 | 103 |
151 | 102 | 0 | | PMSL | Pa | Mean Sea Level Pressure | 0 | 3 | 0 | 101 |
134 | 1 | 0 | | PSFC | Pa | Surface Pressure | 0 | 3 | 0 | 1 |
165 | 105 | 10 | | UU | m s-1 | U at 10 m | 0 | 2 | 2 | 103 |
166 | 105 | 10 | | VV | m s-1 | V at 10 m | 0 | 2 | 3 | 103 |
172 | 1 | 0 | | LANDSEA | proprtn | Land Sea Mask 0/1 Flag | 2 | 0 | 0 | 1 |
139 | 112 | 0 | 7 | ST000007 | K | T 0-07 cm below ground layer | 0 | 0 | 0 | 106 |
170 | 112 | 7 | 28 | ST007028 | K | T 07-28 cm below ground layer | 0 | 0 | 0 | 106 |
183 | 112 | 28 | 100 | ST028100 | K | T 28-100 cm below ground layer | 0 | 0 | 0 | 106 |
236 | 112 | 100 | 289 | ST100289 | K | T100-289 cm below ground layer | 0 | 0 | 0 | 106 |
39 | 112 | 0 | 7 | SM000007 | fraction| Soil Moist 0-07 cm below grn layer | 2 | 0 | 9 | 106 |
40 | 112 | 7 | 28 | SM007028 | fraction| Soil Moist 7-28 cm below grn layer | 2 | 0 | 9 | 106 |
41 | 112 | 28 | 100 | SM028100 | fraction| Soil Moist 028-100 cm below grn layer | 2 | 0 | 9 | 106 |
42 | 112 | 100 | 289 | SM100289 | fraction| Soil Moist 100-289 cm below grn layer | 2 | 0 | 9 | 106 |
-----+------+------+------+----------+---------+-----------------------------------------+-----------------------+
Then it should be fine.
About your remark on the files names, I have the ifs data in several files (test.grb2 and test2.grb2 in my example) and after my modification I cat all the results files (res.grb2 and res2.grb2 in my example). If you have only 1 file apply all change making the previous output file the next input file:
wgrib2 test.grb2 -set_var TMP -grib temp1.grb2
wgrib2 temp1.grb2 -if ":0-7 m below ground" -set_lev "0-0.07 m below ground" -elseif ":7-28 m below ground" -set_lev "0.07-0.28 m below ground" -elseif ":28-100 m below ground" -set_lev "0.28-1 m below ground" -elseif ":100-" -set_lev "1-2.89 m below ground" -endif -grib res.grb2
wgrib2 res.grb2 -set_var SOILW -grib temp1.grb2
wgrib2 temp1.grb2 -if ":0-7 m below ground" -set_lev "0-0.07 m below ground" -elseif ":7-28 m below ground" -set_lev "0.07-0.28 m below ground" -elseif ":28-100 m below ground" -set_lev "0.28-1 m below ground" -elseif ":100-" -set_lev "1-2.89 m below ground" -endif -grib res.grb2
To check everything is all right, run wgrib2 -s on your result file, the output should be something like:
1:0:d=2024041100:TMP:0-0.07 m below ground:120 hour fcst:
2:696788:d=2024041100:TMP:0.28-1 m below ground:120 hour fcst:
3:1382077:d=2024041100:TMP:0.07-0.28 m below ground:120 hour fcst:
4:2076965:d=2024041100:TMP:1-2.89 m below ground:120 hour fcst:
5:2759813:d=2024041100:SOILW:0-0.07 m below ground:120 hour fcst:
6:3230018:d=2024041100:SOILW:0.07-0.28 m below ground:120 hour fcst:
7:3697958:d=2024041100:SOILW:0.28-1 m below ground:120 hour fcst:
8:4167993:d=2024041100:SOILW:1-2.89 m below ground:120 hour fcst:
9:4566592:d=2024041100:HGT:1000 mb:120 hour fcst:
10:5053854:d=2024041100:HGT:700 mb:120 hour fcst:
11:5434160:d=2024041100:HGT:250 mb:120 hour fcst:
12:5786053:d=2024041100:HGT:100 mb:120 hour fcst:
13:6135174:d=2024041100:HGT:400 mb:120 hour fcst:
14:6467120:d=2024041100:HGT:300 mb:120 hour fcst:
15:6810162:d=2024041100:HGT:850 mb:120 hour fcst:
16:7219145:d=2024041100:HGT:200 mb:120 hour fcst:
17:7574065:d=2024041100:HGT:500 mb:120 hour fcst:
18:7895701:d=2024041100:HGT:600 mb:120 hour fcst:
19:8275293:d=2024041100:HGT:925 mb:120 hour fcst:
20:8717764:d=2024041100:HGT:150 mb:120 hour fcst:
21:9073792:d=2024041100:HGT:50 mb:120 hour fcst:
22:9395573:d=2024041100:TMP:500 mb:120 hour fcst:
23:9964163:d=2024041100:TMP:300 mb:120 hour fcst:
24:10508422:d=2024041100:TMP:250 mb:120 hour fcst:
25:11070179:d=2024041100:TMP:400 mb:120 hour fcst:
26:11627248:d=2024041100:TMP:100 mb:120 hour fcst:
27:12239054:d=2024041100:TMP:200 mb:120 hour fcst:
28:12923766:d=2024041100:TMP:850 mb:120 hour fcst:
29:13529006:d=2024041100:TMP:1000 mb:120 hour fcst:
30:14166396:d=2024041100:TMP:700 mb:120 hour fcst:
31:14701799:d=2024041100:TMP:925 mb:120 hour fcst:
32:15313958:d=2024041100:TMP:150 mb:120 hour fcst:
33:16008784:d=2024041100:TMP:600 mb:120 hour fcst:
34:16507143:d=2024041100:TMP:50 mb:120 hour fcst:
35:17213155:d=2024041100:RH:300 mb:120 hour fcst:
36:17762905:d=2024041100:RH:250 mb:120 hour fcst:
37:18204670:d=2024041100:RH:1000 mb:120 hour fcst:
38:18737781:d=2024041100:RH:500 mb:120 hour fcst:
39:19276476:d=2024041100:RH:400 mb:120 hour fcst:
40:19830525:d=2024041100:RH:925 mb:120 hour fcst:
41:20397885:d=2024041100:RH:850 mb:120 hour fcst:
42:20992796:d=2024041100:RH:200 mb:120 hour fcst:
43:21456572:d=2024041100:RH:700 mb:120 hour fcst:
44:21920707:d=2024041100:RH:600 mb:120 hour fcst:
45:22467483:d=2024041100:RH:100 mb:120 hour fcst:
46:22699927:d=2024041100:RH:150 mb:120 hour fcst:
47:23059934:d=2024041100:RH:50 mb:120 hour fcst:
48:23341488:d=2024041100:UGRD:600 mb:120 hour fcst:
49:24009649:d=2024041100:UGRD:50 mb:120 hour fcst:
50:24601595:d=2024041100:UGRD:150 mb:120 hour fcst:
51:25246639:d=2024041100:UGRD:100 mb:120 hour fcst:
52:25988233:d=2024041100:UGRD:400 mb:120 hour fcst:
53:26642712:d=2024041100:UGRD:200 mb:120 hour fcst:
54:27291926:d=2024041100:UGRD:250 mb:120 hour fcst:
55:27949428:d=2024041100:UGRD:300 mb:120 hour fcst:
56:28605153:d=2024041100:UGRD:925 mb:120 hour fcst:
57:29451390:d=2024041100:UGRD:850 mb:120 hour fcst:
58:30297006:d=2024041100:UGRD:1000 mb:120 hour fcst:
59:31145535:d=2024041100:UGRD:500 mb:120 hour fcst:
60:31800522:d=2024041100:UGRD:700 mb:120 hour fcst:
61:32486900:d=2024041100:VGRD:600 mb:120 hour fcst:
62:33136879:d=2024041100:VGRD:50 mb:120 hour fcst:
63:33759256:d=2024041100:VGRD:150 mb:120 hour fcst:
64:34350511:d=2024041100:VGRD:100 mb:120 hour fcst:
65:34916746:d=2024041100:VGRD:400 mb:120 hour fcst:
66:35565981:d=2024041100:VGRD:200 mb:120 hour fcst:
67:36182403:d=2024041100:VGRD:250 mb:120 hour fcst:
68:36719462:d=2024041100:VGRD:300 mb:120 hour fcst:
69:37265183:d=2024041100:VGRD:925 mb:120 hour fcst:
70:38107825:d=2024041100:VGRD:850 mb:120 hour fcst:
71:38836090:d=2024041100:VGRD:1000 mb:120 hour fcst:
72:39656988:d=2024041100:VGRD:500 mb:120 hour fcst:
73:40297303:d=2024041100:VGRD:700 mb:120 hour fcst:
74:41080214:d=2024041100: PRES:surface:120 hour fcst:
75:41688879:d=2024041100:TMP:2 m above ground:120 hour fcst:
76:42438061:d=2024041100: PRES:mean sea level:120 hour fcst:
77:42942388:d=2024041100:VGRD:10 m above ground:120 hour fcst:
78:43866285:d=2024041100:UGRD:10 m above ground:120 hour fcst:
79:44816209:d=2024041100:LAND:surface:120 hour fcst:
Best