      subroutine rmagau(xg,yg) ! bernd berg, sep 25 2000.
c  generates independent random numbers xg,yg with normal probability
c  density p(x)=exp[-(x/sqrt(2))**2]/sqrt(2*pi), i.e. variance one.
      include '../../libs/fortran/implicit.sta'
      include '../../libs/fortran/constants.par'
      call ranmar(xr)
      r=sqrt(abs(two*log(one-xr))) ! xr can be zero but not one.
      call ranmar(xr)
      xg=r*cos(tpi*xr)
      yg=r*sin(tpi*xr)
      return
      end 
