Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!ogicse!usenet!thyphy.physics.orst.edu!ghe From: ghe@physics.orst.edu (Guangliang He) Newsgroups: comp.lang.fortran Subject: Re: Tools for porting fortran? Message-ID: <1991Feb18.210719.4763@lynx.CS.ORST.EDU> Date: 18 Feb 91 21:07:19 GMT References: <91044.104254AMB@SLACVM.SLAC.STANFORD.EDU> <23175@well.sf.ca.us> Sender: @lynx.CS.ORST.EDU Reply-To: ghe@physics.orst.edu Organization: Dept. of Physics, Oregon State University Lines: 21 Nntp-Posting-Host: thyphy.physics.orst.edu In article <23175@well.sf.ca.us>, rchrd@well.sf.ca.us (Richard Friedman) writes: |> AMB@SLACVM.SLAC.STANFORD.EDU writes: |> |> >In C, there are compiler directives (#if, #else, etc) for this. |> >Anyone have a method, or commercial product, for doing this to fortran? |> |> On most systems the C preprocessor can be called directly (cpp ...), |> to give the same functionality for fortran. For example, on Cray UNICOS: |> |> cpp -P small_mdl.fig source.f > source.x.f |> cf77 -o myprog source.x.f [some text deleted here] On most unix workstation I've used (Sys V and BSD), f77 compiler support the cpp directives. You have to name your FORTRAN file file.F, notice the capital F. f77 will compile the .F file direct to .o then a.out. There is also a option in f77 to let you create .f file (After precessed by cpp). I find that it is very nice feature. Guangliang He ghe@physics.orst.edu