How to use the Indigo for the Computing Course


First Steps

Log in as described. There are three ways of starting to edit a program file.
  1. Click here. An editor called asedit will open in a separate window.
  2. Select Edit-a-file from the Tools menu item on the screen.
  3. In the console window, type;
    asedit yourfilename.f
Method 1 will produce a file with a name such as "tmp1234"in the asedit program. Method 2 will give the file the name untitled.f; method 3 will give the file your allocated name.

At this stage, text can now be typed in from the keyboard. The display at the bottom of the editor indicates both the line and column position of the cursor . Fortran programming statements must appear in column 7 onwards, and must not be wider than column 120. Depending on the workstation screen you are using, you may only be able to see about 50 columns and about 16 lines at a time. To inspect the rest of the file, you will have to use either the vertical or horizontal "scroll bars" as indicated below. The editor window can also be resized by placing the mouse cursor on an edge or on the bottom right hand corner and "dragging" the window to a new size.

The next advisable action is to save your program with a more descriptive file name;

Note particularly to select the entire default entry (/tmp/rzepa/untitled.f) or whatever and replace it with just yourfilename.f in the dialog box where the file name is entered. At this point a backup file will also be created called yourfilename.bakup. If you suffer a major disaster during editing, you can always revert to this backup file.

To move or delete a portion of text, select it first with the mouse using the left mouse button and then use the Edit menu to manipulate the text;

Cutting text removes it from its current location and copies it to a "clipboard" ready for pasting elsewhere, whilst clearing selected text removes it entirely. Note that if you make a mistake, the last command can be "undone". Particular occurances of strings in the text can be "searched" for as follows;

At regular intervals, you should save your file to hard disk. Only after this has been done can another program (e.g. the Fortran compiler) access the changes you may have made to it. Likewise, any changes in a listing or data file produced during compilation will not automatically appear in an editor window unless the file is opened again in the editor. You can have several files open in the editor simultaneously, but you need to "open" each. For example, you may have the prog.f file in one window, and the prog.lis file in another. Remember to re-open the file every time it changes (it is not updated automatically). For further help, invoke that menu item as shown above.


Back to Top


Printing Program Listings.

Select Print from the File menu of the Editor and select the "lpr" printer.

The complete listing will be printed on a line printer in the Centre for Computing services (level 4, Mech Eng), from whence you will have to collect it. It is a good idea to put your name and department as a comment line in your program, in case the listing gets lost! If this is inconvenient, you may wish to use the Macintosh computers to print instead.


Back to Top


Compiling and Executing

Once you have created and saved a file using the editor, you should click on the console window and type;
ugfor yourfilename
Note that everything should be typed in lower case! This will assume that you have previously saved your program with a .f qualifier, as e.g. a file called yourfilename.f. A file called yourfilename.lis and an executable called yourfilename.uxe will be produced if there are no errors, and your program will automatically run and produce a file containing appropriate values. If compiler errors do occur, you should inspect the yourfilename.lis file using the editor, and using this, correct the errors in the original horbs.f file, moving between the two editor windows to do so. It is most important to note that before you can re-compile this program, you must save the file again to disk in the editor, since the editor and compiler communicate only via the disk. If you have previously compiled your program and successfully produced an executable file, running ugfor again will produce a prompt asking whether you want to run it again, or whether you wish to re-compile your program to incorporate any modifications etc.
Back to Top

Finding and Fixing Run-time Errors.

There is a special "debugging" environment available only on the Indigo workstations called CaseVision/Workshop. Currently, we are restricted to two concurrent uses of this program, so it is not possible for everyone to use it simultaneously. For this reason, you should reserve its use for particularly difficult problems which are resisting solution by other means. CaseVision is normally only invoked when your code has compiled sucessfully but is not yielding the correct numerical answers. It should NOT be used to fix compiler errors. To invoke the environment, type the following from a console or shell window;

$cvd yourprogname.uxe

A number of overlapping windows appear. To fully view (and focus the keyboard onto) any individual window, you will have to click the lhs mouse button in its area. The main window contains a listing of your program, which by default it is read only, but you can make it editable (from the source menu item). You can set "traps" for your program by clicking in the left hand colum against a line of code. In the example below, a trap is set on line 33 of the code. When the code is RUN (from the menu) it will stop at that point, whereupon the contents of the other windows will fill with the values of any variables. An array window (partially obscured below) can be used to enter an array name (XARRAY in the case below) and will display the value of the array. The execution view (partially obscured below) is where you type data for your program and any output from the program is produced.



The expression window can be used to evaluate an entire expression to check its numerical correctness. To do this, the expression needs to be entered into the appropriate cell of the window. Whilst you can do this by typing, a less error prone method is to proceed as follows. In the main window, move the mouse cursor to the start of the expression you are interested in, and press the lhs mouse button. Keeping it pressed, move it over to the end of the expression. The "highlited" text will change colour. Now click on the first free Expression cell of the Expression window and press the middle mouse button. The expression should be "pasted" in. Actually, this combined operation works anywhere in the workstation environment, not just here! Finally, a build view enables you to recompile your program within the environment. It is invoked when you select recompile from the source menu item of the main window.
Back to Top


The Projects

Both projects will produce additional files containing numerical information that will need to be plotted. Project A requires plotting using the Indigo Explorer program and you canot use a Macintosh for this purpose. Project B requires CricketGraph III or similar, which can only be done from a Macintosh. To inspect any data files produced by your program, you can either open them in the editor, or issue the command from the console window;

page horbit.dat

To end paging, type q. Once your calculated data looks reasonable, run the Explorer or Cricketgraph programs.
Back to Top


Project Requirements.

This would normally involve writing about 100 to 150 lines of Fortran code. The deadline for submission of completed projects will be announced during the lectures, but will not be before mid-February. Your final report should include a program listing and hard copy of any graphical output. If you have other suggestions for a programming project, check with Dr Rzepa before starting.
Copyright (c) B. P. Levitt, H. S. Rzepa and ICSTM Chemistry Department, 1994.
Return to Main Index page