J3/14-168r3 To: J3 Subject: F2015: allow non-default kinds in arguments to intrinsics From: Stan Whitlock & Dan Nagle & Steve Lionel Date: 2014 June 24 Reference: 14-007r1 1. Introduction =============== In Fortran 2008 we extended the allowed kinds for OPEN and INQUIRE specifiers from default kind to any kind. See 14-007r1 [209] OPEN (RECL=) or [237] INQUIRE (NEXTREC=). F2008 did not change default character usage in these specifiers. Several of the intrinsic procedures [chapter 13] and the IEEE intrinsic module procedures [chapter 14] require that their arguments be of default kind. This is unnecessary. The proposal is to extend these arguments to any kind. There is no change proposed for default character arguments or for default kinds for function results. Issues raised with RANDOM_SEED have caused this intrinsic to be removed from this revision. 2. Specification for 2015 work plan ============================== Extend the kinds for arguments in certain intrinsic and intrinsic module procedures to allow any kinds, not just default kinds. The procedures and their arguments that are affected are: [342:17] 13.7.44 DATE_AND_TIME (, , , VALUES) [347:21] 13.7.57 EXECUTE_COMMAND_LINE ( , WAIT, EXITSTAT, CMDSTAT, ) [351:7 ] 13.7.65 GET_COMMAND ( , LENGTH, STATUS) [351:24] 13.7.66 GET_COMMAND_ARGUMENT (NUMBER , , LENGTH, STATUS) [352:27] 13.7.67 GET_ENVIRONMENT_VARIABLE ( , , LENGTH, STATUS, ) [395:1 ] 13.7.167 THIS_IMAGE ( , DIM) [414:1 ] 14.11.4 IEEE_GET_FLAG ( , FLAG_VALUE) [414:12] 14.11.5 IEEE_GET_HALTING MODE ( , HALTING) [415:19] 14.11.8 IEEE_GET_UNDERFLOW_MODE (GRADUAL) [419:19] 14.11.19 IEEE_SET_FLAG ( , FLAG_VALUE) [419:31] 14.11.20 IEEE_SET_HALTING_MODE ( , HALTING) [421:1 ] 14.11.23 IEEE_SET_UNDERFLOW_MODE (GRADUAL) RANDOM_SEED is explicitly excluded from this list due to difficulties in definition. 3. Edits to 14-007r1 ========================== [xviii] Add to the bullet "Intrinsic procedures and modules" the sentence: "Integer and logical arguments are no longer required to be default kind for intrinsic procedures and intrinsic module procedures, other than \si(RANDOM_SEED), that previously had such a restriction." In 13.7.44 DATE_AND_TIME [342:33] For argument VALUES, change "default integer array" to "integer array whose kind can represent a minimum of four decimal digits" [342:35-343:2] Replace "HUGE(0)" with "HUGE(0_)". In 13.7.57 EXECUTE_COMMAND_LINE: [347:27] For argument WAIT, delete "default" [347:30] For argument EXITSTAT, replace "default integer scalar" with "integer scalar whose kind can represent a minimum of nine decimal digits" [348:2] For argument CMDSTAT, replace "default integer scalar" with "integer scalar whose kind can represent a minimum of four decimal digits" In 13.7.65 GET_COMMAND: [351;14] For argument LENGTH, replace "default integer scalar" with "integer scalar whose kind can represent a minimum of four decimal digits" [351:20] For argument STATUS, replace "default integer scalar" with "integer scalar whose kind can represent a minimum of four decimal digits" In 13.7.66 GET_COMMAND_ARGUMENT: [351:28] For argument NUMBER, delete "default" [352:4] For argument LENGTH, replace "default integer scalar" with "integer scalar whose kind can represent a minimum of four decimal digits" [352:10] For argument STATUS, replace "default integer scalar" with "integer scalar whose kind can represent a minimum of four decimal digits" In 13.7.67 GET_ENVIRONMENT_VARIABLE: [352:37] For argument LENGTH, replace "default integer scalar" with "integer scalar whose kind can represent a minimum of four decimal digits" [352:40] For argument STATUS, replace "default integer scalar" with "integer scalar whose kind can represent a minimum of four decimal digits" In 13.7.167 THIS_IMAGE: [395:6] For argument DIM, delete "default" In 14.11.4 IEEE_GET_FLAG: [414:6] For argument FLAG_VALUE, delete "default" In 14.11.5 IEEE_GET_HALTING MODE: [414:19] For argument HALTING, delete "default" In 14.11.8 IEEE_GET_UNDERFLOW_MODE: [415:22] For argument GRADUAL, delete "default" In 14.11.19 IEEE_SET_FLAG: [419:27] For argument FLAG_VALUE, delete "default" In 14.11.20 IEEE_SET_HALTING_MODE: [419:38] argument HALTING, delete "default" In 14.11.23 IEEE_SET_UNDERFLOW_MODE: [421:4] For argument GRADUAL, delete "default"