init_random_seed Subroutine

public subroutine init_random_seed(idx)

Initialized random seed with idx

Arguments

Type IntentOptional AttributesName
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 proc~load_env load_env proc~load_env->proc~tem_start program~tem_sparta_test tem_sparta_test program~tem_sparta_test->proc~tem_start proc~check_serial_multilevel_facedesc check_serial_multilevel_faceDesc proc~check_serial_multilevel_facedesc->proc~tem_start program~bin_search_test bin_search_test program~bin_search_test->proc~tem_start program~tem_spacetime_fun_test tem_spacetime_fun_test program~tem_spacetime_fun_test->proc~load_env program~tem_variable_evaltype_test tem_variable_evaltype_test program~tem_variable_evaltype_test->proc~load_env program~tem_varsys_stfunvar_test tem_varSys_stfunVar_test program~tem_varsys_stfunvar_test->proc~load_env program~tem_varsys_derivevar_test tem_varSys_deriveVar_test program~tem_varsys_derivevar_test->proc~load_env proc~check_serial_singlelevel_facedesc check_serial_singlelevel_faceDesc proc~check_serial_singlelevel_facedesc->proc~load_env program~tem_variable_extract_test tem_variable_extract_test program~tem_variable_extract_test->proc~load_env program~tem_varsys_statevar_test tem_varSys_stateVar_test program~tem_varsys_statevar_test->proc~load_env proc~check_parallel_singlelevel_facedesc check_parallel_singlelevel_faceDesc proc~check_parallel_singlelevel_facedesc->proc~load_env proc~check_variableoperations check_variableOperations proc~check_variableoperations->proc~load_env program~tem_varsys_test tem_varSys_test program~tem_varsys_test->proc~load_env program~tem_variable_combine_test tem_variable_combine_Test program~tem_variable_combine_test->proc~load_env program~tem_face_test~3 tem_face_test program~tem_face_test~3->proc~check_serial_multilevel_facedesc program~tem_varsys_opvar_test tem_varSys_opVar_test program~tem_varsys_opvar_test->proc~load_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