subroutine nbi_random_init_aep(nseed_aep,ind_aep,iscreen1)

  use nbi_random_aep
  implicit none

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

  integer, intent(in) :: nseed_aep      ! integer to init rng seed
  integer, intent(in) :: ind_aep      ! (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_aep,nseed_aep)
  call rng_step_seed(rng_seed_aep,ind_aep,-95,110)

  
! write(iscreen1,*) 'ind= ',ind_aep,' seed= ',rng_print_seed(rng_seed_aep)

  call rng_init(rng_seed_aep,rng_curstate_aep)

  call rng_number(rng_curstate_aep,nbi_srng_aep)
  nbi_srng_ptr_aep = 1

  call rng_gauss(rng_curstate_aep,nbi_sgauss_aep)
  nbi_sgauss_ptr_aep = 1

end subroutine nbi_random_init_aep
