ungrib.exe cannot be compiled

All things involving the setup (compiling, NetCDF, etc.) of the WRF Model itself.

ungrib.exe cannot be compiled

Postby yongsua95 » Sun Aug 20, 2017 12:26 am

Hi, I have been working very hard to compile WRF for more than dozen of hours. It is really a disappointing progress. I have successfully compiled WRF, but I have problem compiling ungrib.exe for WPS (No problem for metgrid and geogrid).


**** Compiling ungrib ****

( cd src/ngl ; make -i -r DEV_TOP="/home/sua/WPS" CC="gcc" FC="gfortran" RANLIB="ranlib" all )
make[1]: Entering directory `/home/sua/WPS/ungrib/src/ngl'
( cd g2 ; make -i -r DEV_TOP="/home/sua/WPS" all ; ranlib libg2_4.a )
make[2]: Entering directory `/home/sua/WPS/ungrib/src/ngl/g2'
Makefile:67: warning: overriding commands for target `.F.o'
/home/sua/WPS/configure.wps:104: warning: ignoring old commands for target `.F.o'
Makefile:72: warning: overriding commands for target `.f.o'
/home/sua/WPS/configure.wps:100: warning: ignoring old commands for target `.f.o'
Makefile:75: warning: overriding commands for target `.c.o'
/home/sua/WPS/configure.wps:96: warning: ignoring old commands for target `.c.o'
gfortran -c -ffixed-form -O -fconvert=big-endian -frecord-marker=4 intmath.f
intmath.f:91.35:

if(iand(i,Z'FFFFFFFF00000000')/=0) then
1
Error: Integer too big for integer kind 8 at (1)
intmath.f:95.9:

endif
1
Error: Expecting END FUNCTION statement at (1)
make[2]: [intmath.o] Error 1 (ignored)
gfortran -c -ffixed-form -O -fconvert=big-endian -frecord-marker=4 simpack.f
simpack.f:56.9:

use intmath
1
Fatal Error: Can't open module file 'intmath.mod' for reading at (1): No such file or directory
make[2]: [simpack.o] Error 1 (ignored)
gfortran -c -ffixed-form -O -fconvert=big-endian -frecord-marker=4 compack.f
compack.f:58.9:

use intmath
1
Fatal Error: Can't open module file 'intmath.mod' for reading at (1): No such file or directory
make[2]: [compack.o] Error 1 (ignored)
gfortran -c -ffixed-form -O -fconvert=big-endian -frecord-marker=4 misspack.f
misspack.f:61.9:

