- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
I would like to use an array with variable rank, i.e. in one run array(2,3), in another run array(3,4,5) and in another run array(5,4,3,2) ...
Please can anyone explain to me, how I can program this?
Thanks,
Dieter
I would like to use an array with variable rank, i.e. in one run array(2,3), in another run array(3,4,5) and in another run array(5,4,3,2) ...
Please can anyone explain to me, how I can program this?
Thanks,
Dieter
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Look at using C_F_POINTER
When the data is ina contiguous chunk you can convert the LOC of the first cell into a C_PTR and then use the C_PTR in C_F_POINTER to convert to a rank 1 through rank 7 array. The only limitation is the conversion produces an array with lower bounds of 1.
Jim Dempsey
When the data is ina contiguous chunk you can convert the LOC of the first cell into a C_PTR and then use the C_PTR in C_F_POINTER to convert to a rank 1 through rank 7 array. The only limitation is the conversion produces an array with lower bounds of 1.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One approach is to make array have as many dimensions as you are ever going to need (seven is the maximum anyway) and leave the unneeded dimensions with an extent of one - array(2,3,1,1), array(3,4,5,1) array(5,4,3,2).
Or you could roll your own array indexing into a rank one array: array(idx_fn(array_size, [2,3])), where idx_fn calculates the appropriate rank one index to use.
Or a bit of both!
Or you could roll your own array indexing into a rank one array: array(idx_fn(array_size, [2,3])), where idx_fn calculates the appropriate rank one index to use.
Or a bit of both!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Don't count on the rank being limited to 7. F2008 raises that to 15.
A proposal for F2008 (not in the standard but in a "Technical Report" being discussed) adds an "assumed rank" feature that would make such things easier.
A proposal for F2008 (not in the standard but in a "Technical Report" being discussed) adds an "assumed rank" feature that would make such things easier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Jim,
unfortunatly I have make a misprint and have rated your postingas poor. Of course, this is not poor, but also a good answer.
I apologize for this but cannot correct my rating.
Dieter
unfortunatly I have make a misprint and have rated your postingas poor. Of course, this is not poor, but also a good answer.
I apologize for this but cannot correct my rating.
Dieter
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