Nash - Scientific Computing with PCs (523165), страница 6
Текст из файла (страница 6)
While "production quality" will requirethe actual photo, a reasonable image can be included in the draft or on the layout sheet by importingit into a word-processing document from an optical scanner.•Image painting or drawing programs allow us to include logos or other designs to improve reportsand slide-show presentations. Image painting programs give us control over the individual pixels ina bit-mapped image. For this book, we used CorelDRAW. It is also possible to consider hypertextforms (Taylor, 1991).•Page layout programs may be considered as graphical tools if we have pictorial elements or fancylayouts in our reports.•To convert paper documents to machine readable form, optical scanning with character recognitionsoftware can be used to provide a more or less correct machine-readable version. This is thenmanually edited to fix any errors in the recognition process.Unfortunately, users of graphics must still ensure that all pieces of software and hardware can beorganized to work together.
Using color information in reports is still expensive, so color is usuallyre-coded as different shading or hatching, sometimes in ways that are not recognizable. As color outputdevices gain acceptance, this difficulty may become less important.One area where graphics have become extremely important is in the interface to computer operatingsystems. Many scientific computists prefer the Macintosh desktop or the Microsoft Windows operatingenvironment to a command driven system.
For some applications, a pointer-driven graphical interface isessential; for others it may slow our work. In many cases the choice is a matter of personal preference,with software available to use in both types of environment.2.8Report WritersMany scientific computations, for example linear programming computations, produce a very largequantity of output. While it is sometimes important to save the detailed information for future analysis,the usual output may not be in a form suitable for review by management or colleagues.
To overcomethe difficulty the volume of data presents, we may use a report writer to summarize the results and12Copyright © 1984, 1994 J C & M M NashSCIENTIFIC COMPUTING WITH PCsNash Information Services Inc., 1975 Bel Air Drive, Ottawa, ON K2C 0X1 CanadaCopy for:Dr. Dobb’s Journalhighlight any important features.Such report writers were a growth industry in the early 1970s, but since then have apparently become lesspopular. In part, this may be attributed to better reporting of numerical results by the scientific programsthemselves. There is also a greater emphasis on graphical reporting of results that renders them moreimmediately accessible to users and their colleagues.Nevertheless, users of PCs may wish to consider the creation and use of simple programs to sift andsummarize results. For example, to compare run-time performance of several programs, we could use asimple filter program to extract the execution time information from files of console (screen) output.
Theprogram could be organized to tabulate our results roughly. The alternative would be to use a text editorto remove the unwanted detail of the results. In practice, we have often chosen the middle ground ofusing a macro-editor, which allows us to find and extract the required information by invoking sequencesof commands with single keystrokes.2.9Programming and Program DevelopmentMost scientific computations involve, at some stage, the use of custom-developed programs. Macro-editorsare a help here in writing the source code. The compilation and linkage editing of the code to make aworking program is clearly data-processing.
PCs can take advantage of a very wide range of programminglanguage processors. In our own case we find that we have access to the following programming tools(compilers, interpreters, assemblers) for MS-DOS computers:•BASIC (several GWBASIC and QBASIC interpreters; IBM, Microsoft, Turbo, Quick and True BASICcompilers);•FORTRAN ( Microsoft 3.2 and 4.1, Lahey F77L 2.2 and 3.1, Watcom F77 Version 9.0);•C (DeSmet 2.4 and 2.5; Eco C; Turbo C++ 1.0, 2.0 and Windows; Microsoft Quick C version 2.5);•PASCAL (Turbo Pascal 3.01a, 5.0, 5.5, and Windows; Pascal-SC);•80x86 Assembly code (Microsoft Macro Assembler, De Smet ASM88).With the above there are several different linkage editors. Some of the listed programming tools are outof date. Others, though dated at the time of writing, are still useful tools.By far the most popular high level language in the early 1980s was BASIC, which is really a family ofsimilar but hardly compatible dialects.
Efforts have been under way for over a decade to standardizeBASIC (Kurtz, 1982), but apart from Minimal BASIC (ISO 6373/1984) this effort has not had a greatimpact. A reason for the popularity of BASIC was that a version is supplied with most MS-DOS PCs.BASIC is, however, rare on Macintosh computers.The use of BASIC is diminishing as users treat the computer as an appliance for information handlingtasks; they are not programmers. Moreover, BASIC lends itself well to quick-and-dirty tasks, (Nash J Cand Nash M M, 1984), but is not well-suited to large scale projects. For example, most BASIC interpretersallow only a single 64K memory segment to be used for program or data on MS-DOS machines. Bycontrast, Microsoft Visual BASIC offers a tool for Windows programming.Scientific computing has traditionally been carried out in FORTRAN.
FORTRAN compilers available forPCs are generally based on the 1977 standard (ISO ANSI X3.9 - 1978, American National StandardProgramming Language FORTRAN). For computational efficiency, FORTRAN appears to be a goodchoice. The compilers generally support memory access to large arrays and there is a wide selection ofsource code available in the public domain. Unfortunately, FORTRAN compilers are not as convenientfor novice users as, for example, the Pascal development environments from Borland Inc.
Nor do theyalways supply the same level of functionality for controlling user interfaces such as Pascal or C compilers,2: DATA PROCESSING CAPABILITIES OF PCs13screens, keyboards, file handling or pointer device functions.The use of various compilers and interpreters can be very tedious. The Microsoft FORTRAN compilerversion 4.10 offers a choice of four different memory models and five different approaches to floatingpoint arithmetic. This presents the user with the tedious chore of specifying the correct disk\directorypath for each compiler and linkage library (the pre-compiled code that provides the appropriate memoryand floating-point choices).When we have to compile and/or consolidate several pieces of code, it is better to automate the process.We may decide to use a BATch command file (Microsoft, 1991), which is essentially a pre-recorded versionof our keystrokes.
To consolidate source code segments, we have had considerable success using simple,though quite long, BATch command files (see Nash J C and Walker-Smith, 1987). MAKE, developed toease the burden of building C codes in UNIX systems, appears in several forms accompanying C,FORTRAN and Pascal systems on PCs. This program takes a simple script (called the MAKEFILE) andbuilds our program from the appropriate pieces. A particularly pleasant feature of MAKE is that it is ableto use the time-stamps of files to avoid recompiling source codes that have not changed since the lastcompilation. Thus it saves time and effort if it can. We have used MAKE in a C-language programmingproject aimed at the study of tumor growth.The BATch command files can also be replaced with programs. Examples are given in Nash J C andWalker-Smith (1989b) in the BASIC program NLPDEX.
In Nash J C (1990b), we suggest consolidation andexecution of program code using a hypertext environment that allows the user to learn about availableprograms and data and then actually use them; this was demonstrated in Nash J C (1993b).2.10 Administration of ResearchWe have already noted that researchers use PCs for preparing reports and performing a myriad ofmundane tasks. Among these are the administration of their scholarly work. This involves, in our mind,planning tasks, preparing grant applications, tracking activity, preparing progress reports andadministering research funds.With research increasingly involving collaborations over distance, these tasks may require extensive useof email and file transfers.
We may anticipate the eventual use of groupware — software allowing realtime exchange of computer messages for collaborative work via a network.Clearly the PC is well suited to the development of work plans, using simple lists generated with a textor outline editor. Grant applications, while generally restricted in format, can usually be prepared usinga word-processor. If there are several aspects to the same overall project, there will be considerableduplication of information.To track activity, we like to use a diary system and extract information from it as needed. One of us (MN)prefers the traditional book form "planner" into which activities are recorded first as plans, later asactivities.