metgrid.exe ERROR: In read_next_field(), got error code -3 with NCEP FNL data (WPS 4.7.0)

朱佳燕

New member
Dear all,

I am a student working on a WRF-based study to simulate the impact of anthropogenic heat emissions on thermal comfort in the Guangdong-Hong Kong-Macao Greater Bay Area. I have been stuck on an issue with metgrid.exe for several days and would really appreciate your help.

**My environment:**
- WRF/WPS version: 4.7.0
- Running in a Docker container (image: ghcr.io/uomresearchit/wrf-wps:latest)
- Forcing data: NCEP FNL Operational Model Global Tropospheric Analyses (ds083.2), GRIB2 format
- Simulation period: 2021-07-23_00:00:00 to 2021-07-25_00:00:00 (9 time levels)
- Domain: Guangdong-Hong Kong-Macao Greater Bay Area, 3 km resolution, 150x150 grid

**What I have successfully done:**
1. geogrid.exe ran successfully and generated geo_em.d01.nc. I checked and found land_cat = 61, which means the LCZ (Local Climate Zone) data was correctly read.
2. ungrib.exe ran successfully and generated 9 intermediate files (FILE:YYYY-MM-DD_HH). I used the 'strings' command to verify that these files contain the required variables: TT, UU, VV, RH, PSFC.

**The problem:**
When I run metgrid.exe, I get the following error:


**What I have already tried (without success):**
1. Confirmed that the FILE: intermediate files exist in both the current directory and /data
2. Checked the METGRID.TBL configuration (tried both the full version and a minimal version)
3. Confirmed that namelist.wps has fg_name = 'FILE' set correctly
4. Used Vtable.GFS (the standard Vtable for FNL data)
5. Ran metgrid.exe from different directories (/data and /WPS-run)
6. Replaced soft links with physical copies of the FILE: files
7. Tried multiple Docker images (ghcr.io/uomresearchit/wrf-wps and openeuler/wrf)
8. Confirmed that num_metgrid_levels = 34 matches the data

I have spent several days trying different approaches, but I keep getting the same error. I would really appreciate any advice on:
- What usually causes this error code -3?
- Where should I focus my debugging efforts?
- Could this be an issue with the WPS toolchain in the Docker container itself?

I have attached my namelist.wps, the last 50 lines of metgrid.log, and the output of ls -la FILE:* below. Please let me know if you need any additional information.

Thank you very much for your time!

**Attachments:**

1. namelist.wps:
&share
wrf_core = 'ARW',
max_dom = 1,
start_date = '2021-07-23_00:00:00',
end_date = '2021-07-25_00:00:00',
interval_seconds = 21600
io_form_geogrid = 2,
opt_output_from_geogrid_path = './',
debug_level = 0,
/

&geogrid
parent_id = 1,
parent_grid_ratio = 1,
i_parent_start = 1,
j_parent_start = 1,
e_we = 150,
e_sn = 150,
geog_data_res = 'cglc_modis_lcz+default',
geog_data_path = '/geog',
dx = 3000,
dy = 3000,
map_proj = 'lambert',
ref_lat = 22.5,
ref_lon = 114.0,
truelat1 = 22.0,
truelat2 = 24.0,
stand_lon = 114.0,
/

&ungrib
out_format = 'WPS',
prefix = 'FILE',
/

&metgrid
fg_name = 'FILE',
io_form_metgrid = 2,
opt_output_from_metgrid_path = './',
/
2. metgrid.log (last 50 lines):
Processing domain 1 of 1
ERROR: In read_next_field(), got error code -3.
application called MPI_Abort(MPI_COMM_WORLD, 25309) - process 0
[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=25309
:
system msg for write_line failure : Bad file descriptor
3. ls -la FILE:*:
[
-rw-r--r-- 1 root root 51391784 FILE:2021-07-23_00
-rw-r--r-- 1 root root 51391784 FILE:2021-07-23_06
-rw-r--r-- 1 root root 51391784 FILE:2021-07-23_12
-rw-r--r-- 1 root root 51391784 FILE:2021-07-23_18
-rw-r--r-- 1 root root 51391784 FILE:2021-07-24_00
-rw-r--r-- 1 root root 51391784 FILE:2021-07-24_06
-rw-r--r-- 1 root root 51391784 FILE:2021-07-24_12
-rw-r--r-- 1 root root 51391784 FILE:2021-07-24_18
-rw-r--r-- 1 root root 51391784 FILE:2021-07-25_00
]
Thank you again for your help!
 
Your namelist.wps looks fine except that the domain size is too small, With dx=3km and grid numbers of 150x150, the domain size is 45km x 450km. FNL is 1-degree resolution data, which is too coarse to drive a 3km WRF run over the area of 450km x 450km. Please consider using high resolution data such as quarterly degree GFS data and run with nested case, e.g., 9km-3km nesting is better than a single 3km domain.

However, the error message you had should be irrelevant to the domain settings. Please tell me where you download the FNL data. i have run a quick test using FNL data as input, and WPS works just fine. I am suspicious that either your FNL data is problematic, or the WPS codes in Docker somehow are damaged.
 
Back
Top