next up previous contents
Next: Stack Simulation Up: Modules Previous: General Form

Modules - Global Data

Fortran 90 implements a new mechanism to implement global data:

For example, to declare pi as a global constant

  MODULE  Pye
   REAL, SAVE :: pi = 3.142
  END MODULE Pye

  PROGRAM Area
   USE Pye
   IMPLICIT NONE
   REAL :: r
    READ*, r
    PRINT*, "Area= ",pi*r*r
  END PROGRAM Area

MODULE s should be placed before the program.

For more information, click here gif


next up previous contents
Next: Stack Simulation Up: Modules Previous: General Form

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