Operating System - HP-UX
1745825 Members
4122 Online
108722 Solutions
New Discussion юеВ

Fortran error when compiling 11.0 code on 10.20

 
SOLVED
Go to solution
Jane Lecian
Valued Contributor

Fortran error when compiling 11.0 code on 10.20

Hello all,

We have developed some Fortran 90 code on an HP-UX 11.0 box with Fortran 90 version 2.5.1 (product number B.11.01.40). When we try to compile this same code on an 10.20 machine with Fortran 90 version 2.4 (product number BH.10.20.20), it gives up an "UNEXPECTED FORMAT ..." error for all the comments that we have placed to the right of code (in a nameless format). Is there some work around to this problem? I could go back and edit all the code to move the comments to seperate lines, but I am looking for something where we would not have to edit the source code.

Thanks,

Jane
3 REPLIES 3
harry d brown jr
Honored Contributor

Re: Fortran error when compiling 11.0 code on 10.20

In my college days, say in the very early 1980's, we used LINT to free ourselves. I doubt that's available today, but you never know.

Or you could write a program to preprocess your code before compiling it. That's one of the dangers of trying to make newer versions backwards compatible.

live free or die
harry

Live Free or Die
Solution

Re: Fortran error when compiling 11.0 code on 10.20

Modern Fortran compilers allow you to use Fortran-77 style fixed format (80 columns, column 6 significant, etc.) and free format (like all other programming languages). Perhaps there is a compilation switch for changing between these two options, which you need to provide.
Jane Lecian
Valued Contributor

Re: Fortran error when compiling 11.0 code on 10.20

Thanks all for your ideas.

We ended up running the code through a script to remove all the comments, and then it compiled just fine.

Jane