subroutine nbi_random_init_pll(nseed_pll,ind_pll,iscreen1)

  use nbi_random_pll
  implicit none

  !
  !  init nbi random numbers
  !  use charles karney's f90 rng interface
  !     (see nbi_random module)
  !

  integer, intent(in) :: nseed_pll      ! integer to init rng seed
  integer, intent(in) :: ind_pll      ! (eventually) no. of cpus / parallel
                                    ! random number streams.
  integer, intent(in) :: iscreen1

  !  (parallel random number streams not yet used as nubeam has not been
  !  parallelized)

  call rng_set_seed(rng_seed_pll,nseed_pll)
  call rng_step_seed(rng_seed_pll,ind_pll,-95,110)

  
! write(iscreen1,*) 'ind= ',ind_pll,' seed= ',rng_print_seed(rng_seed_pll)

  call rng_init(rng_seed_pll,rng_curstate_pll)

  call rng_number(rng_curstate_pll,nbi_srng_pll)
  nbi_srng_ptr_pll = 1

  call rng_gauss(rng_curstate_pll,nbi_sgauss_pll)
  nbi_sgauss_ptr_pll = 1

end subroutine nbi_random_init_pll
