views:

136

answers:

2

Hello

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 features 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

+3  A: 

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?

M. S. B.
+1: I'd go further and refuse to help such a misguided ambition. it's a bit like being asked how to take a couple of cylinders out of my Ferrari V12.
High Performance Mark
With all cylinders your ferrari can't be used on some european roads.
osgx
This fortran compiler doesn't support enddo and while extensions.I want to benchmark this compiler. It is the only fortran compiler for the platform i want to benchmark.
osgx
@osgx: The question is why do you want to benchmark the compiler which is not used by any sensible person?
kemiisto
I want to do it. It is question to me, but if I want it, I have question to community. You can see my question after pressing PGUP
osgx
+1  A: 

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.

Ira Baxter
Is it free or not ?
osgx
Not free, and somebody (you?) has to write the transformations to map F95 to F77. That takes some effort (therefore not free) too.
Ira Baxter