|
| View previous topic :: View next topic |
| Author |
Message |
sarav
Joined: 28 Jul 2005 Posts: 2
|
Posted: Thu Jul 28, 2005 7:17 am Post subject: Question on using SAVE for arrays |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 5001 Location: The Portland Group Inc.
|
Posted: Thu Jul 28, 2005 11:41 am Post subject: |
|
|
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 |
|
 |
sarav
Joined: 28 Jul 2005 Posts: 2
|
Posted: Fri Jul 29, 2005 2:11 pm Post subject: |
|
|
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 |
|
 |
|
|
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 © 2001, 2002 phpBB Group
|