next up previous contents
Next: Introduction to Procedures Up: Program Units Previous: Main Program Syntax

Program Example

    PROGRAM Main
     IMPLICIT NONE
     REAL x
     INTRINSIC FLOOR
     REAL, EXTERNAL :: TenTimes
      READ*, x
      PRINT*, FLOOR(x)
      PRINT*, Negative(x)
      PRINT*, TenTimes(x)
    CONTAINS
     REAL FUNCTION Negative(a)
      REAL, INTENT(IN) :: a
       Negative = -a
     END FUNCTION Negative
    END PROGRAM Main
    
    REAL FUNCTION TenTimes(a)
     IMPLICIT NONE
     REAL, INTENT(IN) :: a
      TenTimes = 10.0*a
    END FUNCTION TenTimes

For more information, click here gif


next up previous contents
Next: Introduction to Procedures Up: Program Units Previous: Main Program Syntax

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 18:56:08 GMT 1996
Not for commercial use.