!===============================================================================
!
! univ_test.F90 - test of "univ.F90"
!
!-------------------------------------------------------------------------------
!
! Copyright (C) 1998-2008 Hinnerk Stueben
!
! This file is part of BQCD -- Berlin Quantum ChromoDynamics program
!
! BQCD is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! BQCD is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with BQCD.  If not, see <http://www.gnu.org/licenses/>.
!
!-------------------------------------------------------------------------------
# include "defs.h"

!-----------------------------------------------------------------------
      program univ_test

      implicit   none
      character  dump*(*)
      parameter (dump = 'univ_test.dump')
      real(8)    x, r(6), univ
      integer    i, n   
      logical    exists


      inquire(file = dump, exist = exists)
      if (exists) call univ_restore(1, dump)

      read(5,*) n

      do i = 1, n
         x = univ()
      enddo

      call univ_dump(1, dump)
      call univ_vec(r, 6)

      do i = 1, 6
         write(6, '(1x,f12.1)') 4096.0 * (4096.0 * r(i))
      enddo


      end

!-----------------------------------------------------------------------
      subroutine die(msg)

      character(*) msg

      write(6,*) msg
      stop

      end

!=======================================================================
