PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Question on using SAVE for arrays

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling
View previous topic :: View next topic  
Author Message
sarav



Joined: 28 Jul 2005
Posts: 2

PostPosted: Thu Jul 28, 2005 7:17 am    Post subject: Question on using SAVE for arrays Reply with quote

Hello,

After declaring an array in a subroutine, I would like to save it for future calls to the subroutine. My code looks as follows:

Code:
SUBROUTINE SUB (a,b,VAR1,x,y)
REAL VAR1(3, x, y)
SAVE VAR1


When I compile, I get an error as follows:
PGF90-S-0050-Assumed size array, VAR1, is not a dummy argument

This code was compiled successfully with XLF, but f90 chokes.
Any suggestions on how to compile this successfully with f90?

Thanks.

Sarav
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6213
Location: The Portland Group Inc.

PostPosted: Thu Jul 28, 2005 11:41 am    Post subject: Reply with quote

Hi Sarav,

The error message is a bit off but the problem is that Fortran does not allow the use of the SAVE attribute on dummy arguments. One thing you could do instead would be to put VAR1 into a module and make it an allocatable array.

I don't know why XLF allows this since it is illegal. Do they issue a warning and just ignore the save attribute?

- Mat
Back to top
View user's profile
sarav



Joined: 28 Jul 2005
Posts: 2

PostPosted: Fri Jul 29, 2005 2:11 pm    Post subject: Reply with quote

Hi Mat,

Thanks for the response.

From what you wrote, pgf90's error message that I got seems to be quite the opposite. Hope someone from PGF90 is reading this. Let me try what you suggested.

Your guess with XLF was right on. Yeah, it gave me a warning, ignored the save and proceeded with the compilation.

Sarav
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group