インテル® Fortran コンパイラー 14.0 ユーザー・リファレンス・ガイド

SEED

Portability Subroutine: Changes the starting point of the pseudorandom number generator.

モジュール

USE IFPORT

CALL SEED (iseed)

iseed

(Input) INTEGER(4). Starting point for RANDOM.

SEED uses iseed to establish the starting point of the pseudorandom number generator. A given seed always produces the same sequence of values from RANDOM.

If SEED is not called before the first call to RANDOM, RANDOM always begins with a seed value of one. If a program must have a different pseudorandom sequence each time it runs, pass the constant RND$TIMESEED (defined in IFPORT.F90) to the SEED routine before the first call to RANDOM.

This routine is not thread-safe.

 USE IFPORT
 REAL myrand
 CALL SEED(7531)
 CALL RANDOM(myrand)

関連情報


このヘルプトピックについてのフィードバックを送信