MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: how to get a real fortran file

In article <ap865o$53p$1 at>, Alessandro Agresti <alessandro.agresti at> writes:
> the cmd FortranForm[expr] writes out expr for fortran.
> Can I also get the real fortran file, the file that it will be going to be compiled. so the file begins at 
> 7-th column and ends at 72-th........

I thought FortranForm[] did this and inserted the necessary column-6
continuation markers. IIRC, FortranForm[expr] > myfile.f can require some
simple post-editing to comply with fortran's columnar formatting rules.

If your expression is at all complicated, it might be worth looking at 
FortranDef (Available from

It optimises the expression for fortran compilation and produces nicely
formatted O/P. It is intended for use (with compilation) on Unix systems but
works fine at generating a fortran O/P file under Windows.


posted & emailed.
Tom Crane, Dept. Physics, Royal Holloway, University of London, Egham Hill,
Egham, Surrey, TW20 0EX, England. 
Email:	uhap023 at
SPAN:   19.875
Fax:    +44 (0) 1784 472794

  • Prev by Date: Re: To plot solutions, FindRoot as a function
  • Next by Date: Re: HelpBrowser Mathematica Book 1.8.3 on Linux
  • Previous by thread: Re: how to get a real fortran file
  • Next by thread: Re: how to get a real fortran file