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

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

LinhSTM
Beginner
433 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
433 Views
0 Kudos
8 Replies
jimdempseyatthecove
Honored Contributor III
433 Views

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

Jim Dempsey

0 Kudos
andrew_4619
Honored Contributor II
433 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?

0 Kudos
mecej4
Honored Contributor III
433 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

 

0 Kudos
Steve_Lionel
Honored Contributor III
433 Views

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

0 Kudos
gib
New Contributor II
433 Views

Those logical operators are very sneaky.

0 Kudos
LinhSTM
Beginner
433 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 :)

0 Kudos
JVanB
Valued Contributor II
434 Views
0 Kudos
Steve_Lionel
Honored Contributor III
433 Views

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

0 Kudos
Reply