Hello.
I think I found a solution. Starting from the beginning. The grib2 files from ECMWF should be uncompressed. If we use the g2print.exe program, we get a list of grib2 codes of all fields in the file. Let's limit ourselves to the codes of the soil moisture and temperature fields that interest us. Below is a list of these fields.
1 2 3 18
151 0 1 0 UNKNOWN 2025-01-10_00:00:00 03
23 2 3 18
151 1 2 0 UNKNOWN 2025-01-10_00:00:00 03
40 2 3 18
151 3 4 0 UNKNOWN 2025-01-10_00:00:00 03
62 2 0 25
151 0 1 0 UNKNOWN 2025-01-10_00:00:00 03
67 2 0 25
151 1 2 0 UNKNOWN 2025-01-10_00:00:00 03
74 2 0 25
151 2 3 0 UNKNOWN 2025-01-10_00:00:00 03
76 2 3 18
151 2 3 0 UNKNOWN 2025-01-10_00:00:00 03
80 2 0 25
151 3 4 0 UNKNOWN 2025-01-10_00:00:00 03
Please note that the code of these fields is "151". And such a code should be read by ungrib. But that's not all. The levels of the soil temperature and visibility fields have not changed and are the same as before. The values are decoded for some reason as
0-1
1-2
2-3
3-4
which corresponds to
0-7
7-28
28-100
100-289
In my opinion, the data must be expressed in centimeters. Here's what my solution looks like now.
First, the Vtable file that I prepared..
View attachment 16872
The second, more difficult step is to change the rd_grib2.F file. At this point I will add that you need to add support for parameter 151, which is missing in the original file.
First change
from
! if ( gfld%ipdtmpl(10) .eq. 106 ) then
to
if (( gfld%ipdtmpl(10) .eq. 106 ) .or.
& ( gfld%ipdtmpl(10) .eq. 151 )) then. !! Added by Prof. Mariusz Figurski, 20250110
Next step:
if (((g2code(4,j) .eq. 106) .or.
& (g2code(4,j) .eq. 151)) .and. !! Added by Prof. Mariusz Figurski, 20250110
& (gfld%ipdtmpl(1) .eq. g2code(2,j)) .and. !! Added by Dr. Haiqing SONG, 20181201
& (gfld%ipdtmpl(2) .eq. g2code(3,j)) .and.
& (glevel1 .eq. level1(j)) .and.
& ((glevel2 .eq. level2(j)) .or.
& (level2(j) .le. -88))) then
In the third step you need to improve the reading of soil moisture and temperature levels from the grib2 file.
View attachment 16873
If we make the corrections as I wrote above, the WRF model will start reading and calculating. As proof, I am sending my results.
Two examples of visualization of temperature and precipitation forecast for the area of Poland with initial data from the GFS model and an implementation that I developed of the IFS model from the ECMWF open repository.
Daily temperature 2m. GFS ............................................................................. ECMWF open data
View attachment 16874
Daily total precipitation. GFS ........................................................... ECMWF open data
View attachment 16875
@Ming Chen @dudhia can I ask you to verify my solution?
Best regards
Mariusz Figurski