- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- f90 bug: calling sub with pointer array
Operating System - HP-UX
1824169
Members
3356
Online
109668
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2000 01:09 PM
11-28-2000 01:09 PM
f90 bug: calling sub with pointer array
I'm using f90 (v2.4 20000107) on HP-UX 10.20. I think there is a bug when passing a pointer array to a subroutine. See the attached example.
With an array with pointer,
real(8), pointer :: hugearray(:)
When it is passed to a subroutine, I think passing by reference should be used. The dummy array in the sub will be associated with the same memory allocated for hugearray.
However, when "call sub(hugearray,...)" is used, f90 seems to use passing by "copy-in/copy-out" for the array. It creates another copy of the array, passing the address of the new array to the sub, and copy the results back to the original array on return. The result is correct but it uses twice as much as memory.
When "call sub(%ref(hugearray))" is used, another copy of the array is also created. However, the changes made in sub are not copy back in the calling routine.
Only when "call sub(hugearray(1))" is used, the dummy argumenet is associated with the memory allocated for hugearray. However, using an element of an array for a dummy argument array is NOT standard comforming.
Does anyone else has the some kind of problem? Is there a patch or work around for the problem?
Thanks.
Dong Zheng
With an array with pointer,
real(8), pointer :: hugearray(:)
When it is passed to a subroutine, I think passing by reference should be used. The dummy array in the sub will be associated with the same memory allocated for hugearray.
However, when "call sub(hugearray,...)" is used, f90 seems to use passing by "copy-in/copy-out" for the array. It creates another copy of the array, passing the address of the new array to the sub, and copy the results back to the original array on return. The result is correct but it uses twice as much as memory.
When "call sub(%ref(hugearray))" is used, another copy of the array is also created. However, the changes made in sub are not copy back in the calling routine.
Only when "call sub(hugearray(1))" is used, the dummy argumenet is associated with the memory allocated for hugearray. However, using an element of an array for a dummy argument array is NOT standard comforming.
Does anyone else has the some kind of problem? Is there a patch or work around for the problem?
Thanks.
Dong Zheng
- Tags:
- f90
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP