User forums > Using Code::Blocks
Converting older fortran files to .f90
(1/1)
LeoIgor:
Hello!
I have the source code for a program that was written in Fortran 77 (iFILE.F).
I get many compiler errors when I try to compile this file. I believe the problem is that many of the lines of code exceed the 72 columns allowed in Fortran 77. I want to convert this file to a .f90. Is there a simple command for CodeBlocks, command line or some fortran programm that I can use to convert this file or do I have to do it manually?
gd_on:
have a look at gfortran compilation options (https://gcc.gnu.org/onlinedocs/gfortran/Option-Summary.html or https://gcc.gnu.org/onlinedocs/gfortran/Fortran-Dialect-Options.html#Fortran-Dialect-Options and many other web pages ...)
If your problem is the length of lines, you can add options as -ffixed-line-length-none or -ffree-line-length-none or -ffixed-line-length-n or -ffree-line-length-n (n max number of characters in the line).
You can also try to change the extension of the file : .F and .f have not the same defaults compilation options for example.
Anf, if you are on Windows, don't use TDM gfortran 5.1 : it's bugged !
gd_on
LeoIgor:
--- Quote from: gd_on on July 09, 2018, 08:59:22 am ---have a look at gfortran compilation options (https://gcc.gnu.org/onlinedocs/gfortran/Option-Summary.html or https://gcc.gnu.org/onlinedocs/gfortran/Fortran-Dialect-Options.html#Fortran-Dialect-Options and many other web pages ...)
If your problem is the length of lines, you can add options as -ffixed-line-length-none or -ffree-line-length-none or -ffixed-line-length-n or -ffree-line-length-n (n max number of characters in the line).
You can also try to change the extension of the file : .F and .f have not the same defaults compilation options for example.
Anf, if you are on Windows, don't use TDM gfortran 5.1 : it's bugged !
gd_on
--- End quote ---
Thank you!
Navigation
[0] Message Index
Go to full version