Changeset 667 for palm/trunk/SOURCE/exchange_horiz_2d.f90
- Timestamp:
- Dec 23, 2010 12:06:00 PM (13 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/palm/branches/suehring 423-666 /palm/branches/letzel/masked_output/SOURCE 296-409
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
palm/trunk/SOURCE/exchange_horiz_2d.f90
r484 r667 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! Dynamic exchange of ghost points with nbgp, which depends on the advection 7 ! scheme. Exchange between left and right PEs is now done with MPI-vectors. 7 8 ! 8 9 ! Former revisions: … … 37 38 IMPLICIT NONE 38 39 39 REAL :: ar(nys-1:nyn+1,nxl-1:nxr+1) 40 REAL :: ar(nysg:nyng,nxlg:nxrg) 41 INTEGER :: i 40 42 41 43 … … 51 53 !-- One-dimensional decomposition along y, boundary values can be exchanged 52 54 !-- within the PE memory 53 ar( nys:nyn,nxl-1) = ar(nys:nyn,nxr)54 ar( nys:nyn,nxr+1) = ar(nys:nyn,nxl)55 ar(:,nxl-nbgp:nxl-1) = ar(:,nxr-nbgp+1:nxr) 56 ar(:,nxr+1:nxr+nbgp) = ar(:,nxl:nxl+nbgp-1) 55 57 56 58 ELSE 57 59 ! 58 60 !-- Send left boundary, receive right one 59 CALL MPI_SENDRECV( ar(nys,nxl), ngp_y, MPI_REAL, pleft, 0, & 60 ar(nys,nxr+1), ngp_y, MPI_REAL, pright, 0, & 61 62 CALL MPI_SENDRECV( ar(nysg,nxl), 1, type_y, pleft, 0, & 63 ar(nysg,nxr+1), 1, type_y, pright, 0, & 61 64 comm2d, status, ierr ) 62 65 ! 63 66 !-- Send right boundary, receive left one 64 CALL MPI_SENDRECV( ar(nys ,nxr), ngp_y, MPI_REAL, pright, 1, &65 ar(nys ,nxl-1), ngp_y, MPI_REAL, pleft, 1, &67 CALL MPI_SENDRECV( ar(nysg,nxr+1-nbgp), 1, type_y, pright, 1, & 68 ar(nysg,nxlg), 1, type_y, pleft, 1, & 66 69 comm2d, status, ierr ) 67 70 ENDIF … … 71 74 !-- One-dimensional decomposition along x, boundary values can be exchanged 72 75 !-- within the PE memory 73 ar(nys- 1,:) = ar(nyn,:)74 ar(nyn+1 ,:) = ar(nys,:)76 ar(nys-nbgp:nys-1,:) = ar(nyn-nbgp+1:nyn,:) 77 ar(nyn+1:nyn+nbgp,:) = ar(nys:nys+nbgp-1,:) 75 78 76 79 ELSE 77 80 ! 78 81 !-- Send front boundary, receive rear one 79 CALL MPI_SENDRECV( ar(nys,nxl-1), 1, type_x, psouth, 0, & 80 ar(nyn+1,nxl-1), 1, type_x, pnorth, 0, & 82 83 CALL MPI_SENDRECV( ar(nys,nxlg), 1, type_x, psouth, 0, & !replace number of sended elements from 84 ar(nyn+1,nxlg), 1, type_x, pnorth, 0, & ! nbgp to 1 81 85 comm2d, status, ierr ) 82 86 ! 83 87 !-- Send rear boundary, receive front one 84 CALL MPI_SENDRECV( ar(nyn,nxl-1), 1, type_x, pnorth, 1, & 85 ar(nys-1,nxl-1), 1, type_x, psouth, 1, & 86 comm2d, status, ierr ) 88 CALL MPI_SENDRECV( ar(nyn+1-nbgp,nxlg), 1, type_x, pnorth, 1, & 89 ar(nysg,nxlg), 1, type_x, psouth, 1, & 90 comm2d, status, ierr ) 91 87 92 ENDIF 88 93 … … 92 97 !-- Lateral boundary conditions in the non-parallel case 93 98 IF ( bc_lr == 'cyclic' ) THEN 94 ar( nys:nyn,nxl-1) = ar(nys:nyn,nxr)95 ar( nys:nyn,nxr+1) = ar(nys:nyn,nxl)99 ar(:,nxl-nbgp:nxl-1) = ar(:,nxr-nbgp+1:nxr) 100 ar(:,nxr+1:nxr+nbgp) = ar(:,nxl:nxl+nbgp-1) 96 101 ENDIF 97 102 98 103 IF ( bc_ns == 'cyclic' ) THEN 99 ar(nys-1,:) = ar(nyn,:) 100 ar(nyn+1,:) = ar(nys,:) 101 ENDIF 104 ar(nys-nbgp:nys-1,:) = ar(nyn-nbgp+1:nyn,:) 105 ar(nyn+1:nyn+nbgp,:) = ar(nys:nys+nbgp-1,:) 106 ENDIF 107 102 108 103 109 #endif … … 106 112 !-- Neumann-conditions at inflow/outflow in case of non-cyclic boundary 107 113 !-- conditions 108 IF ( inflow_l .OR. outflow_l ) ar(:,nxl-1) = ar(:,nxl) 109 IF ( inflow_r .OR. outflow_r ) ar(:,nxr+1) = ar(:,nxr) 110 IF ( inflow_s .OR. outflow_s ) ar(nys-1,:) = ar(nys,:) 111 IF ( inflow_n .OR. outflow_n ) ar(nyn+1,:) = ar(nyn,:) 112 114 IF ( inflow_l .OR. outflow_l ) THEN 115 DO i=nbgp, 1, -1 116 ar(:,nxl-i) = ar(:,nxl) 117 END DO 118 END IF 119 IF ( inflow_r .OR. outflow_r ) THEN 120 DO i=1, nbgp 121 ar(:,nxr+i) = ar(:,nxr) 122 END DO 123 END IF 124 IF ( inflow_s .OR. outflow_s ) THEN 125 DO i=nbgp, 1, -1 126 ar(nys-i,:) = ar(nys,:) 127 END DO 128 END IF 129 IF ( inflow_n .OR. outflow_n ) THEN 130 DO i=1, nbgp 131 ar(nyn+i,:) = ar(nyn,:) 132 END DO 133 END IF 113 134 CALL cpu_log( log_point_s(13), 'exchange_horiz_2d', 'stop' ) 114 135 … … 134 155 IMPLICIT NONE 135 156 136 INTEGER :: ar(nys-1:nyn+1,nxl-1:nxr+1) 157 REAL :: ar(nysg:nyng,nxlg:nxrg) 158 INTEGER :: i 159 137 160 138 161 … … 154 177 ! 155 178 !-- Send left boundary, receive right one 156 CALL MPI_SENDRECV( ar(nys ,nxl), ngp_y, MPI_INTEGER, pleft, 0, &157 ar(nys ,nxr+1), ngp_y, MPI_INTEGER, pright, 0, &179 CALL MPI_SENDRECV( ar(nysg,nxl), 1, type_y_int, pleft, 0, & 180 ar(nysg,nxr+1), 1, type_y_int, pright, 0, & 158 181 comm2d, status, ierr ) 159 182 ! 160 183 !-- Send right boundary, receive left one 161 CALL MPI_SENDRECV( ar(nys,nxr), ngp_y, MPI_INTEGER, pright, 1, & 162 ar(nys,nxl-1), ngp_y, MPI_INTEGER, pleft, 1, & 163 comm2d, status, ierr ) 184 CALL MPI_SENDRECV( ar(nysg,nxr+1-nbgp), 1, type_y_int, pright, 1, & 185 ar(nysg,nxlg), 1, type_y_int, pleft, 1, & 186 comm2d, status, ierr ) 187 164 188 ENDIF 165 189 … … 168 192 !-- One-dimensional decomposition along x, boundary values can be exchanged 169 193 !-- within the PE memory 170 ar(nys-1,:) = ar(nyn,:) 171 ar(nyn+1,:) = ar(nys,:) 194 ar(nysg:nys-1,:) = ar(nyn+1-nbgp:nyn,:) 195 ar(nyn+1:nyng,:) = ar(nys:nys-1+nbgp,:) 196 172 197 173 198 ELSE 174 199 ! 175 200 !-- Send front boundary, receive rear one 176 CALL MPI_SENDRECV( ar(nys,nxl-1), 1, type_x_int, psouth, 0, & 177 ar(nyn+1,nxl-1), 1, type_x_int, pnorth, 0, & 178 comm2d, status, ierr ) 201 CALL MPI_SENDRECV( ar(nys,nxlg),1, type_x_int, psouth, 0, & 202 ar(nyn+1,nxlg),1, type_x_int, pnorth, 0, & 203 comm2d, status, ierr ) 204 179 205 ! 180 206 !-- Send rear boundary, receive front one 181 CALL MPI_SENDRECV( ar(nyn,nxl-1), 1, type_x_int, pnorth, 1, & 182 ar(nys-1,nxl-1), 1, type_x_int, psouth, 1, & 183 comm2d, status, ierr ) 207 CALL MPI_SENDRECV( ar(nyn+1-nbgp,nxlg), nbgp, type_x_int, pnorth, 1, & 208 ar(nysg,nxlg), nbgp, type_x_int, psouth, 1, & 209 comm2d, status, ierr ) 210 184 211 ENDIF 185 212 … … 194 221 195 222 IF ( bc_ns == 'cyclic' ) THEN 196 ar(nys -1,:) = ar(nyn,:)197 ar(nyn+1 ,:) = ar(nys,:)223 ar(nysg:nys-1,:) = ar(nyn+1-nbgp:nyn,:) 224 ar(nyn+1:nyng,:) = ar(nys:nys-1+nbgp,:) 198 225 ENDIF 199 226
Note: See TracChangeset
for help on using the changeset viewer.