Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fortran IV Program update to Fortan 77

Status
Not open for further replies.

djr3203

Electrical
Aug 3, 2011
57
I have an old Fortran IV program that I want to update to a more modern format. Does anyone know if the Fortran IV code can be compiled to a new Fortran? Does anyone know of any compilers that can do this?
 
Replies continue below

Recommended for you

Hold on, do you want to update it or just try to compile 'as-is' with a new compiler? I am getting mixed signals from your short statement.

Needless to say, I would totally go through the code with a fine tooth comb and modernize the entire code...that's the best thing to do.

Back then, they would do some scary things, like saving strings into REALs, pass arrays to scalars into a subruotine, some other Hollerith character stuff that nobody does anymore, etc. etc. etc.

You (or somebody) really needs to go through this code and consciously modernize it. I have done it...it is not sooooo bad, you just need to keep an eye for certain things. Soon enough, you will get an idea of the habits of the original programer and start finding his/her design pattern over and over.

my 2 cents
 
Fortran IV/F66 will compile in F77. Just get the gfortran compiler and build it.

You may need to add a PROGRAM statement to the main program. Other than that it, if there is nothing fancy, it should just build in F77. The things you need to watch out for are

[ul]
[li]F77 doesn't remember values on re-entry. If the values need to be remembered, they have to be SAVEd. There may be a compile flag to get around this.[/li]
[li]the use of hollerith constants. If, say, it was written for a CDC7600 with 6 bit characters and 60 bit words, and a lot of character assignments were done; those will need changing[/li]
[li]Use of assign for formats and assigned gotos. The newer compilers no longer allow assign so that will have to be recoded as a case statement.[/li]
[/ul]

Many of the programs I wrote wouldn't even build because I used to use all the little known features and vendor specific stuff that hardly anyone used. But that was my fault. Normal programs will just build and without any problems.

If you want something more funky like F90, F95, F03 or F08, that is a different ball game since lots of things have been removed and a whole new load of stuff has been added but there is nothing to stop you from writing F08 like F66! As the saying goes: you can write Fortran in any language.
 
Actually, since we are talking about evolution of the language, about things that have been taken out, and about the ones added, etc....maybe the more appropriate saying is:

I don't know what the programming language of the future is going to look like, but it is going to be called Fortran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor