RNNOF
This function generates a pseudorandom number from a standard normal distribution.
Function Return Value
RNNOF — Function value, a random standard normal deviate. (Output)
See Comment 1.
Required Arguments
None.
FORTRAN 90 Interface
Generic: RNNOF ()
Specific: The specific interface names are S_RNNOF and D_RNNOF.
FORTRAN 77 Interface
Single: RNNOF ()
Double: The double precision name is DRNNOF.
Description
Routine RNNOF is the function form of RNNOR. If several standard normal deviates are needed, it may be more efficient to obtain them all at once by a call to RNNOR, rather than by several references to RNNOF.
Comments
1. If the generic version of this function is used, the immediate result must be stored in a variable before use in an expression. For example:
X = RNNOF()
Y = SQRT(X)
must be used rather than
Y = SQRT(RNNOF())
If this is too much of a restriction on the programmer, then the specific name can be used without this restriction.
2. The routine RNSET can be used to initialize the seed of the random number generator. The routine RNOPT can be used to select the form of the generator.
3. This function has a side effect: it changes the value of the seed, which is passed through a common block.
Example
In this example, RNNOF is used to generate five pseudorandom standard normal numbers.
 
USE UMACH_INT
USE RNSET_INT
USE RNNOF_INT
 
IMPLICIT NONE
INTEGER I, ISEED, NOUT, NR
REAL R(5)
!
CALL UMACH (2, NOUT)
ISEED = 123457
CALL RNSET (ISEED)
NR=5
DO 10 I=1, NR
R(I) = RNNOF()
10 CONTINUE
WRITE (NOUT,99999) R
99999 FORMAT (' Standard normal random deviates: ', 5F8.4)
END
Output
 
Standard normal random deviates: 1.8279 -0.6412 0.7266 0.1747 1.0145
Published date: 03/19/2020
Last modified date: 03/19/2020