ENGR 309: INTRODUCTORY MECHANICS

FORTRAN 77 PROGRAMMING
(Last Update: 12-7-99)


Instructor: Dr. Chris L. Mullen
Office: 202 Carrier Hall / Phone: 915-5370
Email: cvchris@olemiss.edu


Select Fortran 77 program by "file.f" name given below:

intfn.f

You may access Matlab from the MCSR SGI machine "sweetgum.mcsr.olemiss.edu" through a telnet session. This requires a student account which may be applied for at theMCSR's web site:

http://www.mcsr.olemiss.edu/computing/account.html

Contact the Information Technology help desk, 915-5222, for more information and short courses. Contact Dr. Mullen if you have problems.


A text file containing Fortran 77 commands can be created with a text editor. When given the extension "*.f", the commands may be "run" or executed by simply typing the name of the prefix. Unlike Matlab, the executable must first be created by "compiling" the text file or "source" code. This is done by typing the command at the prompt,

f77 filename.f -o filename

As the program is debugged, it is necessary to "recompile" each time a change in the text file is made.

The file, intfn.f , contains commands which read an input file containing the {t,f} paired data for an arbitrary function, f(t). Specifically, the program will:

1. Read the input file, "intfn.in".
1. Store the number of data points, "n" , and the paired data in real arrays, {t,f}.
2. Compute the parameters, {a,b,h}, needed by the subroutine, tsint.
3. Call the subroutine, passing the parameters through its argument list.
4. Return the integrals computed using the Trapezoidal and Simpson's rules.
5. Print the results to the output file, "intfn.out".

Typing, "intfn", will execute the commands and should generate the results text file , intfn.out , when the input text file, intfn.in, is in the same directory as the executable file, "intfn".

Two examples of input and output for simple test cases are given in the text file, intfn.ex . To solve the computer assignment, you will need to modify the main routine to:

1. Read "n" from an input file,"intfn.par".
2. Generate the paired data for the two given functions describing the x and y components of velocity (through a "do" loop).
3. Call the subroutine passing the parameters and velocity array through its argument list.