Re: New user of Mathematica (FORTRAN related question)
- To: mathgroup at smc.vnet.net
- Subject: [mg30895] Re: New user of Mathematica (FORTRAN related question)
- From: uhap023 at alpha1.rhbnc.ac.uk (Tom Crane)
- Date: Sun, 23 Sep 2001 02:16:36 -0400 (EDT)
- Organization: Dept. Physics, Royal Holloway, University of London
- References: <9oesql$ijb$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <9oesql$ijb$1 at smc.vnet.net>, Jorge Luis LLanio Trujillo <jolla at taurus.ci.uc.pt> writes: > > > Dear all, i have some questions to ask > > Q1: How to force mathematica to write to my output file file.f > FORTRAN-compliant 72-character lines and also a continuation mark (* > for example) in the 6 columns? It seems to me that FortranForm[] > produce very bad fortran syntaxis. > I need to compile this file after using MATHEMATICA ( f77 Digital > Unix) > > I mean, > > FortranForm[D[f,x1,x2]] >> file.f > > The file file.f gives me a bunch of compilation errors. It is hard to say without a segment of the .f file and the associated compiler errors. FortranForm should put in continuation chars for column 6. They might appear shifted further to the right in the Mathematica output, in the notebook anyway. This confused me before - have another look. One problem I have noticed with FortranForm is that, on very long expressions, it puts many continuations lines - more than 19 which is the limit with some compilers. Much nicer, optimised Fortran is produced by the FortranDef program available on Mathsource. Hope this help. Tom. CCed: to jolla at taurus.ci.uc.pt. -- 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