Ignore:
Timestamp:
Feb 25, 2016 12:31:13 PM (8 years ago)
Author:
hellstea
Message:

Introduction of nested domain system

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/init_grid.f90

    r1744 r1762  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! Introduction of nested domain feature
    2222!
    2323! Former revisions:
     
    156156               io_group, inflow_l, inflow_n, inflow_r, inflow_s,               &
    157157               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,        &
    160161               topography_grid_convention, use_surface_fluxes, use_top_fluxes, &
    161162               wall_adjustment_factor
     
    734735    nzb_max = MAXVAL( nzb_local ) + 1
    735736    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
    738741    ENDIF
    739742
     
    12211224!--             scalar - x-direction
    12221225!--             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
    12261232                   wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 0 )
    12271233                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
    12311240                   wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 1 )
    12321241                ELSE
     
    12361245!--             scalar - y-direction
    12371246!--             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
    12411253                   wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 3 )
     1254!
    12421255!--             WS3
    12431256                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
    12471263                   wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 4 )
     1264!
    12481265!--             WS5
    12491266                ELSE
     
    12871304!--             u component - x-direction
    12881305!--             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
    12931312                    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
    12981320                   wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 10 )
    12991321!
     
    13091331!--             u component - y-direction
    13101332!--             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 )
    13151340                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
    13191347                   wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 13 )
    13201348!
     
    13571385!--             v component - x-direction
    13581386!--             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!
    13631395!--             WS3
    13641396                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
    13681403                   wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 19 )
    13691404!
     
    13791414!--             v component - y-direction
    13801415!--             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 )
    13861423                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
    13901430                   wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 22 )
    13911431!
     
    14271467!--             w component - x-direction
    14281468!--             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 )
    14331476                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
    14371483                   wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 28 )
    14381484!
     
    14481494!--             w component - y-direction
    14491495!--             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 )
    14541503                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
    14581510                   wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 31 )
    14591511!
     
    15041556!--    Set boundary flags at inflow and outflow boundary in case of
    15051557!--    non-cyclic boundary conditions.
    1506        IF ( inflow_l .OR. outflow_l )  THEN
     1558       IF ( inflow_l .OR. outflow_l .OR. nest_bound_l )  THEN
    15071559          wall_flags_0(:,:,nxl-1)  = wall_flags_0(:,:,nxl)
    15081560          wall_flags_00(:,:,nxl-1) = wall_flags_00(:,:,nxl)
    15091561       ENDIF
    15101562
    1511        IF ( inflow_r .OR. outflow_r )  THEN
     1563       IF ( inflow_r .OR. outflow_r .OR. nest_bound_r )  THEN
    15121564          wall_flags_0(:,:,nxr+1)  = wall_flags_0(:,:,nxr)
    15131565          wall_flags_00(:,:,nxr+1) = wall_flags_00(:,:,nxr)
    15141566       ENDIF
    15151567
    1516        IF ( inflow_n .OR. outflow_n )  THEN
     1568       IF ( inflow_n .OR. outflow_n .OR. nest_bound_n )  THEN
    15171569          wall_flags_0(:,nyn+1,:)  = wall_flags_0(:,nyn,:)
    15181570          wall_flags_00(:,nyn+1,:) = wall_flags_00(:,nyn,:)
    15191571       ENDIF
    15201572
    1521        IF ( inflow_s .OR. outflow_s )  THEN
     1573       IF ( inflow_s .OR. outflow_s  .OR. nest_bound_s )  THEN
    15221574          wall_flags_0(:,nys-1,:)  = wall_flags_0(:,nys,:)
    15231575          wall_flags_00(:,nys-1,:) = wall_flags_00(:,nys,:)
Note: See TracChangeset for help on using the changeset viewer.