- Timestamp:
- Mar 8, 2017 3:55:25 PM (8 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/disturb_field.f90
r2101 r2172 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Bugfix removed id_random_array from USE list 23 23 ! 24 24 ! Former revisions: … … 89 89 USE random_generator_parallel, & 90 90 ONLY: random_number_parallel, random_seed_parallel, random_dummy, & 91 id_random_array,seq_random_array91 seq_random_array 92 92 93 93 IMPLICIT NONE -
palm/trunk/SOURCE/init_3d_model.f90
r2119 r2172 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Bugfix: moved parallel random generator initialization into its module 23 23 ! 24 24 ! Former revisions: … … 370 370 371 371 USE random_generator_parallel, & 372 ONLY: random_number_parallel, random_seed_parallel, random_dummy, & 373 id_random_array, seq_random_array 372 ONLY: init_parallel_random_generator 374 373 375 374 USE statistics, & … … 816 815 817 816 ! 818 !-- ID-array and state-space-array for the parallel random number generator819 IF ( random_generator == 'random-parallel' ) THEN820 ALLOCATE ( seq_random_array(5,nysg:nyng,nxlg:nxrg) )821 ALLOCATE ( id_random_array(0:ny,0:nx) )822 seq_random_array = 0823 id_random_array = 0824 ENDIF825 826 !827 817 !-- 4D-array for storing the Rif-values at vertical walls 828 818 IF ( topography /= 'flat' ) THEN … … 1287 1277 1288 1278 IF ( random_generator == 'random-parallel' ) THEN 1289 !-- Asigning an ID to every vertical gridpoint column 1290 !-- dependig on the ensemble run number. 1291 random_dummy=1 1292 DO j=0,ny 1293 DO i=0,nx 1294 id_random_array(j,i) = random_dummy + 1E6 & 1295 * ( ensemble_member_nr - 1000 ) 1296 random_dummy = random_dummy + 1 1297 END DO 1298 ENDDO 1299 !-- Initializing with random_seed_parallel for every vertical 1300 !-- gridpoint column. 1301 random_dummy=0 1302 DO j = nysg, nyng 1303 DO i = nxlg, nxrg 1304 CALL random_seed_parallel (random_sequence=id_random_array(j, i)) 1305 CALL random_number_parallel (random_dummy) 1306 CALL random_seed_parallel (get=seq_random_array(:, j, i)) 1307 END DO 1308 ENDDO 1279 CALL init_parallel_random_generator(nx, ny, nys, nyn, nxl, nxr) 1309 1280 ENDIF 1310 1281 -
palm/trunk/SOURCE/random_generator_parallel_mod.f90
r2145 r2172 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Bugfix: added global initialization routine and removed global array 23 23 ! 24 24 ! Former revisions: … … 67 67 PRIVATE 68 68 PUBLIC random_number_parallel, random_seed_parallel, random_dummy, & 69 id_random_array, seq_random_array 69 id_random_array, seq_random_array, init_parallel_random_generator 70 70 71 71 INTEGER(isp), SAVE :: lenran=0 !< … … 96 96 REAL(wp) :: random_dummy=0.0 !< 97 97 98 INTERFACE init_parallel_random_generator 99 MODULE PROCEDURE init_parallel_random_generator 100 END INTERFACE 101 98 102 INTERFACE random_number_parallel 99 103 MODULE PROCEDURE ran0_s … … 117 121 118 122 CONTAINS 123 124 !------------------------------------------------------------------------------! 125 ! Description: 126 ! ------------ 127 !> Initialize the parallel random number generator for a specific subdomain 128 !------------------------------------------------------------------------------! 129 SUBROUTINE init_parallel_random_generator(nx, ny, nys, nyn, nxl, nxr) 130 131 USE kinds 132 133 USE control_parameters, & 134 ONLY: ensemble_member_nr 135 136 IMPLICIT NONE 137 138 INTEGER(isp), INTENT(IN) :: nx !< 139 INTEGER(isp), INTENT(IN) :: ny !< 140 INTEGER(isp), INTENT(IN) :: nys !< 141 INTEGER(isp), INTENT(IN) :: nyn !< 142 INTEGER(isp), INTENT(IN) :: nxl !< 143 INTEGER(isp), INTENT(IN) :: nxr !< 144 145 INTEGER(iwp) :: i !< 146 INTEGER(iwp) :: j !< 147 148 !-- Allocate ID-array and state-space-array 149 ALLOCATE ( seq_random_array(5,nys:nyn,nxl:nxr) ) 150 ALLOCATE ( id_random_array(nys:nyn,nxl:nxr) ) 151 seq_random_array = 0 152 id_random_array = 0 153 154 !-- Asigning an ID to every vertical gridpoint column 155 !-- dependig on the ensemble run number. 156 DO i=nxl, nxr 157 DO j=nys, nyn 158 id_random_array(j,i) = j*(nx+1.0_wp) + i + 1.0_wp + 1E6 * & 159 ( ensemble_member_nr - 1000 ) 160 ENDDO 161 ENDDO 162 !-- Initializing with random_seed_parallel for every vertical 163 !-- gridpoint column. 164 random_dummy=0 165 DO i = nxl, nxr 166 DO j = nys, nyn 167 CALL random_seed_parallel (random_sequence=id_random_array(j, i)) 168 CALL random_number_parallel (random_dummy) 169 CALL random_seed_parallel (get=seq_random_array(:, j, i)) 170 ENDDO 171 ENDDO 172 173 END SUBROUTINE init_parallel_random_generator 119 174 120 175 !------------------------------------------------------------------------------!
Note: See TracChangeset
for help on using the changeset viewer.