next up previous contents
Next: Stack Simulation Up: Modules Previous: Module - 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: Module - General Form

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