Changeset 4461 for palm/trunk/SOURCE/init_pegrid.f90
- Timestamp:
- Mar 12, 2020 4:51:59 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/init_pegrid.f90
r4444 r4461 25 25 ! ----------------- 26 26 ! $Id$ 27 ! communicator configurations for four virtual pe grids defined 28 ! 29 ! 4444 2020-03-05 15:59:50Z raasch 27 30 ! bugfix: cpp-directives for serial mode added 28 31 ! … … 242 245 243 246 ! 247 !-- Create four default MPI communicators for the 2d virtual PE grid. One of them will be used 248 !-- as the main communicator for this run, while others might be used for specific quantities like 249 !-- aerosol, chemical species, or passive scalars), if their horizontal boundary conditions shall 250 !-- be different from those of the other quantities (e.g. non-cyclic conditions for aerosols, and 251 !-- cyclic conditions for all others). 252 DO i = 1, 4 253 254 IF ( i == 1 ) cyclic = (/ .TRUE., .TRUE. /) ! cyclic along x and y 255 IF ( i == 2 ) cyclic = (/ .TRUE., .FALSE. /) ! cyclic along x 256 IF ( i == 3 ) cyclic = (/ .FALSE., .TRUE. /) ! cyllic along y 257 IF ( i == 4 ) cyclic = (/ .FALSE., .FALSE. /) ! non-cyclic 258 259 CALL MPI_CART_CREATE( comm_palm, ndim, pdims, cyclic, reorder, & 260 communicator_configurations(i)%mpi_communicator, ierr ) 261 262 CALL MPI_CART_SHIFT( communicator_configurations(i)%mpi_communicator, 0, 1, & 263 communicator_configurations(i)%pleft, & 264 communicator_configurations(i)%pright, ierr ) 265 266 CALL MPI_CART_SHIFT( communicator_configurations(i)%mpi_communicator, 1, 1, & 267 communicator_configurations(i)%psouth, & 268 communicator_configurations(i)%pnorth, ierr ) 269 270 ENDDO 271 272 ! 244 273 !-- If necessary, set horizontal boundary conditions to non-cyclic 245 274 IF ( bc_lr /= 'cyclic' ) cyclic(1) = .FALSE. … … 248 277 249 278 ! 250 !-- Create the virtual processor grid 251 CALL MPI_CART_CREATE( comm_palm, ndim, pdims, cyclic, reorder, & 252 comm2d, ierr ) 279 !-- Set the main communicator (virtual pe grid) for this run 280 IF ( bc_lr == 'cyclic' .AND. bc_ns == 'cyclic' ) i = 1 281 IF ( bc_lr == 'cyclic' .AND. bc_ns /= 'cyclic' ) i = 2 282 IF ( bc_lr /= 'cyclic' .AND. bc_ns == 'cyclic' ) i = 3 283 IF ( bc_lr /= 'cyclic' .AND. bc_ns /= 'cyclic' ) i = 4 284 285 comm2d = communicator_configurations(i)%mpi_communicator 286 pleft = communicator_configurations(i)%pleft 287 pright = communicator_configurations(i)%pright 288 psouth = communicator_configurations(i)%psouth 289 pnorth = communicator_configurations(i)%pnorth 290 291 ! 292 !-- Set rank and coordinates of the main communicator 253 293 CALL MPI_COMM_RANK( comm2d, myid, ierr ) 254 294 WRITE (myid_char,'(''_'',I6.6)') myid 255 295 256 296 CALL MPI_CART_COORDS( comm2d, myid, ndim, pcoord, ierr ) 257 CALL MPI_CART_SHIFT( comm2d, 0, 1, pleft, pright, ierr ) 258 CALL MPI_CART_SHIFT( comm2d, 1, 1, psouth, pnorth, ierr ) 297 259 298 ! 260 299 !-- In case of cyclic boundary conditions, a y-shift at the boundaries in … … 316 355 ENDIF 317 356 ENDIF 357 318 358 ! 319 359 !-- Vertical nesting: store four lists that identify partner ranks to exchange
Note: See TracChangeset
for help on using the changeset viewer.