Changeset 2696 for palm/trunk/SOURCE/init_pegrid.f90
- Timestamp:
- Dec 14, 2017 5:12:51 PM (7 years ago)
- Location:
- palm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk
-
palm/trunk/SOURCE
-
palm/trunk/SOURCE/init_pegrid.f90
r2600 r2696 1 1 !> @file init_pegrid.f90 2 2 !------------------------------------------------------------------------------! 3 ! This file is part of PALM.3 ! This file is part of the PALM model system. 4 4 ! 5 5 ! PALM is free software: you can redistribute it and/or modify it under the … … 25 25 ! ----------------- 26 26 ! $Id$ 27 ! 3D-Integer exchange on multigrid level (MS) 28 ! Forcing implemented (MS) 29 ! 30 ! 2600 2017-11-01 14:11:20Z raasch 27 31 ! calculation of block-I/O quantitites removed (is now done in parin) 28 32 ! … … 204 208 !> user)and computation of the grid point number and array bounds of the local 205 209 !> domains. 210 !> @todo: remove MPI-data types for 2D exchange on coarse multigrid level (not 211 !> used any more) 206 212 !------------------------------------------------------------------------------! 207 213 SUBROUTINE init_pegrid … … 210 216 USE control_parameters, & 211 217 ONLY: bc_lr, bc_ns, coupling_mode, coupling_mode_remote, & 212 coupling_topology, gathered_size, grid_level, & 218 coupling_topology, force_bound_l, force_bound_n, force_bound_r, & 219 force_bound_s, gathered_size, grid_level, & 213 220 grid_level_count, inflow_l, inflow_n, inflow_r, inflow_s, & 214 221 maximum_grid_level, message_string, & … … 352 359 CALL MPI_CART_SHIFT( comm2d, 0, 1, pleft, pright, ierr ) 353 360 CALL MPI_CART_SHIFT( comm2d, 1, 1, psouth, pnorth, ierr ) 354 355 361 ! 356 362 !-- In case of cyclic boundary conditions, a y-shift at the boundaries in … … 405 411 ENDIF 406 412 ENDIF 407 408 413 ! 409 414 !-- Vertical nesting: store four lists that identify partner ranks to exchange … … 700 705 #endif 701 706 702 703 707 ! 704 708 !-- Determine the number of ghost point layers … … 823 827 !-- Create custom MPI vector datatypes for contiguous data transfer 824 828 IF ( vnested ) CALL vnest_init_pegrid_domain 825 826 829 827 830 #else … … 1096 1099 !-- Do these calculations for the model grid and (if necessary) also 1097 1100 !-- for the coarser grid levels used in the multigrid method 1098 ALLOCATE ( ngp_xz(0:maximum_grid_level), ngp_yz(0:maximum_grid_level), & 1099 type_xz(0:maximum_grid_level), type_yz(0:maximum_grid_level) ) 1101 ALLOCATE ( ngp_xz(0:maximum_grid_level), & 1102 ngp_xz_int(0:maximum_grid_level), & 1103 ngp_yz(0:maximum_grid_level), & 1104 ngp_yz_int(0:maximum_grid_level), & 1105 type_xz(0:maximum_grid_level), & 1106 type_xz_int(0:maximum_grid_level), & 1107 type_yz(0:maximum_grid_level), & 1108 type_yz_int(0:maximum_grid_level) ) 1100 1109 1101 1110 nxl_l = nxl; nxr_l = nxr; nys_l = nys; nyn_l = nyn; nzb_l = nzb; nzt_l = nzt … … 1125 1134 1126 1135 ! 1136 !-- Define data types for exchange of 3D Integer arrays. 1137 ngp_yz_int(0) = (nzt - nzb + 2) * (nyn - nys + 1 + 2 * nbgp) 1138 1139 CALL MPI_TYPE_VECTOR( nxr-nxl+1+2*nbgp, nbgp*(nzt-nzb+2), ngp_yz_int(0), & 1140 MPI_INTEGER, type_xz_int(0), ierr ) 1141 CALL MPI_TYPE_COMMIT( type_xz_int(0), ierr ) 1142 1143 CALL MPI_TYPE_VECTOR( nbgp, ngp_yz_int(0), ngp_yz_int(0), MPI_INTEGER, & 1144 type_yz_int(0), ierr ) 1145 CALL MPI_TYPE_COMMIT( type_yz_int(0), ierr ) 1146 1147 ! 1127 1148 !-- Definition of MPI-datatypes for multigrid method (coarser level grids) 1128 1149 IF ( psolver(1:9) == 'multigrid' ) THEN … … 1131 1152 DO i = maximum_grid_level, 1 , -1 1132 1153 ! 1133 !-- For 3D-exchange 1154 !-- For 3D-exchange on different multigrid level, one ghost point for 1155 !-- REAL arrays, two ghost points for INTEGER arrays 1134 1156 ngp_xz(i) = (nzt_l - nzb_l + 2) * (nxr_l - nxl_l + 3) 1135 1157 ngp_yz(i) = (nzt_l - nzb_l + 2) * (nyn_l - nys_l + 3) 1136 1158 1137 CALL MPI_TYPE_VECTOR( nxr_l-nxl_l+3, nzt_l-nzb_l+2, ngp_yz(i), & 1159 ngp_xz_int(i) = (nzt_l - nzb_l + 2) * (nxr_l - nxl_l + 3) 1160 ngp_yz_int(i) = (nzt_l - nzb_l + 2) * (nyn_l - nys_l + 3) 1161 ! 1162 !-- MPI data type for REAL arrays, for xz-layers 1163 CALL MPI_TYPE_VECTOR( nxr_l-nxl_l+3, nzt_l-nzb_l+2, ngp_yz(i), & 1138 1164 MPI_REAL, type_xz(i), ierr ) 1139 1165 CALL MPI_TYPE_COMMIT( type_xz(i), ierr ) 1140 1166 1167 ! 1168 !-- MPI data type for INTEGER arrays, for xz-layers 1169 CALL MPI_TYPE_VECTOR( nxr_l-nxl_l+3, nzt_l-nzb_l+2, ngp_yz_int(i), & 1170 MPI_INTEGER, type_xz_int(i), ierr ) 1171 CALL MPI_TYPE_COMMIT( type_xz_int(i), ierr ) 1172 1173 ! 1174 !-- MPI data type for REAL arrays, for yz-layers 1141 1175 CALL MPI_TYPE_VECTOR( 1, ngp_yz(i), ngp_yz(i), MPI_REAL, type_yz(i), & 1142 1176 ierr ) 1143 1177 CALL MPI_TYPE_COMMIT( type_yz(i), ierr ) 1178 ! 1179 !-- MPI data type for INTEGER arrays, for yz-layers 1180 CALL MPI_TYPE_VECTOR( 1, ngp_yz_int(i), ngp_yz_int(i), MPI_INTEGER, & 1181 type_yz_int(i), ierr ) 1182 CALL MPI_TYPE_COMMIT( type_yz_int(i), ierr ) 1144 1183 1145 1184 … … 1155 1194 CALL MPI_TYPE_COMMIT( type_y_int(i), ierr ) 1156 1195 1157 1158 1159 1196 nxl_l = nxl_l / 2 1160 1197 nxr_l = nxr_l / 2 … … 1166 1203 1167 1204 ENDIF 1168 !1169 !-- Define data types for exchange of 3D Integer arrays.1170 ngp_yz_int = (nzt - nzb + 2) * (nyn - nys + 1 + 2 * nbgp)1171 1172 CALL MPI_TYPE_VECTOR( nxr-nxl+1+2*nbgp, nbgp*(nzt-nzb+2), ngp_yz_int, &1173 MPI_INTEGER, type_xz_int, ierr )1174 CALL MPI_TYPE_COMMIT( type_xz_int, ierr )1175 1176 CALL MPI_TYPE_VECTOR( nbgp, ngp_yz_int, ngp_yz_int, MPI_INTEGER, type_yz_int, &1177 ierr )1178 CALL MPI_TYPE_COMMIT( type_yz_int, ierr )1179 1205 1180 1206 #endif … … 1190 1216 ELSEIF ( bc_lr == 'nested' ) THEN 1191 1217 nest_bound_l = .TRUE. 1218 ELSEIF ( bc_lr == 'forcing' ) THEN 1219 force_bound_l = .TRUE. 1192 1220 ENDIF 1193 1221 ENDIF … … 1200 1228 ELSEIF ( bc_lr == 'nested' ) THEN 1201 1229 nest_bound_r = .TRUE. 1230 ELSEIF ( bc_lr == 'forcing' ) THEN 1231 force_bound_r = .TRUE. 1202 1232 ENDIF 1203 1233 ENDIF … … 1210 1240 ELSEIF ( bc_ns == 'nested' ) THEN 1211 1241 nest_bound_s = .TRUE. 1242 ELSEIF ( bc_ns == 'forcing' ) THEN 1243 force_bound_s = .TRUE. 1212 1244 ENDIF 1213 1245 ENDIF … … 1220 1252 ELSEIF ( bc_ns == 'nested' ) THEN 1221 1253 nest_bound_n = .TRUE. 1254 ELSEIF ( bc_ns == 'forcing' ) THEN 1255 force_bound_n = .TRUE. 1222 1256 ENDIF 1223 1257 ENDIF … … 1295 1329 !-- At the inflow or outflow, u or v, respectively, have to be calculated for 1296 1330 !-- one more grid point. 1297 IF ( inflow_l .OR. outflow_l .OR. nest_bound_l ) THEN1331 IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. force_bound_l ) THEN 1298 1332 nxlu = nxl + 1 1299 1333 ELSE 1300 1334 nxlu = nxl 1301 1335 ENDIF 1302 IF ( inflow_s .OR. outflow_s .OR. nest_bound_s ) THEN1336 IF ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR. force_bound_s ) THEN 1303 1337 nysv = nys + 1 1304 1338 ELSE
Note: See TracChangeset
for help on using the changeset viewer.