next up previous contents
Next: Solution Up: Procedures Previous: Solution

 

Local Variables

At each of the indicated points in the code, give the status (local, dummy argument, host associated or undefined) and, if appropriate, the values of the variables v1, v2, v3, v4, r and i.

    SUBROUTINE Subby(V1,V2)
     IMPLICIT NONE
     REAL, INTENT(INOUT) :: V1,V2
     INTEGER :: V3,V4
      V1 = 1.0
      V2 = 2.0
      V3 = 3
      V4 = 4
       ...
   !------ Position 1
       ...
      CALL Inte(V1,V3)
       ...
   !------ Position 2
       ...
      CALL Exte(V1,V3)
       ...
   !------ Position 3
       ...
    CONTAINS
     SUBROUTINE Inte(r,i)
      REAL, INTENT(INOUT) :: r
      INTEGER, INTENT(INOUT) :: i
      INTEGER :: v2 = 25
       ...
   !------ Position 4
       ...
       r = 24.7
       i = 66
       v4 = 77
       ...
     END SUBROUTINE Inte
    END SUBROUTINE Subby
    SUBROUTINE Exte(v1,v2)
     REAL, INTENT(INOUT) :: v1 
     INTEGER, INTENT(INOUT) :: v2
     REAL :: v3 = -2.666
       ...
   !------ Position 5
       ...
      v1 = 234.675
      v2 = -99
      v3 = 0.001
       ...
    END SUBROUTINE Exte




next up previous contents
Next: Solution Up: Procedures Previous: Solution

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 14:10:26 GMT 1996