gfortran fails to compile program that compiles with intel fortran
Axel Freyn
axel-freyn@gmx.de
Mon Mar 1 10:25:00 GMT 2010
Hi Raphaël,
Well, it's almost impossible to give a useful hint without knowing
exactly what you are doing. The optimal would be if you could sent a
minimal testcase which produces the error.
> I have a program here that compiles with intel's ifort, but fails
> compiling with gfortran with the following errors :
>
> ------
> calmag_epicdist_1-320km_v32_ext_feb2010.f:803.72:
>
> write(62,*) rmagmoytot2(iwinmag),ecart2(iwinmag),icompt2(iwinmag
>
> 1
> Error: Invalid form of array reference at (1)
> calmag_epicdist_1-320km_v32_ext_feb2010.f:804.20:
>
> write(62,*) 'Mw, standard deviation, and number of stations used
> 1
> Error: Unterminated character constant beginning at (1)
> ------
However, I would assume that the gfortran-Compiler which you used
assumed the code to be Fortran 77 in fixed-form syntax, and thus only
interpreted the first 72 columns and threw away the remaining
characters.
If you save the file with the extension ".f90" instead of ".f", maybe it
will work (see the documentation of gcc: ".f" is interpreted as "Fixed
form Fortran source code", ".f90" as "Free form Fortran source code")
HTH,
Axel
More information about the Fortran
mailing list