Porting from power station(4) to intel fortran compiler(11/2003)
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 f开发者_运维技巧or 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)?
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.
What are the necessary conditions i need to takecare while porting the fortran code from power station to fortran compiler(2003)?
Fortran Powerstation is just a compiler. So is Intel's Visual Fortran.
While fortran is a language. Although both of the above did have some non standard vendor extensions, as long as you stuck to the Standard you should have no problems porting (fortran77 standard compilant should compile without errors on today's newest compilers).
So the problem arises only if you used some non standard, MS specific stuff. Which no one can really help you with without seeing some actual code.
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 global.
Uhmm, no. What I mean, you can say, there are "global" and "local" variables in fortran (although they're not called like that) but I assure you, they're treated correctly in and by both compilers. I used both, FPS quite recently (I still maybe have it installed somewhere) and they are treated as they should be.
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?
Personally, if you can, I would avoid using COMMON blocks. They're nice, but in most situations they can be avoided.
Apart from this shall I need to takecare any other issues while porting code from powerstation to intel fortran compiler(11/2003)?
Renaming of libraries and modules.
Intel's line of compilers is a descendant of MS's, so it is really a "natural" way to go. However, without seeing some actual data, it is hard to guess like this and give general advice.
p.s. Some "general advice" however can be found on Intel's sofware forums, also with a mass of other users. They're mostly concerned with transition from CVF to IVF, but I guess you could find a FPS user now and then. Although, I repeat, fortran is a very standardized language. And as such, very portable. Jumping from one compiler to another should not present a difficulty taking into account the already said.
精彩评论