- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All, For a Fortran array, Is there any compiler specific parameter to set the array lower bound to zero? Because Linux considers the lower bound as one always.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think we need some clarification of what you are asking.
real a(0:n)
declares an array of size n+1 with a lower bound of 0 within the scope of the declaration. If accessed from outside this scope, with unspecified lower bound, it may appear as a lower bound of 1.
I don't see how this is specific to linux, unless you can clarify, or provide a specific example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is the Fortran standard that specifies the default lower bound as 1, not Linux.
If you want to use a lower bound of 0 (or anything other than 1), you have to program explicitly for it. It can be troublesome to pass such arrays to standard library routines such as those in BLAS/Lapack.
As far as linear algebra is concerned, for most algorithms a lower bound of zero is not in agreement with standard mathematical conventions. For example, we do not talk of "row number zero of matrix M".
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page