Changeset 2918 for palm/trunk
- Timestamp:
- Mar 21, 2018 3:52:14 PM (7 years ago)
- Location:
- palm/trunk
- Files:
-
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk
- Property svn:mergeinfo changed
/palm/branches/rans (added) merged: 2078,2139,2244,2352-2353,2358,2373,2519-2521,2680-2681,2760-2761,2842,2896,2901-2902,2905,2907-2911,2913,2915-2917
- Property svn:mergeinfo changed
-
palm/trunk/SOURCE
- Property svn:mergeinfo changed
/palm/branches/rans/SOURCE (added) merged: 2139,2244,2352-2353,2358,2373,2519-2521,2680-2681,2760-2761,2842,2896,2901-2902,2905,2907-2911,2913,2915-2917
- Property svn:mergeinfo changed
-
palm/trunk/SOURCE/Makefile
- Property svn:mergeinfo changed
/palm/branches/rans/SOURCE/Makefile (added) merged: 2139,2244,2352-2353,2519-2521,2680,2760,2842,2896,2917
- Property svn:mergeinfo changed
-
palm/trunk/SOURCE/check_parameters.f90
- Property svn:mergeinfo changed
/palm/branches/rans/SOURCE/check_parameters.f90 (added) merged: 2139,2244,2352-2353,2519-2521,2680,2760-2761,2842,2896,2913,2916
r2883 r2918 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Add check for 1D model 28 ! 29 ! 2883 2018-03-14 08:29:10Z Giersch 27 30 ! dt_dopr_listing is not set to the default value zero anymore 28 31 ! … … 3993 3996 CALL message( 'check_parameters', 'PA0138', 1, 2, 0, 6, 0 ) 3994 3997 ENDIF 3998 IF ( TRIM( mixing_length_1d ) /= 'as_in_3d_model' .AND. & 3999 TRIM( dissipation_1d ) == 'as_in_3d_model' ) THEN 4000 message_string = 'dissipation_1d = "' // TRIM( dissipation_1d ) // & 4001 '" requires mixing_length_1d = "as_in_3d_model"' 4002 CALL message( 'check_parameters', 'PA0485', 1, 2, 0, 6, 0 ) 4003 ENDIF 3995 4004 3996 4005 ! - 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 2018-03-15 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 grid-dependent as well as near-wall 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 !> Pre-computation of grid-dependent and near-wall 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 grid-dependent mixing length.1376 DO k = 1, nzt1377 l_grid(k) = ( dx * dy * dzw(k) )**0.33333333333333_wp1378 ENDDO1379 !1380 !-- Initialize near-wall 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 near-wall 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 grid-points.1413 !-- Vertical distance, down1414 IF ( .NOT. BTEST( wall_flags_0(k-1,j,i), 0 ) ) &1415 l_wall(k,j,i) = MIN( l_grid(k), zu(k) - zw(k-1) )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 !-- y-distance1422 IF ( .NOT. BTEST( wall_flags_0(k,j-1,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 !-- x-distance1427 IF ( .NOT. BTEST( wall_flags_0(k,j,i-1), 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 !-- yz-distance (vertical edges, down)1432 IF ( .NOT. BTEST( wall_flags_0(k-1,j-1,i), 0 ) .OR. &1433 .NOT. BTEST( wall_flags_0(k-1,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(k-1) )**2 ) )1437 !1438 !-- yz-distance (vertical edges, up)1439 IF ( .NOT. BTEST( wall_flags_0(k+1,j-1,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 !-- xz-distance (vertical edges, down)1446 IF ( .NOT. BTEST( wall_flags_0(k-1,j,i-1), 0 ) .OR. &1447 .NOT. BTEST( wall_flags_0(k-1,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(k-1) )**2 ) )1451 !1452 !-- xz-distance (vertical edges, up)1453 IF ( .NOT. BTEST( wall_flags_0(k+1,j,i-1), 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 !-- xy-distance (horizontal edges)1460 IF ( .NOT. BTEST( wall_flags_0(k,j-1,i-1), 0 ) .OR. &1461 .NOT. BTEST( wall_flags_0(k,j+1,i-1), 0 ) .OR. &1462 .NOT. BTEST( wall_flags_0(k,j-1,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(k-1,j-1,i-1), 0 ) .OR. &1469 .NOT. BTEST( wall_flags_0(k-1,j+1,i-1), 0 ) .OR. &1470 .NOT. BTEST( wall_flags_0(k-1,j-1,i+1), 0 ) .OR. &1471 .NOT. BTEST( wall_flags_0(k-1,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(k-1) )**2 ) )1475 !1476 !-- xyz distance (vertical and horizontal edges, up)1477 IF ( .NOT. BTEST( wall_flags_0(k+1,j-1,i-1), 0 ) .OR. &1478 .NOT. BTEST( wall_flags_0(k+1,j+1,i-1), 0 ) .OR. &1479 .NOT. BTEST( wall_flags_0(k+1,j-1,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: -
palm/trunk/SOURCE/model_1d_mod.f90
r2718 r2918 25 25 ! ----------------- 26 26 ! $Id$ 27 ! - rename l_black into l1d_init 28 ! - calculate l_grid within init_1d_model and save it as l1d_init 29 ! 30 ! 2718 2018-01-02 08:49:38Z maronga 27 31 ! Corrected "Former revisions" section 28 32 ! … … 128 132 !> @todo harmonize code with new surface_layer_fluxes module 129 133 !> @bug 1D model crashes when using small grid spacings in the order of 1 m 134 !> @fixme option "as_in_3d_model" seems to eb an inappropriate option because 135 !> the 1D model uses different turbulence closure approaches at least if 136 !> the 3D model is set to LES-mode. 130 137 !------------------------------------------------------------------------------! 131 138 MODULE model_1d_mod 132 139 133 140 USE arrays_3d, & 134 ONLY: dd2zu, ddzu, ddzw, dzu, l_grid, pt_init, q_init, ug, u_init,&141 ONLY: dd2zu, ddzu, ddzw, dzu, dzw, pt_init, q_init, ug, u_init, & 135 142 vg, v_init, zu 136 143 … … 190 197 REAL(wp), DIMENSION(:), ALLOCATABLE :: kh1d !< turbulent diffusion coefficient for heat (1d-model) 191 198 REAL(wp), DIMENSION(:), ALLOCATABLE :: km1d !< turbulent diffusion coefficient for momentum (1d-model) 192 REAL(wp), DIMENSION(:), ALLOCATABLE :: l_black !< mixing length Blackadar (1d-model)193 199 REAL(wp), DIMENSION(:), ALLOCATABLE :: l1d !< mixing length for turbulent diffusion coefficients (1d-model) 200 REAL(wp), DIMENSION(:), ALLOCATABLE :: l1d_init !< initial mixing length (1d-model) 194 201 REAL(wp), DIMENSION(:), ALLOCATABLE :: l1d_diss !< mixing length for dissipation (1d-model) 195 202 REAL(wp), DIMENSION(:), ALLOCATABLE :: rif1d !< Richardson flux number (1d-model) … … 255 262 SUBROUTINE init_1d_model 256 263 264 USE grid_variables, & 265 ONLY: dx, dy 266 257 267 IMPLICIT NONE 258 268 … … 267 277 ALLOCATE( diss1d(nzb:nzt+1), diss1d_p(nzb:nzt+1), & 268 278 e1d(nzb:nzt+1), e1d_p(nzb:nzt+1), kh1d(nzb:nzt+1), & 269 km1d(nzb:nzt+1), l _black(nzb:nzt+1), l1d(nzb:nzt+1),&279 km1d(nzb:nzt+1), l1d(nzb:nzt+1), l1d_init(nzb:nzt+1), & 270 280 l1d_diss(nzb:nzt+1), rif1d(nzb:nzt+1), te_diss(nzb:nzt+1), & 271 281 te_dissm(nzb:nzt+1), te_e(nzb:nzt+1), & … … 286 296 ! 287 297 !-- Compute the mixing length 288 l _black(nzb) = 0.0_wp298 l1d_init(nzb) = 0.0_wp 289 299 290 300 IF ( TRIM( mixing_length_1d ) == 'blackadar' ) THEN … … 299 309 300 310 DO k = nzb+1, nzt+1 301 l _black(k) = kappa * zu(k) / ( 1.0_wp + kappa * zu(k) / lambda )311 l1d_init(k) = kappa * zu(k) / ( 1.0_wp + kappa * zu(k) / lambda ) 302 312 ENDDO 303 313 304 314 ELSEIF ( TRIM( mixing_length_1d ) == 'as_in_3d_model' ) THEN 305 315 ! 306 !-- Use the same mixing length as in 3D model 307 l_black(1:nzt) = l_grid 308 l_black(nzt+1) = l_black(nzt) 316 !-- Use the same mixing length as in 3D model (LES-mode) 317 !### TODO: rename (delete?) this option 318 !### As the mixing length is different between RANS and LES mode, it 319 !### must be distinguished here between these modes. For RANS mode, 320 !### the mixing length is calculated accoding to Blackadar, which is 321 !### the other option at this point. 322 !### Maybe delete this option entirely (not appropriate in LES case) 323 !### 2018-03-20, gronemeier 324 DO k = nzb+1, nzt 325 l1d_init(k) = ( dx * dy * dzw(k) )**0.33333333333333_wp 326 ENDDO 327 l1d_init(nzt+1) = l1d_init(nzt) 309 328 310 329 ENDIF 311 330 ENDIF 312 l1d = l _black313 l1d_diss = l _black331 l1d = l1d_init 332 l1d_diss = l1d_init 314 333 u1d = u_init 315 334 u1d_p = u_init … … 457 476 diss1d(k) = c_m**3 * e1d(k) * SQRT( e1d(k) ) / l1d_diss(k) 458 477 ELSEIF ( dissipation_1d == 'as_in_3d_model' ) THEN 459 diss1d(k) = ( 0.19_wp + 0.74_wp * l1d_diss(k) / l_grid(k)&478 diss1d(k) = ( 0.19_wp + 0.74_wp * l1d_diss(k) / l1d_init(k) & 460 479 ) * e1d(k) * SQRT( e1d(k) ) / l1d_diss(k) 461 480 ENDIF … … 520 539 diss1d(k) = c_m**3 * e1d(k) * SQRT( e1d(k) ) / l1d_diss(k) 521 540 ELSEIF ( dissipation_1d == 'as_in_3d_model' ) THEN 522 diss1d(k) = ( 0.19_wp + 0.74_wp * l1d_diss(k) / l _grid(k) )&541 diss1d(k) = ( 0.19_wp + 0.74_wp * l1d_diss(k) / l1d_init(k) ) & 523 542 * e1d(k) * SQRT( e1d(k) ) / l1d_diss(k) 524 543 ENDIF … … 804 823 DO k = nzb+1, nzt 805 824 IF ( rif1d(k) >= 0.0_wp ) THEN 806 l1d(k) = l _black(k) / ( 1.0_wp + 5.0_wp * rif1d(k) )825 l1d(k) = l1d_init(k) / ( 1.0_wp + 5.0_wp * rif1d(k) ) 807 826 l1d_diss(k) = l1d(k) 808 827 ELSE 809 l1d(k) = l _black(k)810 l1d_diss(k) = l _black(k) *&828 l1d(k) = l1d_init(k) 829 l1d_diss(k) = l1d_init(k) * & 811 830 SQRT( 1.0_wp - 16.0_wp * rif1d(k) ) 812 831 ENDIF … … 819 838 SQRT( g / pt_init(k) * dpt_dz ) + 1E-5_wp 820 839 ELSE 821 l_stable = l _grid(k)840 l_stable = l1d_init(k) 822 841 ENDIF 823 l1d(k) = MIN( l _grid(k), l_stable )842 l1d(k) = MIN( l1d_init(k), l_stable ) 824 843 l1d_diss(k) = l1d(k) 825 844 ENDDO -
palm/trunk/SOURCE/modules.f90
r2906 r2918 25 25 ! ----------------- 26 26 ! $Id$ 27 ! -l_grid, -l_wall 28 ! 29 ! 2906 2018-03-19 08:56:40Z Giersch 27 30 ! Module control_parameters has been extended with ENVIRONMENT variables 28 31 ! read/write_svf … … 621 624 REAL(wp), DIMENSION(:), ALLOCATABLE :: hyp !< hydrostatic pressure 622 625 REAL(wp), DIMENSION(:), ALLOCATABLE :: inflow_damping_factor !< used for turbulent inflow (non-cyclic boundary conditions) 623 REAL(wp), DIMENSION(:), ALLOCATABLE :: l_grid !< geometric mean of grid sizes dx, dy, dz624 626 REAL(wp), DIMENSION(:), ALLOCATABLE :: ptdf_x !< damping factor for potential temperature in x-direction 625 627 REAL(wp), DIMENSION(:), ALLOCATABLE :: ptdf_y !< damping factor for potential temperature in y-direction … … 715 717 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: kh !< eddy diffusivity for heat 716 718 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: km !< eddy diffusivity for momentum 717 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: l_wall !< near-wall mixing length718 719 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: prr !< rain rate 719 720 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: p_loc !< local array in multigrid/sor solver containing the pressure which is iteratively advanced in each iteration step
Note: See TracChangeset
for help on using the changeset viewer.