# iMOD User Manual version 4.4 (html)

#### 8.8PREPROCESSING-FUNCTIONS

##### 8.8.1CREATEIBOUND-Function

Use this function to create an IBOUND IDF-file that takes into account non existing cells on the bottom of a layer system. The IBOUND value in a cell is set to 0 whenever this cell and all underlying cells do not exist (thickness = 0.). Otherwise the IBOUND value is set to 1.

Example

FUNCTION= CREATEIBOUND
NLAY=3
TOP_L1=D:\MODEL\TOP_L1.IDF
TOP_L2=D:\MODEL\TOP_L2.IDF
TOP_L3=D:\MODEL\TOP_L3.IDF
BOT_L1=D:\MODEL\BOT_L1.IDF
BOT_L2=D:\MODEL\BOT_L2.IDF
BOT_L3=D:\MODEL\BOT_L3.IDF
RESULTDIR=D:\RESULT

This example checks for a 3 layer system whether there are non existing cell on the bottom of the system. These cells get an IBOUND value of 0.
The result of this function is an IBOUND file for each layer D:\RESULT\IBOUND_L{i}.IDF.

##### 8.8.2AHNFILTER-Function

This function filters artificial elements out of a digital terrain model (or equivalent). The method searches for areas that are connected by small vertical thresholds and denote them as true surface whenever the extent is significant. The remaining areas with less extent are marked as potential surface and will become true surface whenever they differ minorly with the interpolated surface at those locations. Moreover, the algorithm searches for local upconing (trees, buildings) and depressions (streams) and removes them from the surface. The function yields two output files: the filtered original file and a pointer file. The pointer file indicates the type of change by the filtering to the original file. The values in the pointer file indicate: 2: no change; $<$2: filtered cell.

Example 1

FUNCTION=AHNFILTER
NAHN =1
IDFFILE1=D:\DATA\AHN_ORG.IDF
OUTFILE=D:\DATA\AHN_FILTERED.IDF

The above mentioned example is the most simple one, it filters the AHN_ORG.IDF with all default setting values and saves the result in AHN_FILTERED.IDF.

Example 2

FUNCTION=AHNFILTER
NAHN =2
IDFFILE1=D:\DATA\AHN_ORG1.IDF
IDFFILE2=D:\DATA\AHN_ORG2.IDF
NWINDOW=2
WINDOW1=125000.0 426000.0 130000.0 430000.0
WINDOW2=130000.0 426000.0 135000.0 430000.0
OUTFILE1=D:\DATA\AHN_FILTERED1.IDF
OUTFILE2=D:\DATA\AHN_FILTERED2.IDF
BUFFER=2500
IGNORENODATA=0
NSCRIT=1250
LOCCRIT=200.0
XCRIT=100.0
DPW=5
DP1=30.0
DP2=90.0
CORXCRIT=10
CORCRIT =75
INTXCRIT=5

The above mentioned example filters two windows and uses two different IDF-files (AHN_ORG1.IDF and AHN_ORG2.IDF). The main reason for using most of the setting variables is that the dimension of the original IDF-files (IDFFILE1 and IDFFILE2) is centimeter instead of meter.

##### 8.8.3CREATESOF-Function

The iMOD-Batch function SOF (Surface Overland Flow) is able to compute “spill” levels (surface overlandflow levels) for large regions with or without supplied outflow or outlet locations. First of all, the “pit”-locations are identified, these are defined as those locations that are surrounded by higher values all around in a $3 \times 3$ matrix of grid cells. There is no other escape possible other than the lowest neighbouring level, the so called “spill”-level. All these identified “pitts” are sorted from the lowest to the highest “pitt” and processed in that order. Given a “pitt” location, the surrounding grid cells will be stored in a boundary list. From the boundary list the lowest “spill”-level will be found and stored in a boundary list. Whenever this “spill”-level is lower than the current “spill”-level, the process stops, because than probably the water can flow outside the current “core-volume”. If not, the lowest level on the boundary becomes the new “spill”level and the node will be remove from the boundary list and added to the “pitt”-list. The process repeats itself. All grid cells that are mentioned in the pitt-list will belong to the same “core-volume” and receive the final “spill”-level. At the end of this section, an example is given. As the “core-area” will be flat, the discharge occurs on that area as follows: it first follows the steepest gradient along the digital elevation model into the pit location and from there it follows the shortest way up towards the outflow cell. As the “core-area” will be flat, it cannot be used for a SFR package (see Section 12.28). To avoid flat-surfaces, the SOF function can be generate a slight adapted surface level for flat areas as a gradient from where the flat area is entered to the elevation next to the exitpoint. Those corrected flat areas (that can be a stretch along a stream) can be used for the SFR discretisation, at the same time the original slope of the flat area (0.0) is adjusted as saved. This slope is used as well for the SFR to define the stream slopes.

