To: J3 J3/14-184r2 From: David Muxworthy & Steve Lionel Subject: UK proposal UK-22 RANDOM_NUMBER intrinsic Date: 2014 June 25 Status: For Consideration Basic Functionality: Independent random number generators Rationale: In N2013, Van Snyder says: "It is processor dependent whether common or independent random number generators are used, and there's no way to detect which is the situation. Therefore taking action using one assumption or the other (e.g., calling or not calling RANDOM_SEED on each image with a hopefully-different value, maybe dependent on the image number) might be the wrong thing to do. It is preferable to provide a named constant in ISO_FORTRAN_ENV to indicate whether the processor uses a common random number generator on all images, or intrinsic procedures so to inquire or specify. References to the intrinsic subroutine that specifies whether common or independent random number generators are used should be image control statements. 13.5p4 should be adjusted so that the segment ordering requirement applies only if a common random number generator is used." Further discussion indicated that it was undesireable for RANDOM_NUMBER to be different/unpredictable by default. The solution chosen is to modify the behavior of RANDOM_SEED without arguments, currently processor-dependent, to assign an unpredictable value to the seed that is different from that of other calls to RANDOM_SEED without arguments in the same program. This implies that calls in different images would result in different seeds. Some implementations already have this behavior for RANDOM_SEED. Specification: Specify that calling RANDOM_SEED without arguments asigns a new, unpredictable seed value that is different from those of other calls to RANDOM_SEED in the same program. Syntax: No syntax change. Edits to J3/14-007r1(= N2014): [xviii] Introduction Add to the bullet "Intrinsic procedures and modules" the sentence "Calling the intrinsic procedure RANDOM_SEED without arguments assigns an unpredictable seed value." [382:6] 13.7.136 RANDOM_SEED - replace: "If no argument is present, the processor assigns a processor-dependent value to the seed." with: "If no argument is present, the processor assigns a processor-dependent, unpredictable value to the seed different from those assigned by other calls to RANDOM_SEED without arguments in the same program."