[Wrf-users] RE: Probelm with ungrib.exe on Mac OS X

Tanamachi, Robin L. rtanamachi at ou.edu
Fri Nov 7 11:35:38 MST 2008


I had a similar problem building WPSV2 on Mac OS X (Leopard) using ifort and gcc.

ungrib requires the g2 and w3 libraries in order to handle GRIB2 files. These libraries are built inside the directory ${WPS}/ungrib/src/ngl.
For some reason, if you have to build the g2 and w3 libraries more than once, all files ending in .F (e.g., addfield.F) are deleted (possibly by the "clean" rules in the Makefiles. I have yet to pinpoint exactly why this is!). Since the *.F files don't exist, they don't get compiled, they don't get put into libg2_4.a and libw3.a, these two libraries are not built, and the compilation of ungrib.exe fails.

My solution was to download and build the g2 and w3 libraries separately (i.e. external to WPS); they are available from http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2/
Note that I still had the problem with disappearing .F files when building these two libraries more than once. Save the tarballs in case you need to manually replace any of the .F files.

Also, since I was using the Intel Fortran compiler, I had to set DEFS=-DLINUX. It looks like you're using g95, so you may not have to change the default DEFS=-DLINUXG95.

I installed the g2 and w3 libraries in my /usr/local/ directory. I then altered ${WPS}/ungrib/src/ngl/Makefile so that the rules pertaining to these libraries read as follows:

***** Snip *****
w3/libw3.a :
#       ( cd w3 ; $(MAKE) DEV_TOP="${DEV_TOP}" all ; $(RANLIB) libw3.a )
#       $(LN) w3/libw3.a .
        $(LN) /usr/local/w3lib/lib/libw3.a .

g2/libg2_4.a :
#       ( cd g2 ; $(MAKE) DEV_TOP="$(DEV_TOP)" all ; $(RANLIB) libg2_4.a )
#       $(LN) g2/libg2_4.a .
        $(LN) /usr/local/g2lib/lib/libg2.a libg2_4.a
***** Snip *****
You may have to alter the paths depending on where you install these libraries on your system.

Alternatively, if you won't be using GRIB2, you can simply reconfigure your build of WPS to build without.

I hope this helps!

Robin Tanamachi, KC0BSC
Graduate Research Assistant
OU School of Meteorology
National Weather Center
120 David L. Boren Blvd., Suite 5355
Norman, OK 73072-7307
405-325-1935

"The reward of the young scientist is the emotional thrill of being the first person in the history of the world to see something or to understand something... The reward of the old scientist is the sense of having seen a vague sketch grow into a masterly landscape." -- Cecilia Payne-Gaposchkin
________________________________________

Date: Mon, 3 Nov 2008 10:02:23 -0500
From: "John Krasting" <krasting at gmail.com>
Subject: [Wrf-users] Probelm with ungrib.exe on Mac OS X
To: wrf-users at ucar.edu
Message-ID:
        <640db780811030702g2ffa1d83t9e2c1872f09c6fa2 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

***** Snip *****

gcc -c -g -D_DOUBLEUNDERSCORE -DBYTESWAP -DIO_NETCDF -DBIT32 -DMACOS   mova2i.c
/bin/rm -f libg2_4.a
ar ru  libg2_4.a gridtemplates.o pdstemplates.o drstemplates.o gribmod.o realloc.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 archive libg2_4.a
ranlib libg2_4.a
ranlib: can't open file: g2/libg2_4.a (No such file or directory)
make[1]: [g2/libg2_4.a] Error 1 (ignored)

***** Snip *****


More information about the Wrf-users mailing list