Skip to main content

skip to main content

developerWorks  >  Linux  >

Server clinic: Fortran, at home on Linux

Linux is hospitable for legacy applications

developerWorks
Document options

Document options requiring JavaScript are not displayed


New site feature

Check out our new article design and features. Tell us what you think.


Rate this page

Help us improve this content


Level: Introductory

Cameron Laird (claird@phaseit.net), Vice president, Phaseit, Inc.

19 Mar 2003

Many Fortran-oriented developers find a happy home with Linux. Along with new development and porting, a surprising amount of this work involves legacy applications, some over thirty-five years old.

Is your company paying onerous license and support fees for the hardware and software needed to run old Fortran programs, along with special electrical power and ventilation that vintage minicomputers often require? Start the experiment of relocating those programs to Linux servers, and see how much you can slash those expenses while improving the applications' performance or usefulness.

Linux also hosts plenty of new Fortran-based work -- more than you probably realize. Language arguments among Linux programmers typically involve such fashionable alternatives as Java, Python, C++, or even C#. Given this, it might surprise you how much useful work is done with languages first invented at the end of the '50s: Cobol, Fortran, and Lisp.

Fortran, in particular, has found a happy home under Linux. This month's "Server clinic" sketches what you should know about the importance of Fortran on Linux, and how to learn more.

Linux to the rescue

Don't think that involvement with Fortran necessarily means a look backward. There's plenty of action around Fortran, with drafting of a new Fortran2000 standard by the international J3 committee, interesting progress on compiler engineering, and a wealth of new applications begun each year. Anecdotes suggest that Linux hosts an increasing fraction of new development; Fortran and Linux often come together on high-performance science-oriented clusters, for example. The Linux4chemistry catalogue, among most similar ones in science and engineering, features many Fortran-coded programs. Programmer familiarity and Fortran's performance advantages over C make it a continuing favorite among technical programmers.

Less visible but arguably more interesting, though, is Linux's contribution to legacy applications. An immense accumulation of Fortran-coded "workhorse" programs, some of them up to thirty-five years old, support daily operations in businesses and laboratories around the world. In some circles, the association of "legacy" is only with the Y2K bubble. There's far more to it than that, though; thousands of Fortran-coded programs report on financials, control factory equipment, analyze experimental data, manage personnel records, switch communications hardware, and perform similar vital functions every working day. Many of these programs are perfectly functional in their roles and need no particular change, except that they run on dying hardware. Hewlett-Packard's retirement of its MPE and OpenVMS lines, for example, presents a serious challenge to customers who have depended on these minicomputer brands during the last decades.

Linux comes to the rescue. Server-class Linux machines are reliable, have excellent uptime, provide good system services including interoperability in heterogenous networks, host a range of high-quality Fortran compilers, and have security that's at least comparable to other enterprise-ready systems. Banks, manufacturers, and government agencies are quietly moving many of their old programs to Linux, often under the rubric of "consolidation."

Satisfaction with the quality and usability of Linux servers for such migrations is high; among the organizations with which I've spoken, these projects have generally turned out better than expected. None of those with whom I have experience, though, are willing to speak "on the record" for competitive, security, and often legal, reasons. Financial and manufacturing companies see no benefits -- and plenty of risks -- in disclosing details of their internal processes. On the other hand, the relative openness of military computing makes for an interesting contrast. Many simulations of weapon systems and campaigns, for example, are known to be written in Fortran. The British Ministry of Defence hosts its analysis programs for the F3 Tornado on Linux.

Here's what you should know about Fortran resources for Linux, in case you're involved with such a legacy migration or taking on support of an active Fortran development team:



Back to top


Plenty of standards and tools available

Start with Michael Metcalf's resource page (see Resources, below). This is the broadest and most current collection of information on compilers, other tools, and documentation.

Popular Linux distributions commonly include a copy of the GNU project's free G77 Fortran compiler. This compiler provides command-line arguments that allow it to process a wide range of Fortran, coded according to the 66, 77, 90, and 95 standards, and several variations. G77 excels in flexibility and portability at the expense of performance, so there's still a thriving market in well-tuned commercial compilers. Note that G77 is generally installed as an executable named "f77," as is also true of several other Fortran compiles.

Even among the proprietary compilers and tools, several are available for no charge, including a downloadable form of Intel's 7.0 Fortran compiler for Linux. This compiler gives excellent performance and looks to have a bright future on both x86 and Itanium-class Linux hosts, as Intel's compiler group has consolidated engineering teams that made their reputations at DEC, Compaq, and HP.

Several companies offer translators of one sort or another. These tools might map source code which conforms to F77 to F95 texts, for example. While they have been important in the past, I've run into little reliance on them among current Linux Fortran users. Current projects seem to meet their needs just by tuning their Fortran compilers. Challenges bigger than those met by command-line arguments often involve specialized and proprietary language extensions; these require skilled translation by human programmers. In either case, automatic source translators currently offer only marginal benefit.

Other tools seem more popular now. Several interactive development environments (IDEs), including Absoft's Pro Fortran, work with Fortran. Profiling is also a mature technology, useful mostly to the performance-minded.



Back to top


Acknowledgments

Special thanks to Arjen Markus and Steve Lionel, who have helped on several occasions to steer me straight about the the state of Fortran computing. I also appreciate all the private discussions with various developers who have chosen not to publicize their use of Linux for mission-critical applications.

Along with the column's usual focus on server-pertinent security and development issues, look for at least one more installment this spring on technologies for hosting legacy applications. In the meantime, keep me posted about how you are using Linux on your servers and the kinds of help you need.



Resources

  • Michael Metcalf maintains the definitive "Fortran 90/95/HPF Information File".

  • Less current is the Usenet-descended "Fortran FAQ".

  • J3 is the US Fortran standards committee. It led formulation of the 66, 77, 90, and 95 definitions, and now "is the primary development body for Fortran 200x."

  • The Fortran 77 Standard specifies what remains perhaps the most widely used Fortran base definition.

  • The GNU Project documents its Fortran compiler in "Using and Porting GNU Fortran." Pay particular attention to the chapter on "Invoking G77." The wealth of command-line options detailed there make it practical to use G77 with an extremely wide range of Fortran coding standards.

  • Already involved with Fortran? IBM's Common Optimization INterface (COIN) code base includes Derivative free optimization (DFO) -- a FORTRAN package for optimizing certain kinds of general nonlinear optimization problems.

  • Although a physicist maintains The Linux Fortran Information Page, much of the information there applies in such far-flung domains as human resources and financial markets.

  • The Intel Fortran Compiler 7.0 for Linux is widely recognized for the performance it achieves for executables compiled with it. It's not the only compiler for Linux; it might have the best reputation, though.

  • If you think of Fortran only as "old," you're missing out on a language with plenty of advantages and life left in it, especially in the demanding scientific circles hungriest for the performance boosts Fortran provides. Learn how easy it is to start your own Fortran programming through any of several capable online tutorials.

  • Linux4Chemistry is one of many science and engineering libraries based in large part on Fortran source code.

  • The Royal Air Force uses Linux for its simulation and analysis of F3 Tornado aircraft.

  • "VMS to Unix and Linux Migration Strategies" discusses, among other issues, the native formats for binary data under different operating systems.

  • Did you know that IBM is the home of Fortran? It was the first language to allow engineers and scientists to write computer programs in more natural forms like C=A/B rather than as strings of 1s and 0s. Read more IBM history 1945-1996. The article History making components describes how Fortran and languages like it contributed to the evolution of object-oriented languages. For more on just the history of Fortran, see also A brief history of Fortran from the User Notes on Fortran Programming (UNFP) pages.

  • It is a documented fact that Real Programmers use Fortran (although it is equally well known that the determined Real Programmer can write Fortran programs in any language.) As the saying goes, "If you can't do it in Fortran, do it in assembly language. If you can't do it in assembly language, it isn't worth doing." Read more in Real Programmers Don't Use PASCAL from 1983. Other worthy Fortran resources include the Fortran purity test and Fortran the song (to the tune of Billy Joel's Pressure.


About the author

Cameron Laird is a full-time developer for independent consultancy Phaseit, Inc. He writes and speaks frequently on open source and other technical topics. Most of his own development work has been in systems programming and on the server side. You can contact him at claird@phaseit.net.




Rate this page


Please take a moment to complete this form to help us better serve you.



 


 


Not
useful
Extremely
useful
 


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!



Back to top