Fortran was one of the first high level language, if not the first! It was created by John Backus, an engineer at IBM, in 1955-1957 when computers were extremely slow and most programming was done at the machine language level. Fortran is still widely used today in mathematical and scientific communities, almost a half century later. There have been several updates to the Fortran language in 1977, 1990, 1999, and again in 2000. Each of these versions of the language has a separate compiler to use. Your Instructor or TA will tell you which version they want you to use on your homework and projects. The department has the following versions installed for students to use:
Fortran 1977 use compiler: f77
|
Fortran 1990 use compiler: f90
|
Fortran 1999 use compiler: f99
|
In order to write a Fortran program you need to be able to type it into the computer and save it to disk so that the compiler can translate the program to machine language which can be executed by the computer. There are two options, you can write your program in Windows using notepad or you may write your program in UNIX using pico, vi, or emacs. Since the departments Fortran compiler is on UNIX there are a few extra steps to convert between Windows and UNIX.
| Sample Hello World Program: |
PROGRAM HELLO
|
In all the examples below I use the f90 compiler, it is customary to name a Fortran program by the version it is written for. Thus I will put ".f90" at the end of my examples.
H: drive. The H: drive is accessible both by Windows and UNIX.
dos2unix" and "unix2dos" to convert the files between the two types of systems. These two commands need to be typed in at the UNIX command prompt as shown below:
| To convert from Windows to UNIX: |
% dos2unix MyProgram.f90 MyProgram.f90
|
| To convert from UNIX to Windows |
% unix2dos MyProgram.f90 MyProgram.f90
|
The department's Fortran compilers are only available on UNIX so even if you wrote your program using windows you must login to unix to compile your program.
% f90 MyProgram.f90 -o MyProgram
|
% ./MyProgram
|
If you see errors like the following on every line of your program you need to use the dos2unix commands before compiling. See "Using notepad to write your Fortran program" for information on the dos2unix commands.
| "MyProgram.f90", Line = 1, Column = 16: Error: Unexpected syntax: "EOS.." Expected but found |
Windows uses "new line" and "carriage return" at the end of each line, where UNIX only uses "new line". These two commands remove or add the "carriage return" to convert between the two systems.
Monday - Friday:
7 am - Midnight
Saturday:
10 am - 7 pm
Sunday:
12 pm - Midnight
Hours subject to change during holidays, emergencies, and summer semester.