Changeset 2918 for palm/trunk/SOURCE/init_grid.f90
 Timestamp:
 Mar 21, 2018 3:52:14 PM (6 years ago)
 Location:
 palm/trunk
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk
 Property svn:mergeinfo changed
/palm/branches/rans (added) merged: 2078,2139,2244,23522353,2358,2373,25192521,26802681,27602761,2842,2896,29012902,2905,29072911,2913,29152917
 Property svn:mergeinfo changed

palm/trunk/SOURCE
 Property svn:mergeinfo changed
/palm/branches/rans/SOURCE (added) merged: 2139,2244,23522353,2358,2373,25192521,26802681,27602761,2842,2896,29012902,2905,29072911,2913,29152917
 Property svn:mergeinfo changed

palm/trunk/SOURCE/init_grid.f90
r2897 r2918 25 25 !  26 26 ! $Id$ 27 ! Moved init_mixing_length to turbulence_closure_mod.f90 28 ! 29 ! 2897 20180315 11:47:16Z suehring 27 30 ! Relax restrictions for topography input, terrain and building heights can be 28 31 ! input separately and are not mandatory any more. … … 284 287 ! ! 285 288 !> Creating grid depending constants 286 !> @todo: Move initialization mixing length287 289 !> @todo: Rearrange topo flag list 288 290 !> @todo: reference 3D buildings on top of orography is not tested and may need … … 517 519 518 520 ! 519 ! Calculated griddependent as well as nearwall mixing length520 CALL init_mixing_length521 522 !523 521 ! Determine the maximum level of topography. It is used for 524 522 ! steering the degradation of order of the applied advection scheme, … … 1342 1340 END SUBROUTINE filter_topography 1343 1341 1344 ! Description:1345 ! !1346 !> Precomputation of griddependent and nearwall mixing length.1347 !> @todo: move subroutine to turbulence module developed by M1 (Tobi).1348 !!1349 SUBROUTINE init_mixing_length1350 1351 USE arrays_3d, &1352 ONLY: dzw, l_grid, l_wall, zu, zw1353 1354 USE control_parameters, &1355 ONLY: message_string, wall_adjustment_factor1356 1357 USE grid_variables, &1358 ONLY: dx, dy1359 1360 USE indices, &1361 ONLY: nbgp, nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt, &1362 wall_flags_01363 1364 USE kinds1365 1366 IMPLICIT NONE1367 1368 INTEGER(iwp) :: i !< index variable along x1369 INTEGER(iwp) :: j !< index variable along y1370 INTEGER(iwp) :: k !< index variable along z1371 1372 ALLOCATE( l_grid(1:nzt) )1373 ALLOCATE( l_wall(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )1374 !1375 ! Compute the griddependent mixing length.1376 DO k = 1, nzt1377 l_grid(k) = ( dx * dy * dzw(k) )**0.33333333333333_wp1378 ENDDO1379 !1380 ! Initialize nearwall mixing length l_wall only in the vertical direction1381 ! for the moment, multiplication with wall_adjustment_factor further below1382 l_wall(nzb,:,:) = l_grid(1)1383 DO k = nzb+1, nzt1384 l_wall(k,:,:) = l_grid(k)1385 ENDDO1386 l_wall(nzt+1,:,:) = l_grid(nzt)1387 1388 DO k = 1, nzt1389 IF ( l_grid(k) > 1.5_wp * dx * wall_adjustment_factor .OR. &1390 l_grid(k) > 1.5_wp * dy * wall_adjustment_factor ) THEN1391 WRITE( message_string, * ) 'grid anisotropy exceeds ', &1392 'threshold given by only local', &1393 ' &horizontal reduction of near_wall ', &1394 'mixing length l_wall', &1395 ' &starting from height level k = ', k, '.'1396 CALL message( 'init_grid', 'PA0202', 0, 1, 0, 6, 0 )1397 EXIT1398 ENDIF1399 ENDDO1400 !1401 ! In case of topography: limit nearwall mixing length l_wall further:1402 ! Go through all points of the subdomain one by one and look for the closest1403 ! surface.1404 ! Is this correct in the ocean case?1405 DO i = nxl, nxr1406 DO j = nys, nyn1407 DO k = nzb+1, nzt1408 !1409 ! Check if current gridpoint belongs to the atmosphere1410 IF ( BTEST( wall_flags_0(k,j,i), 0 ) ) THEN1411 !1412 ! Check for neighbouring gridpoints.1413 ! Vertical distance, down1414 IF ( .NOT. BTEST( wall_flags_0(k1,j,i), 0 ) ) &1415 l_wall(k,j,i) = MIN( l_grid(k), zu(k)  zw(k1) )1416 !1417 ! Vertical distance, up1418 IF ( .NOT. BTEST( wall_flags_0(k+1,j,i), 0 ) ) &1419 l_wall(k,j,i) = MIN( l_grid(k), zw(k)  zu(k) )1420 !1421 ! ydistance1422 IF ( .NOT. BTEST( wall_flags_0(k,j1,i), 0 ) .OR. &1423 .NOT. BTEST( wall_flags_0(k,j+1,i), 0 ) ) &1424 l_wall(k,j,i) = MIN( l_wall(k,j,i), l_grid(k), 0.5_wp * dy )1425 !1426 ! xdistance1427 IF ( .NOT. BTEST( wall_flags_0(k,j,i1), 0 ) .OR. &1428 .NOT. BTEST( wall_flags_0(k,j,i+1), 0 ) ) &1429 l_wall(k,j,i) = MIN( l_wall(k,j,i), l_grid(k), 0.5_wp * dx )1430 !1431 ! yzdistance (vertical edges, down)1432 IF ( .NOT. BTEST( wall_flags_0(k1,j1,i), 0 ) .OR. &1433 .NOT. BTEST( wall_flags_0(k1,j+1,i), 0 ) ) &1434 l_wall(k,j,i) = MIN( l_wall(k,j,i), l_grid(k), &1435 SQRT( 0.25_wp * dy**2 + &1436 ( zu(k)  zw(k1) )**2 ) )1437 !1438 ! yzdistance (vertical edges, up)1439 IF ( .NOT. BTEST( wall_flags_0(k+1,j1,i), 0 ) .OR. &1440 .NOT. BTEST( wall_flags_0(k+1,j+1,i), 0 ) ) &1441 l_wall(k,j,i) = MIN( l_wall(k,j,i), l_grid(k), &1442 SQRT( 0.25_wp * dy**2 + &1443 ( zw(k)  zu(k) )**2 ) )1444 !1445 ! xzdistance (vertical edges, down)1446 IF ( .NOT. BTEST( wall_flags_0(k1,j,i1), 0 ) .OR. &1447 .NOT. BTEST( wall_flags_0(k1,j,i+1), 0 ) ) &1448 l_wall(k,j,i) = MIN( l_wall(k,j,i), l_grid(k), &1449 SQRT( 0.25_wp * dx**2 + &1450 ( zu(k)  zw(k1) )**2 ) )1451 !1452 ! xzdistance (vertical edges, up)1453 IF ( .NOT. BTEST( wall_flags_0(k+1,j,i1), 0 ) .OR. &1454 .NOT. BTEST( wall_flags_0(k+1,j,i+1), 0 ) ) &1455 l_wall(k,j,i) = MIN( l_wall(k,j,i), l_grid(k), &1456 SQRT( 0.25_wp * dx**2 + &1457 ( zw(k)  zu(k) )**2 ) )1458 !1459 ! xydistance (horizontal edges)1460 IF ( .NOT. BTEST( wall_flags_0(k,j1,i1), 0 ) .OR. &1461 .NOT. BTEST( wall_flags_0(k,j+1,i1), 0 ) .OR. &1462 .NOT. BTEST( wall_flags_0(k,j1,i+1), 0 ) .OR. &1463 .NOT. BTEST( wall_flags_0(k,j+1,i+1), 0 ) ) &1464 l_wall(k,j,i) = MIN( l_wall(k,j,i), l_grid(k), &1465 SQRT( 0.25_wp * ( dx**2 + dy**2 ) ) )1466 !1467 ! xyz distance (vertical and horizontal edges, down)1468 IF ( .NOT. BTEST( wall_flags_0(k1,j1,i1), 0 ) .OR. &1469 .NOT. BTEST( wall_flags_0(k1,j+1,i1), 0 ) .OR. &1470 .NOT. BTEST( wall_flags_0(k1,j1,i+1), 0 ) .OR. &1471 .NOT. BTEST( wall_flags_0(k1,j+1,i+1), 0 ) ) &1472 l_wall(k,j,i) = MIN( l_wall(k,j,i), l_grid(k), &1473 SQRT( 0.25_wp * ( dx**2 + dy**2 ) &1474 + ( zu(k)  zw(k1) )**2 ) )1475 !1476 ! xyz distance (vertical and horizontal edges, up)1477 IF ( .NOT. BTEST( wall_flags_0(k+1,j1,i1), 0 ) .OR. &1478 .NOT. BTEST( wall_flags_0(k+1,j+1,i1), 0 ) .OR. &1479 .NOT. BTEST( wall_flags_0(k+1,j1,i+1), 0 ) .OR. &1480 .NOT. BTEST( wall_flags_0(k+1,j+1,i+1), 0 ) ) &1481 l_wall(k,j,i) = MIN( l_wall(k,j,i), l_grid(k), &1482 SQRT( 0.25_wp * ( dx**2 + dy**2 ) &1483 + ( zw(k)  zu(k) )**2 ) )1484 1485 ENDIF1486 ENDDO1487 ENDDO1488 ENDDO1489 !1490 ! Set lateral boundary conditions for l_wall1491 CALL exchange_horiz( l_wall, nbgp )1492 1493 END SUBROUTINE init_mixing_length1494 1342 1495 1343 ! Description:
Note: See TracChangeset
for help on using the changeset viewer.