Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

RECURSIVE FUNCTION - compaq visual fortran 6.6

Status
Not open for further replies.

ivano

New member
Feb 1, 2007
2
IT
I'm using a recursive function with compaq visual fortran 6.6. I've already used this feature in many programs, but now it seems to have some problem. While the computations at the lowest level seem to be correct, the final result is like out of flow.

VO( 1:M1)=funct(p1,VI( 1:N1),flag)+
! funct(p2,VI(N1+1:N2),flag)
VO(M1+1:M2)=funct(p3,VI( 1:N1),flag)+
! funct(p4,VI(N1+1:N2),flag)

funct is the recursive function
VO is the output vector (result)
Where could be the problem. Could this be a compiler bug?
 
Replies continue below

Recommended for you

You need to expand the definitions of V1.

Often, I have found that you can compile and execute correctly without optimization. Try that.
 
I solved the problem by declaring the result variable as POINTER instead of ALLOCATABLE. The fact is that the same cose run perfectly on a previous machine, while experienced this problem on a new one. POINTERS allow for a more powerful management of dynamically allocated memory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top