From janshep@watson.ibm.com Fri Jan 19 10:20:41 1996
Received: from convex.convex.com by mozart.convex.com (8.6.4/1.28)
	id KAA27249; Fri, 19 Jan 1996 10:20:36 -0600
Received: from watson.ibm.com by convex.convex.com (8.6.4.2/1.35)
	id KAA26959; Fri, 19 Jan 1996 10:26:09 -0600
Message-Id: <199601191626.KAA26959@convex.convex.com>
Received: from YKTVMV by watson.ibm.com (IBM VM SMTP V2R3) with BSMTP id 6043;
   Fri, 19 Jan 96 11:25:12 EST
Date: Fri, 19 Jan 96 11:25:11 EST
From: "Janice C. Shepherd" <janshep@watson.ibm.com>
To: lrr@cray.com, bleikamp@convex.convex.com, whitlock@tle.enet.dec.com,
        gra@epcfta.edinburgh.ac.uk
Status: OR

                                                        PC File: 96-006b.040
                                                        Archive: 96-006.B040
--------------------------------------------------------------------------------

NUMBER: 000040
TITLE: Allocation of arrays of pointers
KEYWORDS: array of pointers, pointer allocation, structure
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION:  Consider the following code fragment:

          TYPE DEF
            INTEGER I
            INTEGER, POINTER :: PTR
          END TYPE

          TYPE (DEF) :: STRUCT (5)
          ...
          ALLOCATE (STRUCT%PTR)

Are the following quotations from the standard sufficient to declare this code
fragment to be nonstandard-conforming?

The constraint immediately following R628

    "Each <allocate-object> must be a pointer or an allocatable array."

The second sentence of the fourth constraint after R613

    "A <part-name> to the right of a <part-ref> with nonzero rank must not
    have the POINTER attribute."

ANSWER: The ALLOCATE statement in the example is not permitted by the syntax
rules and constraints of the standard:

    R625 <allocate-object>     is <variable-name>
                               or <structure-component>

    R614 <structure-component> is <data-ref>

    R612 <data-ref>            is <part-ref>[%<part-ref>]...

    R613 <part-ref>            is <part-name>[(<section-subscript-list>)]

    Constraint: A <part-name> to the right of a <part-ref> with nonzero rank
    must not have the POINTER attribute.

REFERENCES: ISO/IEC 1539:1991 (E) sections 6.1.2 and 6.3.1
EDITS: None.
SUBMITTED BY: Larry Rolison, X3J3/92-056
HISTORY: Approved as X3J3/92-069 at meeting 121
         92-267r m123 Edit approved
         N881 WG5 approval
-------------------------------------------------------------------------------

NUMBER: 000041
TITLE: Procedure with target dummy argument requires explicit interface
KEYWORDS: argument - dummy, interface - explicit, TARGET attribute
DEFECT TYPE: Erratum
STATUS: WG5 approved; ready for SC22

QUESTION: If a procedure has a dummy argument that has the TARGET attribute, it
must have an explicit interface (section 12.3.1.1).  The TARGET attribute is
defined solely for the purpose of aiding optimization (C.5.3).  Why must such a
procedure have an explicit interface?

ANSWER: Section C.5.3 is in error by stating the TARGET attribute is solely to
aid optimization. The supplied edit corrects the error.

Discussion: Defect item 000125 supplies edits to make it clear that:

    If the dummy argument has the TARGET attribute and the
    corresponding actual argument has the TARGET attribute but is not
    an array section with a vector subscript:

        (1) Any pointers associated with the actual argument become associated
            with the corresponding dummy argument on invocation of the
            procedure.

        (2) When execution of the procedure completes, any
            pointers associated with the dummy argument remain
            associated with the actual argument.

In this case, the simple argument association mechanism that involves supplying
only the location of the first storage unit of the argument or of a copy of the
argument (see C.12.5) is not adequate at the point of reference.  In particular,
the location of the actual argument and details of its layout in storage may
need to be available within the called routine to ensure that the pointer
association works as described.

EDIT:  Section C.5.3, second sentence, change "solely" to "primarily". [269:21]

SUBMITTED BY: K. Kazumura, X3J3/92-048 (121-ADT-8) page 23
HISTORY: Posted request to f90 interp e-mail
         ui 82, ui 111, ballot, 92-329 (jw note)
         92-070 m121 Approved
                m123 Approval rescinded (uc)
         93-101 m124 Revised response adopted by uc
         93-111 m125 ballot approved
                m128 Status changed to "consideration in progress" as this
                       refers to edits in 000121 that no longer exist
         94-235 m130 draft revision, approved uc
         94-306 m131 X3J3 ballot approved 18-1
         95-044 m132 WG5 ballot approved
--------------------------------------------------------------------------------

NUMBER: 000042
TITLE: KIND parameter value
KEYWORDS: kind type parameter, constant
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION:  It is stated in section 5.1.1.2 that:

    An entity declared with type specifier REAL(KIND(0.0)) is of the same
    kind as one declared with the type specifier REAL.

There are similar statements about INTEGER, DOUBLE PRECISION, and COMPLEX type
specifiers in sections 5.1.1.1, 5.1.1.3, and 5.1.1.4.

In section 5.1.1.2, for example, must the constant be exactly the characters
"0.0" to cause the declared entity to be the same as the default real entity?
Could the result be different if the constant were expressed, for example, as
"0."?

It appears that the committee chose the value 0 in these statements because it
exists on every machine on which a Fortran 90 processor will be run.  Further, a
specific value was chosen so that machine architecture differences would be
factored out.  For example, KIND(10000000.) might have the same kind parameter
value as default real on one machine but not on another.

ANSWER: No, the constant need not be exactly "0.0".  The constant "0.0" is used
only as an example.

Discussion: The KIND intrinsic is defined in section 13.13.51 of the standard to
return a value equal to the kind type parameter of its argument; the argument
may be of any intrinsic type.  In section 13.5.5 it is stated that the value of
the argument to this function need not be defined.  It is only the kind type of
the argument that is relevant.  Nowhere in the standard is there a restriction
that the argument to the KIND intrinsic be a constant at all, much less the
specific constant 0.0.  The <kind-selector> is specified in section 5.1, R505 to
be a <scalar-int-initialization-expr>.  The definition of an
<initialization-expression> is given in section 7.1.6.1, and the restrictions on
the argument of the KIND intrinsic in an <initialization-expression> are
detailed in item (6) of that definition.

The question makes the assertion that KIND(10000000.) might not have the same
kind parameter value as default real on all machines.  This assertion is false.
Possibly the requestor believed that a literal real constant could assume a kind
parameter value based on the number of digits in the constant or some other
implicit criterion.  This is not allowed in Fortran 90.  In section 4.3.1.2, it
is explicitly stated that:

A literal real constant without a kind type parameter is a default real constant
if it is without an exponent part..."

Similar arguments apply to the corresponding questions about INTEGER, DOUBLE
PRECISION, and COMPLEX type specifiers.

REFERENCES: ISO/IEC 1539:1991, sections 4.3.1.2, 5.1, 5.1.1, 7.1.6.1,
            13.5.5, 13.13.51
EDITS: None.
SUBMITTED BY: Larry Rolison, X3J3/92-060
HISTORY: Approved as X3J3/92-084 at meeting 121 by a vote of 19-0
         92-267r m123 Edit approved
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000043
TITLE: List-directed character input
KEYWORDS: i/o list-directed, character, zero length
DEFECT TYPE: Erratum
STATUS: Published

QUESTION: For list directed input of character items, how does the standard
distinguish between the input of an undelimited zero-length character string and
a null value?  If the input is a zero-length character string, the corresponding
list item must be set to blank, whereas if the input is a null value, the
definition status of the corresponding list item must be left unchanged.
However, there appears to be no way to distinguish these two possibilities.

ANSWER: The ambiguity between undelimited zero length character values and the
null value should be resolved by requiring that zero-length character values
always be delimited in list-directed input.

Discussion: Several other potential ambiguities with undelimited character items
in list-directed input were resolved in section 10.8.1 by requiring delimiters
in those cases.  However, the case of a zero-length string was omitted from
this list.

EDITS:
1.  Section 10.8.1: Add " and" to the end of item (4), and [149:12]

2.  Section 10.8.1: Add an additional item to the list after item (4): [149:12]

    "(5)  The character constant contains at least one character,"

SUBMITTED BY: Richard E. Maine, X3J3/92-087
HISTORY: X3J3/92-116 m121 Approved by a vote of 19-0
         Approved in ballot 92-182
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000044
TITLE: END statement and fixed form source
KEYWORDS: END statement, source form - fixed - initial line
DEFECT TYPE: Erratum
STATUS: Published

