Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28636 Discussions

IVF Compiler fixed format error - illegal character

postaquestion
Novice
628 Views

Is there a way to compile this program?

PROGRAM HELLO
WRITE(*,1)
1 FORMAT('Hello World')
END

ifort doesn't like the FOR in columns 4,5,and 6. I have some source (hundreds of files) that is fixed format but labelled lines like format and continue don't start in column 7.

Illegal character in statement label field.

thanks.

0 Kudos
3 Replies
Steven_L_Intel1
Employee
628 Views
The only way that our compiler would accept that as "fixed form source" (.f or .for file type) is if the character following the 1 was a tab and not a blank. We support an extension called "tab source form" which you can look up in our documentation.

Otherwise, I would say that this is really a free-form source and should be compiled as such. You can use /free as an option if the file type is wrong.

If you really have hundreds of files like this, then either they have been corrupted or are really free-form source with the wrong file type. I don't know of any Fortran compiler that would accept this as fixed-form source.
0 Kudos
joerg_kuthe
Novice
628 Views

I haven't tried but I am quite sure that you can compile your program using the /FREE option.

Regarding your other fixed format files with FORMAT and CONTINUE statements not starting in column 7 or beyond, I suspect that there is a horizontal tabulator character (HT, ASCII 9) being used at the beginning.
I knowa compiler which accepts this and interprets HTas 8 characters, so this compiler would accept your sources. However if several HTs are used in a line of code, you might encounter the problem that the compiler tells you that thissource line is too long (> 72 or > 132 characters, respectively).
I don't know how IVF is handling HTs. From your experience I guess that an HT is taken as one character.

Joerg Kuthe
www.qtsoftware.de

0 Kudos
dobrien
Beginner
628 Views

Thanks for the replies.

It was my preprocessor. The Makefile was calling cpp which was removing the extra spaces. I changed the makefile to the Intel fpp for the preprocessor and it's working much better now.

By the way, free-format didn't work either because there were C's in the first column for comments instead of !'s.

0 Kudos
Reply