Homework #7, Using Select Case
(4 points)
You are still working on the development team for the circuit simulation program, and your next
job is to upgrade some ancient Fortran coding to include new Fortran 90 structures. Edit the
driver program drho.f, replacing the computed GO TO structure from the function "rho" with a
SELECT CASE structure. Lines to be modified are bounded by comment lines that look like
this:
c----------------------------------------------------------------
Before making any changes, I recommend that you copy the file drho.f, to one named
"old_drho.f". The results of your altered function must be identical to those of the original one.
One way to check your results is to compile the original program into an executable file with a
special name. For example type the command:
f77 old_drho.f -o old
This creates an executable file named "old". Each time you test your new program by typing
"a.out", you should follow by executing "old" with the same input. I recommend that you run
both programs with input integers from 1 through 5.
Warning:
This homework gives you the oportunity to create a program that loops forever. If the program
won't stop asking for a material ID then hold down the Ctrl key and hit the C key. If that doesn't
work try Ctrl Z. This last one just suspends the program and you either have to read the notes on
the "kill" command, or type "exit" twice in a row when you want off the computer and it
complains about "suspended" or "stopped" jobs.
Leave your modified version of drho.f, (don't change the file name) in your "homework"
subdirectory. We will collect it after the due date.
Maintained by John Mahaffy : jhm@psu.edu