Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
36 Views

the scalar argument can't be passed to a dummy assumed-size array argument for ivf2018

recently i wanna compile some old source files(F77), and many subroutines are like this:

!------------------------

subroutine func(x)

real,dimension(*):: x  !dummy assumed-size array

end subroutine func

 

program main

real:: a

call func(a)  !call  with an actual scalar

end program main

!-----------------------

 

ivf2017u7 is ok for this code but ivf2018u1 throw out the error message #8284: if the actual argument is scalar, the dummy argument shall be scalar......

so  is it a temporary compiler bug for ivf2018 or ivf decide to delete this rule?

 

 

0 Kudos
6 Replies
Highlighted
Black Belt Retired Employee
36 Views

Your program is not standard F77. The 2017 compiler (and many older ones) can also detect this, but if the subroutine and call are in different source files, it requires "generated interface checking" to be enabled AND for the subroutine to be compiled first. That option has been the default for many years. It is not a compiler bug.

I wrote about this back in 2009 (see the section on Sequence Association). Does the subroutine try to change the value of the argument? If not, you can pass instead and satisfy the rule.

0 Kudos
Highlighted
Beginner
36 Views

Steve Lionel (Ret.) wrote:

Your program is not standard F77. The 2017 compiler (and many older ones) can also detect this, but if the subroutine and call are in different source files, it requires "generated interface checking" to be enabled AND for the subroutine to be compiled first. That option has been the default for many years. It is not a compiler bug.

I wrote about this back in 2009 (see the section on Sequence Association). Does the subroutine try to change the value of the argument? If not, you can pass instead and satisfy the rule.

thank you for your advice

you said ivf2017 would detect this but i tried with disable/enable "check routine interface"(i didn't find the "generated interface checking") and split subroutine and call into two files, there is no warning and no error.  

ok, this does't matter. i need to know what i should do with these code for ivf2018 and the later version

 

some subroutines in code really changed the value of the argument

so as your opinion, there is nothing i can do for the compiling with ivf2018 but modify the source file, right?

0 Kudos
Highlighted
Black Belt Retired Employee
36 Views

I'd be interested in seeing the actual source files involved and the buildlog.htm. You can turn off "Check Routine Interfaces" and this error will (probably) go away, but that's like running a power saw without a blade guard. My advice would be to correct the error in your code.

0 Kudos
Highlighted
Beginner
36 Views

Steve Lionel (Ret.) wrote:

I'd be interested in seeing the actual source files involved and the buildlog.htm. You can turn off "Check Routine Interfaces" and this error will (probably) go away, but that's like running a power saw without a blade guard. My advice would be to correct the error in your code.

sorry, i can't offer you the code because the my teacher does not allow this

i will try your advice because i think this code is stable

0 Kudos
Highlighted
Black Belt Retired Employee
36 Views

linying l. wrote:

Quote:

i will try your advice because i think this code is stable

I've heard that many times before. More often than not, the code isn't in fact "stable" and has been producing wrong answers for years. But you do what you need to do. If it were me, I would not let incorrect code remain in my source.

0 Kudos
Highlighted
Beginner
36 Views

Steve Lionel (Ret.) wrote:

Quote:

linying l. wrote:

 

Quote:

i will try your advice because i think this code is stable

 

 

I've heard that many times before. More often than not, the code isn't in fact "stable" and has been producing wrong answers for years. But you do what you need to do. If it were me, I would not let incorrect code remain in my source.

thank you again. i will try.

0 Kudos