The CMA-GFS grib2 datasets is now able to be ingested by the ungrib program. The GRAPES_GFS(here in after referred to as CMA_GFS), the new generation of Global/Regional Assimilation and Prediction Enhanced System which is independently developped by China Meteorological Administration (CMA), has been put into formal operation. So we are committed to solving the problem of WPS correctly handling CMA_GFS forecast data.
one Vtable files(Vtable.CMA_GFS) has been created with the fields required by the WRF model. Modifications to the ungrib source code: Adding support for code 738 in rd_grid2.F because model levels of CMA_GFS are on generalized vertical height coordinates.
I've tested the program with an Intel compiler and it passed without errors. CMA_GFS forecast data were also used to test, the results are normal.
[Dec 22, 2024] These changes permit ungribbing of the CMA model output. Tests on derecho were successful. Note that the global CMA output files are very large and time-consuming to download.
There are 40 pressure levels, 1000hPa up to 0.1hPa (~30km)
Land sea mask
./g2print.exe final_cma_lsm.grib2 <--- Land sea mask
▶
Land sea mask
1 2 3 4 5 6 7 8 9 10 11
ungrib - grib edition num 2 reading from grib file = final_cma_lsm.grib2 unknown model and orig center --------------------------------------------------------------------------------------- rec Prod Cat Param Lvl Lvl Lvl Prod Name Time Fcst num Disc num code one two Templ hour --------------------------------------------------------------------------------------- 1 2 0 0 1 0 0 0 LAND 2025-01-12_00:00:00 00
ERROR: ******************************************************************************** ERROR: LANDSEA field not found in meteorological data file CMA:2025-01-12_00 CRITICAL ERROR: ********************************************************************************
seems CMA_GFS doesn't contain LANDSEA
But, in static.nc, landmask is included. So, why does init_atmosphere_model have to check LANDSEA?
I tried removing all the fields that do not work with the new namelist record. However, MPAS needs the LANDSEA mask to work but I don't know how to add it in the Intermediate Files.
Landsea mask values in ECMWF data lie between 0 and 1, which is different to WRF static data that have values of either 0 (grid box is fully covered by water) or 1 (grid box is fully covered with land). Please see the website below that describes landsea mask in ECMWRF: https://confluence.ecmwf.int/display/FUG/Section+2.1.3.1+Land-Sea+Mask
I am suspicious that Landsea mask values in IFS global data follow the rule of ECMWF data, i.e., its values could be between 0 and 1. This might give rise to troubles when we run MPAS initialization.
I'm trying to create the initial conditions file for MPAS (v8.1) using data obtained from the NCEP FNL ds083.2
Just had to change config_nfgsoillevels to 2 and config_extrap_airtemp to linear in namelist.init_atmosphere. Once those two modifications were made init_atmosphere_model and atmosphere_model ran without issues.
Note that FNL data only contains 2-level of soil information, which is why we need to set config_nfgsoillevels=2. The top of the FNL data is 10 hpa, and therefore extrapolation is needed if MPAS top level is above 10 hpa.
For the option of config_extrap_airtemp, would you please let me know what is the model top of your MPAS run? Thanks.
This error message is an indication that there were one or more points in the MPAS mesh that received a zero or negative value for soil temperature.
Can you also verify that there are soil moisture and soil temperature fields in your WPS intermediate file, and that the number of soil levels in your intermediate files matches the value of the config_nfgsoillevels in your namelist.init_atmosphere file?
MPAS can only process soil data at specific levels with specific field names. If your input soil data are on levels or with names unrecognized by MPAS, then it won't work.
Please take a look at the code "mpas_init_atm_cases.F", and the lines 3908 - 4118 process soil temperature data. This might give you some idea how MPAS works.
The message "Error in interpolation of st_fg to MPAS grid: num_st = XXXX" is generally indicative of an issue with the soil temperature. Would it be possible to use some of the utilities that come with the WRF Pre-processing System (WPS) to check that there are valid soil temperature data in your intermediate file? Specifically, you could use the "rd_intermediate" utility to check that there are fields named, e.g., ST000010, and you could use the "int2nc" utility to convert the intermediate file to netCDF format, where it would be easier to view the soil fields with, e.g., ncview.
check grib2 file
In general, GFS/ERA5/IFS 0.25 deg grib files show
1 2 3 4
# Earth assumed spherical with radius of 6 371 229.0 m (grib2/tables/25/3.2.table) shapeOfTheEarth = 6; Ni = 1440; Nj = 721;
which is not 0.25 deg but 0.125 deg. Therefore, LANDSEA of IFS can not be used for CMA_GFS.
Take GFS's land sea mask (Wrong!!)
The GFS land mask is not suitable for use with CMA_GFS.
Solution (Successful)
Move to next section "CMA_GFS Land Sea Mask"
For MPASv7.3, it is Successful.
Successful completion of program ungrib.exe
Finished running the init_atmosphere core
Finished running the atmosphere core
atmosphere_model
Finished running the atmosphere core
CMA_GFS Land Sea Mask
If the GFS land mask is not suitable for use with CMA_GFS, the presence of 0K values could lead to problems. Is it possible for us to utilize this information to create a land-sea mask specifically for CMA_GFS from CMA_GFS?
check grib2's soil temperature
Solution
We are required to create a land mask using the same source data as CMA_GFS to ensure consistency in our results. In this case, I will utilize the soil temperature data at depths of 1-2 meters, as this data shows a value of 0 in ocean areas.
464:416263005:d=2025011200:TMP:0-0.1 m below ground:anl: 465:418796241:d=2025011200:TMP:0.1-0.4 m below ground:anl: 466:421201726:d=2025011200:TMP:0.4-1 m below ground:anl: 467:423468299:d=2025011200:TMP:1-2 m below ground:anl: 468:424559640:d=2025011200:SPFH:0-0.1 m below ground:anl: 469:426189296:d=2025011200:SPFH:0.1-0.4 m below ground:anl: 470:427793124:d=2025011200:SPFH:0.4-1 m below ground:anl: 471:429405783:d=2025011200:SPFH:1-2 m below ground:anl:
467:423468299:d=2025011200:TMP:1-2 m below ground:anl: is our target.
extract and generate new grib2 for landmask
convert grib2 to nc file,
1 2 3
wgrib2 Z_NAFP_C_BABJ_20250112000000_P_NWPC-GRAPES-GFS-GLB-00000.grib2 -match ':TMP:1-2 m below ground:' -grib TMP_1_2m.grib2
#================== Save ================================================= # Save the result to a new NetCDF file TMP_1_2m_nc.to_netcdf(f'/home/wpsze/mpas/CMA_GFS/test/ungrib/new_TMP_1_2m.nc', format='NETCDF4')
Left: original soil temperature; Right: our created Land sea mask field for CMA_GFS
| LANDSEA | proprtn | Land/Sea flag (1=land, 0 or 2=sea) | 2 | 0 | 0 | 1 |
1 2 3 4 5 6 7 8 9 10 11
ungrib - grib edition num 2 reading from grib file = final_cma_lsm.grib2 unknown model and orig center --------------------------------------------------------------------------------------- rec Prod Cat Param Lvl Lvl Lvl Prod Name Time Fcst num Disc num code one two Templ hour --------------------------------------------------------------------------------------- 1 2 0 0 1 0 0 0 LAND 2025-01-12_00:00:00 00