To: J3 J3/26-108 From: Malcolm Cohen Subject: US16 Default kinds, syntax Date: 2026-January-11 References: 23-199r1, 25-191, 25-191r2. 1. Introduction This paper has the syntax for US16, Default kinds. See 23-199r1 for an introduction to this feature. 25-191r2 has the formal requirements and specifications. 25-191 has some additional discussion and background. 2. Syntax Y1. The form of the new statement shall be default-kind-stmt is DEFAULT KIND ( default-kind-spec-list ) default-kind-spec is basic-intrinsic-type-name = int-constant-expr basic-intrinsic-type-name is REAL or INTEGER or LOGICAL or CHARACTER {Used the long-winded "basic-intrinsic-type-name", to avoid confusion as COMPLEX is not included.} ALTERNATIVE Y1: As above, but with the statement having the form DEFAULT KIND :: default-kind-spec-list This form avoids the parentheses, but the double-colon is mandatory to avoid fixed-form ambiguity with an assignment statement. Y2. The int-constant-expr in a default-kind-spec shall not depend on a property of the default kind of a type, unless that type has its default kind previously specified in the scoping unit or its default kind is not specified in the scoping unit. Y3. A default-kind-stmt shall appear after any USE statement, but before any IMPLICIT statement. Y4. Constraint: The same basic-intrinsic-type-name in a default-kind-stmt shall not appear more than once in a scoping unit. Y5. More than one default-kind-stmt may appear, subject to Y3 and Y4. Y6. A default-kind-stmt shall appear only in the specification part of a program unit, interface body, or nested subprogram, and applies to all nested scoping units other than interface bodies. {This is the same as for IMPLICIT.} Y7. The default kinds can be imported from a single module with a USE statement that has the ", DEFAULT_KINDS" clause. Only one such import is permitted, and if used, no default-kind-stmt shall appear in the scoping unit. The ", DEFAULT_KINDS" clause is only permitted in a scoping unit that would otherwise be permitted to have a default-kind-stmt. This changes the beginning of the USE statement syntax from USE [ [ , module-nature ] :: ] to USE [ [ , module-nature ] [ , DEFAULT_KINDS ] :: ] Y8. The default kind when no default kind specification is in effect is: default real kind = single precision real kind default integer kind = standard integer kind default logical kind = standard logical kind default character kind = system character kind {Previously proposed terminology for INTEGER and LOGICAL was "default range" and "default size" respectively, but it's better to just say standard.} {Note: We could say "standard character" instead of "system character", but I think the latter is more evocative and thus better.} Standard integer kind and standard logical kind are defined to have the same storage size as single precision real kind. Y9. ISO_FORTRAN_ENV shall have named constants as follows: SINGLE_PRECISION - kind of single precision real DOUBLE_PRECISION - kind of double precision real STANDARD_INTEGER - kind of standard integer STANDARD_LOGICAL - kind of standard logical SYSTEM_CHARACTER - kind of system character Y10. Standard generic intrinsic functions that return a default kind shall return the user-specified default kind if active, except for operating system interactions with type CHARACTER which will always be system character kind. {Note: This is achieved by leaving the wording as is in most cases.} The exceptions are thus: DATE_AND_TIME: the DATE, TIME, and ZONE arguments. EXECUTE_COMMAND_LINE: the COMMAND and CMDMSG arguments. GET_COMMAND: the COMMAND and ERRMSG arguments. GET_COMMAND_ARGUMENT: the VALUE and ERRMSG arguments. GET_ENVIRONMENT_VARIABLE: the NAME, VALUE, and ERRMSG arguments. MOVE_ALLOC: the ERRMSG argument. RANDOM_SEED: the GET and PUT arguments. The SIZE argument should be changed to allow any kind of integer with a decimal exponent range of at least four. There is also: DBLE - will continue to return double precision real DPROD - will continue to return double precision real SYSTEM_CLOCK - the "no smaller than default integer" wording will be changed to "no smaller than standard integer". Y11. Standard specific intrinsic functions that return default real or integer shall return single precision real and default range integer. Y12. Procedures in standard intrinsic modules that have an argument of default kind, or a return value of default kind, will remain with those kinds i.e. the wording will be changed to standard kind. {RATIONALE: It would be unreasonable to require all the possible variations of possible kind specifications for the intrinsic modules to be implemented, and some of the possibilities would not in fact work due to 8-bit integer being too small.} Y13. Input/output specifiers that return default kind integer, logical, or character shall be unaffected; that is, the wording will be changed to standard integer, standard logical, and system character. Y14. That the arguments of defined input/output procedures shall be standard integer and system character, as they are now. Y15. That the ERRMSG= specifiers in other statements, such as ALLOCATE, shall be system character kind. ===END===