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

Ungrib.exe not generated after compiling successfully metgrib and geogrid.exe

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.

ssbhaskar0502

New member
==============================================================================================

Version 4.0

Linux hpc-dellr6525-01.amd.com 4.18.0-193.6.3.el8_2.x86_64 #1 SMP Mon Jun 1 20:24:55 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Not sure how to figure out the version of this compiler: flang

==============================================================================================


**** Compiling ungrib ****

( cd src/ngl ; make -i -r DEV_TOP="/home/amd/sharad/sc19setup/sources/WPS" CC="clang" FC="flang" RANLIB="echo" all )
make[1]: Entering directory '/home/amd/sharad/sc19setup/sources/WPS/ungrib/src/ngl'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/amd/sharad/sc19setup/sources/WPS/ungrib/src/ngl'
( cd src ; \
if [ "" = yes ] ; then \
WRF_DIR2=../WRF ; \
else \
WRF_DIR2=/home/amd/sharad/sc19setup/sources/WPS/../WRF ; \
fi ; \
make -i -r ungrib.exe \
WRF_DIR="$WRF_DIR2" \
FC="flang" \
CC="mpicc " \
CPP="/lib/cpp -P -traditional" \
FFLAGS="" \
CFLAGS="-w " \
LDFLAGS="-Mfixed -fopenmp -w -c " \
CPPFLAGS="-D_UNDERSCORE -DBYTESWAP -DIO_NETCDF -DIO_BINARY -DIO_GRIB1 -DBIT32 -D_MPI -D_UNGRIB" )
make[1]: Entering directory '/home/amd/sharad/sc19setup/sources/WPS/ungrib/src'
Makefile:90: warning: overriding recipe for target '.F.o'
../../configure.wps:155: warning: ignoring old recipe for target '.F.o'
Makefile:95: warning: overriding recipe for target '.c.o'
../../configure.wps:147: warning: ignoring old recipe for target '.c.o'
/bin/rm -f ungrib.exe
if [ -z ] ; then \
flang -o ungrib.exe -Mfixed -fopenmp -w -c misc_definitions_module.o debug_cio.o module_debug.o module_stringutil.o table.o module_datarray.o gridinfo.o new_storage.o filelist.o ungrib.o output.o rrpr.o rd_grib1.o file_delete.o datint.o rd_grib2.o \
-L./ngl -lw3 -lg2_4 \
-L/home/amd/sharad/sc19setup/WRFV4/install_jasper/lib -ljasper -lpng -lz -L/home/amd/sharad/sc19setup/WRFV4/install_png/lib -L/home/amd/sharad/sc19setup/WRFV4/install_zlib/lib \
-L. -lpgu ; \
else \
flang -o ungrib.exe -Mfixed -fopenmp -w -c misc_definitions_module.o debug_cio.o module_debug.o module_stringutil.o table.o module_datarray.o gridinfo.o new_storage.o filelist.o ungrib.o output.o rrpr.o rd_grib1.o file_delete.o datint.o rd_grib2.o \
./ngl/w3/libw3.a ./ngl/g2/libg2_4.a \
-L/home/amd/sharad/sc19setup/WRFV4/install_jasper/lib -ljasper -lpng -lz -L/home/amd/sharad/sc19setup/WRFV4/install_png/lib -L/home/amd/sharad/sc19setup/WRFV4/install_zlib/lib \
libpgu.a ; \
fi
make[1]: Leaving directory '/home/amd/sharad/sc19setup/sources/WPS/ungrib/src'
if [ -h ungrib.exe ] ; then \
/bin/rm -f ungrib.exe ; \
fi ; \
if [ -h ../ungrib.exe ] ; then \
/bin/rm -f ../ungrib.exe ; \
fi ; \
if [ -e src/ungrib.exe ] ; then \
ln -sf src/ungrib.exe . ; \
fi
 
I suppose you use LLVM Fortran compiler to install WRF/WPS. Please let me know if I am wrong.
I wonder whether you can take a look at this website: http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compilation_tutorial.php
and try to install WRF/WPS using the standard intel or gnu compiler?
I ask this because we don't use LLVM Fortran compiler and cannot repeat the errors you have, which makes it hard for us to know for sure how to fix the issue.
 
Hi,
I'm having a similar problem, but this time I have clear error message.
It's WRF / WPS 4.2.1 on CentOS 7.9, MPICH 3.4.1, HDF5 1.12.0, NetCDF-C 4.8.0 and NetCDF-Fortran 4.5.3.
The compiler is AMD AOCC 3.0.0, which is based on LLVM 12.
(we're building a cluster based on AMD EPYC, so we'd like to try the AMD compiler).

I've managed to build WRF without problem, and can run single domain tutorial case successfully.
The WPS lacks the ungrib.exe, just like the OP.
The error looks like:

