= Topography implementation = 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 horizontal grid in PALM, they can be directly incorporated into the standard loop structure of the Fortran code as lower vertical index for 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]): {{{ #!Latex \begin{itemize} \item[A.] \texttt{0 $\leq$ k} $<$ \texttt{nzb\_w\_inner}, grid points within obstacles or in the ground that are excluded from calculations, \item[B.] \texttt{nzb\_w\_inner} \texttt{$\leq$} \texttt{k} $<$ \texttt{nzb\_w\_outer}, grid points next to vertical walls, where wall-bounded code is executed, \item[C.] \texttt{k} $=$ \texttt{nzb\_w\_inner} $=$ \texttt{nzb\_w\_outer}, grid points next to horizontal walls, where wall-bounded code is executed, \item[D.] all other $k$, grid points in free fluid. \end{itemize} }}} The additional topography code is executed in regions B and C only. As the velocity components are defined on a different (staggered) grid than the scalar quantities (see Fig. 1 in Sect. [wiki:doc/tec/discret discretization]), three extra pairs of 2-D height index arrays are defined; two for the horizontal velocities and one for scalar quantities (e.g., '''''nzb_s_inner''''' and '''''nzb_s_outer''''' for scalar quantities). \\\\ '''Treatment of holes''' \\ In case there are holes in the topography that are resolved by only one grid point, the topography array in filtered so that such holes are filled up to the minimum topography height of the directly adjoining grid points in the x- and the y-direction. This is necessary, because for such chimney-like features resolved by one grid point, the continuity equation is not fulfilled on a discrete grid, as the only degree of freedom for the pressure solver is the vertical. Such holes are suspected to lead to unrealistic velocity blow-ups, hence, they are filled up.