Topic: Guidance for using Fortran 77 with Fortran 95

Hello I'm new to Fortran and I'm trying to convert a project that has more than 20,000 lines of code from Fortran 77 to Fortran 95. Do any of you guys could point me in the right direction to follow some guidance with this subject?

I'd been trying to compile both kind of files (.for and .f95) in simply Fortran but I have some problems, like how to comment (with a "C" or a "!") or the way a line continues in another ("&" or a character in the sixth column).

Any help would be appreciated. Thanks.

Re: Guidance for using Fortran 77 with Fortran 95

Hi, I did use fortran77 abt 20 years for toe last time but I think that a lot is still working. See also the GNU help.
Beside your mentioned ! in stead of C for comment lines the continuation line and the file extensions (i.e. F90 in stead of for)  you have to take into account a lot which is not automatically to covert by an editor like
The do loop count after the loop is finished
No more alternative returns as subroutine parameters. And there are more obsolete statements; see the guide. 
Be extremely carefully with declaration of variables: I.e. in the "old days" a real*8 variable  in a subroutine call could be linked to a real*4. Take care this could cause bad results which reason is not so easy to find...
But there is much more and nowadays Fortran has so much nice possibilities to give you more and better facilities to write codes

Re: Guidance for using Fortran 77 with Fortran 95

Hello and thanks for your response Klaus,

I'm taking a look into that GNU help, thanks for the advice!

Also, I'm looking through this page:

http://www.star.le.ac.uk/~cgp/f90course … l#tth_sEc1

smile

Re: Guidance for using Fortran 77 with Fortran 95

Fortran 90's "free-format" syntax is substantially different from Fortran 77.  It will some getting used to.  Comments in free-format Fortran must start with an exclamation point.  Line continuation is now done with an ampersand (&) at the end of the line to be continued.  Variable declarations are a bit different as well. Do loops are usually closed with an End Do, and there are almost no circumstances where you should need line numbers any longer.

The link you've posted is a good starting point.  You might consider getting a book as well as a quick reference for Fortran 90 syntax.

If you are able to, you can post your "translated" Fortran code here if you're having problems, and you'll probably get quite a few tips as to what you might change.  We'll be happy to help!

Jeff Armstrong
Approximatrix, LLC

Re: Guidance for using Fortran 77 with Fortran 95

Another Fortran reference to consider is the Fortran 90 Handbook:

http://runge.math.smu.edu/Courses/Math6 … ndbook.pdf

Re: Guidance for using Fortran 77 with Fortran 95

Thank you Jeff and DrFrank!

I will surely come here for further questions and I will check that PDF!