Code:
==============================================================================================
Version 4.2
Linux wrf 3.10.0-1160.25.1.el7.x86_64 #1 SMP Wed Apr 28 21:49:45 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Not sure how to figure out the version of this compiler: flang
==============================================================================================
**** Compiling ungrib ****

( cd src/ngl ; make -i -r DEV_TOP="/home/mike/WPS" CC="clang" FC="flang" RANLIB="echo" all )
make[1]: Entering directory `/home/mike/WPS/ungrib/src/ngl'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/mike/WPS/ungrib/src/ngl'
( cd src ; \
        if [ "" = yes ] ; then \
          WRF_DIR2=../WRF ; \
        else \
          WRF_DIR2=/home/mike/WPS/../WRF ; \
        fi ; \
make -i -r ungrib.exe \
        WRF_DIR="$WRF_DIR2" \
        FC="flang" \
        CC="mpicc" \
        CPP="/lib/cpp -P -traditional" \
        FFLAGS="-Mfree -Mbyteswapio -O" \
        CFLAGS="-O" \
        LDFLAGS="" \
        CPPFLAGS="-D_UNDERSCORE -DBYTESWAP -DLINUX -DIO_NETCDF -DIO_BINARY -DIO_GRIB1 -DBIT32 -D_MPI
-D_UNGRIB" )
make[1]: Entering directory `/home/mike/WPS/ungrib/src'
Makefile:90: warning: overriding recipe for target `.F.o'
../../configure.wps:107: warning: ignoring old recipe for target `.F.o'
Makefile:95: warning: overriding recipe for target `.c.o'
../../configure.wps:99: warning: ignoring old recipe for target `.c.o'
/bin/rm -f ungrib.exe
if [ -z  ] ; then \
                  flang -o ungrib.exe  misc_definitions_module.o debug_cio.o module_debug.o module_stringutil.o table.o module_datarray.o gridinfo.o new_storage.o filelist.o ungrib.o output.o rrpr.o rd_grib1.o file_delete.o datint.o rd_grib2.o  \
                        -L./ngl -lw3 -lg2_4 \
                        -ljasper -lpng -lz \
                        -L. -lpgu ; \
                        else \
                  flang -o ungrib.exe  misc_definitions_module.o debug_cio.o module_debug.o module_stringutil.o table.o module_datarray.o gridinfo.o new_storage.o filelist.o ungrib.o output.o rrpr.o rd_grib1.o file_delete.o datint.o rd_grib2.o  \
                        ./ngl/w3/libw3.a ./ngl/g2/libg2_4.a \
                        -ljasper -lpng -lz \
                        libpgu.a ; \
                        fi
ld.lld: error: duplicate symbol: gbytes_
>>> defined at gbytes.f:1
>>>            gbytes.o:(gbytes_) in archive ./ngl/libw3.a
>>> defined at gbytesc.f:15
>>>            gbytesc.o:(.text+0x40) in archive ./ngl/libg2_4.a
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: [ungrib.exe] Error 1 (ignored)
make[1]: Leaving directory `/home/mike/WPS/ungrib/src'
if [ -h ungrib.exe ] ; then \
        /bin/rm -f ungrib.exe ; \
fi ; \
if [ -h ../ungrib.exe ] ; then \
        /bin/rm -f ../ungrib.exe ; \
fi ; \
if [ -e src/ungrib.exe ] ; then \
        ln -sf src/ungrib.exe . ; \
fi

The error here is "duplicated symbol" while linking the final ungrib.exe.
If I use "-Wl,--allow-multiple-definition" in the LDFLAGS in configure.wps, the ungrib.exe can be created, but is in fact unusable with error:
Code:
ERROR: Grib2 file or date problem, stopping in edition_num.

Note: I build the WRF with option 66, "PGI (clang/flang)" included in the 4.2.1 version, with minimal modification. Don't know about WPS's roadmap on such compiler suite, though.
Note2: The installation of AOCC is very small, easy, and does not need root privileges. Building the NetCDF chain with it can be non-trivial, but I do have some notes that may help.
 
@mikeschen,
Typically if you are able to build the executable, then it has been built correctly. The error message you're getting usually indicates something wrong with either the input file(s), the path to the input file(s), or the namelist date. Can you attach the following?

  • namelist.wps
  • ungrib.log
  • one of your input data files (if it's not too large)
  • Assuming you have completed the ./link_grib.csh step prior to running ungrib, this means you should have some GRIBFILE.xxx files in your WPS directory. Please issue the following command
    Code:
    ls -ls GRIBFILE* >& gribfile.log
    and then attach gribfile.log

Thanks!
 
Hi,
Sorry for the late reply, for my attention has been turned elsewhere :p
Actually it's the 1-domain tutorial case (Hurricane Matthew) on the WRF website.
The same input / namelist was tested with gcc / gfortran and icc / ifort built WPS without problem.
In fact the Intel compiler (21.1) with -march=core-avx2 can produce nice performance on EPYC 7xx2, so we're not sticking to the AMD AOCC, at least for now. :)
 
Top