Related articles |
---|
f77 on SUN vs. on HPRISC'S khire@cae.wisc.edu (1994-12-03) |
Re: f77 on SUN vs. on HPRISC'S przemek@rrdjazz.nist.gov (1994-12-05) |
Re: f77 on Sun vs. on HPRISC's harrist@hsd.utc.com (1994-12-07) |
Re: f77 on SUN vs. on HPRISC'S adams@fb0431.mathematik.th-darmstadt.de (1994-12-14) |
Re: f77 on Sun vs. on HPRISC's jan@neuroinformatik.ruhr-uni-bochum.de (1994-12-16) |
Re: f77 on Sun vs. on HPRISC's shankar@sgi.com (1994-12-21) |
Newsgroups: | comp.compilers,comp.lang.fortran |
From: | przemek@rrdjazz.nist.gov (Przemek Klosowski) |
Keywords: | Fortran |
Organization: | U. of Maryland/NIST |
References: | 94-12-034 |
Date: | Mon, 5 Dec 1994 17:36:48 GMT |
khire@cae.wisc.edu (Milind Khire) writes:
I have a FORTRAN code originally written for VAX-VMS, but it is
compatible with SUN UNIX. But if I try to run it on HPRISC's it compiles
fine but gives me completely garbage numbers in output. If anyone
I don't know the exact differences, but few Fortran-specific gotchas are
worth looking for:
- static vs. dynamic local variables (i.e. in F77 you need to
to explicitly SAVE variables to preserve their value between calls
- ditto, for the values of uninitialized variables (zero for static
locals, garbage for dynamic locals)
- alignment of variables in common blocks (i.e. in "common /c/ a(10),b(10)"
it may or may not hold that a(11) = b(1) ).
Unfortunately, dusty-deck VAX Fortran code tend to make these assumptions.
My favorite way of debugging such code is to run the same program under
debugger in both environment, and look where discrepancies start to show up.
Some compilers have various switches that make them more conformant
to VAX Fortran quirks: for example -static or -vms.
--
przemek klosowski (przemek@rrdstrad.nist.gov)
Reactor Division (bldg. 235), E111
National Institute of Standards and Technology
Gaithersburg, MD 20899, USA
(301) 975 6249
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.