scramble Subroutine

public subroutine scramble(tab, lg)

scramble a vector of reals

Arguments

Type IntentOptional Attributes Name
real(kind=r8), intent(inout), dimension(1:lg) :: tab
integer(kind=i4), intent(in) :: lg

Calls

proc~~scramble~~CallsGraph proc~scramble scramble sort_array2 sort_array2 proc~scramble->sort_array2

Source Code

   subroutine scramble(tab, lg)
   !================================================================================================
   !! scramble a vector of reals
   !------------------------------------------------------------------------------------------------
   implicit none
   integer(kind=i4), intent(in   )                  :: lg
   real(kind=r8)   , intent(inout), dimension(1:lg) :: tab

      real(kind=r8), dimension(1:lg) :: tmp
      integer(kind=i4) :: i

      call random_number( harvest = tmp(1:lg) )

      call sort_array2(tab_inout = tmp(1:lg),            &  !
                            tab1 = tab(1:lg), n = lg)       !

   return
   endsubroutine scramble