Changeset 4109 for palm/trunk/SOURCE/init_grid.f90
- Timestamp:
- Jul 22, 2019 5:00:34 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/init_grid.f90
r3927 r4109 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! - Separate initialization of advection flags for momentum and scalars. 23 ! - Change subroutine interface for ws_init_flags_scalar to pass boundary flags 23 24 ! 24 25 ! Former revisions: … … 373 374 374 375 USE advec_ws, & 375 ONLY: ws_init_flags 376 ONLY: ws_init_flags_momentum, ws_init_flags_scalar 376 377 377 378 USE arrays_3d, & … … 380 381 USE control_parameters, & 381 382 ONLY: bc_lr_cyc, bc_ns_cyc, & 383 bc_dirichlet_l, & 384 bc_dirichlet_n, & 385 bc_dirichlet_r, & 386 bc_dirichlet_s, & 387 bc_radiation_l, & 388 bc_radiation_n, & 389 bc_radiation_r, & 390 bc_radiation_s, & 382 391 constant_flux_layer, dz, dz_max, dz_stretch_factor, & 383 392 dz_stretch_factor_array, dz_stretch_level, dz_stretch_level_end,& … … 392 401 393 402 USE indices, & 394 ONLY: nbgp, nx, nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, nz, & 403 ONLY: advc_flags_m, & 404 advc_flags_s, & 405 nbgp, nx, nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, nz, & 395 406 nzb, nzb_diff, nzb_diff_s_inner, nzb_diff_s_outer, & 396 407 nzb_max, nzb_s_inner, nzb_s_outer, nzb_u_inner, & … … 845 856 !-- Calculate wall flag arrays for the multigrid method. 846 857 !-- Please note, wall flags are only applied in the non-optimized version. 847 IF ( psolver == 'multigrid_noopt' ) CALL poismg_noopt_init 858 IF ( psolver == 'multigrid_noopt' ) CALL poismg_noopt_init 848 859 849 860 ! 850 861 !-- Init flags for ws-scheme to degrade order of the numerics near walls, i.e. 851 !-- to decrease the numerical stencil appropriately. 852 IF ( momentum_advec == 'ws-scheme' .OR. scalar_advec == 'ws-scheme' ) & 853 CALL ws_init_flags 862 !-- to decrease the numerical stencil appropriately. The order of the scheme 863 !-- is degraded near solid walls as well as near non-cyclic inflow and outflow 864 !-- boundaries. Do this separately for momentum and scalars. 865 IF ( momentum_advec == 'ws-scheme' ) THEN 866 ALLOCATE( advc_flags_m(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 867 CALL ws_init_flags_momentum 868 ENDIF 869 IF ( scalar_advec == 'ws-scheme' ) THEN 870 ALLOCATE( advc_flags_s(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 871 advc_flags_s = 0 872 873 CALL ws_init_flags_scalar( bc_dirichlet_l .OR. bc_radiation_l, & 874 bc_dirichlet_n .OR. bc_radiation_n, & 875 bc_dirichlet_r .OR. bc_radiation_r, & 876 bc_dirichlet_s .OR. bc_radiation_s, & 877 advc_flags_s ) 878 ENDIF 854 879 855 880 ! … … 861 886 DO j = nys, nyn 862 887 DO k = nzb, nzt + 1 863 k_top = MAX( k_top, MERGE( k, 0, & 864 .NOT. BTEST( topo(k,j,i), 0 ) ) ) 888 k_top = MAX( k_top, MERGE( k, 0, .NOT. BTEST( topo(k,j,i), 0 ) ) ) 865 889 ENDDO 866 890 ENDDO … … 2496 2520 USE control_parameters, & 2497 2521 ONLY: bc_lr_cyc, bc_ns_cyc, constant_flux_layer, land_surface, & 2498 use_surface_fluxes, use_top_fluxes, urban_surface2522 scalar_advec, use_surface_fluxes, use_top_fluxes, urban_surface 2499 2523 2500 2524 USE indices, & … … 2724 2748 wall_flags_0(nzt+1,j,i) = IBSET( wall_flags_0(nzt+1,j,i), 22 ) 2725 2749 wall_flags_0(nzt+1,j,i) = IBSET( wall_flags_0(nzt+1,j,i), 23 ) 2750 ! 2751 !-- Set flags indicating that topography is close by in horizontal 2752 !-- direction, i.e. flags that infold the topography. These will be used 2753 !-- to set advection flags for passive scalars, where due to large 2754 !-- gradients near buildings stationary numerical oscillations can produce 2755 !-- unrealistically high concentrations. This is only necessary if 2756 !-- WS-scheme is applied for scalar advection. Note, these flags will be 2757 !-- only used for passive scalars such as chemical species or aerosols. 2758 IF ( scalar_advec == 'ws-scheme' ) THEN 2759 DO k = nzb, nzt 2760 IF ( BTEST( wall_flags_0(k,j,i), 0 ) .AND. ( & 2761 ANY( .NOT. BTEST( wall_flags_0(k,j-3:j+3,i-1), 0 ) ) .OR.& 2762 ANY( .NOT. BTEST( wall_flags_0(k,j-3:j+3,i-2), 0 ) ) .OR.& 2763 ANY( .NOT. BTEST( wall_flags_0(k,j-3:j+3,i-3), 0 ) ) .OR.& 2764 ANY( .NOT. BTEST( wall_flags_0(k,j-3:j+3,i+1), 0 ) ) .OR.& 2765 ANY( .NOT. BTEST( wall_flags_0(k,j-3:j+3,i+2), 0 ) ) .OR.& 2766 ANY( .NOT. BTEST( wall_flags_0(k,j-3:j+3,i+3), 0 ) ) .OR.& 2767 ANY( .NOT. BTEST( wall_flags_0(k,j-1,i-3:i+3), 0 ) ) .OR.& 2768 ANY( .NOT. BTEST( wall_flags_0(k,j-2,i-3:i+3), 0 ) ) .OR.& 2769 ANY( .NOT. BTEST( wall_flags_0(k,j-3,i-3:i+3), 0 ) ) .OR.& 2770 ANY( .NOT. BTEST( wall_flags_0(k,j+1,i-3:i+3), 0 ) ) .OR.& 2771 ANY( .NOT. BTEST( wall_flags_0(k,j+2,i-3:i+3), 0 ) ) .OR.& 2772 ANY( .NOT. BTEST( wall_flags_0(k,j+3,i-3:i+3), 0 ) ) & 2773 ) ) & 2774 wall_flags_0(k,j,i) = IBSET( wall_flags_0(k,j,i), 31 ) 2775 2776 ENDDO 2777 ENDIF 2726 2778 ENDDO 2727 2779 ENDDO
Note: See TracChangeset
for help on using the changeset viewer.