f2c translation

Hi all, I am fairly new to programming and I am currently trying to translate a Fortran program to c++ for a research project. The program is written with ~15 different files that are called from Main.f and most of which reference a header file Common.h

I was able to install f2c correctly (I think), and when I type the command:
$ f2c -C++ Main.f

I get the following output:

Main.f:
MAIN md:
Error on line 61 of common.h: unbalanced parentheses, statement skipped
Error on line 62 of common.h: unbalanced parentheses, statement skipped
Error on line 115 of Main.f: unbalanced quotes; closing quote supplied
Error on line 118 of Main.f: syntax error
Error on line 159 of Main.f: misplaced ENDDO
Error on line 159 of Main.f: syntax error
Error on line 169 of Main.f: unbalanced quotes; closing quote supplied
Warning on line 176 of Main.f: local variable main_loop never used

The code lines are

WRITE(17,*) ' Step Energy Kinetic Potential Temperature'

Beginning of MD loop

main_loop: DO S = 1,NSTEP
.
.
.
END DO main_loop


When I try to translate a few of the other files I get similar errors. The strange thing is that the program works just fine when I compile it in fortran, so I doubt there are syntax errors or unbalanced parentheses. In fact, when I inspect the code I can't find anything wrong with the code, although I'm not fluent in fortran.

One thing I should mention is that the code was originally written in Fortran90. I talked to the person that wrote it and he said that he didn't use a lot of Fortran 90 in the code. Could it be that I just need to learn Fortran 77 syntax? Any help you could provide would be greatly appreciated.
Last edited on
Topic archived. No new replies allowed.