QUESTION: Consider the following:

1. Section 3.3.2.4 "Fixed Form Statements", page 24, requires that no
   statement, except the program unit END statement, have an initial line
   that appears to be a program unit END statement.

2. Other statements, for example, <end-function-statement>, R1218
   page 175, may consist of only the keywords "END" or "END FUNCTION".

   While these do not conflict, the combined requirements are not obvious
   and complicate the situation for users.  Consider, for example, ending
   an <interface-body> for a function subprogram:

   1.     END             ! wrong, appears to be a program unit END

   2.     EN              ! END continued to 2nd line. OK
        & D

   3.     END FUNCTION   ! OK in main PROGRAM unit and SUBROUTINE
                         ! subprogram, wrong in FUNCTION subprogram

   4.     EN             ! OK
        & D FUNCTION

   5.     END F          ! OK


   6.     END FUNCTION A ! OK in main program, OK in SUBROUTINE
        &       BC       !subprogram, OK in function if name is not "A"

ANSWER: Section 3.3.2.4 was brought forward from FORTRAN 77 without modification
for new Fortran 90 constructs.  The resulting usability characteristics, as seen
in the examples above, are regrettable enough that a repair should be made.

EDIT: In 3.3.2.4 replace the text

    "and no other statement in the program unit may have an initial line that
    appears to be a program unit END statement"
with
    ".  A statement whose initial line appears to be a program unit END
    statement must not be continued." [24:13]

SUBMITTED BY: Janice C. Shepherd, X3J3/92-012, X3J3/92-013, X3J3/92-014
HISTORY: Approved as X3J3/92-088A at meeting 122 by a vote of 24-0
         92-267r m123 Edit approved
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000045
TITLE: Array intrinsics with arrays of derived-type arguments
KEYWORDS: array intrinsics, derived type
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION: The intrinsic functions ALLOCATED, ASSOCIATED, LBOUND, UBOUND,
PRESENT, SHAPE, SIZE, MERGE, PACK, SPREAD, UNPACK, CSHIFT, EOSHIFT, TRANSPOSE,
RESHAPE, and TRANSFER are documented as accepting arrays of any type.  Does this
include arrays of derived-type, and if so, does this conflict with section 4.4.5
which states:

Any operation on derived-type entities or nonintrinsic assignment for
derived-type entities must be defined explicitly by a function or subroutine and
a procedure interface block.

ANSWER: The intrinsics in question can accept arguments which are arrays of
derived-types.  This does not conflict with section 4.4.5.

Discussion: The term "operation" in section 4.4.5 refers to user defined unary
and binary operations in expressions and nonintrinsic assignments.  Such
operators are defined by means of interface blocks which define operators and
nonintrinsic assignment.  Using an object as an actual argument in a procedure
reference is not considered an operation on that object in this sense.

REFERENCES: ISO/IEC 1539:1991 section 4.4.5 and 13.13
            X3J3/92-051 pages 13-14
EDITS: None.
SUBMITTED BY: H.Funaki, X3J3/92-051 (121-ADT-11) pp13-14
HISTORY: Posted request to f90 interp e-mail
         Approved as X3J3/92-092A meeting 121 by a vote of 19-0
         92-267r m123 Edit approved
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000046
TITLE: RESULT clause for RECURSIVE functions
KEYWORDS: function result, recursive function
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION:
1. Does RECURSIVE require RESULT?

2. Assuming (1), is a <type-spec> permitted on the function name when
   RECURSIVE is present?

ANSWER: The RESULT clause is not required for all RECURSIVE functions; it is
required for those that are directly recursive.  That is, the RESULT clause is
necessary to make the function visible in its own body so that direct recursion
can take place.

It should be noted that the prohibition against typing the function name when a
result variable name is specified was not intended to prohibit putting the
function type into the header.  In other words:

          FUNCTION F() RESULT (FVAR)
          INTEGER FVAR

and

          INTEGER FUNCTION F() RESULT (FVAR)

are both allowed.  The case prohibited is:

          FUNCTION F() RESULT (FVAR)
          INTEGER F

It is possible for both a <type-spec> and RECURSIVE to appear in a single
function header.

REFERENCES: ISO/IEC 1539:1991 (E) section 12.5.2.2
EDITS: None.
SUBMITTED BY: L.Meissner, X3J3/92-045 (121-ADT-5) p17.
HISTORY: For discussion see X3J3/92-45 (121-ADT-5) pp 18, 26-27
         Approved as X3J3/92-101 at meeting 121 by a vote of 20-0
         92-267r m123 Edit approved
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000047
TITLE: Automatic data object in initialization expressions
KEYWORDS: automatic, expression - initialization, PARAMETER statement
DEFECT TYPE: Erratum
STATUS: Published

QUESTION: Can an automatic data object be used as the argument to the LEN
function in the initialization expression of a PARAMETER statement or an item
given the PARAMETER attribute?

ANSWER: No.  It was the intent of the committee to include objects with
nonconstant lengths in the restrictions on the LEN function in section 7.1.6.1
(pages 77 and 78).

EDITS:
1. Section 7.1.6.1, page 77, item (6)
   change "not assumed or"
   to     "not assumed, are not defined by an expression that is not
          a constant expression, and are not" [77:27]

2. Section 7.1.6.1, page 78, item (6)
   change "not assumed or"
   to     "not assumed, are not defined by an expression that is not
          an initialization expression, and are not" [78:9]

SUBMITTED BY: 120.042
LAST SIGNIFICANT CHANGE: 93-07-16 000047 m126 changed "constant" to "initial..."
HISTORY: X3J3/92-036 (121-JKR-4) and 120.073A For discussion
         X3J3/92-107  m121 approved by a vote of 20-0
         X3J3/92-267r m123 edit approved
         N881 WG5 approval
         X3J3/93-151  m125 approved unanimous consent
         N903 changed 1st edit "a constant" to "an initialization" to match
--------------------------------------------------------------------------------

NUMBER: 000048
TITLE: Pointer-valued statement functions
KEYWORDS: statement function, pointer
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION: Can a statement function be pointer-valued?  There appears to be
nothing in section 12.5.4 to prohibit this.

ANSWER: No, a statement function cannot be pointer-valued.

Discussion: From section 12.3.1:

     The interface of a statement function is always implicit.

>From section 12.3.1.1:

     A procedure must have an explicit interface if...
     (2) The procedure has:
         (e) A result that is a pointer (functions only)

Therefore, a statement function cannot have a result that is a pointer.

EDITS: None.
SUBMITTED BY: L.Meissner, X3J3/92-45 (121-ADT-5) p37
HISTORY: Approved as X3J3/92-108 at meeting 121 by a vote of 19-0
         92-267r m123 Edit approved
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000050
TITLE: Repeat counts on edit descriptors
KEYWORDS: i/o edit descriptor, i/o repeat count in format-directed
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION:  Is the repeat specification part of the edit descriptor?

In section 10.1.1 the second constraint states that the comma separating the
<format-items> in a <format-item-list> is optional between certain combinations
of edit descriptors.

In section 10.2 a format-item is defined as, amongst other things,
"[r]<data-edit-desc>" and in 10.2.1 an edit-descriptor can be a data-edit-desc.
However, <data-edit-desc> does not contain the repeat count.  This implies that:

    100   FORMAT(1PE20.10)       ! is legal
    200   FORMAT(1P3E20.10)      ! is not legal
    300   FORMAT(1P,3E20.10)     ! is legal

ANSWER: The repeat count is not part of any edit descriptor except the
"[r]/" edit descriptor.

The comments in the examples are correct.

Discussion: This problem appears to stem from an incompatibility between FORTRAN
66 and FORTRAN 77.  In FORTRAN 66 a FORMAT statement is of the form:

               FORMAT(list)

where the list consists of a series of field descriptors separated by field
separators and optionally preceded and succeeded by slashes.  The field
descriptors for real or double precision values consisted of the now familiar
Dw.d, Ew.d, Fw.d, and Gw.d edit descriptors (a term introduced in FORTRAN 77)
preceded by an optional scale factor and repeat count.  For example, in FORTRAN
66 a valid field descriptor is 1P3E17.10, where 1P is the scale factor, 3 the
repeat count for a field containing 10 digits in the fractional part of the
number and having a E exponent.

