×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

# Contact US

Log In

#### Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
To Your Posts
• Keyword Search
• One-Click Access To Your
Favorite Forums
• Automated Signatures
On Your Posts
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

# RECURSIVE FUNCTION - compaq visual fortran 6.6

 Forum Search FAQs Links MVPs

## RECURSIVE FUNCTION - compaq visual fortran 6.6

(OP)
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?

### RE: RECURSIVE FUNCTION - compaq visual fortran 6.6

You need to expand the definitions of V1.

Often, I have found that you can compile and execute correctly without optimization.  Try that.

### RE: RECURSIVE FUNCTION - compaq visual fortran 6.6

(OP)
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.

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

### Reply To This Thread

#### Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!

Already a member? Close this window and log in.