tags:

views:

41

answers:

2

Hi,

What are the necessary conditions i need to takecare while porting the fortran code from power station to fortran compiler(2003)?

What I observed is, In power station all the variables treat as global variables(even local variables also). where as in intel fortran(2003) they have separate scope for local and global. So I need to make all local variables to gloabal. Is there any option(from properties) to make all local variables to global in fortran 2003. Because there are hundered of variables in my code. Instead of assigning all local variables to global(means in COMMON block), can anybody suggest a good solution for it?

Apart from this shall I need to takecare any other issues while porting code from powerstation to intel fortran compiler(11/2003)?

Thanks in advance.

A: 

I don't know those two compilers specifically, but it would be very strange if you had to put all of your variables into common blocks. What is the evidence that all variables are global? A possible issue with local variables in subprograms (subroutines and functions) with older compilers versus newer compilers is whether the value of a variable persists across invocations of the subprogram. The Fortran standard only guarantees this behavior if the variable is declared with the "save" attribute. Some older compilers made the all variables persistent (static memory), whether or not "save" was used. This can cause bugs when older programs are ported to newer compilers, if the programmer omitted a "save". Many newer compilers provide a compile option to make all variables persistent (e.g., /Qsave with the current Intel Fortran compiler). Or you can add "save" to every subprogram -- "save" with no variables will make all variables persistent.

M. S. B.
A: 
ldigas