Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

(RESOLVED) metgrid.exe fortran runtime error: End of file

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.


New member
Hi, i'm new on WRF and WPS. Today i've finished install and compile everything and i try to do a forecast. I've modified the namelist, which will be not perfect because it's my first work on wrf. Geogrid and ungrid goes well, but when i run metgrid.exe there is a fortran runtime error:

At line 109 of file gridinfo_module.f90 (unit = 10, file = 'namelist.wps')
Fortran runtime error: End of file

Error termination. Backtrace:
#0 0x7fdd300edcd1 in ???
#1 0x7fdd300ee819 in ???
#2 0x7fdd300ef4ef in ???
#3 0x7fdd3032fb3b in ???
#4 0x7fdd30330dec in ???
#5 0x7fdd3033395e in ???
#6 0x7fdd30333bcc in ???
#7 0x7fdd30333d27 in ???
#8 0x561a62bd7623 in ???
#9 0x561a62bd9e24 in ???
#10 0x7fdd2fd990b2 in ???
#11 0x561a62bd534d in ???
#12 0xffffffffffffffff in ???

I attach you also the namelist.wps and the gridinfo_module.f90 (i've never modified it).View attachment namelist.wpsView attachment gridinfo_module.f90View attachment metgrid.log
Hi, during the time between i wrote this topic and the moderator approved It i found some error in namelist.wps and now metgrid.exe Is running well
could you please desribe how you solved the problem? I do have the same problem with the nameslist.wps below. I will appreciate any help a lot!

wrf_core = 'ARW'
max_dom = 1,
start_date = '2021-07-01_01:00:00',
end_date = '2021-07-01_02:00:00',
interval_seconds = 3600,
io_form_geogrid = 2,
opt_output_from_geogrid_path = '/home/s4300795/wrf/WPS-4.3.1/',

parent_id = 1,
parent_grid_ratio = 1,
i_parent_start = 1,
j_parent_start = 1,
e_we = 200,
e_sn = 200,
geog_data_res = 'default',
dx = 9000,
dy = 9000,
map_proj = 'lambert',
ref_lat = 50.30,
ref_lon = 14.00,
truelat1 = 50.30,
truelat2 = 50.30,
stand_lon = 14.00,
geog_data_path = '/home/s4300795/wrf/Bautzen/WPS_GEOG',

out_format = 'WPS',
prefix = 'ERA5_PL',

fg_name = 'ERA5_PL',
io_form_metgrid = 2,
@Lena Muller,
Can you attach the metgrid.log file so I can see the error message you're getting? Please also attach the ungrib.log and geogrid.log so I can look at those, as well. Thanks!
Hello, I am facing same problem. Can somebody help me? I am attaching namelist.wps, geogrid, ungrib and metgrid.logs.


  • namelist.wps
    801 bytes · Views: 37
  • 1geo.log
    6.8 KB · Views: 12
  • 2ungrib.log
    78.4 KB · Views: 10
  • 3metgrid.log
    486 bytes · Views: 25
I'm honestly not sure what could be causing this problem. It typically occurs when there is something missing from your namelist (for e.g., a &metgrid section, or the "/" after the section), but that doesn't seem to be the case with your namelist. I even ran a test using the file you sent and I'm not getting any errors.

1) Did you make any modifications to your WPS code?
2) Are you absolutely certain the namelist.wps file you sent is the one in your WPS running directory?

If you answer "no, yes" to the above questions, I know this sounds silly, but can you try to just recompile WPS (maybe in a clean directory) and try running it again to see if you can get past the error? If that doesn't work, please attach the file "gridinfo_module.f90" from inside WPS/metgrid/src, as that's the file the error message refers to.

At line 109 of file gridinfo_module.f90 (unit = 10, file = 'namelist.wps')
Fortran runtime error: End of file

Hello Kwerner,
thanks for your prompt answer.
I just solved my issue. My WPS was not generating met_em.d01*** files before. I recompiled WPS and found them and it was successful at the end.

Thanks once again