Re: how to get a real fortran file
- To: mathgroup at smc.vnet.net
- Subject: [mg37391] Re: how to get a real fortran file
- From: uhap023 at alpha1.rhbnc.ac.uk (Tom Crane)
- Date: Sat, 26 Oct 2002 02:03:25 -0400 (EDT)
- Organization: Dept. Physics, Royal Holloway, University of London
- References: <ap865o$53p$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <ap865o$53p$1 at smc.vnet.net>, Alessandro Agresti <alessandro.agresti at unifi.it> 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 www.mathsource.com/MathSource/Enhancements/Interfacing/Fortran/0202-172/FortranDef.nb) 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. Tom. posted & emailed. -- Tom Crane, Dept. Physics, Royal Holloway, University of London, Egham Hill, Egham, Surrey, TW20 0EX, England. Email: uhap023 at vms.rhbnc.ac.uk SPAN: 19.875 Fax: +44 (0) 1784 472794