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

volz volz at aeff.uaa.alaska.edu
Mon Feb 2 14:15:49 MST 2009


I am using g95 on Intel Mac OS X.

I found that if I compile WPS a second time after replacing ungrib/src files with pristine sources, I will then be 
able to compile ungrib.exe.

 FIrst I compile WPS, this makes metgrid.exe and geogrid.exe.
 Second I overwrite WPS/ungrib/src with pristine sources.
 Then compile a second time and I have all three executables.

See if this makes sense:

kobuk:tmp ruser$ pwd
/Users/ruser/build/wrf_build/tmp
kobuk:tmp ruser$  ls ../
WPS		WPSV3.0.1.TAR	WRFV3		geog.tar	tmp
kobuk:tmp ruser$ cp -r WPS/ungrib/src ../WPS/ungrib/
kobuk:tmp ruser$ cd ../WPS
kobuk:WPS ruser$ ./compile


--
Karl Volz
(907) 786-7235
volz at aeff.uaa.alaska.edu


Thomas Nehrkorn tnehrkor at aer.com 
Fri Nov 7 12:30:28 MST 2008
Previous message: [Wrf-users] RE: Probelm with ungrib.exe on Mac OS X
Next message: [Wrf-users] Re: Compiling WRFV3 on i686 - module_dm.o fails
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Robin,

I think your .F problem stems from the fact that on the Mac, filenames 
that only differ in case are not unique.  Here is a simple demonstration:

=== On a Unix filesystem:
  funnel[36]% date | tee Today.txt
  Fri Nov  7 14:22:57 EST 2008
  funnel[37]% date | tee today.txt
  Fri Nov  7 14:23:10 EST 2008
  funnel[39]% cat Today.txt
  Fri Nov  7 14:22:57 EST 2008
  funnel[40]% cat today.txt
  Fri Nov  7 14:23:10 EST 2008
=== On a Mac filsystem:
  funnel[41]% cd ~/Documents/junk/
  funnel[42]% date | tee Today.txt
  Fri Nov  7 14:23:58 EST 2008
  funnel[43]% date | tee today.txt
  Fri Nov  7 14:24:01 EST 2008
  funnel[44]% cat Today.txt
  Fri Nov  7 14:24:01 EST 2008
  funnel[45]% cat today.txt
  Fri Nov  7 14:24:01 EST 2008


Thomas


Tanamachi, Robin L. wrote:
> 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