Changeset 1560 for palm/trunk/SOURCE/inflow_turbulence.f90
 Timestamp:
 Mar 6, 2015 10:48:54 AM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/SOURCE/inflow_turbulence.f90
r1354 r1560 20 20 ! Current revisions: 21 21 !  22 ! 22 ! Option recycling_yshift added. If this option is switched on, the turbulence 23 ! data, which is mapped from the recycling plane to the inflow, is shifted in 24 ! y direction (by ny * dy / 2 ) 23 25 ! 24 26 ! Former revisions: … … 59 61 60 62 USE control_parameters, & 61 ONLY: recycling_plane 63 ONLY: recycling_plane, recycling_yshift 62 64 63 65 USE cpulog, & … … 81 83 INTEGER(iwp) :: k !: 82 84 INTEGER(iwp) :: l !: 85 INTEGER(iwp) :: next !: 83 86 INTEGER(iwp) :: ngp_ifd !: 84 87 INTEGER(iwp) :: ngp_pr !: 88 INTEGER(iwp) :: prev !: 85 89 86 90 REAL(wp), DIMENSION(nzb:nzt+1,5,nbgp) :: & 87 91 avpr, avpr_l !: 88 92 REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,5,nbgp) :: & 89 inflow_dist 93 inflow_dist, local_inflow_dist !: 90 94 91 95 CALL cpu_log( log_point(40), 'inflow_turbulence', 'start' ) … … 190 194 IF ( myidx == id_recycling .AND. myidx /= id_inflow ) THEN 191 195 192 CALL MPI_SEND( inflow_dist(nzb,nysg,1,1), ngp_ifd, MPI_REAL, &196 CALL MPI_SEND( inflow_dist(nzb,nysg,1,1), ngp_ifd, MPI_REAL, & 193 197 id_inflow, 1, comm1dx, ierr ) 194 198 … … 196 200 197 201 inflow_dist = 0.0_wp 198 CALL MPI_RECV( inflow_dist(nzb,nysg,1,1), ngp_ifd, MPI_REAL, &202 CALL MPI_RECV( inflow_dist(nzb,nysg,1,1), ngp_ifd, MPI_REAL, & 199 203 id_recycling, 1, comm1dx, status, ierr ) 200 204 201 205 ENDIF 206 207 208 IF ( recycling_yshift .AND. myidx == id_inflow ) THEN 209 210 IF ( pdims(2) >= 2 ) THEN 211 212 IF ( myidy >= INT( pdims(2) / 2 ) ) THEN 213 prev = myidy  INT( pdims(2) / 2 ) 214 ELSE 215 prev = pdims(2)  ( INT( pdims(2) / 2 )  myidy ) 216 ENDIF 217 218 IF ( myidy < pdims(2)  INT( pdims(2) / 2 ) ) THEN 219 next = myidy + INT( pdims(2) / 2 ) 220 ELSE 221 next = INT( pdims(2) / 2 )  ( pdims(2)  myidy ) 222 ENDIF 223 224 ENDIF 225 226 local_inflow_dist = 0.0_wp 227 228 CALL MPI_SENDRECV( inflow_dist(nzb,nysg,1,1), ngp_ifd, MPI_REAL, & 229 next, 1, local_inflow_dist(nzb,nysg,1,1), ngp_ifd, & 230 MPI_REAL, prev, 1, comm1dy, status, ierr ) 231 232 ENDIF 233 202 234 #endif 203 235 … … 205 237 ! Add the disturbance at the inflow 206 238 IF ( nxl == 0 ) THEN 207 208 DO j = nysg, nyng 209 DO k = nzb, nzt + 1 210 211 u(k,j,nbgp+1:0) = mean_inflow_profiles(k,1) + & 212 inflow_dist(k,j,1,1:nbgp) * inflow_damping_factor(k) 213 v(k,j,nbgp:1) = mean_inflow_profiles(k,2) + & 214 inflow_dist(k,j,2,1:nbgp) * inflow_damping_factor(k) 215 w(k,j,nbgp:1) = & 239 240 IF ( recycling_yshift ) THEN 241 242 DO j = nysg, nyng 243 DO k = nzb, nzt + 1 244 245 u(k,j,nbgp+1:0) = mean_inflow_profiles(k,1) + & 246 local_inflow_dist(k,j,1,1:nbgp) * & 247 inflow_damping_factor(k) 248 v(k,j,nbgp:1) = mean_inflow_profiles(k,2) + & 249 local_inflow_dist(k,j,2,1:nbgp) * & 250 inflow_damping_factor(k) 251 w(k,j,nbgp:1) = & 252 local_inflow_dist(k,j,3,1:nbgp) * & 253 inflow_damping_factor(k) 254 pt(k,j,nbgp:1) = mean_inflow_profiles(k,4) + & 255 local_inflow_dist(k,j,4,1:nbgp) * & 256 inflow_damping_factor(k) 257 e(k,j,nbgp:1) = mean_inflow_profiles(k,5) + & 258 local_inflow_dist(k,j,5,1:nbgp) * & 259 inflow_damping_factor(k) 260 e(k,j,nbgp:1) = MAX( e(k,j,nbgp:1), 0.0_wp ) 261 262 ENDDO 263 ENDDO 264 265 ELSE 266 267 DO j = nysg, nyng 268 DO k = nzb, nzt + 1 269 270 u(k,j,nbgp+1:0) = mean_inflow_profiles(k,1) + & 271 inflow_dist(k,j,1,1:nbgp) * inflow_damping_factor(k) 272 v(k,j,nbgp:1) = mean_inflow_profiles(k,2) + & 273 inflow_dist(k,j,2,1:nbgp) * inflow_damping_factor(k) 274 w(k,j,nbgp:1) = & 216 275 inflow_dist(k,j,3,1:nbgp) * inflow_damping_factor(k) 217 pt(k,j,nbgp:1) = mean_inflow_profiles(k,4) +&276 pt(k,j,nbgp:1) = mean_inflow_profiles(k,4) + & 218 277 inflow_dist(k,j,4,1:nbgp) * inflow_damping_factor(k) 219 e(k,j,nbgp:1) = mean_inflow_profiles(k,5) +&278 e(k,j,nbgp:1) = mean_inflow_profiles(k,5) + & 220 279 inflow_dist(k,j,5,1:nbgp) * inflow_damping_factor(k) 221 e(k,j,nbgp:1) = MAX( e(k,j,nbgp:1), 0.0_wp ) 222 223 ENDDO 224 ENDDO 225 226 ENDIF 280 e(k,j,nbgp:1) = MAX( e(k,j,nbgp:1), 0.0_wp ) 281 282 ENDDO 283 ENDDO 284 285 ENDIF 286 287 ENDIF 288 227 289 228 290 CALL cpu_log( log_point(40), 'inflow_turbulence', 'stop' )
Note: See TracChangeset
for help on using the changeset viewer.