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

Parameter Passing Question in IVF8.0

Zhanghong_T_
Novice
441 Views
Hi all,
There is another question bother me forsome time. I want to change the value of a parameter by passing the parameter to a subroutine. In CVF6.6, there is no such problem, the parameter is changed just as what I expected. But when I debug the same program in IVF8.0, the parameter isn't changed. My subroutine is listed as following:
module pp
integer, pointer::pi
contains
subroutine pass(i, ip)
integer i, ip
integer, pointer::pi
end subroutine
end
program test
integer::i
integer, pointer::pi=>null()
i=malloc(100)
call pass(i, loc(pi) )
end
0 Kudos
2 Replies
Zhanghong_T_
Novice
441 Views

Sorry, I have pasted the wrong code, below is the real codes which have the problems in IVF8.0 compiler.

module ppp
type node
type(node), pointer::next=>null()
endtype

type list
type(node), pointer::head=>null()
integer:: nodesize = 0
endtype
contains
subroutine pass( icurr, il)
integer icurr, ifl
type(node), pointer::curr
type(node), target:: T_curr
type(list), pointer::l
type(list), target:: T_l
pointer(icurr, T_curr)
pointer(il, T_l)
curr=>T_curr
l=>T_l
curr % next => l % head
l % head => curr
end subroutine
end module

use ppp
type(list), pointer::l
integer::t, tt
allocate(l)
l%nodesize=30
t=malloc(4 * l%nodesize)
do i=0,3
call pass(t+i*l%nodesize,loc(l))
enddo
end

0 Kudos
Steven_L_Intel1
Employee
441 Views
Are you using a current version of the compiler? There were some early bugs in the way that up-level referencing was handled.
0 Kudos
Reply