simple FORTRAN code for GEMPAK that fails on 64-bit Linux machines
David Ovens
ovens at atmos.washington.edu
Wed Apr 25 11:26:39 MDT 2007
Gembuds,
It turns out that g77 is storing these real functions as real*8 under
64-bit Linux systems. There are two work-around solutions:
1) explicitly declare the pr_sped (or any such GEMPAK function) you
are using as real*8, e.g.,
program test
real*8 pr_sped
call in_bdta(iret)
u = 5
v = 4
spd = pr_sped(u,v)
print *,'spd = ',spd
stop
end
This works for 64-bit ifort on the 64-bit Linux machines that have
used 64-bit g77/gcc to compile the GEMPAK libraries. So the
compile sequence looks like:
source /usr/local/intel/fce/9.0/bin/ifortvars.csh # 64-bit ifort
setenv GEMLIB /gemdir/NAWIPS-5.9.4/os/linux64/lib # 64-bit GEMLIB
ifort test.f $GEMLIB/gemlib.a -lg2c
2) use 32-bit ifort, 32-bit g2c, and 32-bit GEMPAK libraries. On a
64-bit RedHat box this was accomplished this way:
source /usr/local/intel/fc/9.0/bin/ifortvars.csh # note fc not fce
setenv GEMLIB /gemdir/NAWIPS-5.9.4/os/linux/lib # note linux not linux64
ifort test.f $GEMLIB/gemlib.a \
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/32/libg2c.a # note /32/libg2c.a
Another possible solution is to build GEMPAK with ifort. We have
managed to do this in the past, but have found that a handful of
programs are fouled up.
Thanks to Harry Edmon for figuring this out.
David
--
David Ovens e-mail: ovens at atmos.washington.edu
Research Meteorologist phone: (206) 685-8108
Dept of Atm. Sciences plan: Real-time MM5 forecasting for the
Box 351640 Pacific Northwest
University of Washington http://www.atmos.washington.edu/mm5rt
Seattle, WA 98195 Weather Graphics and Loops
http://www.atmos.washington.edu/~ovens/loops
On Tue, Apr 24, 2007 at 10:16:37PM -0700, David Ovens wrote:
> Gembuds,
>
> I guess this must be an 'ifort' problem because I just figured out how
> to compile this on 64-bit machines with 'g77' and it works!
> g77 -fno-second-underscore test.f $GEMLIB/gemlib.a;a.out
> spd = 6.40312433
>
> Still, can anyone get 'ifort' to work on this code on a 64-bit Linux
> box?
>
> David
> --
> David Ovens e-mail: ovens at atmos.washington.edu
> Research Meteorologist phone: (206) 685-8108
> Dept of Atm. Sciences plan: Real-time MM5 forecasting for the
> Box 351640 Pacific Northwest
> University of Washington http://www.atmos.washington.edu/mm5rt
> Seattle, WA 98195 Weather Graphics and Loops
> http://www.atmos.washington.edu/~ovens/loops
>
>
> On Tue, Apr 24, 2007 at 10:09:07PM -0700, David Ovens wrote:
> > Gembuds,
> >
> > I have this incredibly simple FORTAN code, test.f, that works fine on
> > 32-bit Linux machines with any version of GEMPAK, but that fails
> > miserably on all of my 64-bit Linux machines with any version of
> > GEMPAK (I've tried 5.9.4 and 5.8.3ag3 specially built for 64-bit). I
> > am curious if anyone out there can successfully run this on a 64-bit
> > Linux machine. And, if you can, please share your
> > $NAWIPS/config/Makefile.linux.
> >
> > Code test.f:
> > program test
> > call in_bdta(iret)
> > u = 5
> > v = 4
> > spd = pr_sped(u,v)
> > print *,'spd = ',spd
> > stop
> > end
> >
> > Compile and run:
> > ifort test.f $GEMLIB/gemlib.a -lg2c; a.out
> >
> > Correct answer:
> > spd = 6.403124
> >
> > 64-bit Linux box answer:
> > spd = -1.0842022E-19
>
More information about the gembud
mailing list