In FORTRAN 77 the scale factor is an edit descriptor and thus is a list element
in the format specification.  While FORTRAN 77 specifies places where the commas
separating list elements in a format specification are optional, it fails to
make a comma between the scale factor and an immediately succeeding repeated D,
E, F, or G edit descriptor optional.  This situation has been carried over to
Fortran 90.  Thus:

    100   FORMAT(1PE20.10)   ! is legal in F66, F77, and F90
    200   FORMAT(1P3E20.10)  ! is legal in F66, and illegal in F77 & F90
    300   FORMAT(1P,3E20.10) ! is illegal in F66, and legal in F77 & F90


EDITS: None.
SUBMITTED BY: A.D. Tait, X3J3/92-041 (121-ADT-1)
HISTORY: X3J3/92-041
         X3J3/92-042
         X3J3/92-267r m123 Edit approved
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000051
TITLE: On unambiguous generic procedure references
KEYWORDS: generic procedure
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION: Should the rules in 14.1.2.3 include a rule that uses the fact that a
dummy argument is either a subroutine or a function to disambiguate a generic
procedure reference?  For example, such a rule could be in section 14.1.2.3, in
the sentence that is preceded by "(1)", after "with a different type" adding
"present as a subroutine instead of a function".

ANSWER: No.  The intent of the committee was to keep the rules as simple as
possible in order that they would be easy to understand and to use.  It is not
always possible for the processor to tell whether an actual argument that is a
procedure is a subroutine or an implicitly typed function.

EDITS: None.
SUBMITTED BY: John Reid, SC22/WG5 N786A
HISTORY: 266 (jw note)
         X3J3/92-017 m121 generic interfaces and dummy procedure arguments
         X3J3/92-151 m122 Approved 25-0
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000052
TITLE: Expressions in statement function definitions
KEYWORDS: statement function
DEFECT TYPE: Erratum
STATUS: Published

QUESTION: Section 12.5.4 appears to prohibit whole array names appearing as
actual arguments to functions within the <scalar-expr> of a statement function.
The first constraint states:

    The <scalar-expr> may be composed only of constants (literal and named),
    references to scalar variables and array elements, references to
    functions and function dummy procedures, and intrinsic operators.

A defined operator may be an extended intrinsic operator, as well as a defined
unary or binary operator.

Question 1:  Is the legal FORTRAN 77 program fragment,

          EXTERNAL FCN
          REAL A(2)
          STFN(X) = FCN(A) + X

where FCN is some function and STFN is a statement function, a legal Fortran 90
program fragment?

Question 2: Is it intended that a defined operator which is an extended
intrinsic operator be allowed in a statement function definition but other
defined operators not be allowed?

ANSWER: The intent is that the program fragment in question one should be a
valid Fortran 90 program fragment, and that no defined operators be allowed in a
statement function definition.  The standard is in error.  The edits below
should be applied to correct the standard.

Discussion: The intent of the standard was to retain the FORTRAN 77 definition
of statement functions without extending it to include defined operators or
array expressions.  In FORTRAN 77, "expression" and "variable" referred only to
scalar expressions and variables; there were no defined operators.  In Fortran
90 these terms also refer to array expressions and arrays.  The Fortran 90
definition of statement functions was intended to prohibit array expressions but
overlooked the use of an array name as an actual argument to a function in the
definition of a statement function.

EDITS:
1. Section 12.5.4: First constraint, first sentence [182:4]
   change "references to scalar variables and array elements"
   to     "references to variables"

   change "intrinsic operators"
   to     "intrinsic operations"

   after first sentence add

   If <scalar-expr> contains a reference to a function or a function
   dummy procedure, the reference must not require an explicit
   interface, the function must not require an explicit interface or
   be a transformational intrinsic, and the result must be scalar.
   If an argument to a function or a function dummy procedure is array
   valued, it must be an array name.

2. Section 12.5.4: Second constraint, third sentence [182:12]
   change "scalar variable, array element"
   to     "variable"

3. Section 12.5.4: Fifth constraint, first sentence delete second word
   ("scalar") [182:19]

SUBMITTED BY: A.D. Tait X3J3/92-064 item # 13 points to B. Smith e-mail
              in X3J3/92-045 pp. 50-52
HISTORY: X3J3/92-153A m122 Approved 17-2
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000053
TITLE: Optional intrinsic function arguments
KEYWORDS: intrinsic function, argument - optional
DEFECT TYPE: Amendment
STATUS: Published

QUESTION:  Should constraining text be added to the description of

               optional argument   Y    in CMPLX, and
               optional argument   BACK in INDEX, and
               optional argument   SIZE in ISHFTC, and
               optional argument   A3,... in MAX, and
               optional argument   A3,... in MIN, and
               optional argument   BACK in SCAN, and
               optional argument   BACK in VERIFY

to state that the argument must not be an optional argument of an invoking
procedure?

ANSWER: In principle yes; however it is more appropriate to add an additional
restriction on dummy arguments not present in section 12.5.2.8.

Discussion: The standard contains numerous restrictions intended to ensure that
the rank of a given expression never changes.  The case of elemental functions
with optional arguments was inadvertently overlooked.

Consider the following subprogram:

          SUBROUTINE SUB (A,B,C)
            INTEGER :: A ,B
            INTEGER, OPTIONAL :: C (:)
            PRINT *, MAX (A, B, C)
          END

When C is present, the result of the elemental function MAX, is an array of the
same shape as C.  However, if SUB were to be called with the third argument
omitted, the result would be a scalar.  The supplied edit remedies this
deficiency.

REFERENCES: ISO/IEC 1539:1991 (E) 12.5.2.8, 13.13.20, 13.13.46,
            13.13.50, 13.13.52, 13.13.63, 13.13.68, 13.13.91, 13.13.111,
            13.13.113.

EDITS:
1.  Add the following point to the numbered list in section 12.5.2.8: [179:38]

  (5) If it is an array, it must not be supplied as an actual
      argument to an elemental procedure unless an array of the same
      rank is supplied as an actual argument corresponding to a
      nonoptional dummy argument of that elemental procedure.

2.  In the paragraph following the numbered list, replace "It" with
    "Except as noted in (5) above, it" [179:39]

SUBMITTED BY: response to X3J3/92-058 (121-LRR-5)
HISTORY: X3J3/92-058 Submitted as question, draft response prepared
         N786A John Reid's paper
         N815A of the WG5 Victoria meeting
         X3J3/92-094
         X3J3/92-156r m122 approved
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000054
TITLE: Resolving generic procedure references
KEYWORDS: generic name, interface block, intrinsic procedure
DEFECT TYPE: Interpretation
STATUS: WG5 approved; ready for SC22

QUESTION:  Consider the following code fragment:

          PROGRAM HOST
            DIMENSION ABS(10)
            ...
            CONTAINS
               SUBROUTINE SUB()
                 INTERFACE ABS
                   FUNCTION IA1(I)
                     INTEGER IA1, I
                   END FUNCTION
                 END INTERFACE
                 R = ABS(1.5)

Do the rules for resolving references to names established to be generic
(14.1.2.4.1) imply that R will be assigned the value 1.5 as the result of
invoking the intrinsic ABS?

ANSWER: Yes.

Discussion: ABS is established to be generic in the scope of subroutine SUB
(14.1.2.4 item 1(a)).  The rules in section 14.1.2.4.1 can be used to resolve
the procedure reference.  Rule (1) in 14.1.2.4.1 does not apply, as the
reference is not consistent with any specific interface in the interface block
with the name ABS.  Rule (2) does not apply as ABS does not appear in an
INTRINSIC statement.  Rule (3) does not apply as ABS is not established to be
generic in the host scope.  Therefore, rule (4) is applied and the reference is
resolved to the generic intrinsic procedure ABS.

EDITS: None.
SUBMITTED BY: Janice C. Shepherd
HISTORY: 92-048      pg 29-30, 34-40, 51, 52, One of the questions raised in
         92-052      pg 1-3 One of the questions raised in
         92-119      Initially drafted
         92-157 m122 approved
                m129 WG5 #550 email, J Martin, 94-04-26, failed WG5 ballot
         94-293 m130 change status to HOLD for 000083
         HOLD for 83
         95-281 m135 WG5 ballot approved; (83 was also WG5 ballot approved)
--------------------------------------------------------------------------------

NUMBER: 000055
TITLE: Characteristics of character function results
KEYWORDS: character function, function result
DEFECT TYPE: Erratum
STATUS: Published

QUESTION: In section 12.5.2.5 the second paragraph after the constraints
contains the text:

   "Otherwise, they are storage associated and must all be scalars without
   the POINTER attribute and all be of type default character with identical
   length".

Is some of this text redundant?

ANSWER: Yes.

Discussion: The phrase referring to "identical length" was meant to include the
FORTRAN 77 character storage association case.  FORTRAN 77 requires either that
they all be of assumed length or all be of the same constant length; both are
included as characteristics that agree in section 12.5.2.5 in the second
paragraph after the constraints that starts with "If the ENTRY".  The phrase is
redundant and is causing confusion.

EDIT:  In Section 12.5.2.5 in the sentence that starts: "Otherwise,
they ... " delete: "all be scalars ... length or". [178:19]

SUBMITTED BY: John Reid in N786A at the WG5 Victoria Meeting, July 1992.
HISTORY: X3J3/92-158 m122 Drafted at the WG5 Victoria Meeting July, approved
         N881 WG5 approval
-------------------------------------------------------------------------------

NUMBER: 000056
TITLE: TRANSFER intrinsic function description
KEYWORDS: TRANSFER intrinsic
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION:  Should the text of Case (iii) under Examples in the TRANSFER
intrinsic function be corrected so the example reads:

     Case (iii): TRANSFER((/1.1,2.2,3.3/),(/ (0.0,0.0) /),1) is a
                 complex rank-one array of length one whose sole element
                 has the value (1.1,2.2)."

ANSWER: No.

Discussion: The current format of the example, 1.1+2.2i, is valid
mathematical notation for complex type.

EDITS: None.
SUBMITTED BY: Larry Rolison in X3J3/92-059  (121-LRR-6)
LAST SIGNIFICANT CHANGE: 92-11-13 000056 opposite response
HISTORY: X3J3/92-059 Submitted
         X3J3/92-091 Draft response
         X3J3/92-159 m121, m122 Subsequent draft  rejected
         X3J3/92-294 m123 Revised response, approved by uc
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000057
TITLE: Prohibition against multiple explicit specific interfaces
KEYWORDS: interface
DEFECT TYPE: Erratum
STATUS: Published

QUESTION: What is the meaning and/or intent of the following sentence in
12.3.2.1?

    A procedure must not have more than one explicit specific interface in a
    given scoping unit."

Multiple SPECIFIC interfaces can not be produced by the existence of interface
blocks because the definition of an interface body states that it only specifies
an EXPLICIT interface, not a SPECIFIC interface.  According to the statement in
12.3.2.1:

    "An external or module subprogram definition specifies a specific interface
    for the procedures defined in that subprogram",

only external or module subprograms have specific interfaces and the specific
interfaces are only specified by the text of the subprogram itself.

Could an example of code be provided that is prohibited by the statement

    "a procedure must not have more than one explicit specific interface in
    a given scoping unit"

in 12.3.2.1 and that would not be prohibited by some other provision of ISO/IEC
1539:1991?

ANSWER: The statement in the question that "Multiple SPECIFIC interfaces can not
be produced by the existence of interface blocks" is incorrect.  An example
follows.

Discussion: The paragraph following the constraints, in 12.3.2.1 is concerned
with "specific interfaces" and it was intended to be understood from the context
in that discussion that the interface specified by an interface body should be
both specific and explicit.  See also 14.1.2.4, (2), (a) which shows that it was
intended that an interface body define a specific interface.  The intention was
to disallow the same information being provided twice, as for other
specifications.  An edit is supplied to make this clearer.

An example which illustrates what is prohibited follows:

Example:
          MODULE MOD
            INTERFACE
              SUBROUTINE SUB(I,J)
                INTEGER I,J
              END SUBROUTINE
              SUBROUTINE SUB(M,N)   ! duplication of SUB is illegal
                INTEGER M,N
              END SUBROUTINE
            END INTERFACE
          END MODULE

EDITS: Section 12.3.2.1, the sentence that begins "An interface body..." change
"explicit interface" to "explicit specific interface".  [167:39]

SUBMITTED BY: Larry Rolison
LAST SIGNIFICANT CHANGE: 92-11-13 000057
HISTORY: 120.035, 120.090
         X3J3/92-162A m122 Approved by uc
         92-192, 222, 263, 314 (original) (jw note)
         X3J3/92-314  m123 Revised following letter ballot to correct
         transcription errors in the recording of what was contained in 92-162A
         N881 WG5 passed
--------------------------------------------------------------------------------

NUMBER: 000058
TITLE: Ambiguous use of "keyword"
KEYWORDS: keyword, argument keyword, statement keyword
DEFECT TYPE: Erratum
STATUS: WG5 approved; ready for SC22

QUESTION: Is the use of "keyword" in 12.4.1, page 172, 1st paragraph consistent
with the definition of "keyword" in 3.2.1, page 19?  Is the definition of
keyword in 3.2.1 consistent with the two definitions of keyword in 2.5.2, page
16?  In 13.10, page 188, is "keyword" the correct term (or should it be
"argument keyword")?

ANSWER: The term "keyword" is used for both "statement keyword" and "argument
keyword" - see 2.5.2 and Annex A. Which is intended is usually clear from
the context, and this is so on pages 172 and 188. Section 3.2.1 is referring
only to statement keywords and would be clearer if the qualifier "statement"
is added.

EDITS: Page 19 section 3.2.1 [19:37-38]
   Change "Keywords" to "Statement keywords" twice.
   Rationale: 3.2.1 is not referring to argument keywords.

SUBMITTED BY: GEN
HISTORY: WG5/N808, Question 2.
         92-164A  m122 approved 17-4
                      ballot comments, 92-326 (jw note)
                  m124 minutes, approved 15-2
         93-111   m125 ballot approved with Kelble edits
         94-160   m129 WG5 ballot, failed;
         94-361   m131 answer with fewer edits proposed, approved u.c.
         95-034r1 m132 X3J3 ballot, approved 20-0
         95-281   m135 WG5 ballot approved;
--------------------------------------------------------------------------------

NUMBER: 000059
TITLE: SEQUENCE derived type and component bounds
KEYWORDS: SEQUENCE, derived type
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION: Given two objects of SEQUENCE derived type, can the two objects be of
the same derived type if the only difference between the two SEQUENCE derived
type definitions is the value of the low bound and high bound for one dimension
of one of the components (assuming the extent of the dimension of the array
component matches the extent given in the other; and there are no structure
components that have PRIVATE accessibility)?

The description of when two objects of SEQUENCE derived type have the same type
includes the words (2nd paragraph of 4.4.2 "Determination of derived types")
"have structure components that do not have PRIVATE accessibility and agree in
order, name, and attributes".

This text seems to imply that if the derived type includes an <array-spec> then
the individual low bounds and high bounds have to be the same.

An example that corresponds to the question above:

          SUBROUTINE S()
            TYPE T
              SEQUENCE
              INTEGER A(1:10)
            END TYPE
            TYPE (T) X
            CALL S2(X)
            ...

          SUBROUTINE S2(Y)
            TYPE T
              SEQUENCE
              INTEGER A(2:11)
            END TYPE
           TYPE (T) Y
           ...

Do X and Y have the same type?

ANSWER: No.

Discussion: The attributes that a data object may have are enumerated in section
5.1.2.  Included in these is the DIMENSION attribute (section 5.1.2.4).  In
reference to the explicit shape arrays in the example above, in order for the
attributes to agree, the values of the corresponding lower bounds and the
corresponding upper bounds in <explicit-shape-spec> must be equal.

EDITS: None.
SUBMITTED BY: Janice C. Shepherd  X3J3/92-129
HISTORY: X3J3/92-129
         X3J3/92-165A m122 Approved 19-2
         Approved in ballot 92-182
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000060
TITLE: Statement function argument references
KEYWORDS: statement function arguments
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION:  Consider the following program:

         PROGRAM TEST
            INTEGER AR
            EXTERNAL AR
            REAL A(2), FUN, X, Y
            DATA A/2*5./
            FUN(X) = X+X+X
            Y=FUN(A(AR(5)))
          END

          INTEGER FUNCTION AR(I)
            INTEGER I
            AR = 1
            PRINT *, I
            RETURN
          END

When the statement function is referenced, how many times is the function AR
called?  Or, to put it another way, how many times is the PRINT statement in
function AR executed during the statement function reference?

ANSWER: In the program above, the function AR is called once unless the value of
the function "can be determined otherwise" than by evaluating the function.
Therefore, the PRINT statement in function AR is executed at most once.

Discussion: When the statement function is referenced, the actual arguments are
evaluated and the resulting values are associated with the corresponding dummy
arguments.  The statement function FUN has only one actual argument which
contains only one reference to the external function AR.  Therefore, the
function AR is called once as part of the evaluation of the actual argument.
The value resulting from this evaluation is associated with the single dummy
argument of the statement function FUN.  Though the PRINT statement may be
executed once, note that 7.1.7.1 gives license to the processor to not execute
the PRINT statement at all.  Thus the statement in the answer is "the PRINT
statement in function AR is executed at most once".

