(j3.2006) (SC22WG5.4576) Comments on N1885
Bill Long
longb
Thu Oct 27 17:22:15 EDT 2011
Thanks, Van, for carefully reading through the draft. Responses for some
of your observations:
On 10/26/11 1:34 PM, Van Snyder wrote:
>
> I have a few (possibly misguided) comments on N1885.
>
> 5.1p3 Note 5.2: Replace "within Fortran code" by "for a Fortran
> procedure"
>
OK.
> 5.4.2p1: It seems to be OK for a processor to decide that
> pure real function xyz ( x )
> integer, intent(in) :: x
> xyz = x + 1.0
> end function xyz
> is an asynchronous communication initiation or completion procedure.
>
So, you are saying that the description is too vague?
> 6.3p1: With the<array-spec> being<assumed-rank-spec> there's no place
> to write explicit lower bounds. Therefore, all elements of the LBOUND
> result would be 1. The last sentence ought to be something like "The
> value of the lower bound of each dimension of the dummy argument is 1,
> and the value of the upper bound of dimension N of the dummy argument is
> equal to the result of applying the SIZE intrinsic inquiry function to
> the actual argument with DIM=N specified."
>
The current text of LBOUND in F2008 already says that the LBOUND result
values are all 1 for an assumed-rank array (covered by the "otherwise"
branch.)
> 6.4.1p1: I don't understand how the expression can work.
>
> 6.4.3p1: After "result" insert "of UBOUND(ARRAY,RANK(ARRAY),[KIND])".
>
> 8.3.4p6: It's not obvious what attribute code ought to be used for an
> assumed-length character scalar. CFI_attribute_assumed is probably the
> correct one, but (if so) the description ought to say so.
>
The current text says CFI_attribute_assumed applies for a nonallocatable
nonpointer scalar. If your assumed-length character scalar is not
allocatable and not a pointer, then CFI_attribute_assumed is the right
answer. If it is allocatable, it is the wrong answer.
> 8.3.5.2p3: The symbol $r$ appears without explanation. After "array"
> insert "of rank $r$".
OK.
>
> 8.3.5.2p2, description of "subscripts": Is the order of subscripts the
> Fortran order or the C order?
>
It says "corresponding elements of the dim member", and the dim member
array is in the Fortran dimension order. The spec for CFI_dim_t in
8.3.3 is where we actually specify the order.
> 8.3.5.2p5: The example would be more informative if the subscripts were
> different. Inquiring minds might realize that Fortran and C subscripts
> have opposite ordering, and wonder which order they ought to appear in
> the subscripts array.
>
Good suggestion.
> 8.3.5.3p1: The style for descriptions in 1539-1 is telegraphic, and in
> active rather than passive voice. Replace "Allocates" with "Allocate".
>
OK.
> 8.3.5.3p2, descriptions of "lower_bounds" and "upper_bounds": Is the
> order of elements in the arrays the order of C array bounds or Fortran
> array bounds?
>
> 8.3.5.3p4: Is dv->elem_len updated if no error is detected?
>
If the type is character. Needs a fix.
> 8.3.5.3p7: The example would be more informative if the bounds were
> different. Inquiring minds might realize that Fortran and C bounds
> have opposite ordering, and wonder which order they ought to appear in
> the lower and upper arrays.
>
The upper bounds are already different (100 and 1000). Would 100 and 500
be better?
> 8.3.5.4p1: The style for descriptions in 1539-1 is telegraphic, and in
> active rather than passive voice. Replace "Deallocates" with
> "Deallocate".
>
OK.
> 8.3.5.5p1: The style for descriptions in 1539-1 is telegraphic, and in
> active rather than passive voice. Replace "Establishes" with
> "Establish".
>
OK.
> 8.3.5.5 generally: It's not obvious how to establish an assumed-length
> character scalar.
>
Do you mean one for which the length is deferred?
> 8.3.5.5p2, description of "extents": Is the order of extents the
> Fortran order or the C order?
>
> 8.3.5.7p1: The style for descriptions in 1539-1 is telegraphic, and in
> active rather than passive voice. Replace "Updates" with "Update".
>
OK.
> 8.3.5.7p2, description of "lower_bounds" and "upper_bounds": Is the
> order of elements in the arrays the order of C array bounds or Fortran
> array bounds? What is "the given array?" Should this be "the array
> described by the descriptor dv?" Is it OK for the number of elements
> to be> source->rank?
>
No. But, in C it is not clear how you would ever know.
> 8.3.5.7p2, description of "strides": Is the order of elements in the
> array the order of C array bounds or Fortran array bounds? Is it OK
> for the number of elements to be> source->rank?
>
No.
> 8.3.5.8p1: The style for descriptions in 1539-1 is telegraphic, and in
> active rather than passive voice. Replace "CFI_select part updates"
> with "Update".
>
OK.
> 8.3.5.8p2: It's not obvious how (or even if it's possible) to select a
> substring of a character array.
>
If it were not possible, the elem_len argument would not be part of the
formal parameter list. The displacement gives the offset from the
beginning of the character array element, and the elem_len gives the
length of the substring. The maximum size of the elem_len should
probably be source->elem_len - displacement*sizeof() for the type.
> 8.3.5.9p1: The style for descriptions in 1539-1 is telegraphic, and in
> active rather than passive voice. Replace "CFI_setpointer part
> updates" with "Update".
>
OK.
> 8.3.8p5 Note 8.12: "bind(c)" should be "bind(c,name='Cfun')", or "Cfun"
> in the narrative should be "cfun".
>
OK.
> 8.3.9p2,p3(1): "BIND" should be "BIND(C)"
>
The name of the attribute is "BIND" (5.3.5 in F2008), and the text being
replaced in F2008 by this text currently says "BIND", so I disagree with
this.
> 9.11p1: Values specified by attribute macros should be in the list.
>
OK.
Cheers,
Bill
>
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3
--
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