init_random_seed Subroutine

public subroutine init_random_seed(idx)

Initialized random seed with idx

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: idx

Called by

proc~~init_random_seed~~CalledByGraph proc~init_random_seed init_random_seed proc~init_env init_env proc~init_env->proc~init_random_seed proc~tem_start tem_start proc~tem_start->proc~init_env

Contents

Source Code


Source Code

  subroutine init_random_seed( idx )
    ! ---------------------------------------------------------------------------
    integer, intent(in) :: idx
    integer :: nSeeds
    integer, allocatable :: seed(:)
    integer :: i
    ! ---------------------------------------------------------------------------

    call random_seed(size = nSeeds)
    allocate(seed(nSeeds))
    seed = 37 * [ (idx*nSeeds + i, i=1,nSeeds) ]
    call random_seed(put = seed)
    deallocate(seed)

  end subroutine init_random_seed