- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Balises:
- Intel® Fortran Compiler
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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".
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable