Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29249 ディスカッション

error #6633: ...actual argument differs from dummy argument...IVF 11.0

psaba
ビギナー
1,398件の閲覧回数

Hi

I downloaded IVF 11.0 which has the latest Fortran compiler & MKL bundles. I made use of IMSL libs from the earlier verison (10.025). When i compiled my application, I get the following error:

"error #6633: ...actual argument differs from dummy argument.....". (the code snippet is incomplete...)

-----------------------------------

program main

common a(100)

n1 = 1

n2 = 11

n3 = 21

call foo(a(n1), a(n2), a(n3))

....

stop

end

subroutine foo(x, y, narr)

dimension x(1), y(1), narr(1)

do i=1,10

x(i) = y(i) + real(narr(i))

enddo

return

end

------------------------------------------

Basically, I am unable to share the data from "a(n3)" and "narr()". I included the compiler/linker/libraries/include options in tools->options->fortran, project->properties->fortran and project->properties->linker locations. In addition, i have include /force:multiple in my linker command line.

Please help!

Thanks

Praba

0 件の賞賛
7 返答(返信)
Les_Neilson
高評価コントリビューター II
1,398件の閲覧回数
Quoting - psaba
program main

common a(100)

You could add :

integer narr(10)
equivalence (narr,a(21))
always assuming that a(21) to a(30) contain valid integers of course.

then you change the call to :
call foo(a(1),a(11),narr(1))

Les

pchidamb
ビギナー
1,398件の閲覧回数
Quoting - psaba

Hi

I downloaded IVF 11.0 which has the latest Fortran compiler & MKL bundles. I made use of IMSL libs from the earlier verison (10.025). When i compiled my application, I get the following error:

"error #6633: ...actual argument differs from dummy argument.....". (the code snippet is incomplete...)

-----------------------------------

program main

common a(100)

n1 = 1

n2 = 11

n3 = 21

call foo(a(n1), a(n2), a(n3))

....

stop

end

subroutine foo(x, y, narr)

dimension x(1), y(1), narr(1)

do i=1,10

x(i) = y(i) + real(narr(i))

enddo

return

end

------------------------------------------

Basically, I am unable to share the data from "a(n3)" and "narr()". I included the compiler/linker/libraries/include options in tools->options->fortran, project->properties->fortran and project->properties->linker locations. In addition, i have include /force:multiple in my linker command line.

Please help!

Thanks

Praba

pchidamb
ビギナー
1,398件の閲覧回数
Quoting - pchidamb
Just to add to my previous post...
This code snippet is demo sample from IVF newsletter...

".........................

May 1998

"Ask Dr. Fortran"
Steve Lionel

Dear Dr. Fortran,

I know this program who seems to be OK, but he is a little different from all the other programs. (Just between you and me, he is a legacy program. Don't let that get out. It would not be politically correct.)

But lets give this a go. I need some help understanding what really goes on in this guys head. There are many cases of the following coding:

     
        subroutine xyz(n,array)
        integer n
        real array(1)      <-- Note the size is only 1
           . . .           <-- code in here loops from 1 to n.
        return
        end
........"
To be precise, "Do i need to play with compiler settings to make this sample code to get compiled/linked in IVF 11.0?"

ender01
新規コントリビューター I
1,398件の閲覧回数
Quoting - pchidamb

I suspect that this has something to do with the fact that a is implicitly typed as a real and you're passing it to narr which is implicitly typed as an integer. Note that the Dr. Fortran column explicitly typed the variables.

Cheers,

Rich

pchidamb
ビギナー
1,398件の閲覧回数
Quoting - psaba

Hi

I downloaded IVF 11.0 which has the latest Fortran compiler & MKL bundles. I made use of IMSL libs from the earlier verison (10.025). When i compiled my application, I get the following error:

"error #6633: ...actual argument differs from dummy argument.....". (the code snippet is incomplete...)

-----------------------------------

program main

common a(100)

n1 = 1

n2 = 11

n3 = 21

call foo(a(n1), a(n2), a(n3))

....

stop

end

subroutine foo(x, y, narr)

dimension x(1), y(1), narr(1)

do i=1,10

x(i) = y(i) + real(narr(i))

enddo

return

end

------------------------------------------

Basically, I am unable to share the data from "a(n3)" and "narr()". I included the compiler/linker/libraries/include options in tools->options->fortran, project->properties->fortran and project->properties->linker locations. In addition, i have include /force:multiple in my linker command line.

Please help!

Thanks

Praba

MiB1980
ビギナー
1,398件の閲覧回数

What happens if we are calculating n3 runtime? Is there a way of overcoming this difficulty ? (Calling equivalence is not possible then)
TimP
名誉コントリビューター III
1,398件の閲覧回数
And why should this be accepted? Even if this code were written in the style of 30 years ago, the variable length arrays in the subroutine must be declared with size (*) or with the size explicitly passed as a scalar argument, in addition to correcting the type mismatch which others pointed out.
Passing real data to a subroutine which takes them as integer and converts them to real can't do anything useful.
返信