In the following figure the mentioned variables are explained.

Example of the concepts for the “spill”-level procedure.

The steepest gradient of the digital terrain model is computed for a $3 \times 3$ neighbourhood, so the slope $s$ and aspect $a$ are at one point estimated from elevations of it and surrounding $8$ points $i$, thus:

\begin{align*} s_i & = {\rm tan}^{-1}\frac {z_i-z_0} {\sqrt {(x_i-x_0)^2+(y_i-y_0)^2}} \\ a_i & = {\rm arctan}^{-1}\left (x_i-x_0,y_i-y_0\right ) \end{align*}

where the slope $s_i$ is in radians as well as the aspect $a_i$, and $z_0$, $x_0$ and $y_0$ are the elevation, x-coordinate and y-coordinate at the current node respectively, for which the gradient and aspect need to be computed. For reasons of conveniences, the aspect $a$ is taken by the arctangent function with two arguments. The purpose of using two arguments instead of one is to gather information on the signs of the inputs in order to return the appropriate quadrant of the computed angle, which is not possible for the single-argument arctangent function. The final value for the aspect $a$ is $-\pi < a < \pi$, meaning that $\pi$ is pointing to the east, $0.5\times \pi$ points to the south, $0.0 \times \pi$ points to the west and $-0.5\times \pi$ points to the north. For perfect flat areas, a south direction is chosen arbitrarily. Also NodataValues are threated as “pitts”.

The CREATESOF function continues to follow a drop of water to its down slope neighbour, we call this a trace and all cells that are passed are stored in a thread. This method uses the steepest descent direction from a particular location and moves to the next ceel along that direction, so the new x-location $x_i$ is found from the previous x-location $x_{i-1}$ by:

\begin{align*} x_i=x_{i-1}+ \Delta x \cdot {\rm cos}(a_{i-1}) \ ; \ y_i=y_{i-1} \Delta y \cdot {\rm sin}(a_{i-1}) \end{align*}

where $\Delta x$ and $\Delta y$ are the cellsizes of the digital elevation model.

Below an example is given for the output variables for IFLOW=0 and IFLOW=1 for an artificial DTM.

Example of (upperleft) a DTM (upperright) the PITTs (lowerleft) the SLOPE and (lowerright) the ASPECT.

Example of (upperleft) a SOF (upperright) the number of passes and (lowerleft) the flowpaths GEN).

Example 1

FUNCTION=CREATESOF
IFLOW=0
LEVELIDF=D:\DATA\DTM.IDF
SOFIDF=D:\OUTPUT\SOF.IDF

Example 2

FUNCTION=CREATESOF
IFLOW=1
ASPECTIDF=D:\OUTPUT\DTM_ASPECT.IDF
IFLOW=1

Example 3

FUNCTION=CREATESOF
IFLOW=2

##### 8.8.4DRNSURF-Function

The DRNSURF function is used to calculate the drainage level for surface runoff based on info about landuse, DEM and a pointer IDF with info on buildings.

This figure shows the differences in surface level relative to the defined drainage levels.

Example 1

FUNCTION=DRNSURF
SURFIDF=D:\DATABASE\AHN2.IDF
PNTRIDF=d:\DATABASE\KDSTR_2012.IDF
LUSEIDF=d:\DATABASE\LGN6.IDF
NLUSE=3
ILUSE1=1
ILUSE2=2
ILUSE3=3
TDRAINAGE=50.0
TSURFLEVEL=50.0
PERCENTILE=50.0
OUTIDF=d:\MODEL\DRN\DRN_SL.idf

This example creates an IDF with the drainage elevation for the surface level.