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

Error passing text-string in a subroutine call

reidar
New User
488 Views

Hi,

When compiling the code below I get the message:

Error 1  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 substring of such an element.   [TEXT] C:\CALC\veivaks\Veivaks2_IVF\Veivaks2_IVF\Example_Source1.F90 14 
Error 2  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 substring of such an element.   [TEXT] C:\CALC\veivaks\Veivaks2_IVF\Veivaks2_IVF\Example_Source1.F90 17 

This sibroutine and call has been used for VAX/VMS, MS Powerstation and with CVF without problems, but with IVF it do not work. What's wrong:

The example code is attached

Regards

 

 

0 Kudos
1 Solution
GVautier
New Contributor III
488 Views

Hello

Old compilers doesn't detect such usage : treating as character*1 array a character*n argument.

Replace

CHARACTER*1 TEXT(50),IEND,TEX(50)

by

CHARACTER*(*) TEXT

CHARACTER*1 IEND,TEX(LEN(TEXT))

and

TEXT(I)

by

TEXT(I:I)

I think it will works

View solution in original post

0 Kudos
1 Reply
GVautier
New Contributor III
489 Views

Hello

Old compilers doesn't detect such usage : treating as character*1 array a character*n argument.

Replace

CHARACTER*1 TEXT(50),IEND,TEX(50)

by

CHARACTER*(*) TEXT

CHARACTER*1 IEND,TEX(LEN(TEXT))

and

TEXT(I)

by

TEXT(I:I)

I think it will works

0 Kudos
Reply