- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
ifort compiles the attached program without complaining. I wonder if some kind of a diagnostic message is necessary for subroutine f, which invokes subroutine g with an argument that may or may not be contiguous.
Link kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
current ifort:
test.f90(6): error #8375: Array section is not contiguous if it has stride other
than unity.
call g(x(1 : 10 : 2)) ! no good
-------------^
test.f90(6): error #8372: If dummy argument is declared CONTIGUOUS, actual argum
ent must be contiguous as well.
call g(x(1 : 10 : 2)) ! no good
-----------^
compilation aborted for test.f90 (code 1)
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
TimP (Intel) wrote:
current ifort:
test.f90(6): error #8375: Array section is not contiguous if it has stride other
than unity.
call g(x(1 : 10 : 2)) ! no good
-------------^
test.f90(6): error #8372: If dummy argument is declared CONTIGUOUS, actual argum
ent must be contiguous as well.
call g(x(1 : 10 : 2)) ! no good
-----------^
compilation aborted for test.f90 (code 1)
Line 6 is commented out. Please do not bring it back.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
f receives a contiguous copy and passes it on to g.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
TimP (Intel) wrote:
f receives a contiguous copy and passes it on to g.
Seemingly that is not the case with ifort. If you fill with the original x with 1, 2, ..., 10 and print out x(1) and x(2) in g, you get 1 and 2. gfortran 4.7 packs the noncontiguous argument in f before passing it to g and prints out 1 and 3.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
styc,
IVF requires caller to pass CONTIGUOUS array when dummy argument attributed with CONTIGUOUS.
gfortran apparently creates temporary array (when caller's arg not contiguous). This is equivalent to the called subroutine having no interface (explicit or implicit) with regard to the array dummy attributed CONTIGUOUS. Analogous to F90 calling F77 subroutine with no interface.
Sounds like an interpritation of the standards issue. Steve may be able to comment on this.
Jim Dempsey
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
The Fortran standard changed in this area since Fortran 2008 was published. Intel Fortran follows the original text that says:
The CONTIGUOUS attribute specifies that an assumed-shape array can only be associated with a contiguous effective argument.
Interpretation F08/0061 changed this to:
The CONTIGUOUS attribute specifies that an assumed-shape array is contiguous.
This interpretation was part of the just-approved Corrigendum 2 - we haven't caught up to that yet, but we will. I have filed issue DPD200241665 regarding this change.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Steve Lionel (Intel) wrote:
The Fortran standard changed in this area since Fortran 2008 was published. Intel Fortran follows the original text that says:
The CONTIGUOUS attribute specifies that an assumed-shape array can only be associated with a contiguous effective argument.
Interpretation F08/0061 changed this to:
The CONTIGUOUS attribute specifies that an assumed-shape array is contiguous.
This interpretation was part of the just-approved Corrigendum 2 - we haven't caught up to that yet, but we will. I have filed issue DPD200241665 regarding this change.
Thanks for the clarification. In that case, is implied pack/unpack (à la gfortran) the expected behavior?
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
I would say that, yes, that is the expected behavior.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Implemented in 15.0.
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite