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

IIDEX gives error in v 6.6B

rahzan
Novice
394 Views
On using

routineX (line)
use numnerical_libraries, only: IIDEX
character(*), intent(in):: line
N=IIDEX(line, 'Hello')
...

I get the compiler error:

Error: If the actual argument is scalar, the corresponding dummy argument shall be scalar unless the actual argument is an element of an array that is not an assumed-shape or pointer array, or a subs

none of the inputs to IIDEX are arrays, or are they? I treied Line(:) but not good.

any ideas? else is there another case insensitive INDEX function?

Tim
0 Kudos
4 Replies
Steven_L_Intel1
Employee
394 Views
Well, here's the interface for IIDEX from NUMERICAL_LIBRARIES.F90:

      integer function iidex (chrstr, key) 
      character, dimension(*), intent(in) :: chrstr 
      character, dimension(*), intent(in) :: key 
      end function


So it is indeed an array in the interface, but the interface is wrong, if I look up the documentation on IIDEX. It seems there are a few others like this, where some programmer at VNI thought that the above declaration was the same as character(len=*).

You could create your own interface for IIDEX and rename the one from NUMERICAL_LIBRARIES to be something else, so as to not conflict. That's what I would recommend.

Steve
0 Kudos
rahzan
Novice
394 Views
Yes, those airheads!

The same problem exists with IICSR, and likely other string manipulation routines.

An easy solution seems to be to feed the args to trim(), e.g.

n=IIDEX(trim(a),trim(b))

I can only guess how this might address the problem.

tim
0 Kudos
Steven_L_Intel1
Employee
394 Views
I will make sure that this error is corrected for the 6.6C update (yes, still in the works.) We get the IMSL modules precompiled from VNI, but I went ahead and edited them to remove this class of error as well as a few others I observed.

I'll upload the corrected interfaces to our FTP site on Monday and provide a pointer here so that folks can try them.

Steve
0 Kudos
Jugoslav_Dujic
Valued Contributor II
394 Views
It looks as if history repeats... similar error existed on several places in early DFWIN versions (probably inherited from Microsoft). For one, I recall that WIN32_FIND_DATA had file name declared as CHARACTER:: cFileName(MAX_PATH) -- it was a real PITA to do anything with it :-(.

Jugoslav
0 Kudos
Reply