Ignore:
Timestamp:
May 9, 2014 2:03:54 PM (10 years ago)
Author:
knoop
Message:

Parallel random number generator added (preliminary version).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/init_3d_model.f90

    r1385 r1400  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! Parallel random number generator added
    2323!
    2424! Former revisions:
     
    198198   
    199199    USE random_function_mod
     200   
     201    USE random_generator_parallel,                                             &
     202        ONLY:  random_number_parallel, random_seed_parallel, random_dummy,     &
     203               id_random_array, seq_random_array
    200204   
    201205    USE statistics,                                                            &
     
    481485
    482486!
     487!-- ID-array and state-space-array for the parallel random number generator
     488    IF ( random_generator == 'random-parallel' )  THEN
     489       ALLOCATE ( seq_random_array(5,nysg:nyng,nxlg:nxrg) )
     490       ALLOCATE ( id_random_array(0:ny,0:nx) )
     491       seq_random_array = 0
     492       id_random_array  = 0
     493    ENDIF
     494   
     495!
    483496!-- 3D-arrays for the leaf area density and the canopy drag coefficient
    484497    IF ( plant_canopy ) THEN
     
    913926
    914927!
     928!--    Initialize the random number generators (from numerical recipes)
     929       CALL random_function_ini
     930       IF ( random_generator == 'random-parallel' )  THEN
     931          CALL random_function_ini
     932          !- asigning an ID to every vertical gridpoint column
     933          DO j=0,ny
     934             DO i=0,nx
     935                id_random_array(j,i) = 1000000*i + j
     936             END DO
     937          ENDDO
     938          !- executing the initial ran_parallel
     939          DO j = nysg, nyng
     940             DO i = nxlg, nxrg
     941                CALL random_seed_parallel (random_sequence=id_random_array(j, i))
     942                CALL random_number_parallel (random_dummy)
     943                CALL random_seed_parallel (get=seq_random_array(:, j, i))
     944             END DO
     945          ENDDO
     946       ENDIF
     947
     948!
    915949!--    Initialize fluxes at bottom surface
    916950       IF ( use_surface_fluxes )  THEN
     
    10981132          q(nzb,:,:) = q(nzb,:,:) + q_surface_initial_change
    10991133       ENDIF
    1100 !
    1101 !--    Initialize the random number generator (from numerical recipes)
    1102        CALL random_function_ini
    11031134
    11041135!
Note: See TracChangeset for help on using the changeset viewer.