Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26753 Discussions

Cannot regconize operator when migration from Compaq visual Fortran 6.1 (CVF) to Intel Visual Fortran (IVF)

LinhSTM
Beginner
134 Views

I am newbie in Fortran. I have to convert  fortran src code from Compaq visual fortran 6.0 to Intel visual fortran 2018. 

I follow step by step in https://software.intel.com/en-us/articles/migrating-from-compaq-visual-fortran but when build, the error about the compiler does not regconize the operator "<>" (NEG) is displayed. When I change all the error point from <> to /=, it build success but the whole library is quite huge and I thought, maybe have some kind of option will make me don't have to change line by line. Anyone have any idea  about the root cause of this error, please let me know.

P/S: all the source code extension are .for and .f

Thank in advances

0 Kudos
1 Solution
JVanB
Valued Contributor II
134 Views
8 Replies
jimdempseyatthecove
Black Belt
134 Views

You are going to have to grin and bear it. Fortunately VS can perform entire Solution Find and Replace (with query).

Jim Dempsey

andrew_4619
Honored Contributor I
134 Views

I've never seen "<>" used for ".NE." or "/=" was that legal in CVF and if so what flavour of Fortran did it come from?

mecej4
Black Belt
134 Views

I don't have CVF 6.0, and you have not shown the exact usage of '<>', but the CVF6.6C compiler does not accept the following program.

program tst
integer i,j
i=3; j=4
if(i <> j)print 'Not equal'
end program

The compile time error is:

Compaq Visual Fortran Optimizing Compiler Version 6.6 (Update C)
Copyright 2003 Compaq Computer Corp. All rights reserved.

landg.f90
landg.f90(4) : Error: Syntax error, found '>' when expecting one of: ( <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> ...
if(i <> j)print 'Not equal'

If you cannot get your program source editor to do the replacement of '<>' by '/=', the following SED command (in Unix/Linux/Windows-Cygwin/Windows Bash) will do the conversion:

sed -e "/<>/s//\/=/g" landg.f90 > newLandG.f90

 

Steve_Lionel
Black Belt Retired Employee
134 Views

I have a vague memory that <> crept in to CVF unintentionally and we removed it when we found it.

gib
New Contributor II
134 Views

Those logical operators are very sneaky.

LinhSTM
Beginner
134 Views

andrew_4619 wrote:

I've never seen "<>" used for ".NE." or "/=" was that legal in CVF and if so what flavour of Fortran did it come from?

The source come from my customer made from at least 20 years ago . It kind of curious when I saw something new and I don't even know what the cause of problem. I will take a look back everything tomorrow.

Thank you all you guys for quick reply :)

JVanB
Valued Contributor II
135 Views
Steve_Lionel
Black Belt Retired Employee
134 Views

Yes, it's BASIC syntax. We decided that we didn't want to support it so took it out.

Reply