Articles with tag WPS

Problem

Previously, to use WPS on NSCC to prepare MPAS’s Initial Condition (IC), I would use

module load wps
module load wrf
cp -r /app/apps/wps <RELEVANT_PATH>

Today, on a new account on the NSCC system, using the commands above, WPS's ungrib.exe didn’t work on the first try and returned an error:

 Name of source model =>ECMWF
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source
ungrib.exe         000000000047B4CA  for__signal_handl     Unknown  Unknown
libpthread-2.28.s  00007F0BFCDC8B20  Unknown               Unknown  Unknown
ungrib.exe         0000000000420BA8  Unknown               Unknown  Unknown
ungrib.exe         0000000000413103  Unknown               Unknown  Unknown
ungrib.exe         000000000040BEA2  Unknown               Unknown  Unknown
libc-2.28.so       00007F0BFC692493  __libc_start_main     Unknown  Unknown
ungrib.exe         000000000040BDAE  Unknown               Unknown  Unknown

Checking the directory, all the PFILES have been generated. So ungrib has gone through the GRIB files at least once. It seems the 'integration' part went wrong.

Solution

The solution is to

  1. Load wps only (version 3.9.1-b2), and also load mkl/2024.0.

The system used to prompt the user to load mkl but not anymore. So I tried manually loading it.

module load wps
# module load wrf
module load mkl/2024.0
  1. Add some common memory hacks (for the new environment)

As I am running using a new account that hasn’t run MPAS/WRF before, I also tried adding these lines to .bashrc :

ulimit -s unlimited           # help prevent stack overflow
export MALLOC_CHECK_=0

After applying the above changes, ungrib.exe ran successfully.

It is still unclear which modification was strictly necessary; further testing would be required to isolate the exact cause.

Tags

WPS, ungrib, SIGSEGV, segmentation fault, MPAS IC

Published on 2025/08/25
Originally finished on 2024/10/01

TL;DR: Use the existing modules on NSCC.

Note: NSCC is a local supercomputer. If your supercomputer does not have wps out-of-the-box or as a module, you might need to download and build it.

Get WPS

Don’t rebuild the wheel.

module load wps
module load wrf
cp -r /app/apps/wps <RELEVANT_PATH>

Then edit the namelist file.

For Vtable, refer to this website: WRF - Free Data.

Use WPS

First, use link_grib followed by grib files. It will generate files like GRIBFILE.AAA.

Then, edit the namelist.wps accordingly. Mainly, look for the start and end datetime and the file interval, and also the filename prefix in the &ungrib section.

Then, use ungrib.exe. If it complains, fix according to the error prompt.

ungrib.exe will look into GRIBFILES one by one and try to extract useful fields. Since not all GRIBFILE might be relevant, it is normal to see empty lines, something like

Inventory for date = 20XX-XX-XX XX:00:00

PRES   GEOPT    HGT      TT       UU       VV       RH       DEWPT    LANDSEA  SOILGEO  SOILHGT  PSFC     PMSL     SKINTEMP SEAICE   SST      SNOW_DEN SNOW_EC  SNOW     SNOWH    ST000007 ST007028 ST028100 ST100289 SM000007 SM007028 SM028100 SM100289
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------