J3/00-287 Date: 18 Sep 2000 To: J3 From: Dan Nagle Subject: Passing IO Mode to DTIO routines (Unresolved Issue #30) The interaction of user specified DTIO routines and the modes specified in format control and in I/O control lists is leftover business from 153. This paper addresses this issue. Briefly, an intrinsic derived type is defined in the ISO_FORTRAN_ENV module. An argument of this type is passed to the user specified DTIO routines. The INTRINSIC derived type is named ISO_IO_MODE. The derived type specifies the current state of the following modes: BLANK, DECIMAL, PAD, ROUND, SCALE, and SIGN. Edits: 190:20+ add bullet item the user defined derived type formatted data transfer procedure is passed the optional argument of type ISO_IO_MODE 190:30+ io_mode, & 190:31+ USE, INTRINSIC :: ISO_FORTRAN_ENV 190: 37+ TYPE( ISO_IO_MODE), OPTIONAL, INTENT( IN) :: io_mode 191:7+ io_mode, & 191:8+ USE, INTRINSIC :: ISO_FORTRAN_ENV 191: 14+ TYPE( ISO_IO_MODE), OPTIONAL, INTENT( IN) :: io_mode 192:27+ add paragraph The child data transfer routine may determine the values of the IO modes prevailing in the parent data transfer statement at the point of call via the values of the argument of type ISO_IO_MODE. These values may be different from those specified on the most recent OPEN statement for this unit. The optional argument of type ISO_IO_MODE shall not be passed to the user defined derived type data transfer procedure if it is invoked via any means other than as a child data transfer statement. 194:7+ add to Note The INQUIRE will provide values based upon the most recently executed OPEN statement for this unit. The values currently in effect at the point where this child transfer statement was invoked may be learned via the argument of type ISO_IO_MODE. 198:3 replace "executed." with "executed, unless the INQUIRE statement is executed from within a child data transfer statement. If the INQUIRE statement is executed from within a child data transfer statement, it returns values in effect prior to the execution of the ultimate parent of the child data transfer statement. 340:22+ Variables of this intrinsic derived type are used to pass the current I/O mode to user specified derived type I/O routines. TYPE :: ISO_IO_MODE INTEGER :: SCALE ! default kind CHARACTER( LEN= 2) :: BLANK ! "BN" | "BZ" CHARACTER( LEN= 2) :: DECIMAL ! "DC" | "DP" CHARACTER( LEN= 2) :: ROUND ! "RU" | "RD" | "RZ" | "RN" | "RP" | "RC" CHARACTER( LEN= 2) :: SIGN ! "S" | "SP" | "SS" CHARACTER( LEN= 3) :: PAD ! "YES" | "NO" END TYPE ISO_IO_MODE