next up previous contents
Next: Scoping Rules Up: Program Units Previous: Local Objects

 

Argument Intent

Hints to the compiler can be given as to whether a dummy argument will:

    SUBROUTINE example(arg1,arg2,arg3)
     REAL, INTENT(IN) :: arg1
     INTEGER, INTENT(OUT) :: arg2
     CHARACTER, INTENT(INOUT) :: arg3
     REAL :: r
      r = arg1*ICHAR(arg3)
      arg2 = ANINT(r)
      arg3 = CHAR(MOD(127,arg2))
    END SUBROUTINE example
The use of INTENT attributes is recommended as it:

Note: if an actual argument is ever a literal, then the corresponding dummy must be INTENT(IN). For more information, click here gif

Now try this question gif


next up previous contents
Next: Scoping Rules Up: Program Units Previous: Local Objects

©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997
Not for commercial use.