module OW_rndseed1

use OW_exec_time
use OW_parms_areal

implicit none

contains

!---------------------------------------------
SUBROUTINE init_random_seed5(rand1)

   real 				:: rnd,rand1(:,:,:,:,:)
   integer, dimension(2) 		:: seed, seed_old
   integer 			:: seed_1,seed_2

   call owexec_time (rnd)
   seed(1)=rnd
   call owexec_time (rnd)
   seed(2)=int(log(rnd)) !+rndcte
   call random_seed(put=seed)
   call random_number(rand1)

   rand1=(rand1-0.5)*2.*pi

END SUBROUTINE
!---------------------------------------------
SUBROUTINE init_random_seed4(rand1)

   real 				:: rnd,rand1(:,:,:,:)
   integer, dimension(2) 		:: seed, seed_old
   integer 			:: seed_1,seed_2

   call owexec_time (rnd)
   seed(1)=rnd
   call owexec_time (rnd)
   seed(2)=int(log(rnd)) !+rndcte
   call random_seed(put=seed)
   call random_number(rand1)

   rand1=(rand1-0.5)*2.*pi

END SUBROUTINE
!---------------------------------------------
SUBROUTINE init_random_seed3(iwb,rand1)

   real 				:: rnd,rand1(sog%xm%n,sog%ym%n,wblock%blen(iwb))
   integer, dimension(2) 		:: seed, seed_old
   integer 			:: seed_1,seed_2,iwb

!   call owexec_time (rnd)
!   seed(1)=rnd
!   call owexec_time (rnd)
!   seed(2)=int(log(rnd))+rndcte
!   call random_seed(put=seed)
   call random_number(rand1)

   rand1=2*(rand1-0.5)*pi

END SUBROUTINE
!---------------------------------------------
SUBROUTINE init_random_seed2(rand1)

   real 				:: rnd,rand1(:,:)
   integer, dimension(2) 		:: seed

   call owexec_time (rnd)
   seed(1)=rnd
   call owexec_time (rnd)
   seed(2)=int(log(rnd))+rndcte
   call random_seed(put=seed)
   call random_number(rand1)

   rand1=(rand1-0.5)*2.*pi

END SUBROUTINE
!---------------------------------------------
SUBROUTINE init_random_seed1(rand1)

   real 				:: rnd,rand1(:)
   integer, dimension(2) 		:: seed


   call owexec_time (rnd)
   seed(1)=rnd
   call owexec_time (rnd)
   seed(2)=int(log(rnd))*rndcte
   call random_seed(put=seed)
   call random_number(rand1)

   rand1=(rand1-0.5)*2.*pi

END SUBROUTINE
!---------------------------------------------
!SUBROUTINE init_random_seed1(rand1,term,a)
!
!   integer, optional		:: term,a
!   real 				:: rnd,rand1,rnd2
!   integer, dimension(2) 		:: seed, seed_old
!   integer 			:: seed_1,seed_2
!
!   call owexec_time (rnd)
!   if (present(term).and.present(a)) then
!      seed(1)=term*int(log(rnd))
!   else 
!      seed(1)=int(term**1.5)*int(log(rnd))
!   end if
!   call owexec_time (rnd)
!   if (present(term)) then
!      seed(2)=int(log(rnd))+term
!   else
!      seed(2)=int(log(rnd))
!   end if
!
!   call random_seed(put=seed)
!   call random_number(rand1)
!
!   rand1=(rand1-0.5)*2.
!
!END SUBROUTINE
end module
