- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MATMUL (when BLAS call is not suitable),MERGE (more so in ifort 9), MAXLOC/MINLOC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
JugoslavDujic wrote:
First, let me clarify: there is (almost) no changes from F77 to F9x. All that F9x brought were additions and extensions. Thus, your "F77" code is in the same time a valid F9x code and you can legitimatelysay "My codeis F95 compliant".That being said, there are many advantagesin new features ofF9x that you may want (or not) to use. In my opinion, people generally accept some F9x features they find more practical first, and reject some, making the shift gradually. This is only matter of practical issues and personal preferences. For example, I still prefer .GE. and .LT. to >= and < -- it's just a matter of habit.For example, if you don't intend to much maintain/develop that code further, you can leave it as-is, on the principle "don't fix if ain't broken". If you do intend to spend much time improving it, you may consider some of the following changes, which I find most appealing in the "porting":1) change the fixed-form source to free-form source. That can be automatized by some of free utilities, like one from Alan Miller2) replace COMMON blocks by module variables.2a) make the arrays allocatable in order to allow for free sizing of the problem3) use IMPLICIT NONE to force variable declaring and prevent stupid mistyping errors difficult to track4) replace "old style" blocks (like IF(x) GOTOor DO260 i=1,...) with structured blocks (IF...ELSE...ENDIF, DO...CYCLE..END DO)5) use array notation6)use new intrinsic routines tomake the code more elegant and readable7)...It's up to you which changes you will find useful and which not. Generally, they all lead to better code readability and easier maintenance (and performance gains are unlikely).Hope this helpsJugoslav
Hi Jugoslav,
thanks for this detailed answer. What I have to evaluate is:How much time do I have to spend and what do I have exactly to do to change the existing Fortran 77 code to a clean and pure Fortran 95 code to be safe in code for the next x years? Which are the reasonablepros to do this "conversion" to Frotran 95 now? Remember that I have reached a state where the old VAX/VMS Fortran 77 programs now run with IVF 8.1. I have to argue why it is senseful to change the (working) F 77 programs into F 95 programs. Are there reasons and risks for/against this step?
Maybe I am wrong but my understanding is that e.g. .GE. is Fortran 77 while >= is "real" Fortran 95. I still might use .GE. but thenative Fortran 95 usage is >=. So if one day Intel compilers only understand pure Fortran 95, I have to switch to >= etc.
Like:
Fortran 95: >= / Fortran 77: .GE.
Is this right?
Or is it:
Fortran 95: >= and .GE. (I choose)
?
On http://www.nsc.liu.se/~boein/f77to90/c1.htmlI have read:
"It is possible to mix old and new statements, but it is advised to try to be consistent, which means using either the old or the new form for the statement."
Is there some kind of table or list available old statements vs. new statements?
Message Edited by h-faber on 06-09-2005 01:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
tim18 wrote:
ifort doesn't yet incorporate much of Fortran 2003, beyond what is in the f95 standard. A few f95 intrinsics could give better performance as well as readability than equivalent f77 code:
MATMUL (when BLAS call is not suitable),MERGE (more so in ifort 9), MAXLOC/MINLOC
Hi Tim,
thanks for this answer too, although I have to admit that I have never seen those words in the old F77 code nor do I (yet) know what they are good for and what they can replace in the old code. ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you write new code, feel free to take advantage of new language features, but my own opinion is that it is not a good idea to rewrite working code just to bring it into line with the current standard.
Now, if you feel that the old code is unmaintainable (in that it is so full of convoluted GOTOs, etc., that nobody can understand it), you can consider rewrites. But otherwise, leave it alone and put your energy into something new.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do a compile with /stand:f95 and see what the compiler says.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page