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

WRF Segmentation Fault during Test Case: compilation/installation error?

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
I am trying to configure & compile WRF 4.0 on my new server (I just left an institution with a lot of resources and an HPC and I’m now sort of on my own here). I’ve searched the forum and reached out to my IS dept multiple times, but nothing I’ve found has worked yet. Basically, I have all of the executables created, ungrib, metgrid, and real.exe run perfectly, wrf.exe segmentation faults every time. I’m not sure where the error lies.

The server is comprised of two CPUs that are Intel Xeon-Gold wit 20 cores each.
I’ve gone through this Configure/Compile wrf walkthrough ( and all of the tests produced the correct output - although for test 2 under Library Compatibility Tests – each of the lines printed 40 times, which I assumed was for each core – perhaps this is in error and one of the libraries is installed incorrectly.

Then I go on to configure and compile wrf. It only creates the executables when I chose option 20 under configure (which is dmpar). I actually think I should be configuring it with 19/smpar, because as I understand it, compiling with serial – one core, SMpar – shared memory parallel (all the cores in a multi-core computer?) and DMpar (distributed memory) – all the cores in every computer of a cluster. But, the compilation does not succeed when I try that one or when I try 21. I have attached the compilation logs for when it works when I choose options 19 and 20.

I went forward with it configured/compiled using option 20 and the executables built and tried the test case study. The first three executables/steps (geogrid.exe, ungrib.exe, real.exe) work totally fine. And then, when I try and run the climate model itself - it segmentation faults every time. Both when I just try and run it just using ‘./wrf.exe’ and when I try and run it on multiple nodes (I’ve used both ‘mpirun –np 2 ./wrf.exe’ and ‘export OMP_NUM_THREADS = 2 / mpirun –np 2 ./wrf.exe’ – both of these might be the incorrect syntax, but regardless it *should* work using use ./wrf.exe). The error and out files are attached. Is there just something wrong in the namelist (last file attached) – this would be the ideal outcome, haha.


  • log19.compile
    631.2 KB · Views: 47
  • log20.compile
    762.3 KB · Views: 51
  • namelist.input
    3.7 KB · Views: 47
  • rsl.error.0000.txt
    352.4 KB · Views: 56
This post has been moved to the wrf.exe section of the forum, as this seems to be more of a running problem, as opposed to a compile problem. Someone will respond to your post soon.
Your namelist.input looks fine.

I am suspicious that this failure is related to settings in your machine. The log file indicates that you built WRF in smpar (openMP) mode. You may need to run wrf.exe using the following commands:

export OMP_NUM_THREADS = 2

Please also set debug_level=0