                    !!!  ------------------  !!!
                         MODULE ISINGLIB
                    !!!  ------------------  !!!


  implicit none

  integer :: ran_seed

  contains


      FUNCTION RANDOM()

            ! Use seed = 1 as first value.

      implicit none
      DOUBLE PRECISION MINV,RANDOM
      integer m,a,Qran,r,hi,lo
      PARAMETER(M=2147483647,A=16807,Qran=127773,R=2836)
      PARAMETER(MINV=0.46566128752458d-09)
      HI = RAN_SEED/Qran
      LO = MOD(RAN_SEED,Qran)
      RAN_SEED = A*LO - R*HI
      IF(RAN_SEED.LE.0) RAN_SEED = RAN_SEED + M
      RANDOM = RAN_SEED*MINV
      END FUNCTION RANDOM

                  !!!  ----------------------  !!!
                       END MODULE ISINGLIB
                  !!!  ----------------------  !!!