use intmath
1
Fatal Error: Can't open module file 'intmath.mod' for reading at (1): No such file or directory
make[2]: [misspack.o] Error 1 (ignored)
gcc -c -D_UNDERSCORE -DBYTESWAP -DLINUX -DIO_NETCDF -DBIT32 -DNO_SIGNAL -I/usr/local -DUSE_JPEG2000 -DUSE_PNG -D__64BIT__ enc_jpeg2000.c
enc_jpeg2000.c: In function ‘enc_jpeg2000_’:
enc_jpeg2000.c:141:10: error: ‘jas_image_t’ has no member named ‘inmem_’
image.inmem_=1;
^
make[2]: [enc_jpeg2000.o] Error 1 (ignored)
/bin/rm -f libg2_4.a
ar ru libg2_4.a gridtemplates.o pdstemplates.o drstemplates.o gribmod.o realloc.o intmath.o addfield.o addgrid.o addlocal.o getfield.o gb_info.o gf_getfld.o gf_free.o gf_unpack1.o gf_unpack2.o gf_unpack3.o gf_unpack4.o gf_unpack5.o gf_unpack6.o gf_unpack7.o gettemplates.o getlocal.o getdim.o getpoly.o gribcreate.o gribend.o gribinfo.o mkieee.o rdieee.o simpack.o simunpack.o cmplxpack.o compack.o misspack.o pack_gp.o reduce.o comunpack.o specpack.o specunpack.o jpcpack.o jpcunpack.o enc_jpeg2000.o dec_jpeg2000.o pngpack.o pngunpack.o enc_png.o dec_png.o gbytesc.o skgb.o ixgb2.o getidx.o getg2i.o getg2ir.o getgb2s.o getgb2r.o getgb2l.o getgb2.o getgb2p.o getgb2rp.o putgb2.o g2grids.o gdt2gds.o params.o params_ecmwf.o mova2i.o
ar: creating libg2_4.a
ar: intmath.o: No such file or directory
make[2]: [libg2_4.a] Error 1 (ignored)
ranlib libg2_4.a
ranlib: 'libg2_4.a': No such file
make[2]: [libg2_4.a] Error 1 (ignored)
make[2]: Leaving directory `/home/sua/WPS/ungrib/src/ngl/g2'
ranlib: 'libg2_4.a': No such file
make[1]: [g2/libg2_4.a] Error 1 (ignored)
ln -sf g2/libg2_4.a .
make[1]: Leaving directory `/home/sua/WPS/ungrib/src/ngl'
( cd src ; \
if [ "" = yes ] ; then \
WRF_DIR2=../WRFV3 ; \
else \
WRF_DIR2=/home/sua/WPS/../WRFV3 ; \
fi ; \
make -i -r ungrib.exe \
WRF_DIR="$WRF_DIR2" \
FC="gfortran" \
CC="gcc" \
CPP="/usr/bin/cpp -P -traditional" \
FFLAGS="-ffree-form -O -fconvert=big-endian -frecord-marker=4" \
CFLAGS="" \
LDFLAGS="" \
CPPFLAGS="-D_UNDERSCORE -DBYTESWAP -DLINUX -DIO_NETCDF -DBIT32 -DNO_SIGNAL -D_UNGRIB" )
make[1]: Entering directory `/home/sua/WPS/ungrib/src'
Makefile:90: warning: overriding commands for target `.F.o'
../../configure.wps:104: warning: ignoring old commands for target `.F.o'
Makefile:95: warning: overriding commands for target `.c.o'
../../configure.wps:96: warning: ignoring old commands for target `.c.o'
/bin/rm -f ungrib.exe
if [ -z ] ; then \
gfortran -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 \
-L/usr/local -ljasper -lpng -lz \
-L. -lpgu ; \
else \
gfortran -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 \
-L/usr/local -ljasper -lpng -lz \
libpgu.a ; \
fi
/usr/bin/ld: cannot find -lg2_4
collect2: error: ld returned 1 exit status
make[1]: [ungrib.exe] Error 1 (ignored)
make[1]: Leaving directory `/home/sua/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
yongsua95
 
Posts: 1
Joined: Sun Aug 20, 2017 12:20 am

Re: ungrib.exe cannot be compiled

Postby wefoust » Thu Oct 05, 2017 1:51 pm

Hi,
I encountered the same problem with Ungrib but I was able to succfully able to compile and run it with a bit of modification to the intmath.f file. These are the steps I took to circumvent the error.

-Go to the ‘WPS/ungrib/src/ngl/g2′ directory and open the intmath.f file. (you may need to change the file permissions to open it)

-Go to line 91 and edit the line
“if(iand(i,Z’FFFFFFFF0000000’)/=0) then”
such that you simply remove a 0 from the 0000000 string.

I was surprised this worked, but simply removing a zero seemed to do the trick. This is a “quick fix” as it simply reduces the integers that are passed along. I will look into this further, so that I can provide more details as to what the actual problem is, and why this solution works.

~Eliott
wefoust
 
Posts: 1
Joined: Mon May 29, 2017 1:51 am

Re: ungrib.exe cannot be compiled

Postby kdeblois » Fri Oct 20, 2017 9:37 am

Yes, it worked! Thanks very much. Do you know if this is going to be fixed?
Kees
kdeblois
 
Posts: 8
Joined: Tue Jan 29, 2013 4:51 am


Return to Installation

Who is online

Users browsing this forum: Google [Bot] and 6 guests