- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We have a (F77) program that dynamically allocates a large chunk of memory that is managed as a buffer that could be used as either integer, real or double precision. The memory management was a previous compiler's proprietary system that we are looking to convert to CVF. In CVF/F90 I can allocate the memory and use a saved pointer to make it available across many separately compiled modules, but I can't get the pointer array definition to accept a different type. Is there a way around (or through) this in F90?
CVF also has a malloc / loc feature that might offer a possibility (not F90, but at this stage I'm not that fussed), but as far as I can see with that mechanism, I can't reference the memory like a standard array reference.
I'd appreciate any ideas on the dilemma. Thanks.
CVF also has a malloc / loc feature that might offer a possibility (not F90, but at this stage I'm not that fussed), but as far as I can see with that mechanism, I can't reference the memory like a standard array reference.
I'd appreciate any ideas on the dilemma. Thanks.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In standard F90, no. But if you don't mind extensions...
Steve
integer i real r,x pointer (p,i) pointer (p,r) x = 1.4 p = loc(x) write (*,*) i end
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve.
I had been using a "non-standard" construct in the first place. While it's much "nicer" (more maintainable, portable, etc) to use standard constructs, I do need to get a job done! Thanks.
Geoff
I had been using a "non-standard" construct in the first place. While it's much "nicer" (more maintainable, portable, etc) to use standard constructs, I do need to get a job done! Thanks.
Geoff

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