!! Initialize_Uniform : procedure (value1, value2, value3 : integer
!!                                ;seeds : out array [1..3] 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 <= 32_362
!!		1 <= s2 <= 31_726
!!		1 <= s3 <= 31_656
!!
!! This procedure will NOT assign any value to the global integers
!! unless both range conditions are satisfied.
!!
!! This function 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, Value3, Seeds, Succes)

      implicit character*255 (a-z)

      !!----------------------------------------------------------------------
      !! Constants.
      !!----------------------------------------------------------------------

      logical*1 TRUE
        parameter (TRUE= .true.)

      logical*1 FALSE
        parameter (FALSE= .false.)

      !!----------------------------------------------------------------------
      !! Parameters.
      !!----------------------------------------------------------------------

      !! IN:

      integer*2 Value1		!! Values to
      integer*2 Value2		!! initialize the
      integer*2 Value3		!! generator with.

      !! OUT:

      integer*2 Seeds (1:3)	!! List of seed values for use by the
				!! generator function.

      logical*1 Succes		!! Indicates whether the initialization
				!! 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.

      logical*1 range3		!! Indicates whether the range condition for
				!! Value3 is satisfied.

!! begin

      range1= (1 .le. Value1) .and. (Value1 .le. 32362)
      range2= (1 .le. Value2) .and. (Value2 .le. 31726)
      range3= (1 .le. Value3) .and. (Value3 .le. 31656)

      if (range1 .and. range2 .and. range3) then
        Seeds(1)= Value1
        Seeds(2)= Value2
        Seeds(3)= Value3
        Succes= TRUE

      else
        Succes= FALSE

      end if

      return

      end !! InitU
