***********************************************************************
C
C
        FUNCTION rgauss(iseed,xmean,sigma)
C
C
C***********************************************************************
C
C
C   Function to produce a Gaussianly distributed random number.
C
C
C=======================================================================

C   Declaration of local variables.
C   -------------------------------

        REAL sigrange,a,x,b,p,rgauss,xmean,sigma

C=======================================================================

        sigrange=5.

  10    CONTINUE

        a=ran1(iseed)
        x=2.*(a-0.5)*sigma*sigrange + xmean
        b=ran1(iseed)
        p=EXP(-(x-xmean)*(x-xmean)/(2.*sigma*sigma))

        IF(b.gt.p) GO TO 10

        rgauss=x

        RETURN
        END
