----- Original Message -----
From: "Frank OuYang" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Wednesday, April 10, 2002 9:45 AM
Subject: Ask for help on the global variable of F77/F90
> How define a global variable?
>
> In C/C++, we can define a stastic variable at the begining of program so
as to
> get a global varibale.
>
> For For90/For77, how can I do then?
For Fortran 77 you can do that only by use of COMMON. With Fortran 90 or 95
you have the better alternative of placing the variable in a module that is
used wherever necessary. Either you will need to give the variable the SAVE
attribute, or you should USE the module in your main program ("Fortran 90/95
Explained", Sections 5.5 and 7.9).
Hope that helps,
Mike Metcalf
|