- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
![](/skins/images/895D6060305DF45A57FACF854B5A8CD1/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page