Enhancements to Derived-Type I/O
Specs, Syntax, Edits
by Craig T. Dedo
August 13, 1998
1. Rationale
This paper is a response to resolution T.8 in paper J3 / 98-169 (WG5-N1323). In this resolution,
WG5 "notes with concern that the current proposal for derived type input / output is both inadequate
and not amenable to extension and urges the primary development body to consider the changes
proposed in WG5-N1322". The paper WG5-N1322 proposes, "For derived-type I/O, provide more
flexibility in the interfaces of user-defined derived type I/O routines for formatted I/O and in the syntax
of the DT edit descriptor, in particular, to allow a variable number of integer values ... instead of a
maximum of 3".
2. Technical Specification
The JOR subgroup proposes that the DT edit descriptor be revised to replace the w.d.m designation
with an optional list of constants separated by commas and enclosed in parentheses. The list may be
of any length. This list of constants shall correspond to an argument to the user-defined READ
(FORMATTED) and WRITE (FORMATTED) subroutines. This argument shall be an assumed-shape
array of type default integer and with a number of elements the same as the number of items in the list.
3. Syntax
The DT edit descriptor is changed to the following format:
DT[char-literal-constant] [(a,b,c...)]
where:
char-literal-constant is an optional character string literal of default kind.
(a,b,c, ...) is an optional comma-separated list of default integer constants enclosed in
parentheses.
4. Edits
Page and line references are to document 98-007r2.
In section 9.4.4.4.3:
[168:44] Replace "w, d, m" with "v_list".
[169:1] Replace the line with:
INTEGER, INTENT(IN) :: v_list(:)
[169:22] Replace "w, d, m" with "v_list".
[169:29] Replace the line with:
INTEGER, INTENT(IN) :: v_list(:)
[170:19-21] Change the item list to read:
"DT" concatenated with the char-literal-constant of the edit descriptor, if any, if the parent data
transfer statement contained a format specification and the list item's corresponding edit descriptor
was a DT edit descriptor.
[170:27-29] Change the paragraph to read:
The v_list argument shall have the user-specified values from the v-list of the edit descriptor. v_list
shall have the same number of elements, in the same order, as v-list if v-list is present; otherwise v_list
is a zero-sized array. v_list is a zero-sized array if the data transfer statement specified list-directed
or namelist formatting.
[170:42-43] Change Note 9.40 to read:
The user's procedure may choose to interpret an element of the v_list argument as a field width, but
it is not required. If it does, it would be appropriate to fill an output field with asterisks if the width
is too small.
In section 10.2.1:
[185:2] In R1005, change the line to read:
or DT[char-literal-constant] [(v-list)]
[185:6+] Add a rule R101x:
R101x v is signed-int-literal-constant
[185:10] Change the constraint to read:
Constraint: w, m, d, e, and v shall not have kind parameters specified for them.
[185:11-12] Change the constraint to read:
Constraint: The char-literal-constant in the DT edit descriptor shall not have a kind type parameter
specified for it.
[185:13] Change "and D" to "D, and DT".
In section 10.3:
[186:42] Add to the end of the sentence, after the word "parenthesis", the words, "that is not part of
a DT edit descriptor".
In section 10.5.5:
[193:37-41] Change the paragraph to read:
The DT edit descriptor may contain a character literal constant. The character value "DT"
concatenated with the character literal constant is passed to the user-defined derived-type input /
output procedure as the iotype argument (9.4.4.4.3). The v values are passed to the user-defined
derived-type input / output procedure as the v_list array argument.
[194:1-3] Replace note 10.17:
NOTE 10.17
For the edit descriptor DT'Link List'(10,4,2), iotype is "DTLink List" and v_list is (/10,4,2/).
END NOTE
5. References
J3 / 98-169 (aka ISO/IEC JTC1/SC22/WG5-N1323), Resolutions of the WG5 Meeting on 8 to 12 June
1998 in Trollhättan, Sweden.
ISO/IEC JTC1/SC22/WG5-N1322, Proposal for More Flexible Derived-Type I/O Facility
[End of J3 / 98-189]