REFERENCES: ISO/IEC 1539:1991 (E) sections 7.1.7.1 and 12.5.4, the
            fourth paragraph after the last constraint
EDITS: None.
SUBMITTED BY: Linda J. O'Gara
LAST SIGNIFICANT CHANGE: 92-11-13 000060
HISTORY: 121-LJO-3, 121-ADT-11 pages 14-17
         X3J3/92-168 m122 Approved 17-0
         X3J3/92-315 m123 Revised after letter ballot
         m123 Revision approved by unanimous consent
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000061
TITLE: G edit descriptor with "d" = 0
KEYWORDS: i/o G edit descriptor, i/o edit descriptors, conformance
DEFECT TYPE: Erratum
STATUS: Published

QUESTION: Is a value of 0 for "d" in a G edit descriptor (e.g.  1PG8.0)
permitted?

ANSWER: Yes. See R1008, R1005, and R404.

QUESTION: Did the committee mean to change the definition of G format in Fortran
90 (compared to FORTRAN 77)?

ANSWER: Yes.  The form of output text produced by the G edit descriptor for some
values and particular edit descriptors was intentionally changed.  The changes
require processors to give meaningful output instead of "*"s for certain values
and edit descriptors.

QUESTION: What happens when N (the value to be printed) is zero and "d" is zero?

ANSWER: The standard indicates a format of F(w-n).-1 is to be used.  This is an
error in the standard.

EDITS:
1. In section 10.5.4.1.2 second paragraph, 3rd sentence,
   after "- 0.5," add " or N is identically 0 and d is 0,". [144:37]

2. In section 10.5.4.1.2, second paragraph, fourth sentence,
   after "N is identically 0" add " and d is not zero". [144:40]

3. In section 1.4.1, add item (5) as follows: [3:32]

   (5) A value of 0 for a list item in a formatted output statement will be
       formatted in a different form for some G edit descriptors. In addition,
       the Fortran 90 standard specifies how rounding of values will affect the
       output field form, but FORTRAN 77 did not address this issue: therefore,
       some FORTRAN 77 processors may produce a different output form than
       Fortran 90 processors for certain combinations of values and G edit
       descriptors.

SUBMITTED BY: Joanne Brixius, 121-JB-1
HISTORY: 121-ADT-7 pp 1-9, 92-076, 92-118
         X3J3/92-149A m122 Approved 20-3
         X3J3/92-267r m123 Edit approved
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000062
TITLE: Statement function constraints
KEYWORDS: statement function, host association
DEFECT TYPE: Erratum
STATUS: Published

QUESTION: Does the last constraint under R1226 allow variables in a
<scalar-expr> of a statement function definition to be accessed via host
association or use association?

          PROGRAM HOST
            INTEGER I
            ...
            CONTAINS
              SUBROUTINE INNER()
                STMTFUNC()=I+1
                ...

ANSWER: Yes.

Discussion: It was the intent of the committee to allow variables made
accessible by use or host association to appear in a <scalar-expr> of a
statement function definition.  The text of the last constraint under R1226
needs clarification to better reflect that intent.

REFERENCES: ISO/IEC 1539:1991 (E) section 12.5.4

EDITS:  In the last constraint after R1226 in section 12.5.4
           replace "local to"
           with    "accessible in". [182:20]

SUBMITTED BY: Janice C. Shepherd X3J3/92-015
HISTORY: X3J3/92-046 Discussed in, pp 28-29
         X3J3/92-120 Initially drafted
         X3J3/92-160 m122 Approved 23-0
         X3J3/92-182 Approved in ballot
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000063
TITLE: Interfaces and dummy procedure arguments
KEYWORDS: interface - explicit, procedure - dummy
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION: Given a procedure that has a dummy argument, must an explicit
interface for the procedure show sufficient information to indicate that its
dummy argument is a dummy procedure?

ANSWER: Yes.

Discussion: The first sentence of the second paragraph in 12.3.2.1 indicates
that an interface body must specify all of the procedures characteristics.
Section 12.2 indicates that a procedure's characteristics include the
characteristics of its arguments.  Therefore, an interface body must include an
EXTERNAL statement or a nested interface block for each dummy argument that is a
dummy procedure, even though this may not be necessary in the procedure
definition.

EDITS: None.
SUBMITTED BY: Janice C. Shepherd, X3J3/92-016
HISTORY: X3J3/92-161 m122 Approved 24-0
         X3J3/92-182 Approved in ballot
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000064
TITLE: SPACING result for 0.0
KEYWORDS: SPACING intrinsic
DEFECT TYPE: Erratum
STATUS: Published

QUESTION:  Is the SPACING intrinsic function intended to return absolute
spacing of model numbers about 0.0 when its argument is 0.0?

Section 13.12.100 under Result Value specifies that the result should be
b**(e-p); this is not equal to the absolute spacing of model numbers around zero
because zero has e == 0, so b**(e-p) provides a much larger value than expected.

ANSWER: Yes.

Discussion: Since the smallest magnitude model numbers are TINY(X) and -TINY(X),
the absolute spacing around zero is TINY(X).  It was intended that the
"otherwise" clause of the SPACING definition apply to this case.

REFERENCES: ISO/IEC 1539:1991 (E) Sections 12.7.1 and 13.13.100.

EDITS:  In section 13.13.100, after "Result Value."
           change "The"
           to     "If X is not zero, the".

In the same section,
           change "; otherwise "
           to     ". Otherwise". [234:6]

SUBMITTED BY: John Reid
HISTORY: N786a item 234/7
         N815a item 6 (X3J3/92-136 item 6)
         X3J3/92-171  m122 Approved 22-0
         X3J3/92-267r m123 Edit approved in
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000065
TITLE: DO construct - Block and Nonblock
KEYWORDS: DO construct - block and nonblock
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION:  Consider the following DO loop:

          DO 10, I = 1, 10
            K = I
    10    CONTINUE

It can be parsed using either of the following two paths:

  R816  <do-construct>             is  <block-do-construct>

  R817  <block-do-construct>       is  <do-stmt>
                                       <do-block>
                                       <end-do>

  R818  <do-stmt>                  is  <label-do-stmt>

  R819  <label-do-stmt>            is   DO <label> [<loop-control>]

  R821  <loop-control>             is  ,<do-variable> =
                                             <scalar-numeric-expr>,
                                             <scalar-numeric-expr>

  R822  <do-variable>              is  <scalar-variable>

  R823  <do-block>                 is  <block>

  R801  <block>                    is  [<execution-part-construct>]...

  R209  <execution-part-construct> is  <executable-construct>

  R215  <executable-construct>     is  <action-stmt>

  R216  <action-stmt>              is  <assignment-stmt>

  R824  <end-do>                   is  <continue-stmt>

or

  R816 <do-construct>              is  <nonblock-do-construct>

  R826  <nonblock-do-construct>    is <action-term-do-construct>

  R827  <action-term-do-construct> is  <label-do-stmt>
                                       <do-body>
                                       <do-term-action-stmt>

  R819  <label-do-stmt>            is  DO <label> [<loop-control>]

  R821  <loop-control>             is  ,<do-variable> =
                                             <scalar-numeric-expr>,
                                             <scalar-numeric-expr>

  R822  <do-variable>              is  <scalar-variable>

  R828  <do-body>                  is  [<execution-part-construct>]...

  R209  <execution-part-construct> is  <executable-construct>

  R215  <executable-construct>     is  <action-stmt>

  R216  <action-stmt>              is  <assignment-stmt>

  R829  <do-term-action-stmt>      is  <action-stmt>

  Constraint:  A <do-term-action-stmt> must not be a <continue-stmt>...

How is a compiler to decide that the above DO loop is obeying the rules for a
<block-do-construct> (and thus no diagnostic is required) or that it is
following the rules for a <nonblock-do-construct> (and thus by 1.4 it should
report that the program is being rejected because it is violating the
constraint)?

ANSWER: The intent of the cited constraint is to remove the ambiguity raised in
the question in favor of the <block-do-construct> interpretation.

Discussion: Item 5 in section 1.5.1 states that

    The syntax rules are not a complete and accurate syntax description of
    Fortran, ...; where a syntax rule is incomplete, it is accompanied by
    the corresponding constraints and text.

This is an application of this rule.

