(j3.2006) J3 Fortran interp letter ballot #22 - due 19-Nov-2010

Bill Long longb
Wed Oct 20 18:11:57 EDT 2010



J3 Fortran Letter Ballot 22:

Vote from Bill Long, Cray Inc.

Yes  No   Number     Title

-C-  ---  F03/0030   IEEE divide by zero
-Y-  ---  F03/0048   Control edit descriptors in UDDTIO
-Y-  ---  F03/0085   Finalizing targets of pointer or allocatable
                       actual arguments
-Y-  ---  F03/0091   Array components cannot depend on length type
                       parameters
-Y-  ---  F03/0096   Can a read statement change the unit value?
-Y-  ---  F03/0105   SIZE= specifier and UDDTIO
-C-  ---  F03/0110   Error in field width for special cases of signed
                       INFINITY output
-Y-  ---  F03/0121   Precise FP semantics of the REAL intrinsic
-Y-  ---  F03/0123   Implicit typing in derived types
-Y-  ---  F03/0124   definition is poorly defined
-Y-  ---  F03/0128   Subobjects in namelist output
-Y-  ---  F08/0006   generic resolution with banned argument
                       combinations
-Y-  ---  F08/0040   MOVE_ALLOC for coarrays
-C-  ---  F08/0041   Segment ordering rules
-Y-  ---  F08/0042   SOURCE= questions
-Y-  ---  F08/0043   Executing a type-bound procedure on a coindexed
                       object
-Y-  ---  F08/0044   Resolving the type of a coarray or coindexed object
-Y-  ---  F08/0045   constraints on entities of type LOCK_TYPE
-y-  ---  F08/0046   VALUE attribute restrictions
-Y-  ---  F08/0047   public generic with same name as private type
---  -N-  F08/0048   Sequence association for coarrays
-C-  ---  F08-0049   ELEMENTAL functions with nonconstant type parameters


Comments:

F03/0030: In the History section, 10-nnn should be 10-238r1.

F03/0110: I assume the title should be "Restoring dropped restriction
on ENTRY " - at least that is what is in 10-248 and in 10-254 where
the full interp is included.  In the ANSWER section, the reference in
10-007 should be 310:5-8 (not 10:5-8).

F08/0041: In PROGRAM example1, the declaration of the p component of
type t2 should be TYPE(t1),POINTER :: P, and not TYPE(T2)... I suspect
this is just a typo. The current version results in errors later (y%p
=> x has mismatched types.)

F08/0048: The proposed restriction on coarrays as actual arguments
sequence associated with a contiguous dummy makes yet another
exception to ordinary array behavior for coarrays. In this case, there
seems to be no justification other than the view that sequence
association of arguments is archaic. I think that the confusion
introduced by making another case where coarrays are different from
ordinary arrays is less desirable that allowing coarrays to behave
like "old" arrays.

F08-0049: In the example code, the function gcd(..) is type REAL, but
a reference to it is used later to be the len parameter value in a
character(gcd(..)) declaration.  The function gcd should be modified
to return an integer result.  If there is interest, this is an
executable version of the test case:

   MODULE ex1
     INTEGER :: mylen
   CONTAINS
     ELEMENTAL CHARACTER(mylen) FUNCTION f(a)
       INTEGER,INTENT(IN) :: a
       f = REPEAT(CHAR(a),mylen)
     END FUNCTION
   END MODULE

   ELEMENTAL FUNCTION ex2(a,b)
     CHARACTER(*),INTENT(IN) :: a,b
     CHARACTER(LEN(a)+LEN(b)) :: ex2
     ex2 = a//b
   END FUNCTION

   MODULE ex3
     INTEGER,ALLOCATABLE :: x(:)
   CONTAINS
     PURE FUNCTION gcd(a)
       INTEGER,INTENT(IN) :: a(:)
       integer :: gcd
       gcd = sum(a)
     END FUNCTION
     ELEMENTAL FUNCTION f(y,z)
       CHARACTER(*),INTENT(IN) :: y,z
       CHARACTER(gcd([x,LEN(y),LEN(z)])) :: f
       f = "1234567890"
     END FUNCTION
   END MODULE

program test
call test1
call test2
end program test

subroutine test1
use ex1

mylen=10
print *, f(ichar("x"))
end subroutine test1

subroutine test2
use ex3

allocate(x(3))
x = [1,1,1]
print *, f("11","222")
end subroutine test2


with output:

 > ./a.out
  xxxxxxxxxx
  12345678


-- 
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