home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / fortran / 5211 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  2.8 KB

  1. Path: sparky!uunet!charon.amdahl.com!amdahl!rtech!pacbell.com!sgiblab!spool.mu.edu!agate!ames!elroy.jpl.nasa.gov!nntp-server.caltech.edu!almach.caltech.edu!shoppa
  2. From: shoppa@almach.caltech.edu (TIM SHOPPA)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Re: compiling FORTRAN IV on Unix f77
  5. Date: 27 Jan 1993 11:45 PST
  6. Organization: California Institute of Technology
  7. Lines: 44
  8. Distribution: world
  9. Message-ID: <27JAN199311453903@almach.caltech.edu>
  10. References: <1k6e6cINNmqo@bigboote.WPI.EDU>
  11. NNTP-Posting-Host: almach.caltech.edu
  12. News-Software: VAX/VMS VNEWS 1.41    
  13.  
  14. In article <1k6e6cINNmqo@bigboote.WPI.EDU>, bugsy@yoyodyne.WPI.EDU (Christopher Sean Moran) writes...
  15. >Help me... I have a program called VORLAX which I need to compile.
  16. >It was written and compiled originally on CDC FORTRAN IV.  All
  17. >I have access to is Unix f77.  I have tried to compile it, but
  18. >its a no go.  One problem is the first line
  19. >PROGRAM VORLAX(INPUT,OUTPUT, etc)
  20. >the compiler doesnt like the parenthesis after the program 
  21. >declaration.  Past that there are no other problems.
  22. >I do get an executable after compiling if I take the stuff
  23. >in the parenthesis out. But UNIX dumps my core every time
  24. >I run the program.  Can anyone help me?
  25.     Well, there is no problem with removing the stuff in the
  26. parentheses.  Just be aware that it is a sign that the original Fortran
  27. very likely didn't use OPEN statements to open the files used.  Most
  28. UNIX Fortrans are a little more picky about OPENs being required.
  29.     Core Dumps?  Well, this again is the Unix compiler being a little
  30. more picky.  99% of the time when I have this problem (porting VAX Fortran
  31. to a HP-UX platform) it is because of a "type mismatch" in function
  32. or subroutine parameter passing.  In particular, on a VAX you can often
  33. get away with passing a REAL*4 to a subroutine expecting a REAL*8 and
  34. actually have a working program.  But it will do a core-dump on HP-UX just
  35. about every time.  Another thing is that passing an integer "0" when a
  36. subroutine expects a floating "0.0" (or "0d0") will usually work on
  37. a VAX but also does core dumps on HP-UX.  Lots of old code did things like
  38. this and often worked, even though they technically are bugs in the
  39. source code!
  40.     An important thing to note is that most NON-UNIX FORTRANS ASSUME
  41. STATIC VARIABLE STORAGE IN SUBROUTINES, while UNIX FORTRANS USUALLY
  42. ASSUME DYNAMIC STORAGE.  Check the manual for your compiler to see if you
  43. can set it to default to static storage with a compilation switch.  The
  44. alternative is to put a STATIC statement at the beginning of every
  45. function or subroutine.
  46.     A useful package for finding things like this is "FLINT", which
  47. unfortunately is not (as far as I know) a public-domain program.  It's like
  48. C's "lint", but instead for Fortran.  Does anyone know of a similar
  49. product which *is* public-domain?
  50.  
  51.  
  52.                 Good luck!
  53.  
  54.                 Tim (shoppa@erin.caltech.edu)
  55.