REFERENCES: ISO/IEC 1539:1991 (E) sections 1.5.1, 2.1, and 8.1.
EDITS: None.
SUBMITTED BY: Larry Rolison X3J3/92-126
HISTORY: X3J3/92-169  m122 Approved 20-0
         X3J3/92-267r m123 Edit approved
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000066
TITLE: Declaration of FUNCTION type
KEYWORDS: function type
DEFECT TYPE: Erratum
STATUS: Published

QUESTION:  In the following example:

          SUBROUTINE SUB
            ...
            Y=F(X)
            ...
            CONTAINS
              FUNCTION F(X)
                REAL F,X
                  ...
              END FUNCTION F
          END

Is the declaration of function-name "F" in the REAL <entity-decl-list> legal?
Does the second constraint in 5.1 contradict the text in the first sentence of
the first paragraph after constraints in section 12.5.2.2?

ANSWER: Yes.  The example above is standard conforming.  There is no conflict
between the constraint and the text mentioned.

Discussion: The information in section 5.1 that applies to functions describes
functions being called, not functions being defined by program units or by
internal functions.  The information in section 12.5.2.2 describes the
definition of functions.

However, this distinction has been made less clear by syntax rules and
constraints in section 5.1 that do not reflect it.  The supplied edit remedies
this situation by using consistent terminology and eliminating the resultant
redundant constraint.

EDITS:
1. Change R504 "<function-name>{(<array-spec>)}" to "<function-name>".
   [39:36]

2. Change "Constraint: An <array-spec> for a <function-name> that
           does not have the POINTER attribute must be an
           <explicit-shape-spec-list>"
   to      "Constraint: An <array-spec> for an <object-name> that
           is a function result that does not have the POINTER attribute
           must be an <explicit-shape-spec-list>". [40:12]

3. Delete the constraint "An <array-spec> for a <function-name> that
   does have the POINTER attribute must be a <deferred-shape-spec-
   list>". [40:14]

SUBMITTED BY: Larry Rolison X3J3/92-057 (121-LRR-4)
HISTORY: X3J3/92-090 Original response reconsidered and rewritten
         X3J3/92-173 m122 Approved uc
         X3J3/92-182 Approved in ballot
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000067
TITLE: Output of negative signed zero
KEYWORDS: i/o F edit descriptors, i/o format-directed - negative signed zero
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION:  If the real variables A, B, C, and D have the values -.003,
-.003, -0.0, and 0.0 respectively  and they are written with:

          WRITE(6,100) A,B,C,D
   100    FORMAT(F10.2, F10.3, 2F10.3)

is the following output correct:

     -0.00    -0.003       0.0       0.0
.........1.........2.........3.........4

ANSWER: No.

QUESTION:  or should it be

      0.00    -0.003     0.000     0.000
.........1.........2.........3.........4

ANSWER: Yes.  Negative signed zero in an output record is prohibited by section
10.5.1 item (3).  Truncation of trailing zeros by F edit descriptor is not
allowed.  See the last paragraph of section 10.5.1.2.1.

REFERENCES: ISO/IEC 1539:1991 (E) sections 10.5.1 and 10.5.1.2.1
EDITS: None.
SUBMITTED BY: A.D. Tait X3J3/92-045 pp 14-16
HISTORY: X3J3/92-074 m122 Approved 22-0
         X3J3/92-182 Approved in ballot
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000068
TITLE: Pointer association status
KEYWORDS: pointer association status
DEFECT TYPE: Erratum
STATUS: Published

QUESTION: When the execution of a procedure is terminated by the execution of a
RETURN or END statement, the pointer association status of a pointer declared or
accessed in the procedure becomes undefined unless one of the exceptions listed
in section 6.3.3.2 of the standard applies.

In the following example, when SUB is terminated, X remains associated because
it is in a COMMON block.  Pointer Z will become undefined.  The Y in the main
program is useful, but according to the standard, it is invalid because it
points to the undefined Z.  Is this correct?

            COMMON /COM/ X,Y
            CHARACTER*10,POINTER::X,Y
            ...
            CALL SUB
            PRINT *, X         ! X must be valid
            PRINT *, Y         ! is this Y valid?
          END

          SUBROUTINE SUB
            COMMON /COM/ X,Y
            CHARACTER*10,POINTER::X,Y,Z
            ALLOCATE (X,Z)
            X = 'A STRING'
            Z = 'ANOTHER'
            Y => Z
            RETURN
          END

ANSWER: No, the interpretation suggested in the question is not correct.  The
example is valid.

Discussion: The question appears to confuse the association status of the
pointer and the definition status of its target.  The pointer association status
of Z becomes undefined on the execution of the RETURN statement in the above
example, but this does not imply that the target of Z becomes undefined.  The
situation is analogous to that described in section 6.3.1.2 of the standard in
the context of the ALLOCATE statement.

If the previous target had been created by allocation, it becomes inaccessible
unless it can still be referred to by other pointers that are currently
associated with it.

An example and further elaboration is given in section C.6.4

The basic principle is that ALLOCATE, NULLIFY, and pointer assignment primarily
affect the pointer rather than the target.  ALLOCATE creates a new target but,
other than breaking its connection with the specified pointer, it has no effect
on the old target.  Neither NULLIFY nor pointer assignment has any effect on
targets.

Similarly, the target of Z in the above example is not affected when the pointer
association status of Z becomes undefined.  If the old target of Z could not be
referred to by other pointers, then it would become inaccessible (though still
technically defined).  In this example, the old target of Z can still be
referenced by Y.  It therefore remains both defined and accessible.

The statement in section 14.6.2.2 that "The definition status of a pointer is
that of its target" applies only when the pointer is associated with a target.

REFERENCES: ISO/IEC 1539:1991, sections 6.3.1.2, 6.3.3.2, 14.6.2.1, C.6.4

EDITS:
1. In section 14.6.2.1, item (3) subitem (c), delete "or" [247:2]

2. The reference to section 6.3.3.2 in 14.6.2.1 (3) (d) is misleading.
   In section 14.6.2.1, item (3) subitem (d), remove "6.3.3.2,"
   and change the period at the end to ", or" [247:4].

3. The list in section 14.6.2.1, item (3), of ways that pointer
   association status can become undefined is incomplete.
   In section 14.6.2.1, item (3) add a new subitem as follows: [247:4]

     (e) After the execution of a RETURN or END statement in a procedure
         where the pointer was either declared or, with the exceptions
         described in 6.3.3.2, accessed.

SUBMITTED BY: Y. Yoshida, X3J3/92-051 p4
HISTORY: X3J3/92-083A m122 Approved 18-2
         X3J3/92-329  m123 Approved uc
         N881 WG5 approval
         N904 added 3rd edit, delete "or" to match
--------------------------------------------------------------------------------

NUMBER: 000069
TITLE: I/O implied DO variable
KEYWORDS: implied-DO in i/o statement, i/o implied-do
DEFECT TYPE: Erratum
STATUS: Published

QUESTION(S):
(1)  Can the "do-variable" in an implied-DO in an I/O statement be a
     sub-object?

(2)  Should the second constraint in section 9.4.2 read:
     "Constraint: The "do-variable" must be a named scalar variable
     of type integer, default real, or double precision real."?

ANSWER(S):
1. No.  The intent of the committee was to allow only named scalar
   variables as "do-variables".  The supplied edit corrects this error.

2.  Yes, it should have.

Discussion: In FORTRAN 77, all implied-DO variables were required to be a
"variable", and derived types were not part of the language.  The rules for
implied-DO variables and DO loop "do-variables" were identical.  The committee's
intent was to permit only simple variables (named scalar variables) as
implied-DO variables in I/O statements.

REFERENCES: ISO/IEC 1539:1991 (E) sections 8.1.4.1.1, 9.4.2, 5.2.9,
            ANSI X3.9-1978 12.8.2.3, 11.10, 9.3.

EDIT:  In section 9.4.2, in the second constraint,
          replace the word "scalar"
                      with "named scalar variable". [123:30]

SUBMITTED BY: Larry Rolison, 92-086 (121-86/121-LRR-9)
HISTORY: ui 102 (jw note)
         X3J3/92-086
         X3J3/92-217b m123 Approved
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000071
TITLE: Use association and common block names
KEYWORDS: use association, common block name, association - storage
DEFECT TYPE: Erratum
STATUS: Published

QUESTION:  Can a module or subprogram access through use association
variables declared in different modules to be in the same common block?

