- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everybody. I am currently writing a SUBROUTINE in which I need two variables to be saved between callings, namely et and ey.
If I declare them this way
SUBROUTINE mysub(y)
REAL(KIND=dp), DIMENSION(:) :: y
REAL(KIND=dp), SAVE :: et=0.0D0
REAL(KIND=dp), DIMENSION(SIZE(y,1)),SAVE :: ey=0.0D0
...
END SUBROUTINE mysub
the compiler complains: he doesn't like the SAVE attribute for the automatic-shaped array ey. I would like to obtain the same effect for ey, possibly without using allocatable array. I think this is a general feature in FORTRAN 90, and maybe has nothing to do with the IFORT compiler I'm using. Does anybody know how to overvcome the problem? Thank in advance.
Daniele
If I declare them this way
SUBROUTINE mysub(y)
REAL(KIND=dp), DIMENSION(:) :: y
REAL(KIND=dp), SAVE :: et=0.0D0
REAL(KIND=dp), DIMENSION(SIZE(y,1)),SAVE :: ey=0.0D0
...
END SUBROUTINE mysub
the compiler complains: he doesn't like the SAVE attribute for the automatic-shaped array ey. I would like to obtain the same effect for ey, possibly without using allocatable array. I think this is a general feature in FORTRAN 90, and maybe has nothing to do with the IFORT compiler I'm using. Does anybody know how to overvcome the problem? Thank in advance.
Daniele
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page