Changeset 4474
- Timestamp:
- Mar 26, 2020 9:32:18 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/exchange_horiz_mod.f90
r4461 r4474 25 25 ! ----------------- 26 26 ! $Id$ 27 ! bugfix for correct usage of alternative communicators in case of 1d-decompositions and in 28 ! non-parallel mode 29 ! 30 ! 4461 2020-03-12 16:51:59Z raasch 27 31 ! optional communicator added to exchange_horiz 28 32 ! … … 182 186 !-- One-dimensional decomposition along y, boundary values can be exchanged 183 187 !-- within the PE memory 184 IF ( bc_lr_cyc ) THEN 185 ar(:,:,nxl-nbgp_local:nxl-1) = ar(:,:,nxr-nbgp_local+1:nxr) 186 ar(:,:,nxr+1:nxr+nbgp_local) = ar(:,:,nxl:nxl+nbgp_local-1) 188 IF ( PRESENT( alternative_communicator ) ) THEN 189 IF ( alternative_communicator <= 2 ) THEN 190 ar(:,:,nxl-nbgp_local:nxl-1) = ar(:,:,nxr-nbgp_local+1:nxr) 191 ar(:,:,nxr+1:nxr+nbgp_local) = ar(:,:,nxl:nxl+nbgp_local-1) 192 ENDIF 193 ELSE 194 IF ( bc_lr_cyc ) THEN 195 ar(:,:,nxl-nbgp_local:nxl-1) = ar(:,:,nxr-nbgp_local+1:nxr) 196 ar(:,:,nxr+1:nxr+nbgp_local) = ar(:,:,nxl:nxl+nbgp_local-1) 197 ENDIF 187 198 ENDIF 188 199 … … 244 255 !-- One-dimensional decomposition along x, boundary values can be exchanged 245 256 !-- within the PE memory 246 IF ( bc_ns_cyc ) THEN 247 ar(:,nys-nbgp_local:nys-1,:) = ar(:,nyn-nbgp_local+1:nyn,:) 248 ar(:,nyn+1:nyn+nbgp_local,:) = ar(:,nys:nys+nbgp_local-1,:) 257 IF ( PRESENT( alternative_communicator ) ) THEN 258 IF ( alternative_communicator == 1 .OR. alternative_communicator == 3 ) THEN 259 ar(:,nys-nbgp_local:nys-1,:) = ar(:,nyn-nbgp_local+1:nyn,:) 260 ar(:,nyn+1:nyn+nbgp_local,:) = ar(:,nys:nys+nbgp_local-1,:) 261 ENDIF 262 ELSE 263 IF ( bc_ns_cyc ) THEN 264 ar(:,nys-nbgp_local:nys-1,:) = ar(:,nyn-nbgp_local+1:nyn,:) 265 ar(:,nyn+1:nyn+nbgp_local,:) = ar(:,nys:nys+nbgp_local-1,:) 266 ENDIF 249 267 ENDIF 250 268 … … 302 320 !-- workaround has to be removed later. Also, since PGI compiler 12.5 has problems 303 321 !-- with array syntax, explicit loops are used. 304 IF ( bc_lr_cyc ) THEN 305 ar(:,:,nxl-nbgp_local:nxl-1) = ar(:,:,nxr-nbgp_local+1:nxr) 306 ar(:,:,nxr+1:nxr+nbgp_local) = ar(:,:,nxl:nxl+nbgp_local-1) 322 IF ( PRESENT( alternative_communicator ) ) THEN 323 IF ( alternative_communicator <= 2 ) THEN 324 ar(:,:,nxl-nbgp_local:nxl-1) = ar(:,:,nxr-nbgp_local+1:nxr) 325 ar(:,:,nxr+1:nxr+nbgp_local) = ar(:,:,nxl:nxl+nbgp_local-1) 326 ENDIF 327 ELSE 328 IF ( bc_lr_cyc ) THEN 329 ar(:,:,nxl-nbgp_local:nxl-1) = ar(:,:,nxr-nbgp_local+1:nxr) 330 ar(:,:,nxr+1:nxr+nbgp_local) = ar(:,:,nxl:nxl+nbgp_local-1) 331 ENDIF 307 332 ENDIF 308 333 … … 315 340 !$ACC WAIT(2) 316 341 317 IF ( bc_ns_cyc ) THEN 318 ar(:,nys-nbgp_local:nys-1,:) = ar(:,nyn-nbgp_local+1:nyn,:) 319 ar(:,nyn+1:nyn+nbgp_local,:) = ar(:,nys:nys+nbgp_local-1,:) 342 IF ( PRESENT( alternative_communicator ) ) THEN 343 IF ( alternative_communicator == 1 .OR. alternative_communicator == 3 ) THEN 344 ar(:,nys-nbgp_local:nys-1,:) = ar(:,nyn-nbgp_local+1:nyn,:) 345 ar(:,nyn+1:nyn+nbgp_local,:) = ar(:,nys:nys+nbgp_local-1,:) 346 ENDIF 347 ELSE 348 IF ( bc_ns_cyc ) THEN 349 ar(:,nys-nbgp_local:nys-1,:) = ar(:,nyn-nbgp_local+1:nyn,:) 350 ar(:,nyn+1:nyn+nbgp_local,:) = ar(:,nys:nys+nbgp_local-1,:) 351 ENDIF 320 352 ENDIF 321 353
Note: See TracChangeset
for help on using the changeset viewer.