********************************************************************************
*                                                                              * 
*  2DHF version 1-2003                                                         *
*  Copyright (C) 1996  Jacek Kobus, Leif Laaksonen, Dage Sundholm              *
*                                                                              *
*  This software may be used and distributed according to the terms            *
*  of the GNU General Public License, see README and COPYING.                  *
*                                                                              *
********************************************************************************
c ### setomega ###
c
c     Determines optimal omega overrelaxation parameter for relaxing
c     potentials according to a semiempirical formula due to B.Sobczak's
c     MSc thesis, Torun 2002
c
      function setomega()
      implicit integer*4 (i-n)
      implicit real*8 (a-h,o-z)
      parameter (a=0.603,b=0.79)
      include 'commons8.inc'

      rho=0.5*(cos(pii/dble(mxnmu))+cos(pii/dble(nni)))
      setomega=2.d0*a/(1.d0+sqrt(1.d0-rho*rho))+b
      return
      end
