Changeset 4301 for palm/trunk/SOURCE/init_pegrid.f90
- Timestamp:
- Nov 22, 2019 12:09:09 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/init_pegrid.f90
r4264 r4301 25 25 ! ----------------- 26 26 ! $Id$ 27 ! changed message PA0467 28 ! 29 ! 4264 2019-10-15 16:00:23Z scharf 27 30 ! corrected error message string 28 31 ! … … 237 240 !-- Get coordinates of left and right neighbor on PE grid 238 241 IF ( y_shift /= 0 ) THEN 239 240 IF ( bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic' ) THEN 241 message_string = 'y_shift /= 0 is only allowed for cyclic ' // & 242 'boundary conditions in both directions ' 243 CALL message( 'check_parameters', 'PA0467', 1, 2, 0, 6, 0 ) 244 ENDIF 245 IF ( TRIM( psolver ) /= 'multigrid' .AND. & 246 TRIM( psolver ) /= 'multigrid_noopt') & 247 THEN 248 message_string = 'y_shift /= 0 requires a multigrid pressure solver ' 249 CALL message( 'check_parameters', 'PA0468', 1, 2, 0, 6, 0 ) 250 ENDIF 251 252 CALL MPI_CART_COORDS( comm2d, pright, ndim, rcoord, ierr ) 253 CALL MPI_CART_COORDS( comm2d, pleft, ndim, lcoord, ierr ) 254 255 ! 256 !-- If the x(y)-coordinate of the right (left) neighbor is smaller (greater) 257 !-- than that of the calling process, then the calling process is located on 258 !-- the right (left) boundary of the processor grid. In that case, 259 !-- the y-coordinate of that neighbor is increased (decreased) by y_shift. 260 !-- The rank of the process with that coordinate is then inquired and the 261 !-- neighbor rank for MPI_SENDRECV, pright (pleft) is set to it. 262 !-- In this way, the calling process receives a new right (left) neighbor 263 !-- for all future MPI_SENDRECV calls. That neighbor has a y-coordinate 264 !-- of y+(-)y_shift, where y is the original right (left) neighbor's 265 !-- y-coordinate. The modulo-operation ensures that if the neighbor's 266 !-- y-coordinate exceeds the grid-boundary, it will be relocated to 267 !-- the opposite part of the grid cyclicly. 268 IF ( rcoord(1) < pcoord(1) ) THEN 269 rcoord(2) = MODULO( rcoord(2) + y_shift, pdims(2) ) 270 CALL MPI_CART_RANK( comm2d, rcoord, pright, ierr ) 271 ENDIF 272 273 IF ( lcoord(1) > pcoord(1) ) THEN 274 lcoord(2) = MODULO( lcoord(2) - y_shift, pdims(2) ) 275 CALL MPI_CART_RANK( comm2d, lcoord, pleft, ierr ) 242 IF ( bc_lr == 'cyclic' ) THEN 243 IF ( TRIM( psolver ) /= 'multigrid' .AND. & 244 TRIM( psolver ) /= 'multigrid_noopt') & 245 THEN 246 message_string = 'y_shift /= 0 requires a multigrid pressure solver ' 247 CALL message( 'check_parameters', 'PA0468', 1, 2, 0, 6, 0 ) 248 ENDIF 249 250 CALL MPI_CART_COORDS( comm2d, pright, ndim, rcoord, ierr ) 251 CALL MPI_CART_COORDS( comm2d, pleft, ndim, lcoord, ierr ) 252 253 ! 254 !-- If the x(y)-coordinate of the right (left) neighbor is smaller (greater) 255 !-- than that of the calling process, then the calling process is located on 256 !-- the right (left) boundary of the processor grid. In that case, 257 !-- the y-coordinate of that neighbor is increased (decreased) by y_shift. 258 !-- The rank of the process with that coordinate is then inquired and the 259 !-- neighbor rank for MPI_SENDRECV, pright (pleft) is set to it. 260 !-- In this way, the calling process receives a new right (left) neighbor 261 !-- for all future MPI_SENDRECV calls. That neighbor has a y-coordinate 262 !-- of y+(-)y_shift, where y is the original right (left) neighbor's 263 !-- y-coordinate. The modulo-operation ensures that if the neighbor's 264 !-- y-coordinate exceeds the grid-boundary, it will be relocated to 265 !-- the opposite part of the grid cyclicly. 266 IF ( rcoord(1) < pcoord(1) ) THEN 267 rcoord(2) = MODULO( rcoord(2) + y_shift, pdims(2) ) 268 CALL MPI_CART_RANK( comm2d, rcoord, pright, ierr ) 269 ENDIF 270 271 IF ( lcoord(1) > pcoord(1) ) THEN 272 lcoord(2) = MODULO( lcoord(2) - y_shift, pdims(2) ) 273 CALL MPI_CART_RANK( comm2d, lcoord, pleft, ierr ) 274 ENDIF 275 276 ELSE 277 ! 278 !-- y-shift for non-cyclic boundary conditions is only implemented 279 !-- for the turbulence recycling method in inflow_turbulence.f90 280 IF ( .NOT. turbulent_inflow ) THEN 281 message_string = 'y_shift /= 0 is only allowed for cyclic ' // & 282 'boundary conditions in both directions ' // & 283 'or with turbulent_inflow == .TRUE.' 284 CALL message( 'check_parameters', 'PA0467', 1, 2, 0, 6, 0 ) 285 ENDIF 276 286 ENDIF 277 287 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.