Next: Solving the Problem
Up: More Arrays as Arguments
Previous: Array Sizes

Array Bounds

Why didn't Fortran tell us when we accessed beyond the bounds of the array in the subroutine? Think about this carefully.

Click here for the answer

Can you design an experiment to determine whether Fortran will do array bounds checking within a subroutine, just as it does in the main program?

Click here for the answer

What happens now when we run the program?

Click here for the answer

So here's our problem in a nutshell:

We can now see that our problem is to arrange that the declared bounds of all dummy and actual arrays be exactly the same. Unfortunately, this is impossible to do if we continue to use the approach embodied in ``aparm2.f''. Why is that?

Click here for the answer


Next: Solving the Problem
Up: More Arrays as Arguments
Previous: Array Sizes

Hamlet Project
hamlet@cs.utah.edu