- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a question how to use a part of an array as an argument in a function. How large a part I want to send to the subroutine varies.
Program
integer ix1,ix2,a(100,100)
do i=1,9
ix1=1+(i-1)*10
ix2=i*10
call sub(a(ix1:ix1+i,ix2:ix2+i))
enddo
stop
end
How shall I declare the array in subroutine sub to make it work (if possible)?
Best regards
Anders S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Best way is to declare as an assumed-shape array, (:,:). An explicit interface to the subroutine must be visible to the caller. See here.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Best way is to declare as an assumed-shape array, (:,:). An explicit interface to the subroutine must be visible to the caller. See here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
Thanks a lot for a rapid answer! Your suggestion has already been implemented and works fine.
Best regards
Anders S
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page