Changeset 1762 for palm/trunk/SOURCE/init_grid.f90
- Timestamp:
- Feb 25, 2016 12:31:13 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/init_grid.f90
r1744 r1762 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Introduction of nested domain feature 22 22 ! 23 23 ! Former revisions: … … 156 156 io_group, inflow_l, inflow_n, inflow_r, inflow_s, & 157 157 masking_method, maximum_grid_level, message_string, & 158 momentum_advec, ocean, outflow_l, outflow_n, outflow_r, & 159 outflow_s, psolver, scalar_advec, topography, & 158 momentum_advec, nest_domain, nest_bound_l, nest_bound_n, & 159 nest_bound_r, nest_bound_s, ocean, outflow_l, outflow_n, & 160 outflow_r, outflow_s, psolver, scalar_advec, topography, & 160 161 topography_grid_convention, use_surface_fluxes, use_top_fluxes, & 161 162 wall_adjustment_factor … … 734 735 nzb_max = MAXVAL( nzb_local ) + 1 735 736 IF ( inflow_l .OR. outflow_l .OR. inflow_r .OR. outflow_r .OR. & 736 inflow_n .OR. outflow_n .OR. inflow_s .OR. outflow_s ) THEN 737 nzb_max = nzt 737 inflow_n .OR. outflow_n .OR. inflow_s .OR. outflow_s .OR. & 738 nest_domain ) & 739 THEN 740 nzb_max = nzt 738 741 ENDIF 739 742 … … 1221 1224 !-- scalar - x-direction 1222 1225 !-- WS1 (0), WS3 (1), WS5 (2) 1223 IF ( k <= nzb_s_inner(j,i+1) .OR. ( ( inflow_l .OR. outflow_l )& 1224 .AND. i == nxl ) .OR. ( ( inflow_r .OR. outflow_r ) & 1225 .AND. i == nxr ) ) THEN 1226 IF ( k <= nzb_s_inner(j,i+1) .OR. & 1227 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l ) & 1228 .AND. i == nxl ) .OR. & 1229 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r ) & 1230 .AND. i == nxr ) ) & 1231 THEN 1226 1232 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 0 ) 1227 1233 ELSEIF ( k <= nzb_s_inner(j,i+2) .OR. k <= nzb_s_inner(j,i-1) & 1228 .OR. ( ( inflow_r .OR. outflow_r ) .AND. i == nxr-1 ) & 1229 .OR. ( ( inflow_l .OR. outflow_l ) .AND. i == nxlu ) & 1230 ) THEN 1234 .OR. & 1235 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r ) & 1236 .AND. i == nxr-1 ) .OR. & 1237 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l ) & 1238 .AND. i == nxlu ) ) & 1239 THEN 1231 1240 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 1 ) 1232 1241 ELSE … … 1236 1245 !-- scalar - y-direction 1237 1246 !-- WS1 (3), WS3 (4), WS5 (5) 1238 IF ( k <= nzb_s_inner(j+1,i) .OR. ( ( inflow_s .OR. outflow_s )& 1239 .AND. j == nys ) .OR. ( ( inflow_n .OR. outflow_n ) & 1240 .AND. j == nyn ) ) THEN 1247 IF ( k <= nzb_s_inner(j+1,i) .OR. & 1248 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s ) & 1249 .AND. j == nys ) .OR. & 1250 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n ) & 1251 .AND. j == nyn ) ) & 1252 THEN 1241 1253 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 3 ) 1254 ! 1242 1255 !-- WS3 1243 1256 ELSEIF ( k <= nzb_s_inner(j+2,i) .OR. k <= nzb_s_inner(j-1,i) & 1244 .OR. ( ( inflow_s .OR. outflow_s ) .AND. j == nysv ) & 1245 .OR. ( ( inflow_n .OR. outflow_n ) .AND. j == nyn-1 ) & 1246 ) THEN 1257 .OR. & 1258 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s ) & 1259 .AND. j == nysv ) .OR. & 1260 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n ) & 1261 .AND. j == nyn-1 ) ) & 1262 THEN 1247 1263 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 4 ) 1264 ! 1248 1265 !-- WS5 1249 1266 ELSE … … 1287 1304 !-- u component - x-direction 1288 1305 !-- WS1 (9), WS3 (10), WS5 (11) 1289 IF ( k <= nzb_u_inner(j,i+1) & 1290 .OR. ( ( inflow_l .OR. outflow_l ) .AND. i <= nxlu ) & 1291 .OR. ( ( inflow_r .OR. outflow_r ) .AND. i == nxr ) & 1292 ) THEN 1306 IF ( k <= nzb_u_inner(j,i+1) .OR. & 1307 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l ) & 1308 .AND. i <= nxlu ) .OR. & 1309 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r ) & 1310 .AND. i == nxr ) ) & 1311 THEN 1293 1312 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 9 ) 1294 ELSEIF ( k <= nzb_u_inner(j,i+2) .OR. k <= nzb_u_inner(j,i-1) & 1295 .OR. ( ( inflow_r .OR. outflow_r ) .AND. i == nxr-1 )& 1296 .OR. ( ( inflow_l .OR. outflow_l ) .AND. i == nxlu+1)& 1297 ) THEN 1313 ELSEIF ( k <= nzb_u_inner(j,i+2) .OR. k <= nzb_u_inner(j,i-1) & 1314 .OR. & 1315 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r ) & 1316 .AND. i == nxr-1 ) .OR. & 1317 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l ) & 1318 .AND. i == nxlu+1) ) & 1319 THEN 1298 1320 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 10 ) 1299 1321 ! … … 1309 1331 !-- u component - y-direction 1310 1332 !-- WS1 (12), WS3 (13), WS5 (14) 1311 IF ( k <= nzb_u_inner(j+1,i) .OR. ( ( inflow_s .OR. outflow_s )& 1312 .AND. j == nys ) .OR. ( ( inflow_n .OR. outflow_n ) & 1313 .AND. j == nyn ) ) THEN 1314 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 12 ) 1333 IF ( k <= nzb_u_inner(j+1,i) .OR. & 1334 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s ) & 1335 .AND. j == nys ) .OR. & 1336 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n ) & 1337 .AND. j == nyn ) ) & 1338 THEN 1339 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 12 ) 1315 1340 ELSEIF ( k <= nzb_u_inner(j+2,i) .OR. k <= nzb_u_inner(j-1,i) & 1316 .OR. ( ( inflow_s .OR. outflow_s ) .AND. j == nysv ) & 1317 .OR. ( ( inflow_n .OR. outflow_n ) .AND. j == nyn-1 ) & 1318 ) THEN 1341 .OR. & 1342 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s ) & 1343 .AND. j == nysv ) .OR. & 1344 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n ) & 1345 .AND. j == nyn-1 ) ) & 1346 THEN 1319 1347 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 13 ) 1320 1348 ! … … 1357 1385 !-- v component - x-direction 1358 1386 !-- WS1 (18), WS3 (19), WS5 (20) 1359 IF ( k <= nzb_v_inner(j,i+1) .OR. ( ( inflow_l .OR. outflow_l )& 1360 .AND. i == nxl ) .OR. (( inflow_r .OR. outflow_r ) & 1361 .AND. i == nxr ) ) THEN 1362 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 18 ) 1387 IF ( k <= nzb_v_inner(j,i+1) .OR. & 1388 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l ) & 1389 .AND. i == nxl ) .OR. & 1390 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r ) & 1391 .AND. i == nxr ) ) & 1392 THEN 1393 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 18 ) 1394 ! 1363 1395 !-- WS3 1364 1396 ELSEIF ( k <= nzb_v_inner(j,i+2) .OR. k <= nzb_v_inner(j,i-1) & 1365 .OR. ( ( inflow_r .OR. outflow_r ) .AND. i == nxr-1 ) & 1366 .OR. ( ( inflow_l .OR. outflow_l ) .AND. i == nxlu ) & 1367 ) THEN 1397 .OR. & 1398 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r ) & 1399 .AND. i == nxr-1 ) .OR. & 1400 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l ) & 1401 .AND. i == nxlu ) ) & 1402 THEN 1368 1403 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 19 ) 1369 1404 ! … … 1379 1414 !-- v component - y-direction 1380 1415 !-- WS1 (21), WS3 (22), WS5 (23) 1381 IF ( k <= nzb_v_inner(j+1,i) & 1382 .OR. ( ( inflow_s .OR. outflow_s ) .AND. j <= nysv ) & 1383 .OR. ( ( inflow_n .OR. outflow_n ) .AND. j == nyn ) & 1384 ) THEN 1385 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 21 ) 1416 IF ( k <= nzb_v_inner(j+1,i) .OR. & 1417 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s ) & 1418 .AND. j <= nysv ) .OR. & 1419 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n ) & 1420 .AND. j == nyn ) ) & 1421 THEN 1422 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 21 ) 1386 1423 ELSEIF ( k <= nzb_v_inner(j+2,i) .OR. k <= nzb_v_inner(j-1,i) & 1387 .OR. ( ( inflow_s .OR. outflow_s ) .AND. j == nysv+1 )& 1388 .OR. ( ( inflow_n .OR. outflow_n ) .AND. j == nyn-1 )& 1389 ) THEN 1424 .OR. & 1425 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s ) & 1426 .AND. j == nysv+1) .OR. & 1427 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n ) & 1428 .AND. j == nyn-1 ) ) & 1429 THEN 1390 1430 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 22 ) 1391 1431 ! … … 1427 1467 !-- w component - x-direction 1428 1468 !-- WS1 (27), WS3 (28), WS5 (29) 1429 IF ( k <= nzb_w_inner(j,i+1) .OR. ( ( inflow_l .OR. outflow_l )& 1430 .AND. i == nxl ) .OR. ( ( inflow_r .OR. outflow_r ) & 1431 .AND. i == nxr ) ) THEN 1432 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 27 ) 1469 IF ( k <= nzb_w_inner(j,i+1) .OR. & 1470 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l ) & 1471 .AND. i == nxl ) .OR. & 1472 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r ) & 1473 .AND. i == nxr ) ) & 1474 THEN 1475 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 27 ) 1433 1476 ELSEIF ( k <= nzb_w_inner(j,i+2) .OR. k <= nzb_w_inner(j,i-1) & 1434 .OR. ( ( inflow_r .OR. outflow_r ) .AND. i == nxr-1 ) & 1435 .OR. ( ( inflow_l .OR. outflow_l ) .AND. i == nxlu ) & 1436 ) THEN 1477 .OR. & 1478 ( ( inflow_r .OR. outflow_r .OR. nest_bound_r ) & 1479 .AND. i == nxr-1 ) .OR. & 1480 ( ( inflow_l .OR. outflow_l .OR. nest_bound_l ) & 1481 .AND. i == nxlu ) ) & 1482 THEN 1437 1483 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 28 ) 1438 1484 ! … … 1448 1494 !-- w component - y-direction 1449 1495 !-- WS1 (30), WS3 (31), WS5 (32) 1450 IF ( k <= nzb_w_inner(j+1,i) .OR. ( ( inflow_s .OR. outflow_s )& 1451 .AND. j == nys ) .OR. ( ( inflow_n .OR. outflow_n ) & 1452 .AND. j == nyn ) ) THEN 1453 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 30 ) 1496 IF ( k <= nzb_w_inner(j+1,i) .OR. & 1497 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s ) & 1498 .AND. j == nys ) .OR. & 1499 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n ) & 1500 .AND. j == nyn ) ) & 1501 THEN 1502 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 30 ) 1454 1503 ELSEIF ( k <= nzb_w_inner(j+2,i) .OR. k <= nzb_w_inner(j-1,i) & 1455 .OR. ( ( inflow_s .OR. outflow_s ) .AND. j == nysv ) & 1456 .OR. ( ( inflow_n .OR. outflow_n ) .AND. j == nyn-1 ) & 1457 ) THEN 1504 .OR. & 1505 ( ( inflow_s .OR. outflow_s .OR. nest_bound_s ) & 1506 .AND. j == nysv ) .OR. & 1507 ( ( inflow_n .OR. outflow_n .OR. nest_bound_n ) & 1508 .AND. j == nyn-1 ) ) & 1509 THEN 1458 1510 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 31 ) 1459 1511 ! … … 1504 1556 !-- Set boundary flags at inflow and outflow boundary in case of 1505 1557 !-- non-cyclic boundary conditions. 1506 IF ( inflow_l .OR. outflow_l ) THEN1558 IF ( inflow_l .OR. outflow_l .OR. nest_bound_l ) THEN 1507 1559 wall_flags_0(:,:,nxl-1) = wall_flags_0(:,:,nxl) 1508 1560 wall_flags_00(:,:,nxl-1) = wall_flags_00(:,:,nxl) 1509 1561 ENDIF 1510 1562 1511 IF ( inflow_r .OR. outflow_r ) THEN1563 IF ( inflow_r .OR. outflow_r .OR. nest_bound_r ) THEN 1512 1564 wall_flags_0(:,:,nxr+1) = wall_flags_0(:,:,nxr) 1513 1565 wall_flags_00(:,:,nxr+1) = wall_flags_00(:,:,nxr) 1514 1566 ENDIF 1515 1567 1516 IF ( inflow_n .OR. outflow_n ) THEN1568 IF ( inflow_n .OR. outflow_n .OR. nest_bound_n ) THEN 1517 1569 wall_flags_0(:,nyn+1,:) = wall_flags_0(:,nyn,:) 1518 1570 wall_flags_00(:,nyn+1,:) = wall_flags_00(:,nyn,:) 1519 1571 ENDIF 1520 1572 1521 IF ( inflow_s .OR. outflow_s ) THEN1573 IF ( inflow_s .OR. outflow_s .OR. nest_bound_s ) THEN 1522 1574 wall_flags_0(:,nys-1,:) = wall_flags_0(:,nys,:) 1523 1575 wall_flags_00(:,nys-1,:) = wall_flags_00(:,nys,:)
Note: See TracChangeset
for help on using the changeset viewer.