Example:

      MODULE MOD1
      COMMON /BLOCK/ A,B,C
      END MODULE MOD1

      MODULE MOD2
      COMMON /BLOCK/ X,Y,Z
      END MODULE MOD2

      SUBROUTINE USER()
      USE MOD1
      USE MOD2
      ...
      Y = A               ! Are both Y and A accessible?
      END

ANSWER: Yes.

Discussion: The COMMON statement in MOD1 forms a common block storage sequence
as described in 5.5.2.1.  The COMMON statement in MOD2 similarly forms a common
block storage sequence.  These two sequences are associated as described in
5.5.2.3, thus associating A with X, B with Y, and C with Z.  The USE statements
in USER make these variables accessible in that scoping unit.  The associated
variables are considered to behave as though they had been equivalenced.  The
list of entities made accessible by use association in 11.3.2 includes variables
but not common blocks, so there is no implication that these two specifications
of common block storage sequences for /BLOCK/ interfere with each other or
require a concatenated common block storage sequence in USER.

Various other combinations of use association, host association, and local
COMMON statements can similarly result in common associated variables being
accessible in the same scoping unit.  One of these cases, that involve use
association and local COMMON statements, is prohibited in 5.5.2.5.

The edits below emphasize the independence of common block storage sequence
formation from use and host association and eliminate the ineffective
restriction in 5.5.2.5.

EDITS:
1. In the first sentence of 5.5.2.1 after "For each common block",
   insert "in a scoping unit". [59:11]

2. At the end of 5.5.2.1, add the following paragraph:

   "Only COMMON statements and EQUIVALENCE statements appearing in the
   scoping unit contribute to common block storage sequences formed in that
   unit.  Variables, in common blocks, made accessible by use association or
   host association do not contribute." [59:19]

3. At the end of the first paragraph of 5.5.2.3, add the following sentence:

   "Use association or host association may cause these associated objects
   to be accessible in the same scoping unit." [59:30]

4. Delete the last two sentences in 5.5.2.5. [60:19]

SUBMITTED BY: Jon Steidel, 120-JLS-8
HISTORY: ui 97 (jw note)
         120-86 (120-MBSH-3), initial response draft
         92-163      revised draft response
         92-191      revised draft response
         92-316      revised draft response - approved (19-2) m123
         93-087      consideration of ballot response:
         92-316      reapproved by unanimous consent
         93-111 m125 ballot, approved with Weaver and Rolison edits
         94-160 m129 WG5 ballot approved
--------------------------------------------------------------------------------

NUMBER: 000072
TITLE: Missing constraint for SIZE=
KEYWORDS: i/o OPEN statement SIZE=
DEFECT TYPE: Erratum
STATUS: Published

QUESTION:  In section 9.4.1, should there be an additional constraint:

    "If a SIZE= specifier is present, an ADVANCE= specifier also must appear"?

ANSWER: Yes.

In reading the first two paragraphs of section 9.4.1, immediately following the
list of constraints, it can be seen that SIZE and EOR have the same requirements
and, thus, there should be a constraint for SIZE that parallels the constraint
(last in the list) for EOR.

EDIT: Section 9.4.1, [120:25], add a constraint to the end of list:

      "If a SIZE= specifier is present, an ADVANCE= specifier also must appear."

SUBMITTED BY: Dick Weaver
HISTORY: 92-193
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000073
TITLE: Description of the MERGE intrinsic function
KEYWORDS: function - elemental, MERGE, array construction function
DEFECT TYPE: Interpretation
STATUS: Published

QUESTIONS: The MERGE intrinsic function is described as an array construction
function in sections 13.8.6 and 13.10.16.

The description of MERGE in section 13.13.67 classifies it as an elemental
function.

1.  Are the descriptions of MERGE in sections 13.8.6 and 13.10.16 consistent
with its classification as an elemental function?  Note that 13.8 is "Array
intrinsic functions" and MERGE is the only elemental included.

2.Should all elemental functions be listed as "array construction" functions or
should MERGE be described elsewhere?

ANSWERS:

1. Yes.  MERGE is both an elemental intrinsic function and, when called with
   array arguments, an array construction function.

2. All elemental intrinsic functions are array construction functions when
   called with array arguments.

EDIT:  None
SUBMITTED BY: Dick Weaver X3J3/92-197
HISTORY: 92-197      Submitted
         92-322 m123 Draft response (not approved)
         93-090      Response in passed 14-4
         93-111 m125 ballot approved with Rolison edit
         94-160 m129 WG5 ballot approved
--------------------------------------------------------------------------------

NUMBER: 000074
TITLE: Meaning of "referenced" in 11.3.2
KEYWORDS: local name - duplicates
DEFECT TYPE: Erratum
STATUS: Published

QUESTION:
Question 1:  The section of the standard in 11.3.2 [158:27-31] states:

    "Two or more accessible entities, other than generic interfaces, may
    have the same name only if no entity is referenced by this name in the
    scoping unit."

Should the use of this name as an argument to an inquiry function also be
disallowed; or passing the duplicate name as an argument be disallowed; or the
duplicate name in a pointer assignment be disallowed?  Can the duplicate name be
the left hand side of an assignment statement?

Question 2: Is it valid to have two local-names on a rename-list that are the
same but refer to two different data entities?  In the following example, is the
appearance of the second AA local-name in the rename-list legal?

          USE MID, AA=>BB
          USE MID, AA=>CC

ANSWER:

Answer 1: The cases cited in the question are not covered specifically in 11.3.2
although they were intended to be included in the quoted text as "referenced"
entities.  The cited cases are examples of the appearance of names rather than
as a technical Fortran 90 term for "reference".

Answer 2: The example is invalid.  The appearance of the second AA is not
allowed by the standard.  In section 11.3.2 [158:15-16], the standard states
that the local name is a "local name for the entity" which was intended to mean
that a new entity is not created, the existing entity is just renamed.

Discussion: It was intended that the term "referenced" be used in the sense that
an entity "appears in" or "is referred to" in the scoping unit, and was not
intended to mean "referenced" in terms of the technical definition.  That is, if
two or more accessible entities have the same name, that name must not appear in
the same scoping unit.  The following edit improves this wording.

EDIT: In section 11.3.2 [158:28]
         change the term "no entity is referenced by this name"
         to              "the name is not used to refer to an entity".

SUBMITTED BY: Dick Weaver
HISTORY: 92-198 question raised.
         92-297 m123 Response draft approved uc
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000075
TITLE: Interface blocks in block data
KEYWORDS: interface block, BLOCK DATA program unit
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION:  In section 12.3.2.1, on page 167, the third constraint

   "An <interface-block> must not appear in a BLOCK DATA program unit."

is constraining what? (The existence of a constraint implies that, if
the constraint were not present, the constrained "action" would be allowed.)

ANSWER: The syntax rules for <specification-part> include
<declaration-construct> which in turn includes <interface-block>.  Although the
constraint is redundant with the second constraint in section 11.4, the
committee feels there is no harm in leaving this constraint intact as a reminder
that an interface block must not appear in a block data subprogram.

EDITS: None.
SUBMITTED BY: Dick Weaver
HISTORY: 92-200
         92-323 m123 Draft response, not approved
         92-323 m124 reconsidered; reapproved uc
         93-111 m125 ballot approved
         94-160 m129 WG5 ballot approved with Rolison edit
         94-176 m129 Rolison edits as requested by WG5 ballot
         N981   m131 WG5 approved
--------------------------------------------------------------------------------

NUMBER: 000076
TITLE: Attributes, properties, characteristics
KEYWORDS: data object, attribute, property, characteristics
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION: The first paragraph of Section 5 states:

    Every data object has a number of properties (for example, type, rank, and
    shape) that determine the characteristics of the data and the uses of the
    object.  Collectively, these properties are termed the attributes of the
    data object.

Thus data objects have

    -- attributes
    -- properties
    -- characteristics (see also 12.2.1.1)

Other sections of ISO/IEC 1539:1991 use these terms indiscriminately.  What is
the relationship between attributes, properties, and characteristics?  Is this
complexity, which seems to lead to a number of difficulties, necessary?

ANSWER: In Section 5, the term "attribute" is used in a technical sense and the
terms "property" and "characteristic" are used as "normal English" to help
explain the meaning of "attribute".  In Section 12, "characteristic" is given a
technical definition.  Thus the usage of the term "characteristic" is not
consistent throughout ISO/IEC 1539:1991.  There may be other sections of the
standard that use these terms in an inconsistent fashion.

These inconsistencies will be resolved in a revision of ISO/IEC 1539:1991.

