!! Initialize_Uniform : procedure (value1, value2 : integer !! ;seeds : out array [1..2] of integer !! ;succes : out boolean) !! Version 1.1 !! Purpose: !! Initialize the global integer variables for use by the random !! number generator function "Uniform". !! !! Initial values range limitations are as follows: !! 1 <= s1 <= 2_147_483_562 !! 1 <= s2 <= 2_147_483_398 !! !! This procedure will NOT assign any value to either global integer !! unless both range conditions are satisfied. !! !! This procedure will return the value TRUE (in SUCCES) if the range !! conditions are met (initialization is successful), and FALSE otherwise !! (initialization failed). !!###################################################################### !!# # !!# This procedure must be called before Unifrm is called. # !!# # !!###################################################################### !! Source: !! Pierre L'Ecuyer, Efficient and Portable Combined Random Number !! Generators, Communications of the ACM, Vol. 31, No. 6 (June 1988), !! 742-749, 774. !! Author(s): James J. Fullerton !! Creation Date: 22 JUN 88 !! Date Last Approved: 22 JUN 88 !! Revisions (Date, Name, and summary of revision(s)): subroutine InitU (Value1, Value2, Seeds, Succes) implicit character*255 (a-z) !!---------------------------------------------------------------------- !! Constants. !!---------------------------------------------------------------------- logical*1 TRUE parameter (TRUE= .true.) logical*1 FALSE parameter (FALSE= .false.) !!---------------------------------------------------------------------- !! Parameters. !!---------------------------------------------------------------------- !! IN: integer*4 Value1 !! Values to initialize integer*4 Value2 !! the generator with. !! OUT: integer*4 Seeds (1:2) !! Seed values used by the generator !! function each time a new random !! number is generated. logical*1 Succes !! Indicates whether the initialization !! operation was successful. !!---------------------------------------------------------------------- !! Local variables. !!---------------------------------------------------------------------- logical*1 range1 !! Indicates whether the range condition for !! Value1 is satisfied. logical*1 range2 !! Indicates whether the range condition for !! Value2 is satisfied. !! begin range1= (1 .le. Value1) .and. (Value1 .le. 2147483562) range2= (1 .le. Value2) .and. (Value2 .le. 2147483398) if (range1 .and. range2) then Seeds(1)= Value1 Seeds(2)= Value2 Succes= TRUE else Succes= FALSE end if return end !! InitU