Changes between Version 4 and Version 5 of doc/tec/topography


Ignore:
Timestamp:
Jun 6, 2017 1:05:06 PM (8 years ago)
Author:
suehring
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • doc/tec/topography

    v4 v5  
    11= Topography implementation =
    22
    3 The topography implementation described in Sect. [wiki:/doc/tec/bc#Topography boundary conditions] allows the use of 2-D topography height data in PALM. Currently, the topography data has to be provided within a rastered ASCII file. After reading and mapping of these data to the
    4 horizontal grid in PALM, they can be directly incorporated into the standard loop structure of the Fortran code as lower vertical index
     3Under construction
     4
     5With revision -r2232, the topography implementation is completely revised.
     6Starting from this revision, overhanging structures (e.g. bridges, ceilings or tunnels) are allowed, i.e. topography does not necessarily be surface-mounted.
     7
     8The topography implementation described in Sect. [wiki:/doc/tec/bc#Topography boundary conditions] allows the use of 2-D topography height data (if no overhanging structures should be considered), or 3-D topography information. The topography input data has to be provided within a rastered ASCII or NetCDF file. Rastered 3-D topography consists of values either 1 (within topography) or 0 (outside topography), and has to be provided up to the level of the highest present topography structures.
     9After reading and mapping of topography data to the 3-D grid in PALM, flag arrays are set in order to mask grid boxes within the integration loops accordingly.
     10
     11The prognostic terms are executed overall, i.e. also within topography.
     12Masking of topography is done via Fortran integer bit flags, where a certain bit position indicates whether the respective grid point belongs to an obstacle (bit is 0) or to the atmosphere (bit is 1).
     13Different bit positions indicate different masking on the staggered grid, e.g. on the u, v, w grid, equivalent to the former nzb_u/v/w_inner arrays.  Further, regions where special wall-bounded code is executed, is also masked via special bit flags.
     14A list of the respective bit flags and their meaning concerning the deprecated implementation via the nzb_u/v/w_inner arrays can be found in Table 1. 
     15
     16||='''Bit position'''  =||='''Meaning'''  =||
     17|----------------
     18{{{#!td  style="vertical-align:top"
     190
     20}}}
     21{{{#!td style="vertical-align:top"
     22mask topography on scalar-grid ( former nzb_s_inner )
     23}}}
     24|----------------
     25{{{#!td  style="vertical-align:top"
     261
     27}}}
     28{{{#!td style="vertical-align:top"
     29mask topography on u-grid ( former nzb_u_inner )
     30}}}
     31|----------------
     32{{{#!td  style="vertical-align:top"
     332
     34}}}
     35{{{#!td style="vertical-align:top"
     36mask topography on v-grid ( former nzb_v_inner )
     37}}}
     38|----------------
     39{{{#!td  style="vertical-align:top"
     403
     41}}}
     42{{{#!td style="vertical-align:top"
     43mask topography on w-grid ( former nzb_w_inner )
     44}}}
     45|----------------
     46{{{#!td  style="vertical-align:top"
     478
     48}}}
     49{{{#!td style="vertical-align:top"
     50mask regions where surface-bounded code for u, v, w, and scalars is executed ( combines information of former nzb_s_outer, nzb_u_outer, nzb_v_outer and nzb_w_outer arrays )
     51}}}
     52|----------------
     53{{{#!td  style="vertical-align:top"
     549
     55}}}
     56{{{#!td style="vertical-align:top"
     57mask regions where model-top fluxes are applied ( former nzt_diff )
     58}}}
     59|----------------
     60{{{#!td  style="vertical-align:top"
     6112
     62}}}
     63{{{#!td style="vertical-align:top"
     64flags upward-facing surfaces on scalar-grid
     65}}}
     66|----------------
     67{{{#!td  style="vertical-align:top"
     6813
     69}}}
     70{{{#!td style="vertical-align:top"
     71flags downward-facing surfaces on scalar-grid
     72}}}
     73|----------------
     74{{{#!td  style="vertical-align:top"
     7514
     76}}}
     77{{{#!td style="vertical-align:top"
     78flags upward-facing surfaces on u-grid
     79}}}
     80|----------------
     81{{{#!td  style="vertical-align:top"
     8215
     83}}}
     84{{{#!td style="vertical-align:top"
     85flags downward-facing surfaces on u-grid
     86}}}
     87|----------------
     88{{{#!td  style="vertical-align:top"
     8917
     90}}}
     91{{{#!td style="vertical-align:top"
     92flags upward-facing surfaces on v-grid
     93}}}
     94|----------------
     95{{{#!td  style="vertical-align:top"
     9617
     97}}}
     98{{{#!td style="vertical-align:top"
     99flags downward-facing surfaces on v-grid
     100}}}
     101|----------------
     102{{{#!td  style="vertical-align:top"
     10318
     104}}}
     105{{{#!td style="vertical-align:top"
     106flags upward-facing surfaces on w-grid
     107}}}
     108|----------------
     109{{{#!td  style="vertical-align:top"
     11019
     111}}}
     112{{{#!td style="vertical-align:top"
     113flags downward-facing surfaces on w-grid
     114}}}
     115|----------------
     116{{{#!td  style="vertical-align:top"
     11720
     118}}}
     119{{{#!td style="vertical-align:top"
     120mask topography on u-grid and one grid point above, used only for adding random perturbations ( former nzb_u_inner+1 )
     121}}}
     122|----------------
     123{{{#!td  style="vertical-align:top"
     12421
     125}}}
     126{{{#!td style="vertical-align:top"
     127mask topography on v-grid and one grid point above, used only for adding random perturbations ( former nzb_v_inner+1 )
     128}}}
     129|----------------
     130{{{#!td  style="vertical-align:top"
     13124
     132}}}
     133{{{#!td style="vertical-align:top"
     134mask regions where surface-bounded code is executed on scalar-grid ( former nzb_s_outer )
     135}}}
     136|----------------
     137{{{#!td  style="vertical-align:top"
     13825
     139}}}
     140{{{#!td style="vertical-align:top"
     141mask regions where surface-bounded code is executed on scalar-grid ( former nzb_s_outer+1 )
     142}}}
     143|----------------
     144{{{#!td  style="vertical-align:top"
     14526
     146}}}
     147{{{#!td style="vertical-align:top"
     148mask regions where surface-bounded code is executed on u-grid ( former nzb_u_outer )
     149}}}
     150|----------------
     151{{{#!td  style="vertical-align:top"
     15227
     153}}}
     154{{{#!td style="vertical-align:top"
     155mask regions where surface-bounded code is executed on v-grid ( former nzb_v_outer )
     156}}}
     157|----------------
     158{{{#!td  style="vertical-align:top"
     15928
     160}}}
     161{{{#!td style="vertical-align:top"
     162mask regions where surface-bounded code is executed on w-grid ( former nzb_w_outer )
     163}}}
     164|----------------
     165{{{#!td  style="vertical-align:top"
     16629
     167}}}
     168{{{#!td style="vertical-align:top"
     169mask regions where surface-bounded code is executed on s-grid ( former nzb_diff_s_outer - 1 )
     170}}}
     171|----------------
     172{{{#!td  style="vertical-align:top"
     17330
     174}}}
     175{{{#!td style="vertical-align:top"
     176mask regions where surface-bounded code is executed on s-grid ( former nzb_diff_s_outer )
     177}}}
     178|----------------
     179
     180
     181The following  example illustrates the general realization of topography masking in the code using Bit flags:
     182{{{
     183#!Latex
     184\begin{verbatim}
     185   DO  k = nzb+1, nzt
     186      tend(k,j,i) = tend(k,j,i) + …  &
     187                       * MERGE( 1.0_wp, 0.0_wp, BTEST(wall_flags_0(k,j,i),0) )
     188   ENDDO
     189\end{verbatim}
     190}}}
     191Here, the intrinsic Fortran function `MERGE` returns 1 if `wall_flags_0(k,j,i)` at bit position zero is 1 (`BTEST` returns `.TRUE.`), else, `MERGE` would return 0 and no term is effectively added to the tend array. 
     192A similar approach is also realized for the 5th-order advection-scheme  to degrade the order near surfaces. 
     193
     194
     195
     196 they can be directly incorporated into the standard loop structure of the Fortran code as lower vertical index
    5197for all integration loops. Therefore, PALM employs two 2-D height index arrays (e.g., '''''nzb_w_inner(j, i)''''' and '''''nzb_w_outer(j, i)''''' for the velocity component ''w'') to separate the domain into four regions based on the vertical index ''k'' (see Fig. 4 in Sect. [wiki:/doc/tec/bc#Topography boundary conditions]):
    6198{{{