(j3.2006) Clarify F08/0147 ?

Bill Long longb
Tue Nov 3 17:08:33 EST 2015


In working through the test case in Interp F08/0147, I think I understand the change, but the words I was looking for are not part of the answer.  The test case is:

 Module da_module
    Type t
      Real c
    End Type
    Interface Assignment(=)
      Module Procedure edasgn
    End Interface
  Contains
    Elemental Subroutine edasgn(a,b)
      Class(t),Intent(Out) :: a
      Class(t),Intent(In) :: b
      a%c = -b%c
    End Subroutine
  End Module
  Program edatest
    Call test(10,10,13)
  Contains
    Subroutine test(n,n2,m)
      Use da_module
      Type(t) :: x(n),z(m)
      Type(t),Allocatable :: y(:)
      x%c = [ (i,i=1,n) ]
      z%c = [ (i,i=1,m) ]
      Allocate(y(n2),Source=t(0))
      y = x                        ! A
      Print 1,y
    1 Format(*(1X,F0.1,:))
      y = z                        ! B
      Print 1,y
    End Subroutine
  End Program

With the change made by the edits, it appears that

1) The assignment A is defined assignment and is conforming (from first edit).

2) The assignment B is not standard conforming, since the shapes are not the same (from second edit).

3) Effectively, auto-reallcation on assignment will not occur if the assignment is defined assignment and the subroutine is elemental (since the shapes already agree).

All of which is fine with me. 

Cheers,
Bill


Bill Long                                                                       longb at cray.com
Fortran Technical Support  &                                  voice:  651-605-9024
Bioinformatics Software Development                     fax:  651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101





More information about the J3 mailing list