By Anatoly Krivitsky | Article Rating: |
|
November 9, 2006 11:00 AM EST | Reads: |
22,817 |

There is a market from which a history of computers began - a market of numerical simulations for scientific and engineering applications. Note that these applications usually deal with a high number of mathematical calculations that are impossible without a computer. Historically, this was what provoked the computer's invention. Also, the main purpose of software for this market is to provide results in a reasonable amount of time. Despite a long history, this market is alive and well, and it will be for the foreseeable future. Consider, for instance, the following fields of numerical simulations: steam turbines (which are core elements of most conventional and nuclear power plants that supply electricity), so-called "green energy" (wind, waves and solar energy) facilities, blood flow in the human body, elementary particles of which our universe consists, the universe itself, environmental issues (including pollution simulations and simulations of ecosystems), etc.
An important part of this market is the approximation of complex dependencies in order to speed up computations while maintaining accuracy (see for examples the books and articles listed in the resources section at the end of the article). Many applications for this market were developed for decades using mainframes and the programming languages available at the time. Many of these applications were written with various versions of Fortran.
Let us note that modern PCs (personal computers) are relatively cheap and provide us with the same computational power of the mainframes of a not-so-distant past. Therefore, if you're happy with your legacy mainframe scientific or engineering applications, it's a good time to make the transition from mainframes to PCs to save money on mainframe time cost.
There are a good many commercial Fortran compilers for PCs (consider Intel Fortran compiler). You may want to measure the performance of a compiler by benchmarks that suit your specific needs. (More information on benchmarks can be found in my article in JDJ, Vol. 10, issue 5, 2005, listed in the resources section or online at http://jdj.sys-con.com/read/83099.htm.) However, to save money, one should consider using open source compilers. It is well known that GCC (GNU Compiler Collection) compilers (including G77 Fortran) are mature and have reasonable performance. Besides, if you use a G77, the number of changes needed in your mainframe Fortran code is relatively small. On the other hand, there are a number of free editors that can be used for convenient editing of the source code. So you may want to implement a technology that will combine these editors and G77 in a sort of self-made IDE (integrated development environment).
Operating System for a PC
Let's face it, most modern PCs come with Windows pre-installed. Most manufacturers of peripheral devices (printers, external HDDs, etc.) provide drivers for Windows XP. If you bought your PC with Windows XP pre-installed, you may not want to waste time installing another operating system (say various Linux or FreeBSD distributions). However, GCC works really well on Linux. Here are a few ways to solve this problem:
- You may want to use virtualization. (See my articles about using Windows XP/Linux virtualization for compilations: from LinuxWorld Magazine, Vol. 4, issue 5, 2006, available online at http://jdj.sys-con.com/read/219966.htm, and from Enterprise Open Source Magaine, Vol. 4, issue 8, 2006.) Virtualization is great, however, it may not fit your application needs in terms of performance (some computer power is needed to support virtualization).
- You may use CygWin (emulation of Unix environment) under Windows XP. How to create self-made IDEs using free open source technologies with CygWin under Windows XP will be described later in this article as a part of the migration from mainframes to PCs.
There is a cheap tool that allows great simplification of the migration in question - Quick3270 - most likely it's already used in your organization. If it is not used, I strongly recommend buying and implementing it. The tool is available from www.dn-computing.com/
- Split your ISPF screen (if your are unfamiliar with ISPF, TSO and other mainframe stuff, many more resources can be found at www.ibm.com) using a corresponding command (most likely it will be F2). You may want to double-check with mainframe developers/administrators from your organization to be sure of the command.
- In one part of the split screen, go to "Command" TSO option (say it will be 7). Again, check the actual number for the option described above.
- From this part of the screen, select appropriate options for file transformation from the Quick3270 menu. When the "File Transfer" dialog appears, put the fully qualified name of a member of your source code library in single quotes. For example, ÔMYLEVEL1NAME.MYLEVEL2NAME.MYLIBRARYNAME(MYFTNMEMBER)'. Of course, in real life, you should use real names. You may want to go to the corresponding library within the second part of the split screen, copy said name into the clipboard, and paste it in single quotes to save yourself some typing.
- Put the needed file name on your PC under "PC file name" without quotes - for example, C:\FromMainframe\program1.f.
- Hit "Receive File" button.
CygWin Installation
The process is described in numerous Internet resources. However, there are several things not articulated in known sources that could save you a lot of time if properly implemented:
- For readers in the USA, a reasonable choice of CygWin mirrors/ftp sites is as follows:
http://cygwin.elite-systems.org/ for a mirror and ftp://mirrors.kernel.org for an ftp site. - When considering what to install, it would be smart to keep in mind that these days HDD drives are cheap (less then $1 per Gigabyte at the time of writing). So if you care about the completeness of your CygWin distribution - and saving money by eliminating unnecessary findings of missing CygWin parts - you may want to install the whole thing. Installation of the whole CygWin is very simple. There is a figure that resembles a circle with two arrows, located next to every category within the "CygWin setup select - packages" window of the CygWin setup program. Clicking on this figure, which is located near "All," will provide the needed installation. On average (the specific time will depend on your connection and PC), it takes about an hour to complete the installation.
- After the installation, you will most likely need the following CygWin related shortcuts on your desktop: CygWin shortcut, start X server shortcut (these two are likely to be provided by the setup program), and X term shortcut. To place the X term shortcut on a desktop, go to Start | All programs | GygWin X, right-click on the X term icon, and select Send to | Desktop. Note that the X server and X terminal from CygWin will not be used further in this article. However, you may find them useful for your other development needs.
There are many free and/or open source editors that are suited for source code editing. However, you may find it convenient to use Crimson, available for free from http://www.crimsoneditor.com. Crimson has support for Fortran syntax highlighting, and, as you will see in this section, it can be used as part of a self-made IDE. Also, if VS.Net 2003 or 2005 is a part of the standard PC software image in your organization (i.e., if there is no need for additional investments in VS.Net 2005 for the migration in question), why not use its highly customizable editor? Please see my article from Enterprise Open Source Magazine (Vol. 4, issue 8, 2006) for an analysis on how a typical IDE works. With help from the article as well as the aforementioned editors, you'll be able to build your own IDE.
The program in question will allow you to call G77 within the CygWin environment right from the editor (likewise you can call a native or external compiler from the IDE), and see the results within Notepad (likewise you can see the results in the designated IDE area).
Published November 9, 2006 Reads 22,817
Copyright © 2006 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Anatoly Krivitsky
Anatoly Krivitsky has a PhD in computer science and has more than 24 years of working experience in the IT field. He's the author of 20 published papers and books and five patents. For more information, please visit http://www.myjavaserver.com/~akrivitsky/index.html.
Apr. 20, 2018 03:45 AM EDT Reads: 1,814 |
By Elizabeth White ![]() Apr. 20, 2018 12:45 AM EDT Reads: 4,585 |
By Liz McMillan ![]() Apr. 19, 2018 11:00 PM EDT Reads: 9,786 |
By Liz McMillan ![]() Apr. 19, 2018 10:45 PM EDT Reads: 22,335 |
By Maria C. Horton ![]() Apr. 19, 2018 09:30 PM EDT Reads: 13,514 |
By Elizabeth White ![]() Apr. 19, 2018 08:30 PM EDT Reads: 1,000 |
By Elizabeth White ![]() Apr. 19, 2018 07:00 PM EDT Reads: 5,936 |
By Pat Romanski Apr. 19, 2018 02:00 PM EDT Reads: 1,993 |
By Pat Romanski Apr. 19, 2018 01:45 PM EDT Reads: 1,141 |
By Elizabeth White Apr. 19, 2018 01:30 PM EDT Reads: 1,553 |
By Pat Romanski Apr. 19, 2018 01:30 PM EDT Reads: 2,060 |
By Liz McMillan Apr. 19, 2018 01:15 PM EDT Reads: 1,583 |
By Liz McMillan ![]() Apr. 19, 2018 12:45 PM EDT Reads: 3,631 |
By Pat Romanski ![]() Apr. 19, 2018 12:45 PM EDT Reads: 5,213 |
By Yeshim Deniz Apr. 19, 2018 12:30 PM EDT Reads: 3,883 |
By Yeshim Deniz Apr. 19, 2018 12:15 PM EDT Reads: 4,848 |
By Liz McMillan ![]() Apr. 19, 2018 11:00 AM EDT Reads: 7,007 |
By Yeshim Deniz ![]() Apr. 19, 2018 08:30 AM EDT Reads: 1,832 |
By Liz McMillan Apr. 19, 2018 08:15 AM EDT Reads: 2,455 |
By Yeshim Deniz Apr. 19, 2018 08:00 AM EDT Reads: 2,997 |