Automatic translation from fortran 90 to f77
Is there an converter from fortran 90 downto fortran 77 ?
I have a fortran77 only compiler and want to run NAS Parallel Benchmark (NPB for short) on it. But NPB uses some fea开发者_如何学运维tures of F90, like do enddo, smth else. All features are rather simple.
Is there A way to translate NPB to F77 strict language?
Tags: fortran parallel convert programming-languages
I need tool to lower minimally
DO ... ENDDO
and
DO ... WHILE
to DO
with number labels and to DO
+ IF
There are converters from FORTRAN 77 to Fortran 90, but I have never heard of one for the other direction. I expect that there is very little demand for such. DO ... END DO and DO ... WHILE were common extensions supported by FORTRAN 77 compilers, so these features in the source code may not be signs of using limited Fortran 90 but of using typical but non-strict FORTRAN 77. Why stick with a FORTRAN 77 compiler? Why not download gfortran or another modern compiler?
The DMS Software Reengineering Toolkit is used to carry out program transformations on large applications in many languages.
It has a full Fortran 95 front end, and can apply source-to-source rewrites to code. Since F77 is pretty much a subset of F95, you can implement your conversion by applying rewrites that map F95 constructs into the corresponding F77 idioms still in F95. You examples of transforming structured DO blocks into F77 code with gotos and line numbers would be pretty straightforward. There are likely to be lots of other changes (F95 has strings, structures, modules, ...) but which ones you'd have to transform depend on precisely what's in the source code base of interest.
精彩评论