Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to identify fortran standard - '77, '90, or '95?

Tags:

fortran

I have a piece of fortran code, and I am not sure which standard it is - '77, '90 or '95. Is there a standard tool to identify which standard it subjects to?

like image 960
Fredriku73 Avatar asked Dec 24 '08 17:12

Fredriku73


1 Answers

There probably are automated tools, but my methods are largely heuristic:

  • Do comments use a ! anywhere on the line (F90+) or a C in the first column (F77)?
  • Do loops use do..end do (F90+) or do..continue (F77)?
  • Are lines continued using & at the end of the line (F90+) or in column 6 (f77)?
  • Does the code use module or type structures (F90)?
  • If the code uses arrays, does it operate on them as a single structure (F90) or always using loops (F77)?
  • Is dynamic memory (either using allocatable or pointer methods) used (F90)?

Generally these are enough to discriminate between F90 and F77. The differences between Fortran 90 and FORTRAN 77 are much, much larger than the differences between Fortran 90 and Fortran 95 so I usually stop there.

like image 101
Tim Whitcomb Avatar answered Oct 19 '22 03:10

Tim Whitcomb