EDITS: None
SUBMITTED BY: Dick Weaver
HISTORY: 92-202r m123 Submitted along with suggested edits
         92-248 A related question appears in
         92-305 suggested edits
         92-307 suggested edits
         93-112r m125 Draft response, adopted 15-6
         93-255r1 m127 ballot passed 23-1
         94-160 m129 WG5 ballot approved
--------------------------------------------------------------------------------

NUMBER: 000077
TITLE: Miscellaneous questions
KEYWORDS: entity, data entity, data object, variable, external subprogram
DEFECT TYPE: Erratum
STATUS: Published

QUESTION:

Question 1: In Annex A, the definition of the term "entity" should subsume the
definition of the term "data entity".  This is not the case.  Is this a flaw?

Question 2: In many places in the standard (in sections 2, 4, 7, 8, 9, and
13), the term "entity" (or "entities") is actually referring to "data entity"
(or "data entities").  There are other places (in sections 6 and 9) where the
term "entity" is used, that the term "variable" would be more precise.  In
section 9.1, the term "physical entity" is used in the ordinary English sense
and this is inconsistent with the definition of "entity" in Annex A.  In
section 9.4.4.4, "namelist entity (10.9)" appears, but section 10.9 defines
"name-value  subsequences" which is the proper term.  Should not the standard
be more precise in usage of the term "entity"?

Question 3: In sections 9.4.4.4 and 9.4.4.4.2, "data are transferred" appears.
In these instances "data" is a collective noun and should be accompanied by a
singular verb as the collection is taken as a unit.  Should this phrase be
changed to "data is transferred"?

Question 4: In Annex A, should "subprogram" in the definition of "main program"
be changed to "external subprogram" to be consistent with the definition for
"program unit"?

ANSWER:
Answer 1: Yes, an edit below corrects this flaw.

Answer 2 and 3: These questions will be addressed in the revision of ISO/IEC
1539:1991.

Answer 4: Yes, an edit below makes this change.

EDITS:
1. In Annex A, in the entry for "entity",
   replace "a <named variable>, an <expression>, a <component> of a
            <structure>,  a <named constant>"
      with "a <data entity>". [256:38-39]

2. In Annex A, in the entry for "main program",
   replace "<subprogram>"
      with "<external subprogram>" [258:22]

SUBMITTED BY: Dick Weaver
HISTORY: 92-203   m123 Submitted along with suggested edits
         93-113   m125 Draft response, adopted 18-1
         93-255r1 m127 ballot passed 23-1
         94-160   m129 WG5 ballot approved
--------------------------------------------------------------------------------

NUMBER: 000078
TITLE: Intrinsic functions in MODULE specification statements
KEYWORDS: use association, intrinsic function, module,
          expression - specification
DEFECT TYPE: Interpretation
STATUS: Published

QUESTION: Consider a module that references an intrinsic function in a
specification expression which declares a public data object in the
specification part of the module.  Section 11.3.2 states

    "The local name of an entity made accessible by a USE statement may
    appear in no other specification statement that would cause any
    attribute (5.1.2) of the entity to be respecified in the scoping unit
    that contains the USE statement, except that it may appear in a PUBLIC
    or PRIVATE statement in the scoping unit of a module."

The question centers on whether a scoping unit which uses such a module gains
access to the intrinsic procedure through use association.  Specifically, are
the following two cases standard conforming?

     Case 1:
       MODULE SPEC
         PARAMETER (J = 3)
         DIMENSION ARRAY (IABS(10 - J)) ! Reference to IABS
       END MODULE

       PROGRAM USER
         USE SPEC
         REAL,DIMENSION (100)  :: IABS  ! Legal to respecify IABS?
         ...
       END

    Case 2:
       MODULE SPEC
         PARAMETER (J = 3)
         INTRINSIC IABS             ! IABS explicitly declared INTRINSIC
         DIMENSION ARRAY (IABS(10 - J)) ! Reference to IABS
       END MODULE

       PROGRAM USER
         USE SPEC
         REAL,DIMENSION (100)  :: IABS  ! Legal to respecify IABS?
         ...
       END

ANSWER: Neither case is standard conforming.

Discussion: In both cases, IABS denotes an intrinsic procedure in module SPEC.
Procedures are entities which may be made accessible by USE association, and in
the absence of a PRIVATE declaration applicable to IABS, they are made
accessible.  Thus, the cited restriction applies and the examples do not
conform.

EDIT: None
SUBMITTED BY: Jon Steidel
LAST SIGNIFICANT CHANGE: 92-11-13 000078 new
HISTORY: X3J3/92-205 Initially drafted
         X3J3/92-278 Response
         m123 Approved uc
         N881 WG5 approval
--------------------------------------------------------------------------------

NUMBER: 000079
TITLE: Automatic character and ALLOCATABLE, POINTER and TARGET attributes
KEYWORDS: allocatable, automatic, character, POINTER attribute,
          TARGET attribute, array allocatable, array automatic
DEFECT TYPE: Erratum
STATUS: Published

QUESTION: Section 5.1 states:

    The <specification-expr> (7.1.6.2) of a <type-param-value> (5.1.1.5) or an
    <array-spec> (5.1.2.4) may be a nonconstant expression provided the
    specification expression is in an interface body (12.3.2.1) or in the
    specification part of a subprogram.  If the data object being declared
    depends on the value of such a nonconstant expression and is not a dummy
    argument, such an object is called an automatic data object.  An automatic
    object must not appear in a SAVE or DATA statement nor be declared with a
    SAVE attribute nor be initially defined with an = <initialization-expr>.

Thus, a character object with a length-selector which is a nonconstant
type-param-value is an automatic object.

Section 5.1.2.9 states:

    The ALLOCATABLE attribute specifies that objects declared in the statement
    are allocatable arrays.  Such arrays must be deferred-shape arrays whose
    shape is determined when space is allocated for each array by the execution
    of an ALLOCATE statement (6.3.1).

The standard does not appear to prohibit allocatable arrays of automatic
objects.

Question 1: Is it the intent to allow allocatable arrays of automatic character?

      FUNCTION FRED (J)
      CHARACTER(LEN=J), DIMENSION(:), ALLOCATABLE :: CH
      ALLOCATE (CH(100))

Question 2: If allocatable arrays of automatic objects are allowed, is it
correct to assume the array must not have the SAVE attribute?

Question 3: Character length is part of a character entity's type and type
parameters.  Was it intended that character entities whose length is specified
by a variable expression or an * (assumed length character) be allowed to also
have the POINTER or TARGET attribute?

The third constraint of Section 7.5.2 states

     The target must be of the same type, type parameters, and rank as the
     pointer.

In general, there should be no problem with allowing the POINTER and TARGET
attribute for automatic arrays.  However, there is a problem if TARGET is
intended to be allowed for automatic character, both scalar and arrays, where
the length is specified by a variable expression.  Character length is part of
the type and type parameters, but where length is specified by a variable, the
above constraint cannot be diagnosed at compile time.

Was it the intent to allow the TARGET attribute on any automatic objects, only
on automatic arrays except where character length is specified by a variable
expression, or for no automatic objects?  If the intent is to allow TARGET on
all automatic objects, the above constraint must be relaxed as it cannot be
detected at compile time.

ANSWER:
(1) Yes, allocatable arrays of automatic character are allowed.

(2) Yes, such an array must not have the SAVE attribute.

(3) The TARGET attribute is allowed on any automatic object.  The third
constraint of section 7.5.2 cannot be diagnosed at compile time for automatic
character targets or targets that are character dummy arguments with assumed
length and, therefore, is relaxed by one of the supplied edits. Character
entities whose length is specified by a variable expression or an * (assumed
length character) are allowed to have the POINTER attribute.

EDITS:
1. In the third constraint of section 7.5.2 [92:12]
   change ", type parameters,"
   to     ", kind type parameters,"

2. Add at the beginning of the paragraph following the constraints of
   section 7.5.2 [92:15],

     "The target must have the same type parameters as the pointer."

SUBMITTED BY: Jon Steidel
HISTORY: 92-206        Initially drafted, with two possible responses
         92-206b  m123 "Second Possibility" rejected (9-9)
         92-206b  m123 "First Possibility" rejected (14-5)
                  m124  "Second Possibility" adopted (14-2)
         93-111   m125 ballot approved with Rolison edit
         93-123   m125 Question 3 is not completely answered
         93-150        edits
                  m127 J. Shepherd, during Monday report, changed to status C
                         noting that question 3 is not completely answered
         93-318   m127 response withdrawn
         94-043r1 m128 proposed response, approved uc
         94-116   m129 X3J3 ballot approved 22-1
         N984     m131 WG5 approved
--------------------------------------------------------------------------------

